:root {
    --navy: #102542;
    --navy2: #17375f;
    --orange: #f47b20;
    --ink: #172235;
    --muted: #6f7b8e;
    --line: #e4e9f0;
    --bg: #f5f7fa;
    --white: #fff;
    --green: #168563;
    --amber: #a96700;
    --red: #b53c43;
    --shadow: 0 12px 30px rgba(16, 37, 66, .08);
}

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fcfcfa; padding: 20px; gap: 20px; }
.auth-form-side { display: flex; flex-direction: column; padding: 30px 8%; min-width: 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #102542; font-size: 20px; letter-spacing: 1px; }
.auth-brand strong { font-weight: 800; }
.auth-brand small { display: block; font-size: 8px; letter-spacing: 1.6px; color: #7a8492; margin-top: 5px; }
.auth-brand-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #f47b20; color: white; font-size: 28px; flex-shrink: 0; }
.auth-form-wrap { width: 100%; max-width: 420px; margin: auto; padding: 35px 0; }
.auth-eyebrow { color: #a35a25; font-size: 12px; letter-spacing: .3px; }
.auth-form-wrap h1 { font-size: 44px; font-weight: 750; color: #102542; margin: 16px 0 12px; }
.auth-form-wrap h1 span { color: #f47b20; }
.auth-intro { color: #75808e; font-size: 14px; line-height: 1.9; margin-bottom: 34px; }
.auth-form-wrap .login-field { margin-bottom: 22px; }
.auth-form-wrap .login-field label { color: #24354b; margin-bottom: 10px; font-weight: 600; }
.auth-form-wrap .login-field input { background: #fff; height: 54px; font-size: 14px; border-color: #dfe4e9; padding: 14px 16px; }
.auth-password { position: relative; }
.auth-password input { padding-left: 70px !important; }
.auth-password button { position: absolute; left: 9px; top: 9px; border: 0; border-radius: 6px; background: transparent; padding: 8px; color: #667486; font-size: 12px; cursor: pointer; }
.auth-form-wrap .login-help { margin: 4px 0 27px; }
.auth-form-wrap input[type="checkbox"] { accent-color: #f47b20; margin-left: 5px; vertical-align: middle; }
.auth-submit { width: 100%; background: #f47b20; color: #fff; border: 0; border-radius: 10px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px #f47b2026; }
.auth-submit:hover { background: #df6812; }
.auth-security { text-align: center; color: #87909b; font-size: 12px; margin: 23px 0 35px; }
.auth-security span { margin-left: 6px; }
.auth-categories { display: flex; align-items: center; justify-content: center; gap: 16px; border-top: 1px solid #e6e9ed; padding-top: 25px; color: #6c7988; font-size: 11px; direction: ltr; }
.auth-categories i { width: 3px; height: 3px; border-radius: 50%; background: #f47b20; }
.auth-footer { color: #8d96a1; font-size: 10px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.auth-visual { position: relative; border-radius: 24px; overflow: hidden; min-height: 640px; color: white; background: #183c51; }
.auth-visual img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.auth-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #081d3525 0%, transparent 30%, #071e35e8 100%); }
.auth-visual-top { position: absolute; top: 32px; right: 36px; left: 36px; display: flex; align-items: center; justify-content: space-between; z-index: 1; font-size: 12px; }
.auth-visual-top span:first-child { background: #ffffff25; border: 1px solid #ffffff50; border-radius: 30px; padding: 9px 16px; backdrop-filter: blur(10px); }
.auth-visual-top span:last-child { font-size: 28px; }
.auth-visual-copy { position: absolute; bottom: 52px; right: 48px; left: 38px; z-index: 1; }
.auth-visual-kicker { font-size: 10px; letter-spacing: 3px; color: #efd9bf; }
.auth-visual-copy h2 { font-size: clamp(32px, 3.4vw, 54px); line-height: 1.45; font-weight: 700; margin: 18px 0; }
.auth-visual-copy p { color: #e0e7eb; line-height: 1.9; font-size: 14px; }
.auth-visual-tags { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 26px; }
.auth-visual-tags span { border: 1px solid #ffffff45; border-radius: 30px; padding: 8px 16px; font-size: 11px; background: #ffffff0c; }
@media (max-width: 1000px) { .auth-form-side { padding: 25px 5%; } .auth-brand { font-size: 16px; } .auth-visual-copy { right: 28px; left: 25px; } }
@media (max-width: 720px) { .auth-page { grid-template-columns: 1fr; padding: 14px; gap: 10px; } .auth-form-side { padding: 20px 14px; } .auth-form-wrap { padding: 48px 0 35px; } .auth-form-wrap h1 { font-size: 36px; } .auth-visual { min-height: 370px; } .auth-visual-copy { bottom: 25px; } .auth-visual-copy h2 { font-size: 30px; margin: 10px 0; } .auth-visual-top { top: 20px; right: 25px; left: 25px; } .auth-visual-tags { margin-top: 15px; } }

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    text-align: right;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 16px;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    text-align: start;
}

button,
a {
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

a {
    color: var(--navy2);
}

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

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.side {
    background: linear-gradient(180deg, var(--navy), #0b1c33);
    color: #fff;
    padding: 26px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 8px 34px;
    color: #fff;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    background: var(--orange);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 17px;
    letter-spacing: .3px;
    line-height: 1.1;
}

.brand small {
    display: block;
    color: #aebdd0;
    font-size: 12px;
    margin-top: 4px;
}

.nav-label {
    font-size: 12px;
    color: #8398b1;
    margin: 20px 12px 8px;
}

.side-nav {
    padding-bottom: 120px;
}

.nav-btn {
    width: 100%;
    display: flex;
    gap: 12px;
    align-items: center;
    border: 0;
    border-radius: 11px;
    padding: 13px 14px;
    margin: 3px 0;
    background: transparent;
    color: #ccdae9;
    text-align: right;
    text-decoration: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.nav-btn.active {
    background: var(--orange);
    color: #fff;
}

.nav-icon {
    width: 22px;
    flex: 0 0 22px;
    font-size: 19px;
    line-height: 1;
    text-align: center;
}

.profile {
    position: absolute;
    bottom: 20px;
    left: 18px;
    right: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, .07);
    border-radius: 13px;
}

.profile b {
    display: block;
    font-size: 14px;
}

.profile small {
    display: block;
    color: #aebdd0;
    margin-top: 2px;
}

.profile-logout {
    border: 0;
    background: transparent;
    color: #fff;
    padding: 8px 0 0;
    font-size: 13px;
}

.profile-logout:hover {
    color: #ffc89f;
}

.main-shell {
    min-width: 0;
}

.topbar {
    height: 80px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.mobile-menu {
    display: none;
    border: 0;
    background: transparent;
    color: var(--navy);
    font-size: 24px;
}

.global-search {
    flex: 1;
    max-width: 660px;
    position: relative;
    margin: 0;
}

.global-search input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 12px;
    padding: 13px 46px 13px 14px;
    outline: 0;
}

.global-search input:focus {
    border-color: rgba(244, 123, 32, .7);
    box-shadow: 0 0 0 3px rgba(244, 123, 32, .1);
}

.global-search-submit {
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
    height: 46px;
    border: 0;
    background: transparent;
    border-radius: 12px;
    z-index: 1;
    color: var(--muted);
    font-size: 27px;
    cursor: pointer;
}

.lang {
    margin-right: auto;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    padding: 9px 12px;
    border-radius: 9px;
}

.content {
    max-width: 1500px;
    margin: auto;
    padding: 30px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-head h1,
.page-head h2 {
    margin: 0 0 7px;
    color: var(--ink);
    font-size: 29px;
    font-weight: 700;
}

.page-head p {
    margin: 0;
    color: var(--muted);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 26px;
}

.section-card {
    display: block;
    min-height: 170px;
    border: 0;
    background: #fff;
    color: var(--ink);
    border-radius: 17px;
    padding: 22px;
    text-align: right;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.section-card::after {
    content: "";
    position: absolute;
    left: -25px;
    bottom: -35px;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: rgba(244, 123, 32, .1);
}

.section-card:hover {
    color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(16, 37, 66, .12);
}

.section-card .icon {
    display: block;
    font-size: 29px;
    line-height: 1;
}

.section-card h3 {
    margin: 14px 0 7px;
    font-size: 18px;
}

.section-card p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.section-card b {
    color: var(--orange);
    font-size: 14px;
}

.count-chip {
    position: absolute;
    top: 20px;
    left: 20px;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #fff4e9;
    color: #97500f;
    font-weight: 700;
    z-index: 1;
}

.panel,
.card {
    background: #fff;
    border: 0;
    border-radius: 17px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 22px;
    margin-bottom: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
}

.panel h2,
.panel h5,
.card h5 {
    color: var(--ink);
    font-size: 19px;
    margin: 0;
}

.table-wrap,
.table-responsive {
    overflow: auto;
}

table,
.table {
    width: 100%;
    min-width: 760px;
    margin: 0;
    border-collapse: collapse;
    color: var(--ink);
}

table th,
table td,
.table th,
.table td {
    padding: 15px 13px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: middle;
    font-size: 14px;
}

table th,
.table th,
.table thead th {
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-weight: 600;
}

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

.filters,
.filters-form {
    display: flex;
    gap: 11px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filters input,
.filters select,
.filters-form input,
.filters-form select {
    min-height: 43px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    background: #fff;
}

.filters input[type="text"],
.filters input[type="search"],
.filters-form input[type="text"],
.filters-form input[type="search"] {
    flex: 1;
    min-width: 230px;
}

.form-control,
.custom-select {
    min-height: 43px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
}

.form-control:focus,
.custom-select:focus {
    border-color: rgba(244, 123, 32, .7);
    box-shadow: 0 0 0 3px rgba(244, 123, 32, .1);
}

textarea.form-control {
    min-height: 110px;
    line-height: 1.8;
}

label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.primary,
.btn-primary {
    border: 0;
    background: var(--orange);
    color: #fff;
    border-radius: 10px;
    padding: 11px 16px;
}

.primary:hover,
.btn-primary:hover,
.btn-primary:focus {
    background: #df6812;
    border-color: #df6812;
    color: #fff;
    box-shadow: none;
}

.secondary,
.btn-light,
.btn-outline-secondary,
.btn-outline-primary {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 10px;
    padding: 10px 15px;
}

.secondary:hover,
.btn-light:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover {
    border-color: var(--orange);
    background: #fff8f2;
    color: var(--orange);
}

.btn-dark {
    border-color: var(--navy);
    background: var(--navy);
    border-radius: 10px;
}

.btn-outline-danger,
.danger-outline {
    border: 1px solid #e9bfc3;
    background: #fff;
    color: var(--red);
    border-radius: 9px;
    padding: 9px 12px;
}

.btn-outline-danger:hover,
.danger-outline:hover {
    background: #fbeaec;
    border-color: #e9bfc3;
    color: var(--red);
}

.btn-outline-warning {
    border-color: #f2d5a4;
    color: var(--amber);
    border-radius: 9px;
}

.btn-sm {
    padding: 7px 10px;
    border-radius: 8px;
}

.status,
.badge-trust,
.badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 5px 9px;
    border-radius: 30px;
    border: 0;
    font-size: 12px;
    font-weight: 500;
}

.status,
.badge-success,
.trust-very-high {
    background: #e8f6f1;
    color: var(--green);
}

.status.review,
.badge-warning,
.trust-high {
    background: #fff3db;
    color: var(--amber);
}

.status.disabled,
.badge-secondary,
.trust-low {
    background: #fbeaec;
    color: var(--red);
}

.command,
.command-link {
    display: inline-block;
    direction: ltr;
    padding: 6px 9px;
    border-radius: 7px;
    background: #edf3f9;
    color: var(--navy2);
    font-family: Consolas, monospace;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.command-link:hover {
    color: var(--orange);
}

.user-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.user-kpi {
    background: #fff;
    border-radius: 14px;
    padding: 17px;
    box-shadow: var(--shadow);
}

.user-kpi span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 7px;
}

.user-kpi b {
    color: var(--ink);
    font-size: 25px;
}

.empty-note,
.text-muted,
small.text-muted {
    color: var(--muted) !important;
    font-size: 13px;
}

.provider-hero {
    background: linear-gradient(135deg, var(--navy), var(--navy2));
    color: #fff;
    border-radius: 18px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 18px 0 20px;
}

.provider-hero h1 {
    margin: 7px 0;
    color: #fff;
    font-size: 28px;
}

.provider-hero p {
    margin: 0;
    color: #c8d6e7;
}

.provider-hero .empty-note {
    color: #aebdd0 !important;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.detail-layout .panel:last-child.full-width,
.detail-layout > .full-width {
    grid-column: 1 / -1;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
    margin-top: 16px;
}

.detail-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    overflow-wrap: anywhere;
}

.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.notes {
    color: var(--muted);
    white-space: pre-wrap;
    line-height: 1.9;
}

.device {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 10px;
    margin: 8px 0;
}

.device small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.alert {
    border: 0;
    border-radius: 11px;
    box-shadow: 0 7px 18px rgba(16, 37, 66, .05);
}

.alert-success {
    background: #e8f6f1;
    color: var(--green);
}

.alert-info {
    background: #eaf1fb;
    color: #235a9f;
}

.alert-danger {
    background: #fbeaec;
    color: var(--red);
}

.pagination {
    gap: 4px;
}

.page-link {
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 8px !important;
}

.page-item.active .page-link {
    border-color: var(--orange);
    background: var(--orange);
}

.login-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #0b1c33, #17375f);
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-box {
    width: min(450px, 100%);
    background: #fff;
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-box h1 {
    color: var(--ink);
    font-size: 25px;
    margin: 0;
}

.login-box > p,
.login-logo p {
    color: var(--muted);
    margin: 7px 0 20px;
}

.login-logo p {
    margin-bottom: 0;
}

.login-field {
    margin-bottom: 13px;
}

.login-field label {
    display: block;
}

.login-field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    outline: 0;
}

.login-field input:focus {
    border-color: rgba(244, 123, 32, .7);
    box-shadow: 0 0 0 3px rgba(244, 123, 32, .1);
}

.login-help {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 10px 0 20px;
    font-size: 13px;
}

.login-help label {
    margin: 0;
    color: var(--ink);
}

.login-help a {
    color: var(--orange);
}

.prototype-note {
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #fff4e9;
    color: #97500f;
    font-size: 12px;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 1000px) {
    .app-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }

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

    .user-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .content {
        padding: 22px;
    }

    .side {
        padding: 20px 12px;
    }
}

@media (max-width: 720px) {
    .app-shell {
        display: block;
    }

    .side {
        display: none;
        position: fixed;
        right: 0;
        top: 0;
        width: 270px;
        z-index: 40;
    }

    .side.open {
        display: block;
    }

    .sidebar-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(8, 21, 38, .45);
    }

    .mobile-menu {
        display: block;
    }

    .topbar {
        height: 68px;
        padding: 0 15px;
    }

    .content {
        padding: 18px 14px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-head h1,
    .page-head h2 {
        font-size: 24px;
    }

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

    .user-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .provider-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .lang {
        display: none;
    }

    .global-search input {
        padding-left: 8px;
    }
}

@media (max-width: 460px) {
    .user-kpis {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 24px 20px;
    }
}
