/* ==========================================
   The Plant Space - Admin Dashboard Styles
   Green Theme - Modern UI
   ========================================== */

:root {
    --primary: #2d6a4f;
    --primary-dark: #1b4332;
    --primary-light: #40916c;
    --secondary: #52b788;
    --accent: #95d5b2;
    --light-green: #d8f3dc;
    --bg: #f0faf4;
    --surface: #ffffff;
    --sidebar-bg: #1b4332;
    --text: #1a2e1e;
    --text-secondary: #4a7c59;
    --text-muted: #74a480;
    --border: #b7e4c7;
    --border-light: #e8f5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 1px 4px rgba(27,67,50,0.08);
    --shadow-md: 0 4px 16px rgba(27,67,50,0.12);
    --shadow-lg: 0 10px 40px rgba(27,67,50,0.18);
    --radius: 14px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    --sidebar-width: 260px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==========================================
   LOGIN SCREEN
   ========================================== */

#loginScreen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 50%, #40916c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
    from { opacity:0; transform:translateY(30px); }
    to { opacity:1; transform:translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #2d6a4f, #52b788);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(45,106,79,0.35);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.login-logo p { color: var(--text-muted); font-size: 0.9rem; }

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-icon-wrap input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
}

.input-icon-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2d6a4f, #40916c);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(45,106,79,0.35);
}

.btn-login:hover {
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45,106,79,0.45);
}

.login-hint {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================
   ADMIN APP LAYOUT
   ========================================== */

#adminApp {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #52b788, #95d5b2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #1b4332;
    flex-shrink: 0;
}

.brand-text h2 {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    padding: 1rem 1.5rem 0.5rem;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.nav-link.active {
    background: rgba(82,183,136,0.2);
    color: var(--accent);
    border-left-color: var(--secondary);
    font-weight: 700;
}

.nav-link .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 700;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #52b788, #95d5b2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #1b4332;
    font-weight: 700;
    flex-shrink: 0;
}

.user-details h4 { font-size: 0.85rem; color: #fff; font-weight: 600; }
.user-details span { font-size: 0.72rem; color: var(--accent); }

.btn-logout {
    width: 100%;
    padding: 0.65rem;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-logout:hover { background: rgba(239,68,68,0.25); color: #fff; }

/* ==========================================
   MAIN CONTENT
   ========================================== */

.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-menu-btn:hover { background: var(--light-green); color: var(--primary); }

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    position: relative;
    padding: 0.6rem 1rem;
    background: var(--light-green);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn:hover { background: var(--accent); color: var(--primary-dark); }

.notif-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 10px; height: 10px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

/* ==========================================
   SECTIONS
   ========================================== */

.section { display: none; }
.section.active { display: block; animation: sectionFadeIn 0.3s ease; }

@keyframes sectionFadeIn {
    from { opacity:0; transform:translateY(8px); }
    to { opacity:1; transform:translateY(0); }
}

/* ==========================================
   STAT CARDS
   ========================================== */

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

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.stat-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.green { background: linear-gradient(135deg, #d8f3dc, #b7e4c7); color: #2d6a4f; }
.stat-icon.teal { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0d9488; }
.stat-icon.amber { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.stat-icon.red { background: linear-gradient(135deg, #fef2f2, #fecaca); color: #dc2626; }

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.85rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 0.3rem; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-trend { font-size: 0.78rem; margin-top: 0.4rem; display: flex; align-items: center; gap: 0.25rem; font-weight: 600; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ==========================================
   CARDS / CHART CARDS
   ========================================== */

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i { color: var(--secondary); }

.card-body { padding: 1.5rem; }

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

.chart-container { position: relative; height: 280px; }

/* ==========================================
   TABLES
   ========================================== */

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead tr { background: var(--bg); }

th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }

.plant-name-cell { font-weight: 600; color: var(--primary-dark); }
.plant-variety-cell { color: var(--text-muted); font-size: 0.8rem; }

/* ==========================================
   STATUS BADGES
   ========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-processing { background: #e0e7ff; color: #3730a3; }
.badge-shipped { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-in-stock { background: #d1fae5; color: #065f46; }
.badge-low-stock { background: #fef3c7; color: #92400e; }
.badge-out-stock { background: #fee2e2; color: #991b1b; }
.badge-admin { background: #f3e8ff; color: #6b21a8; }
.badge-manager { background: #e0f2fe; color: #075985; }
.badge-sales { background: #d8f3dc; color: #1b4332; }

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #2d6a4f, #40916c);
    color: white;
    box-shadow: 0 2px 8px rgba(45,106,79,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #1b4332, #2d6a4f); transform:translateY(-1px); box-shadow:0 4px 12px rgba(45,106,79,0.4); }

.btn-secondary {
    background: var(--light-green);
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--accent); }

.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.btn-warning:hover { background: var(--warning); color: white; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-icon { padding: 0.5rem; width: 34px; height: 34px; justify-content: center; }
.btn-block { width: 100%; justify-content: center; }

.action-btns { display: flex; gap: 0.4rem; align-items: center; }

/* ==========================================
   FORMS
   ========================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-group.full-width { grid-column: 1 / -1; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.form-control::placeholder { color: var(--text-muted); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ==========================================
   TOOLBAR / SEARCH + FILTER ROWS
   ========================================== */

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 220px;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--surface);
    transition: var(--transition);
    font-family: inherit;
    color: var(--text);
}

.search-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(45,106,79,0.1); }

.search-wrap { position: relative; flex:1; min-width: 220px; }
.search-wrap i { position:absolute; left:0.85rem; top:50%; transform:translateY(-50%); color:var(--text-muted); font-size:0.85rem; }

.filter-select {
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.filter-select:focus { outline:none; border-color:var(--primary); }

/* ==========================================
   MODAL
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active { opacity:1; pointer-events:all; }

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal { transform:scale(1); }
.modal.modal-lg { max-width: 800px; }

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); }

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover { background: var(--light-green); color: var(--danger); }

.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-light); display:flex; gap:0.75rem; justify-content:flex-end; }

/* ==========================================
   NOTIFICATIONS PANEL
   ========================================== */

.notif-panel {
    position: fixed;
    top: 0; right: -420px;
    width: 420px; height: 100vh;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
}

.notif-panel.active { right: 0; }

.notif-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-panel-header h3 { font-size: 1rem; font-weight: 700; color: var(--primary-dark); }

.notif-list { flex:1; overflow-y:auto; }

.notif-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    transition: var(--transition);
}

.notif-item:hover { background: var(--bg); }
.notif-item.unread { border-left: 3px solid var(--secondary); }

.notif-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items:center; justify-content:center;
    font-size: 0.9rem; flex-shrink:0;
}

.notif-icon.order { background: #dbeafe; color: #1e40af; }
.notif-icon.stock { background: #fef3c7; color: #92400e; }
.notif-icon.user  { background: #d1fae5; color: #065f46; }

.notif-content { flex:1; }
.notif-content h4 { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.notif-content p  { font-size: 0.8rem; color: var(--text-muted); }
.notif-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */

.toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 280px;
    animation: toastIn 0.35s ease;
}

@keyframes toastIn {
    from { opacity:0; transform:translateX(50px); }
    to { opacity:1; transform:translateX(0); }
}

.toast.success { background: #065f46; color: #fff; }
.toast.error   { background: #991b1b; color: #fff; }
.toast.warning { background: #92400e; color: #fff; }
.toast.info    { background: #1e40af; color: #fff; }

/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i { font-size: 3rem; opacity: 0.3; margin-bottom: 1rem; display: block; }
.empty-state h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-secondary); }
.empty-state p  { font-size: 0.875rem; }

/* ==========================================
   LOADING SPINNER
   ========================================== */

.spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform:rotate(360deg); } }

.loading-row td { text-align: center; padding: 3rem; color: var(--text-muted); }

/* ==========================================
   STOCK LEVEL INDICATOR
   ========================================== */

.stock-bar { height: 6px; border-radius: 3px; background: var(--border-light); overflow: hidden; width: 80px; }
.stock-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.stock-bar-fill.high  { background: var(--success); }
.stock-bar-fill.medium { background: var(--warning); }
.stock-bar-fill.low   { background: var(--danger); }

/* ==========================================
   OVERVIEW METRICS (mini)
   ========================================== */

.mini-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mini-metric {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.mini-metric .value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.mini-metric .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ==========================================
   SYNC ALERT BANNER
   ========================================== */

.sync-banner {
    background: linear-gradient(135deg, #2d6a4f, #40916c);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sync-banner p { font-size: 0.9rem; margin: 0; }
.sync-banner p strong { display: block; font-size: 1rem; margin-bottom: 0.15rem; }

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .admin-main { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .content-area { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .admin-header { padding: 1rem; }
    .page-title { font-size: 1.2rem; }
    .mini-metrics { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-wrap { min-width: unset; }
    table { font-size: 0.8rem; }
    th, td { padding: 0.65rem 0.75rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .mini-metrics { grid-template-columns: 1fr; }
    .notif-panel { width: 100vw; }
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

@media (max-width: 1024px) {
    .sidebar-overlay.active { display: block; }
}

/* ==========================================
   FACEBOOK IMPORT SECTION
   ========================================== */

.fb-import-banner {
    background: linear-gradient(135deg, #1877f2 0%, #0a5ac7 100%);
    color: white;
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(24,119,242,0.3);
}

.fb-import-banner-icon {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.fb-import-banner h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.fb-import-banner p  { opacity: 0.85; font-size: 0.875rem; }

.fb-connect-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.required-mark {
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 500;
}

.fb-token-help {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.fb-token-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text);
}

.step-num {
    width: 22px; height: 22px;
    background: #1877f2;
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.fb-token-step a { color: #1877f2; text-decoration: underline; }

.fb-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.fb-post-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.fb-post-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.fb-post-card.selected { border-color: var(--primary); background: var(--bg-light); }

.fb-post-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}

.fb-post-img img { width: 100%; height: 100%; object-fit: cover; }

.fb-post-body { padding: 1rem; }

.fb-post-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.fb-post-select input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.fb-post-select label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
}

.fb-post-fields { display: flex; flex-direction: column; gap: 0.5rem; }

.fb-field {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.5rem;
    align-items: center;
}

.fb-field label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.fb-field input, .fb-field select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--white);
    width: 100%;
}

.fb-field input:focus, .fb-field select:focus {
    outline: none;
    border-color: var(--primary);
}

.fb-post-message {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.fb-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.fb-tab {
    background: none;
    border: none;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    border-radius: 0;
}

.fb-tab:hover { color: var(--primary); }
.fb-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.fb-tab-panel.hidden { display: none; }

.fb-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.fb-drop-zone:hover,
.fb-drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--bg-light);
    color: var(--primary);
}

.fb-drop-zone p { margin: 0.5rem 0 0; font-size: 0.95rem; }
.fb-drop-hint { font-size: 0.8rem !important; opacity: 0.65; }

.fb-zip-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.fb-zip-info i { color: var(--secondary); font-size: 1.1rem; }
.fb-zip-size { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; }

.fb-zip-btn-wrap { margin-top: 1rem; }

@media (max-width: 640px) {
    .fb-connect-grid { grid-template-columns: 1fr; }
    .fb-import-banner { flex-direction: column; text-align: center; }
    .fb-posts-grid { grid-template-columns: 1fr; }
    .fb-tabs { flex-wrap: wrap; }
}
