:root {
    --primary: #458B43; /* Vision-Aid Green */
    --primary-hover: #336B31;
    --bg-main: #F3F4F6;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-muted: #64748B;
    --border: #E2E8F0;
    
    --success: #059669;
    --warning: #D97706;
    --error: #DC2626;
    --expired: #DC2626;
    --info: #2563EB;
    
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 0.875rem; /* Slightly smaller base font for admin data density */
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }

/* Dashboard Layout */
.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 40;
}
.sidebar-header {
    height: 4rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; color: var(--text-main); text-decoration: none; }
.sidebar-nav { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem;
    border-radius: var(--radius-md); color: var(--text-muted); text-decoration: none; font-weight: 500;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--bg-main); color: var(--primary); text-decoration: none;
}
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); }

.main-content { flex: 1; margin-left: 250px; display: flex; flex-direction: column; }
.topbar {
    height: 4rem; background: var(--bg-card); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 2rem;
    position: sticky; top: 0; z-index: 30;
}
.page-content { padding: 2rem; flex: 1; }

/* Search */
.search-bar {
    display: flex; align-items: center; background: var(--bg-main); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 0.5rem 1rem; width: 300px;
}
.search-bar input {
    border: none; background: transparent; outline: none; margin-left: 0.5rem; width: 100%;
}

/* Cards & Tables */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-main); font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; }
td { vertical-align: middle; }

/* Buttons & Badges */
.btn {
    display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem;
    font-size: 0.875rem; font-weight: 500; border-radius: var(--radius-md); cursor: pointer; border: 1px solid transparent; gap: 0.5rem;
}
.btn-primary { background: var(--primary); color: white; border: 1px solid var(--primary); }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; color: white; }
.btn-secondary { background: white; color: var(--text-main); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-main); text-decoration: none; }
.btn-danger { background: white; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: #FEF2F2; text-decoration: none; }

.badge { display: inline-flex; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-expired { background: #FEE2E2; color: #991B1B; }
.badge-suspended { background: #FEF3C7; color: #92400E; }
.badge-premium { background: #E0E7FF; color: #3730A3; }
.badge-basic { background: #F3F4F6; color: #374151; }

/* Utilities */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.form-control { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-md); }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
    z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-content {
    background: white; border-radius: var(--radius-lg); width: 100%; max-width: 500px;
    box-shadow: var(--shadow-lg); padding: 1.5rem;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .search-bar { width: 150px; }
}
