/* ==========================================================================
   CAREAYUR TRADITIONAL OILS — ADMIN PANEL STYLES
   Botanical Luxury Aesthetics: Emerald (#1b4332), Gold (#d4af37), Dark (#0f2d1e)
   ========================================================================== */

:root {
    --primary: #1b4332;
    --primary-light: #2d5a3d;
    --primary-dark: #0f2d1e;
    --accent: #d4af37;
    --accent-light: #fef9e7;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #15803d;
    --dark: #0f2d1e;
    --light: #f8faf7;
    --gray: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --white: #ffffff;
    --black: #092015;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LOGIN PAGE (Modern Glassmorphic Botanical Style)
   ========================================================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: radial-gradient(circle at 20% 20%, #1b4332 0%, #0a2016 50%, #05100a 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12), transparent 70%);
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 90, 61, 0.25), transparent 70%);
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

.login-box {
    background: rgba(15, 45, 30, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    color: #f8faf7;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.login-box label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.4rem;
    display: block;
}

.login-box .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.login-box .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-box .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
    outline: none;
}

.login-box .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #d4af37 0%, #aa841c 100%);
    color: #092015;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.85rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.45);
}

.login-box a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: color 0.15s ease;
}

.login-box a:hover {
    color: var(--accent);
}

/* ==========================================================================
   LEGACY & LAYOUT COMPATIBILITY
   ========================================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #ffffff;
    color: var(--dark);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    z-index: 200;
}

.sidebar-brand {
    padding: 1.25rem;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.admin-main {
    margin-left: 250px;
    flex: 1;
    padding: 1.5rem;
}

.admin-content {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(27, 67, 50, 0.08);
    box-shadow: 0 4px 20px rgba(15, 45, 30, 0.03);
}

/* ==========================================================================
   CARDS & STATS
   ========================================================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(27, 67, 50, 0.08);
    box-shadow: 0 4px 16px rgba(15, 45, 30, 0.03);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.4rem;
    background: #f8faf7;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--dark);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(27, 67, 50, 0.08);
    box-shadow: 0 4px 14px rgba(15, 45, 30, 0.03);
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 45, 30, 0.07);
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--gray);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
}

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

.table th {
    background: #f8faf7;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    border-top: 1px solid var(--border);
}

.table th:first-child {
    border-top-left-radius: var(--radius-sm);
}

.table th:last-child {
    border-top-right-radius: var(--radius-sm);
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover td {
    background: #f4f8f5;
}

.table td {
    font-size: 0.88rem;
    color: var(--dark);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark);
}

.form-control,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    background: #ffffff;
    color: var(--dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.12);
    outline: none;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(27, 67, 50, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(27, 67, 50, 0.28);
    color: #ffffff;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
}

.btn-success:hover {
    background: #15803d;
    color: #ffffff;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.76rem;
    border-radius: 8px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ==========================================================================
   BADGES & CHIPS
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

.badge-active,
.badge-delivered,
.badge-confirmed,
.badge-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-inactive,
.badge-cancelled,
.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-pending,
.badge-warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-packing,
.badge-shipped,
.badge-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    line-height: 1.5;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination {
    margin: 1.5rem 0;
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark);
    font-size: 0.85rem;
    font-weight: 600;
    background: #ffffff;
    transition: all 0.15s ease;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdf4;
}

.pagination .current {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ==========================================================================
   LAYOUT UTILITIES & RESPONSIVE
   ========================================================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.col-md-6 {
    flex: 1 1 300px;
}

.col-md-8 {
    flex: 2 1 450px;
}

.col-md-4 {
    flex: 1 1 250px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.quick-actions {
    display: grid;
    gap: 0.75rem;
}

.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }

@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .admin-table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn, .btn-sm, button[type="submit"], .action-btn {
        min-height: 44px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .admin-main {
        padding: 0.75rem 0.5rem;
    }
    
    .table th, .table td,
    .orders-table th, .orders-table td,
    .users-table th, .users-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.78rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 1rem;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .btn, .btn-sm, button[type="submit"], .action-btn {
        min-height: 44px;
        font-size: 0.82rem;
    }
}