/* ============================================================
   ARIES / ADAPTIVE SD-WAN
   Dashboard V0.1
   ============================================================ */

:root {
    --aries-navy: #071a36;
    --aries-navy-2: #0b2347;
    --aries-navy-3: #12335f;

    --aries-blue: #215fa6;
    --aries-blue-light: #eaf2fb;

    --surface: #ffffff;
    --surface-soft: #f5f7fa;
    --surface-muted: #edf1f5;

    --text: #152033;
    --text-soft: #5e6b7d;
    --text-muted: #8792a2;

    --border: #dce3ea;

    --success: #21875b;
    --warning: #b97a16;
    --danger: #c44242;

    --shadow-sm:
        0 4px 16px rgba(7, 26, 54, 0.08);

    --shadow-md:
        0 16px 40px rgba(7, 26, 54, 0.14);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --sidebar-width: 270px;

    --transition: 160ms ease;
}


/* ============================================================
   RESET
   ============================================================ */

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

html,
body {
    margin: 0;
    min-height: 100%;
}

html {
    background: var(--surface-soft);
}

body {
    min-height: 100vh;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    color: var(--text);
    background: var(--surface-soft);

    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}


/* ============================================================
   COMMON
   ============================================================ */

.app-view {
    min-height: 100vh;
}

.eyebrow {
    display: inline-block;

    margin-bottom: 10px;

    color: var(--aries-blue);

    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-logo {
    object-fit: contain;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 10px 18px;

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    font-weight: 650;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition);
}

.button:active {
    transform: translateY(1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.button-primary {
    color: #ffffff;
    background: var(--aries-navy);
}

.button-primary:hover:not(:disabled) {
    background: var(--aries-navy-3);
}

.button-secondary {
    color: var(--aries-navy);
    background: #ffffff;
    border-color: var(--border);
}

.button-secondary:hover:not(:disabled) {
    background: var(--surface-soft);
}


/* ============================================================
   BOOT
   ============================================================ */

.boot-screen {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 32px;

    text-align: center;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 70% 25%,
            rgba(33, 95, 166, 0.30),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            var(--aries-navy),
            #041126
        );
}

.brand-logo-boot {
    width: min(430px, 75vw);
    margin-bottom: 24px;

    border-radius: var(--radius-md);
}

.boot-screen h1 {
    margin: 0;

    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 650;
}

.boot-screen p {
    margin: 8px 0 26px;

    color: rgba(255, 255, 255, 0.70);
}

.loading-indicator {
    width: 30px;
    height: 30px;

    border: 3px solid rgba(255, 255, 255, 0.20);
    border-top-color: #ffffff;
    border-radius: 50%;

    animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   AUTH / LOGIN / MFA
   ============================================================ */

.auth-layout {
    min-height: 100vh;

    display: grid;
    grid-template-columns:
        minmax(440px, 0.9fr)
        minmax(520px, 1.1fr);

    background: #ffffff;
}

.auth-layout-centered {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;

    background:
        radial-gradient(
            circle at 80% 20%,
            rgba(33, 95, 166, 0.12),
            transparent 30%
        ),
        var(--surface-soft);
}

.auth-panel {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    padding: clamp(32px, 6vw, 76px);
}

.auth-panel-compact {
    width: min(560px, 100%);
    min-height: auto;

    padding: 46px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: #ffffff;

    box-shadow: var(--shadow-md);
}

.auth-header {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo-auth {
    width: 150px;
    height: 90px;

    object-fit: cover;

    border-radius: var(--radius-sm);
}

.auth-header h1 {
    margin: 0;

    color: var(--aries-navy);

    font-size: 1.15rem;
    font-weight: 700;
}

.auth-header p {
    margin: 4px 0 0;

    color: var(--text-soft);

    font-size: 0.88rem;
}

.auth-content {
    width: min(440px, 100%);

    margin: auto 0;
    padding: 50px 0;
}

.auth-intro {
    margin-bottom: 30px;
}

.auth-intro h2 {
    margin: 0 0 12px;

    color: var(--aries-navy);

    font-size: clamp(1.8rem, 4vw, 2.45rem);
    line-height: 1.12;
}

.auth-intro p {
    margin: 0;

    color: var(--text-soft);

    line-height: 1.65;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: var(--text);

    font-size: 0.86rem;
    font-weight: 650;
}

.form-group input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    outline: none;

    background: #ffffff;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-group input:focus {
    border-color: var(--aries-blue);

    box-shadow:
        0 0 0 3px rgba(33, 95, 166, 0.12);
}

#login-form .button,
#mfa-form .button {
    width: 100%;
    margin-top: 4px;
}

#mfa-code {
    text-align: center;

    font-size: 1.35rem;
    font-weight: 700;

    letter-spacing: 0.28em;
}

.alert {
    margin-bottom: 20px;
    padding: 12px 14px;

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    font-size: 0.88rem;
    line-height: 1.45;
}

.alert-error {
    color: #8e2929;
    background: #fff0f0;
    border-color: #f2cccc;
}

.alert-success {
    color: #176442;
    background: #ecf8f2;
    border-color: #c7e7d7;
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    padding-top: 20px;

    color: var(--text-muted);

    border-top: 1px solid var(--border);

    font-size: 0.76rem;
}

.auth-visual {
    position: relative;

    overflow: hidden;

    min-height: 100vh;

    background:
        linear-gradient(
            180deg,
            rgba(4, 17, 38, 0.10),
            rgba(4, 17, 38, 0.24)
        ),
        url("/assets/img/aries-login-reference.png")
            center center / cover no-repeat;

    background-color: var(--aries-navy);
}

.auth-visual::before {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            rgba(4, 17, 38, 0.20) 0%,
            transparent 24%,
            transparent 76%,
            rgba(4, 17, 38, 0.10) 100%
        );
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.dashboard-shell {
    min-height: 100vh;

    display: grid;
    grid-template-columns:
        var(--sidebar-width)
        minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;

    height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 24px 18px;

    color: #ffffff;

    background:
        linear-gradient(
            180deg,
            var(--aries-navy),
            #041126
        );
}

.sidebar-brand {
    padding: 4px 8px 24px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.10);
}

.brand-logo-sidebar {
    width: 190px;
    margin-bottom: 16px;

    border-radius: var(--radius-sm);
}

.sidebar-product {
    display: flex;
    flex-direction: column;
}

.sidebar-product strong {
    font-size: 0.9rem;
}

.sidebar-product span {
    margin-top: 3px;

    color: rgba(255, 255, 255, 0.58);

    font-size: 0.70rem;
}

.sidebar-nav {
    overflow-y: auto;

    display: flex;
    flex-direction: column;

    gap: 3px;

    margin-top: 22px;
}

.sidebar-nav a {
    padding: 11px 12px;

    color: rgba(255, 255, 255, 0.76);

    border-radius: var(--radius-sm);

    text-decoration: none;

    font-size: 0.86rem;

    transition:
        color var(--transition),
        background var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.10);
}

.nav-heading {
    margin:
        20px 12px
        7px;

    color: rgba(255, 255, 255, 0.38);

    font-size: 0.66rem;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-main {
    min-width: 0;

    background: var(--surface-soft);
}

.topbar {
    position: sticky;
    top: 0;

    z-index: 10;

    min-height: 86px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    padding: 18px 32px;

    border-bottom: 1px solid var(--border);

    background:
        rgba(255, 255, 255, 0.94);

    backdrop-filter: blur(10px);
}

#page-eyebrow {
    display: block;

    margin-bottom: 3px;

    color: var(--text-muted);

    font-size: 0.68rem;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#page-title {
    margin: 0;

    color: var(--aries-navy);

    font-size: 1.35rem;
}

.session-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.session-user {
    display: flex;
    flex-direction: column;

    text-align: right;
}

.session-user span {
    font-size: 0.86rem;
    font-weight: 650;
}

.session-user small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 0.70rem;
}

.dashboard-content {
    padding: 32px;
}

.dashboard-section {
    width: min(1500px, 100%);
    margin: 0 auto;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;

    color: var(--aries-navy);

    font-size: 1.7rem;
}

.metric-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}

.metric-card {
    min-height: 135px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}

.metric-card span {
    color: var(--text-soft);

    font-size: 0.80rem;
    font-weight: 600;
}

.metric-card strong {
    color: var(--aries-navy);

    font-size: 2rem;
    font-weight: 700;
}


/* ============================================================
   DATA PANELS / TABLES / EDITORS
   ============================================================ */

.data-panel {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}

.data-panel-header {
    min-height: 62px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 16px 20px;

    border-bottom: 1px solid var(--border);
}

.data-panel-header > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-panel-header strong {
    color: var(--aries-navy);

    font-size: 0.95rem;
}

.data-panel-header span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 28px;
    height: 28px;

    padding: 0 8px;

    color: var(--aries-navy);

    border-radius: 999px;

    background: var(--aries-blue-light);

    font-size: 0.76rem;
    font-weight: 700;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 760px;

    border-collapse: collapse;

    background: #ffffff;
}

.data-table th,
.data-table td {
    padding: 15px 20px;

    border-bottom: 1px solid var(--border);

    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--text-soft);

    background: var(--surface-soft);

    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table td {
    color: var(--text);

    font-size: 0.86rem;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: #fbfcfe;
}

.data-table .table-actions {
    width: 130px;

    text-align: right;
}

.table-empty {
    padding: 36px 20px !important;

    color: var(--text-muted) !important;

    text-align: center !important;
}

.editor-panel {
    margin-top: 24px;
    padding: 24px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}

.editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 24px;
    padding-bottom: 20px;

    border-bottom: 1px solid var(--border);
}

.editor-header h3 {
    margin: 0;

    color: var(--aries-navy);

    font-size: 1.25rem;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0 20px;
}

.form-group select {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    outline: none;

    background: #ffffff;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-group select:focus {
    border-color: var(--aries-blue);

    box-shadow:
        0 0 0 3px rgba(33, 95, 166, 0.12);
}

.editor-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 6px;
    padding-top: 20px;

    border-top: 1px solid var(--border);
}



/* ============================================================
   ORGANIZATIONS FILTERS / PAGINATION
   ============================================================ */

.table-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 20px;
    padding: 18px 20px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}


.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;

    min-width: 260px;
}


.filter-group label {
    color: var(--text-soft);

    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.04em;
    text-transform: uppercase;
}


.filter-group input,
.filter-group select {
    width: 100%;
    height: 44px;

    padding: 0 14px;

    color: var(--text);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    outline: none;

    background: #ffffff;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}


.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--aries-blue);

    box-shadow:
        0 0 0 3px rgba(33, 95, 166, 0.12);
}


.pagination-bar {

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 16px;

    padding: 16px 20px;

    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 0.85rem;
}


.pagination-buttons {

    display: flex;
    align-items: center;
    gap: 14px;
}


.pagination-buttons span {

    min-width: 90px;

    color: var(--aries-navy);

    text-align: center;

    font-size: 0.82rem;
    font-weight: 650;
}


.pagination-buttons .button:disabled {

    opacity: 0.45;

    cursor: not-allowed;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .auth-panel {
        width: min(620px, 100%);
        margin: 0 auto;
    }

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


@media (max-width: 820px) {

    :root {
        --sidebar-width: 220px;
    }

    .brand-logo-sidebar {
        width: 160px;
    }

    .topbar {
        padding:
            16px
            20px;
    }

    .dashboard-content {
        padding: 24px 20px;
    }
}


@media (max-width: 680px) {

    .section-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }

    .section-heading .button {
        align-self: flex-start;
    }

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

    .editor-header {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }

    .editor-header .button {
        align-self: flex-start;
    }

    .editor-actions {
        justify-content: stretch;
    }

    .editor-actions .button {
        width: 100%;
    }

    .data-table th,
    .data-table td {
        padding: 13px 16px;
    }

    .auth-panel {
        padding: 26px 22px;
    }

    .auth-panel-compact {
        margin: 20px;
        padding: 28px 22px;
    }

    .auth-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand-logo-auth {
        width: 130px;
        height: auto;

        object-fit: contain;
    }

    .auth-footer {
        flex-direction: column;
        gap: 5px;
    }

    .dashboard-shell {
        display: block;
    }

    .sidebar {
        position: relative;

        width: 100%;
        height: auto;

        padding: 14px 18px;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        gap: 14px;

        padding-bottom: 14px;
    }

    .brand-logo-sidebar {
        width: 110px;
        margin: 0;
    }

    .sidebar-nav {
        display: none;
    }

    .topbar {
        position: relative;

        align-items: flex-start;
        flex-direction: column;

        gap: 14px;
    }

    .session-area {
        width: 100%;

        justify-content: space-between;
    }

    .session-user {
        text-align: left;
    }

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

    .dashboard-content {
        padding: 22px 16px;
    }
}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }
}
