:root {
    --primary: #2563eb;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --muted: #64748b;
    --muted-foreground: #475569;
    --accent: #0ea5e9;
    --destructive: #ef4444;
    --border: #e2e8f0;
    --input: #f8fafc;
    --ring: #2563eb;
    --background: #ffffff;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: transparent;
    color: var(--muted-foreground);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--input);
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.badge-approved {
    background-color: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.badge-rejected {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.badge-under-review {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.badge-documents-required {
    background-color: #fed7aa;
    color: #9a3412;
    border-color: #fdba74;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.table tr:hover {
    background-color: #f8fafc;
}

/* Modal dialog styles */
dialog {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: transparent;
    padding: 0;
    max-width: none;
    max-height: none;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--background);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: var(--muted-foreground);
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--foreground);
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: var(--secondary);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

@media (max-width: 768px) {
    dialog {
        padding: 0;
    }
    
    dialog > div {
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0.75rem 0.75rem 0 0;
        max-height: 90vh;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1rem;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
}

/* Custom styles for responsive card images */
.product-card-image {
    max-width: 100%;
    height: auto; /* Allow height to adjust automatically */
    display: block; /* Remove extra space below image */
}

/* Modal form improvements */
dialog form {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

dialog .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    flex: 1;
    padding: 1rem;
}

dialog .form-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: white;
    position: sticky;
    bottom: 0;
}

dialog .form-actions button {
    flex: 1;
    min-height: 2.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

@media (max-width: 640px) {
    dialog .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    dialog .form-actions {
        flex-direction: column;
    }
    
    dialog .form-actions button {
        min-height: 3rem;
    }
    
    /* Better mobile modal positioning */
    dialog {
        padding: 0;
    }
    
    dialog > div {
        margin: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    dialog > div > div:first-child {
        flex-shrink: 0;
    }
    
    dialog .form-grid {
        flex: 1;
        padding: 1rem;
    }
    
    dialog .form-actions {
        flex-shrink: 0;
    }
}
