:root {
    --primary: #0f6fff;
    --primary-dark: #0757d7;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --text: #172033;
    --muted: #6b7280;
    --border: #e5eaf1;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, #2680ff, #0757d7);
    box-shadow: 0 18px 35px rgba(15, 111, 255, 0.32);
    color: white;
    font-size: 2rem;
    font-weight: 800;
}

.brand-mark.small {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.2rem;
}

/* Login */

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 111, 255, 0.14), transparent 36%),
        #f3f6fb;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 0.95fr);
}

.login-brand-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: 70px;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(15, 43, 89, 0.94)),
        radial-gradient(circle at top right, #0f6fff, transparent 58%);
    color: white;
}

.login-brand-panel::after {
    position: absolute;
    right: -140px;
    bottom: -170px;
    width: 410px;
    height: 410px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    content: "";
}

.login-brand-panel .eyebrow {
    margin-top: 32px;
    color: #8bbcff;
}

.login-brand-panel h1 {
    max-width: 700px;
    margin: 0;
    font-size: clamp(2.4rem, 4.5vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.login-brand-panel p {
    max-width: 590px;
    margin: 24px 0 0;
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.8;
}

.brand-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-modules span {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #e5edf8;
    font-size: 0.82rem;
    font-weight: 700;
}

.login-form-panel {
    display: grid;
    padding: 45px;
    place-items: center;
}

.login-card {
    width: min(100%, 450px);
    padding: 38px;
    border: 1px solid rgba(229, 234, 241, 0.9);
    border-radius: 24px;
    background: rgba(255,255,255,0.95);
    box-shadow: var(--shadow);
}

.mobile-logo {
    display: none;
    margin-bottom: 32px;
    align-items: center;
    gap: 13px;
}

.login-card h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.035em;
}

.form-intro {
    margin: 10px 0 28px;
    color: var(--muted);
    line-height: 1.65;
}

.login-card label {
    display: block;
    margin: 18px 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid #d9e0e9;
    border-radius: 12px;
    outline: none;
    background: #fbfcfe;
    transition: 0.2s ease;
}

.login-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 111, 255, 0.1);
    background: white;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 72px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transform: translateY(-50%);
}

.primary-button {
    width: 100%;
    min-height: 54px;
    margin-top: 25px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 26px rgba(15, 111, 255, 0.22);
    color: white;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(15, 111, 255, 0.28);
}

.login-note {
    margin: 22px 0 0;
    color: #9aa4b2;
    font-size: 0.76rem;
    text-align: center;
}

.alert {
    margin: 20px 0 4px;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 0.83rem;
    line-height: 1.5;
}

.alert-error {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

/* Dashboard */

.sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 268px;
    padding: 20px 16px;
    flex-direction: column;
    background: var(--sidebar);
    color: #e5edf8;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    padding: 8px 8px 22px;
    align-items: center;
    gap: 13px;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand strong {
    font-size: 1.02rem;
}

.sidebar-brand span {
    margin-top: 2px;
    color: #93a3ba;
    font-size: 0.75rem;
}

.sidebar-nav {
    display: flex;
    overflow-y: auto;
    padding-right: 3px;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.nav-heading {
    margin: 21px 10px 7px;
    color: #66758b;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-link {
    position: relative;
    display: flex;
    min-height: 45px;
    padding: 0 12px;
    border-radius: 11px;
    align-items: center;
    gap: 12px;
    color: #aebbd0;
    font-size: 0.83rem;
    font-weight: 650;
    transition: 0.18s ease;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.nav-link:hover,
.nav-link.active {
    background: var(--sidebar-soft);
    color: white;
}

.nav-link.active::before {
    position: absolute;
    left: -16px;
    width: 3px;
    height: 24px;
    border-radius: 0 5px 5px 0;
    background: var(--primary);
    content: "";
}

.nav-link small {
    margin-left: auto;
    color: #5f6e83;
    font-size: 0.65rem;
}

.nav-link.disabled {
    cursor: default;
    opacity: 0.68;
}

.sidebar-user {
    display: flex;
    margin-top: 14px;
    padding: 14px 10px 4px;
    border-top: 1px solid #273244;
    align-items: center;
    gap: 10px;
}

.avatar {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    background: #27364b;
    color: #dfe8f5;
    font-size: 0.76rem;
    font-weight: 800;
}

.sidebar-user-copy {
    min-width: 0;
    flex: 1;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-user-copy strong {
    color: white;
    font-size: 0.76rem;
}

.sidebar-user-copy span {
    margin-top: 3px;
    color: #78889f;
    font-size: 0.67rem;
}

.sidebar-user > a {
    color: #8492a7;
}

.dashboard-layout {
    min-height: 100vh;
    margin-left: 268px;
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 84px;
    padding: 14px 34px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(18px);
}

.topbar h1 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.topbar .eyebrow {
    margin-bottom: 4px;
    font-size: 0.63rem;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    cursor: pointer;
}

.topbar-actions {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 12px;
}

.system-online {
    display: flex;
    padding: 10px 13px;
    border: 1px solid #dcfce7;
    border-radius: 999px;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 0.74rem;
    font-weight: 800;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    place-items: center;
    background: white;
    color: #667085;
}

.dashboard-content {
    padding: 28px 34px 50px;
}

.welcome-panel {
    display: flex;
    min-height: 185px;
    padding: 34px;
    border-radius: 22px;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background:
        linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(15, 68, 143, 0.96)),
        var(--sidebar);
    box-shadow: 0 20px 45px rgba(15, 37, 71, 0.15);
    color: white;
}

.welcome-panel .eyebrow {
    color: #8ec0ff;
}

.welcome-panel h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    letter-spacing: -0.045em;
}

.welcome-panel p {
    max-width: 700px;
    margin: 13px 0 0;
    color: #cbd7e7;
    line-height: 1.7;
}

.welcome-meta {
    min-width: 180px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.07);
}

.welcome-meta span,
.welcome-meta strong,
.welcome-meta small {
    display: block;
}

.welcome-meta span {
    color: #9db0c7;
    font-size: 0.72rem;
}

.welcome-meta strong {
    margin: 5px 0;
    font-size: 1rem;
}

.welcome-meta small {
    color: #d5dfec;
    font-size: 0.72rem;
}

.overview-grid {
    display: grid;
    margin-top: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.overview-card {
    display: flex;
    min-height: 108px;
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: center;
    gap: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.overview-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    border-radius: 13px;
    place-items: center;
    background: #eef5ff;
    color: var(--primary);
}

.overview-card span,
.overview-card strong {
    display: block;
}

.overview-card span {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.72rem;
}

.overview-card strong {
    font-size: 0.96rem;
}

.section-block {
    margin-top: 34px;
}

.section-heading,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.section-heading h2,
.panel-heading h2 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -0.028em;
}

.section-note {
    color: var(--muted);
    font-size: 0.75rem;
}

.module-grid {
    display: grid;
    margin-top: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.module-card {
    display: flex;
    min-height: 255px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-direction: column;
    background: white;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
    transition: 0.2s ease;
}

.module-card:hover:not(.planned) {
    border-color: #c8d9f5;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.module-card.planned {
    background: #fafbfc;
}

.module-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.module-icon {
    display: grid;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    place-items: center;
    font-size: 1.12rem;
}

.module-icon.blue { background: #eaf2ff; color: #0f6fff; }
.module-icon.cyan { background: #e8fbff; color: #0891b2; }
.module-icon.purple { background: #f3edff; color: #7c3aed; }
.module-icon.green { background: #eafaf0; color: #16a34a; }
.module-icon.orange { background: #fff4e5; color: #ea580c; }
.module-icon.slate { background: #eef1f5; color: #475569; }

.module-status {
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
}

.module-status.live {
    background: #ecfdf3;
    color: #15803d;
}

.module-status.planned {
    background: #f1f3f6;
    color: #7a8594;
}

.module-copy {
    flex: 1;
}

.module-copy h3 {
    margin: 20px 0 8px;
    font-size: 1.03rem;
    letter-spacing: -0.018em;
}

.module-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.79rem;
    line-height: 1.7;
}

.module-action {
    display: flex;
    margin-top: 22px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.module-action.unavailable {
    color: #98a1af;
}

.bottom-grid {
    display: grid;
    margin-top: 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.panel {
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.panel-heading > i {
    color: #9aa6b6;
}

.system-list {
    display: grid;
    margin-top: 20px;
    gap: 2px;
}

.system-list > div {
    display: flex;
    padding: 13px 0;
    border-bottom: 1px solid #eef1f5;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-size: 0.78rem;
}

.system-list > div:last-child {
    border-bottom: 0;
}

.system-list span {
    color: #5d6878;
}

.system-list span i {
    margin-right: 9px;
    color: #22c55e;
    font-size: 0.5rem;
}

.system-list strong {
    color: #344054;
    font-size: 0.72rem;
}

.security-copy {
    margin-top: 20px;
}

.security-copy > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.75;
}

.security-badge {
    display: flex;
    margin-top: 21px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    align-items: center;
    gap: 13px;
    background: #f6faff;
    color: var(--primary);
}

.security-badge > i {
    font-size: 1.2rem;
}

.security-badge span,
.security-badge strong {
    display: block;
}

.security-badge span {
    color: #687386;
    font-size: 0.73rem;
    line-height: 1.55;
}

.security-badge strong {
    color: #27364a;
    font-size: 0.78rem;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 1180px) {
    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .dashboard-layout {
        margin-left: 0;
    }

    .menu-button {
        display: grid;
        place-items: center;
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 50;
        inset: 0;
        background: rgba(15, 23, 42, 0.48);
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 860px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .mobile-logo {
        display: flex;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 22px;
    }

    .welcome-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .welcome-meta {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .topbar {
        min-height: 72px;
        padding: 12px 16px;
    }

    .topbar .eyebrow {
        display: none;
    }

    .topbar h1 {
        font-size: 1rem;
    }

    .system-online {
        display: none;
    }

    .dashboard-content {
        padding: 18px 14px 36px;
    }

    .welcome-panel {
        min-height: auto;
        padding: 24px;
        border-radius: 18px;
    }

    .welcome-panel h2 {
        font-size: 1.65rem;
    }

    .welcome-panel p {
        font-size: 0.82rem;
    }

    .overview-grid,
    .module-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .overview-card {
        min-height: 92px;
    }

    .module-card {
        min-height: 230px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-note {
        margin-top: -8px;
    }

    .login-card {
        padding: 27px 22px;
        border-radius: 19px;
    }

    .login-card h2 {
        font-size: 1.7rem;
    }
}


/* Phase 2 live dashboard */
.compact-welcome {
    min-height: 154px;
}

.compact-welcome .welcome-meta {
    min-width: 245px;
}

.compact-welcome .welcome-meta strong {
    font-size: 1.4rem;
}

.live-metrics {
    display: grid;
    margin-top: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.live-card {
    display: flex;
    min-height: 126px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: center;
    gap: 15px;
    background: white;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.live-card.primary {
    border-color: #cfe0ff;
    background: linear-gradient(145deg, #ffffff, #f1f6ff);
}

.live-card.attention .live-card-icon {
    background: #fff7e8;
    color: #d97706;
}

.live-card-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 14px;
    place-items: center;
    background: #edf4ff;
    color: var(--primary);
    font-size: 1rem;
}

.live-card span,
.live-card strong,
.live-card small {
    display: block;
}

.live-card span {
    color: var(--muted);
    font-size: 0.72rem;
}

.live-card strong {
    margin: 6px 0 4px;
    font-size: 1.42rem;
    letter-spacing: -0.035em;
}

.live-card small {
    color: #98a2b3;
    font-size: 0.66rem;
}

.mini-metrics {
    display: grid;
    margin-top: 14px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.mini-metrics article {
    display: flex;
    min-height: 73px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255,255,255,0.74);
}

.mini-metrics span {
    color: var(--muted);
    font-size: 0.7rem;
}

.mini-metrics strong {
    font-size: 1.06rem;
}

.data-grid {
    display: grid;
    margin-top: 28px;
    grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.8fr);
    gap: 16px;
}

.data-panel {
    min-width: 0;
}

.panel-heading a {
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.activity-list,
.inquiry-list {
    margin-top: 14px;
}

.activity-row {
    display: grid;
    padding: 14px 0;
    border-bottom: 1px solid #eef1f5;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.activity-row:last-child,
.inquiry-row:last-child {
    border-bottom: 0;
}

.activity-symbol {
    display: grid;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    place-items: center;
    background: #eff5ff;
    color: var(--primary);
    font-size: 0.76rem;
}

.activity-main strong,
.activity-main span,
.activity-side small,
.inquiry-row strong,
.inquiry-row span {
    display: block;
}

.activity-main strong,
.inquiry-row strong {
    overflow: hidden;
    color: #344054;
    font-size: 0.76rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.activity-main span,
.activity-side small,
.inquiry-row span {
    margin-top: 4px;
    color: #8b95a5;
    font-size: 0.66rem;
}

.activity-side {
    text-align: right;
}

.record-badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f3f6;
    color: #667085;
    font-size: 0.59rem;
    font-weight: 800;
    text-transform: uppercase;
}

.record-badge.success {
    background: #ecfdf3;
    color: #15803d;
}

.record-badge.warning {
    background: #fff7e8;
    color: #b45309;
}

.record-badge.danger {
    background: #fff1f2;
    color: #be123c;
}

.inquiry-row {
    display: grid;
    padding: 14px 0;
    border-bottom: 1px solid #eef1f5;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
}

.small-avatar {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #eef4ff;
    color: var(--primary);
}

.empty-state {
    padding: 28px 10px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.compact-modules .module-card {
    min-height: 230px;
}

@media (max-width: 1180px) {
    .live-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .data-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .live-metrics,
    .mini-metrics {
        grid-template-columns: 1fr;
    }

    .live-card {
        min-height: 105px;
    }

    .mini-metrics article {
        min-height: 62px;
    }

    .activity-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .activity-side {
        grid-column: 2;
        text-align: left;
    }

    .activity-side small {
        display: inline-block;
        margin-left: 8px;
    }
}
