/* ================================================================
   Karyiq  –  Design System
   Aesthetic: Industrial Precision meets Warm Refinement
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────── */
:root {
    /* KaryiQ Navy */
    --brand-900: #0E1729;
    --brand-800: #141F35;
    --brand-700: #1A2744;
    --brand-600: #243356;
    --brand-500: #2E4068;
    --brand-400: #4A6490;
    --brand-300: #7090B8;
    --brand-200: #A0B8D4;
    --brand-100: #D0DEF0;
    --brand-50:  #EDF2F8;

    /* KaryiQ Pink/Magenta accent */
    --pink-600: #C4167A;
    --pink-500: #E91E8C;
    --pink-400: #F04DA5;
    --pink-300: #F580BE;
    --pink-100: #FDE0F0;
    --pink-50:  #FFF0F8;

    --amber-600: #C67E1A;
    --amber-500: #E8981C;
    --amber-400: #F5B041;
    --amber-100: #FEF3D4;
    --amber-50:  #FFFBF0;

    --emerald-600: #0D7C53;
    --emerald-500: #10B07A;
    --emerald-100: #D1FAE5;
    --emerald-50:  #ECFDF5;

    --rose-600: #C0293E;
    --rose-500: #E03E52;
    --rose-100: #FFE4E8;
    --rose-50:  #FFF1F2;

    --sky-500: #0EA5E9;
    --sky-100: #E0F2FE;

    --slate-950: #0A0F1A;
    --slate-900: #0F172A;
    --slate-800: #1E293B;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748B;
    --slate-400: #94A3B8;
    --slate-300: #CBD5E1;
    --slate-200: #E2E8F0;
    --slate-100: #F1F5F9;
    --slate-50:  #F8FAFC;

    --white: #FFFFFF;
    --black: #000000;

    --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 8px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 12px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
    --shadow-xl:  0 20px 48px rgba(0,0,0,0.14), 0 8px 20px rgba(0,0,0,0.06);

    --sidebar-w: 264px;
    --header-h: 60px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.65;
    color: var(--slate-800);
    background: var(--slate-50);
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

a { color: var(--brand-500); text-decoration: none; }
a:hover { color: var(--brand-600); }

/* ================================================================
   AUTH PAGES  (login / register)
   ================================================================ */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--white);
}

@media (max-width: 991px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}

/* ── Left brand panel ─────────────────────── */
.auth-brand {
    background: linear-gradient(160deg, var(--brand-900) 0%, var(--brand-700) 60%, var(--brand-500) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(232,152,28,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(91,163,209,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -30%;
    width: 70%;
    height: 180%;
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand .brand-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.auth-brand h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 0 1rem 0;
}

.auth-brand p {
    font-size: 1rem;
    color: var(--brand-300);
    line-height: 1.7;
    margin: 0 0 2.5rem 0;
}

.auth-brand .brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.brand-features .feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.feature .f-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--amber-400);
}

.feature .f-text {
    font-size: 0.875rem;
    color: var(--brand-200);
    line-height: 1.5;
}

.feature .f-text strong {
    display: block;
    color: var(--white);
    font-weight: 600;
    margin-bottom: 0.125rem;
}

/* ── Right form panel ─────────────────────── */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-wrap {
    width: 100%;
    max-width: 440px;
}

.auth-form-wrap .logo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.logo-row .logo-box {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    background: var(--brand-800);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(12,27,42,0.25);
}

.logo-row .logo-text {
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

.auth-form-wrap h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    margin: 0 0 0.375rem 0;
}

.auth-form-wrap .auth-subtitle {
    font-size: 0.9375rem;
    color: var(--slate-500);
    margin: 0 0 1.75rem 0;
}

/* ── Step indicator ───────────────────────── */
.steps-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 1.75rem;
}

.steps-bar .step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--slate-200);
    transition: background 0.3s;
}

.steps-bar .step.current { background: var(--brand-500); }
.steps-bar .step.done    { background: var(--amber-500); }

/* ── Form elements ────────────────────────── */
.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--slate-700);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.form-control, .form-select {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--slate-800);
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 0.6875rem 0.875rem;
    background: var(--white);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(42,85,120,0.10);
    outline: none;
}

.form-control::placeholder {
    color: var(--slate-400);
    font-weight: 400;
}

.input-group-text {
    background: var(--slate-50);
    border: 1.5px solid var(--slate-200);
    color: var(--slate-500);
    font-size: 0.9375rem;
}

.form-check-input:checked {
    background-color: var(--brand-500);
    border-color: var(--brand-500);
}

.form-text {
    font-size: 0.75rem;
    color: var(--slate-400);
}

.required { color: var(--rose-500); }

/* ── Buttons ──────────────────────────────── */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius);
    padding: 0.625rem 1.25rem;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.btn-brand {
    background: var(--brand-700);
    border: none;
    color: var(--white);
}
.btn-brand:hover {
    background: var(--brand-800);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(12,27,42,0.20);
}

.btn-amber {
    background: var(--amber-500);
    border: none;
    color: var(--white);
}
.btn-amber:hover {
    background: var(--amber-600);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--slate-200);
    color: var(--slate-700);
}
.btn-ghost:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
    color: var(--slate-800);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--slate-500);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover {
    background: var(--slate-100);
    color: var(--slate-700);
}

/* ── Alerts ───────────────────────────────── */
.alert {
    border-radius: var(--radius);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.alert-success  { background: var(--emerald-50);  color: var(--emerald-600); border-left: 3px solid var(--emerald-500); }
.alert-danger   { background: var(--rose-50);      color: var(--rose-600);    border-left: 3px solid var(--rose-500); }
.alert-warning  { background: var(--amber-50);     color: var(--amber-600);   border-left: 3px solid var(--amber-500); }
.alert-info     { background: var(--sky-100);       color: var(--brand-600);   border-left: 3px solid var(--sky-500); }

/* ── Badges ───────────────────────────────── */
.badge {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.1875rem 0.625rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bg-emerald { background: var(--emerald-100); color: var(--emerald-600); }
.bg-rose    { background: var(--rose-100);    color: var(--rose-600); }
.bg-amber   { background: var(--amber-100);   color: var(--amber-600); }
.bg-sky     { background: var(--sky-100);      color: var(--brand-600); }
.bg-slate   { background: var(--slate-100);    color: var(--slate-600); }
.bg-brand   { background: var(--brand-100);    color: var(--brand-700); }

/* ================================================================
   LAYOUT  (sidebar + header + content)
   ================================================================ */

/* ── Sidebar ──────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--slate-950);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: transform 0.25s ease;
    overflow: hidden;
}

.sidebar-head {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.sidebar-head .s-logo {
    width: 34px; height: 34px;
    border-radius: var(--radius);
    background: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--white);
}

.sidebar-head .s-title {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-head .s-title small {
    display: block;
    font-weight: 400;
    font-size: 0.6875rem;
    color: var(--slate-500);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-section {
    padding: 1rem 1.25rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--slate-600);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 1rem;
    margin: 1px 0.625rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-400);
    transition: all var(--transition);
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    color: var(--slate-100);
    background: rgba(255,255,255,0.05);
}

.sidebar-nav .nav-link.active {
    color: var(--white);
    background: var(--brand-600);
    box-shadow: 0 2px 10px rgba(42,85,120,0.35);
    font-weight: 600;
}

.sidebar-nav .nav-link svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: 0.65;
}

.sidebar-nav .nav-link.active svg { opacity: 1; }

.sidebar-foot {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.sidebar-foot .u-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius);
    background: var(--brand-600);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-foot .u-info { flex: 1; min-width: 0; }
.sidebar-foot .u-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-foot .u-role {
    font-size: 0.6875rem;
    color: var(--slate-500);
}

/* ── Main area ────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin var(--transition);
}

/* ── Header ───────────────────────────────── */
.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: var(--shadow-xs);
}

.topbar .page-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0;
    letter-spacing: -0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--slate-600);
    margin-right: 0.5rem;
}

/* ── Page content ─────────────────────────── */
.content {
    padding: 1.5rem;
    flex: 1;
}

/* ── Card ─────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-head {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--slate-800);
}

.card-body { padding: 1.25rem; }

/* ── Stat cards ───────────────────────────── */
.stat {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition);
}

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

.stat .stat-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
}

.stat .stat-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat .stat-label {
    font-size: 0.8125rem;
    color: var(--slate-500);
    margin-top: 0.25rem;
}

/* ── Tables ───────────────────────────────── */
.table {
    font-size: 0.875rem;
    margin: 0;
}

.table thead th {
    background: var(--slate-50);
    border-bottom: 2px solid var(--slate-200);
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
    padding: 0.625rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.6875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
}

.table tbody tr:hover { background: var(--slate-50); }

.tbl-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.tbl-user .tbl-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius);
    background: var(--brand-100);
    color: var(--brand-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tbl-user .tbl-name {
    font-weight: 600;
    color: var(--slate-800);
}

.tbl-user .tbl-email {
    font-size: 0.75rem;
    color: var(--slate-400);
}

.tbl-actions {
    display: flex;
    gap: 4px;
}

/* ── Modals ───────────────────────────────── */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}
.modal-header {
    border-bottom: 1px solid var(--slate-100);
    padding: 1.25rem 1.5rem;
}
.modal-title {
    font-weight: 700;
    font-size: 1.0625rem;
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    border-top: 1px solid var(--slate-100);
    padding: 1rem 1.5rem;
}

/* ── Animation ────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.4s ease-out forwards; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }

/* ── Utilities ────────────────────────────── */
.font-mono { font-family: var(--font-mono); }
.fw-semibold { font-weight: 600; }
.text-brand { color: var(--brand-600); }
.text-amber { color: var(--amber-500); }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--slate-400);
}
.empty-state svg {
    width: 56px; height: 56px;
    color: var(--slate-300);
    margin-bottom: 0.75rem;
}
.empty-state h5 {
    color: var(--slate-600);
    font-weight: 600;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1045;
    backdrop-filter: blur(2px);
}
.overlay.show { display: block; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .mobile-toggle { display: block; }
    .overlay.show { display: block; }
}

/* ── Password strength bar ────────────────── */
.pw-bar {
    display: flex;
    gap: 4px;
    margin-top: 0.375rem;
}
.pw-bar .pw-seg {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--slate-200);
    transition: background 0.2s;
}

/* ── Section heading inside forms ─────────── */
.section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    margin: 0;
    padding: 0;
}
