:root {
    --navy: #1a1a2e;
    --blue: #4361ee;
    --blue-light: #4cc9f0;
    --green: #06d6a0;
    --red: #ef476f;
    --orange: #ffd166;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-400: #adb5bd;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--gray-50); color: var(--gray-800); min-height: 100vh; }

/* AUTH PAGES */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card { background: #fff; border-radius: 12px; padding: 48px; max-width: 420px; width: 100%; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.auth-card h1 { font-size: 24px; margin-bottom: 8px; }
.auth-card .subtitle { color: var(--gray-600); margin-bottom: 32px; font-size: 14px; }
.auth-card .logo { display: block; font-size: 20px; font-weight: 700; margin-bottom: 32px; color: var(--navy); }
.auth-card .logo span { color: var(--blue); }

/* DASHBOARD LAYOUT */
.dashboard { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--navy); color: #fff; padding: 24px 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 50; }
.sidebar .logo { display: block; padding: 0 24px; font-size: 18px; font-weight: 700; margin-bottom: 32px; color: #fff; text-decoration: none; }
.sidebar .logo span { color: var(--blue-light); }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: rgba(255,255,255,.6); font-size: 14px; text-decoration: none; transition: background .15s; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a .icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar .user-info { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.1); margin-top: auto; position: absolute; bottom: 0; left: 0; right: 0; }
.sidebar .user-info .email { font-size: 12px; color: rgba(255,255,255,.4); overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-info .plan-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--blue); color: #fff; margin-top: 4px; text-transform: uppercase; }

.main { margin-left: 240px; flex: 1; padding: 32px; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 24px; margin-bottom: 4px; }
.page-header p { color: var(--gray-600); font-size: 14px; }

/* CARDS & WIDGETS */
.card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.card h2 { font-size: 16px; margin-bottom: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card .value { font-size: 32px; font-weight: 700; color: var(--navy); }
.stat-card .label { font-size: 13px; color: var(--gray-600); margin-top: 4px; }
.stat-card .icon { font-size: 24px; float: right; }

/* FORMS */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--gray-800); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius);
    font-size: 14px; font-family: inherit; transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-group { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.checkbox-group input[type="checkbox"] { width: auto; }
.checkbox-group label { margin: 0; font-weight: 400; }

.btn { display: inline-block; padding: 10px 24px; border-radius: var(--radius); font-weight: 600; font-size: 14px; cursor: pointer; border: none; transition: opacity .15s; font-family: inherit; }
.btn:hover { opacity: .9; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--gray-200); color: var(--gray-800); }
.btn-sm { padding: 6px 16px; font-size: 13px; }

/* TABLE */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--gray-200); font-size: 12px; text-transform: uppercase; color: var(--gray-600); letter-spacing: .5px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); }
tr:hover { background: var(--gray-50); }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-viewing_invited { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-failed { background: #fef3c7; color: #92400e; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* TOGGLE */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; inset: 0; background: var(--gray-200); border-radius: 24px; cursor: pointer; transition: background .2s; }
.toggle .slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.toggle input:checked + .slider { background: var(--blue); }
.toggle input:checked + .slider::before { transform: translateX(20px); }

/* MOBILE */
.mobile-header { display: none; background: var(--navy); color: #fff; padding: 12px 16px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.mobile-header .toggle-sidebar { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .3s; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 80px 16px 16px; }
    .mobile-header { display: flex; align-items: center; justify-content: space-between; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
