@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --accent: #e60023;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8f9fc;
    --sidebar-bg: #14152b;
    --sidebar-text: #a0a3bd;
    --sidebar-text-active: #ffffff;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }

/* ===== LAYOUT ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 24px 8px;
}
.sidebar-logo .logo-img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}
.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.sidebar-logo-title {
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logo-tagline {
    font-size: 11px;
    color: #6b6e8a;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 14px 8px 10px 8px;
}
.nav-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b6e8a;
    font-weight: 700;
    padding: 0 12px 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user { font-size: 13px; color: var(--sidebar-text); padding: 8px; }
.sidebar-user strong { color: #fff; display:block; font-size: 13px; }

.main {
    flex: 1;
    padding: 32px 40px;
    max-width: 1200px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.topbar h1 { font-size: 22px; font-weight: 800; margin: 0; }
.topbar p { color: var(--text-secondary); margin: 4px 0 0 0; font-size: 14px; }

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.section-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 4px 0 12px 2px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.stat-card .label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.stat-card .value.accent { color: var(--primary); }
.stat-card .value.green { color: var(--success); }
.stat-card .value.red { color: var(--danger); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: 0.15s;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: #fff; color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f9fafb; }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-primary); }
.form-group .hint { font-size: 12px; color: var(--text-secondary); margin-top: 5px; }
input[type="text"], input[type="password"], input[type="url"], input[type="file"], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ===== TABLE ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #fafbfc; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; font-size: 11px; letter-spacing: 0.4px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-error { background: #fee2e2; color: #991b1b; }

/* ===== PROGRESS BAR ===== */
.progress-outer { background: #eef0f5; border-radius: 20px; overflow: hidden; height: 10px; }
.progress-inner { background: linear-gradient(90deg, var(--primary), #a855f7); height: 100%; width: 0%; transition: width 0.3s ease; border-radius: 20px; }
.progress-label { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--text-secondary); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-secondary); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

/* ===== LOGIN PAGE (dark split-screen) ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0a0a14;
    font-family: 'Inter', sans-serif;
}
.login-main {
    flex: 1;
    display: flex;
    min-height: 640px;
}

/* LEFT: hero / illustration side */
.login-hero {
    flex: 1.1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 70px;
    background: #0a0a14;
}
.login-hero::before {
    content: "";
    position: absolute;
    top: -180px; left: -160px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(99,102,241,0.35), transparent 70%);
    border-radius: 50%;
    filter: blur(10px);
}
.login-hero::after {
    content: "";
    position: absolute;
    bottom: -220px; right: -160px;
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(168,85,247,0.3), transparent 70%);
    border-radius: 50%;
    filter: blur(10px);
}
.login-hero-content { position: relative; z-index: 2; max-width: 520px; }

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #a5a8ff;
    padding-bottom: 14px;
    border-bottom: 2px solid #6366f1;
    margin-bottom: 28px;
}

.login-hero h1 {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin: 0 0 18px 0;
}
.login-hero h1 .grad {
    background: linear-gradient(135deg, #818cf8, #d946ef);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.login-hero p.lead {
    font-size: 16px;
    color: #9296b8;
    line-height: 1.6;
    margin: 0 0 40px 0;
}

.login-feature-list { display: flex; flex-direction: column; gap: 12px; }
.login-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 14px 16px;
}
.login-feature .f-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.login-feature .f-icon.i1 { background: rgba(99,102,241,0.18); }
.login-feature .f-icon.i2 { background: rgba(230,0,35,0.15); }
.login-feature .f-icon.i3 { background: rgba(16,185,129,0.15); }
.login-feature .f-title { color: #fff; font-weight: 600; font-size: 14px; }
.login-feature .f-sub { color: #7d80a0; font-size: 12.5px; margin-top: 1px; }

/* RIGHT: form side */
.login-form-side {
    flex: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #0d0d1a;
    border-left: 1px solid rgba(255,255,255,0.06);
}
.login-card {
    background: #13131f;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 44px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.login-logo { text-align: left; margin-bottom: 28px; }
.login-logo img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
.login-card h2 { text-align: left; margin: 18px 0 4px 0; font-size: 22px; font-weight: 800; color: #fff; }
.login-card .sub { color: #8286a3; font-size: 13.5px; margin-bottom: 26px; }

.login-error {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    border: 1px solid rgba(239,68,68,0.3);
}

.login-card .form-group label {
    color: #b6b9d1;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 7px;
}
.login-input-wrap { position: relative; }
.login-input-wrap .field-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: 0.6;
}
.login-card input[type="text"],
.login-card input[type="password"] {
    background: #0a0a14;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 12px 14px 12px 40px;
    border-radius: 10px;
}
.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.login-card input::placeholder { color: #565a75; }

.login-card .btn-primary {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
    font-size: 15px;
    padding: 13px 20px;
}

.login-footer-note {
    text-align: center;
    color: #55597a;
    font-size: 12px;
    margin-top: 26px;
}

/* Login page footer (Company links, inspired reference) */
.login-page-footer {
    background: #08080f;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 36px 70px 20px 70px;
}
.lpf-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}
.lpf-brand { max-width: 340px; }
.lpf-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lpf-logo img { width: 28px; height: 28px; border-radius: 7px; }
.lpf-logo span { color: #fff; font-weight: 800; font-size: 14px; }
.lpf-brand p { color: #6b6e8a; font-size: 13px; line-height: 1.6; margin: 0; }

.lpf-links h4 {
    color: #a5a8ff;
    font-size: 13px;
    font-weight: 700;
    text-transform: capitalize;
    margin: 0 0 14px 0;
}
.lpf-links { display: flex; flex-direction: column; }
.lpf-links a {
    color: #b6b9d1;
    font-size: 13.5px;
    text-decoration: none;
    margin-bottom: 10px;
    transition: 0.15s;
}
.lpf-links a:hover { color: #a5a8ff; text-decoration: underline; }

.lpf-bottom {
    max-width: 1100px;
    margin: 24px auto 0 auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: #55597a;
    font-size: 12.5px;
    text-align: center;
}

@media (max-width: 900px) {
    .login-page-footer { padding: 30px 24px 18px 24px; }
}

@media (max-width: 900px) {
    .login-hero { display: none; }
    .login-form-side { flex: 1; border-left: none; }
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,15,35,0.5);
    align-items: center; justify-content: center;
    z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin: 0 0 20px 0; font-size: 17px; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ===== UTILITY ===== */
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-3 { margin-top: 12px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-secondary); }
