:root {
    --sidebar-width: 246px;
    --sidebar-collapsed: 72px;
    --topbar-height: 58px;
    --border: #e5e7eb;
    --background: #f6f7f9;
    --surface: #ffffff;
    --text: #18202a;
    --muted: #6b7280;
    --primary: #1f5fae;
    --primary-soft: #eaf2fc;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --success: #16794a;
    --success-soft: #ecfdf3;
    --sidebar: #111827;
    --sidebar-text: #d1d5db;
    --sidebar-muted: #7f8999;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    color: var(--text);
    background: var(--background);
}

body {
    font-size: 14px;
}

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

button,
input {
    font: inherit;
}


/* LOGIN */

.login-page,
.status-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        linear-gradient(
            145deg,
            #f7f9fc,
            #eef3f8
        );
}

.login-shell {
    width: 100%;
    max-width: 390px;
}

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

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
}

.brand-mark-small {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex: 0 0 auto;
}

.brand-title {
    font-size: 21px;
    font-weight: 700;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.login-card,
.status-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    box-shadow:
        0 10px 28px
        rgba(15, 23, 42, 0.08);
}

.status-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.status-card .brand-mark {
    margin: 0 auto 16px;
}

.login-heading {
    font-size: 20px;
    font-weight: 700;
}

.login-description {
    margin: 5px 0 20px;
    color: var(--muted);
}

.login-footer {
    text-align: center;
    margin-top: 15px;
    color: var(--muted);
    font-size: 11px;
}


/* FORM */

.form-label {
    display: block;
    margin: 13px 0 6px;
    font-weight: 600;
    font-size: 12px;
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    border: 1px solid #cfd5dd;
    border-radius: 7px;
    background: #fff;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px
        rgba(31, 95, 174, 0.10);
}


/* BUTTON */

.btn {
    border: 0;
    border-radius: 7px;
    padding: 10px 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-light {
    background: #f3f4f6;
    color: #374151;
}

.btn-block {
    width: 100%;
    margin-top: 18px;
}

.btn-small {
    padding: 7px 10px;
    font-size: 12px;
}


/* ALERT */

.alert {
    padding: 10px 12px;
    margin: 14px 0;
    border-radius: 7px;
    font-size: 12px;
}

.alert-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #fecdca;
}

.alert-success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid #abefc6;
}


/* SIDEBAR */

.sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: var(--sidebar);
    color: var(--sidebar-text);
    overflow-y: auto;
    transition: width 0.18s ease;
}

.sidebar-brand {
    position: sticky;
    top: 0;
    z-index: 2;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    background: var(--sidebar);
    border-bottom:
        1px solid
        rgba(255,255,255,0.08);
}

.sidebar-brand-text {
    min-width: 0;
    white-space: nowrap;
}

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

.sidebar-brand-text span {
    font-size: 10px;
    color: var(--sidebar-muted);
    margin-top: 2px;
}

.sidebar-nav {
    padding: 9px 8px 22px;
}

.nav-section {
    margin: 15px 10px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-muted);
    white-space: nowrap;
}

.nav-item {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    margin-bottom: 2px;
    border-radius: 6px;
    color: var(--sidebar-text);
    white-space: nowrap;
}

.nav-item.active {
    background:
        rgba(255,255,255,0.10);
    color: #fff;
}

.nav-item.disabled {
    opacity: 0.56;
    cursor: default;
}

.nav-icon {
    width: 26px;
    flex: 0 0 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        rgba(255,255,255,0.08);
    font-size: 10px;
    font-weight: 700;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}


/* TOPBAR */

.topbar {
    position: fixed;
    z-index: 20;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transition: left 0.18s ease;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
}

.topbar-title {
    font-weight: 700;
}

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

.user-meta {
    text-align: right;
}

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

.user-meta span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}


/* CONTENT */

.content {
    margin-left: var(--sidebar-width);
    padding:
        calc(var(--topbar-height) + 17px)
        17px
        30px;
    transition: margin-left 0.18s ease;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.page-heading h1 {
    font-size: 20px;
    margin: 0;
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.status-pill,
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
}

.status-pill {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge-ready {
    color: var(--success);
    background: var(--success-soft);
}


/* CARDS */

.stats-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.stat-card {
    padding: 14px;
}

.stat-label {
    color: var(--muted);
    font-size: 11px;
}

.stat-value {
    margin-top: 7px;
    font-size: 25px;
    font-weight: 700;
}

.panel {
    padding: 14px;
    margin-bottom: 12px;
}

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

.panel-header h2 {
    font-size: 15px;
    margin: 0;
}

.panel-header p {
    color: var(--muted);
    font-size: 11px;
    margin: 3px 0 0;
}

.foundation-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.foundation-item {
    background: #f8fafc;
    border: 1px solid #edf0f4;
    border-radius: 7px;
    padding: 11px;
}

.foundation-item strong,
.foundation-item span {
    display: block;
}

.foundation-item strong {
    font-size: 12px;
}

.foundation-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.two-column {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row span {
    color: var(--muted);
}

.roadmap-list {
    margin: 0;
    padding-left: 21px;
}

.roadmap-list li {
    padding: 4px 0;
    color: var(--muted);
}

.roadmap-list li.current {
    color: var(--primary);
    font-weight: 700;
}


/* COLLAPSED DESKTOP */

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .topbar {
    left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .content {
    margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed
.sidebar-brand-text,
body.sidebar-collapsed
.nav-label,
body.sidebar-collapsed
.nav-section {
    display: none;
}

body.sidebar-collapsed
.sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed
.nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-backdrop {
    display: none;
}


/* MOBILE */

@media (max-width: 900px) {

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

    .two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {

    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 0.18s ease;
    }

    .topbar {
        left: 0;
    }

    .content {
        margin-left: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

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

    body.sidebar-open
    .sidebar-backdrop {
        display: block;
        position: fixed;
        z-index: 25;
        inset: 0;
        background:
            rgba(15, 23, 42, 0.38);
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }

    body.sidebar-collapsed
    .sidebar-brand-text,
    body.sidebar-collapsed
    .nav-label,
    body.sidebar-collapsed
    .nav-section {
        display: initial;
    }

    body.sidebar-collapsed
    .sidebar-brand {
        justify-content: flex-start;
        padding: 0 15px;
    }

    body.sidebar-collapsed
    .nav-item {
        justify-content: flex-start;
        padding: 7px 9px;
    }

    .user-meta {
        display: none;
    }

    .page-heading {
        display: block;
    }

    .status-pill {
        margin-top: 9px;
    }

    .stats-grid,
    .foundation-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* ==========================================================
   PROFILE MANAGEMENT V1
   ========================================================== */

.breadcrumbs {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
}

.breadcrumbs a {
    color: var(--primary);
}

.panel-no-padding {
    padding: 0;
    overflow: hidden;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 940px;
}

.data-table th {
    position: sticky;
    top: var(--topbar-height);
    z-index: 3;
    padding: 9px 11px;
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 11px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

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

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

.table-primary {
    font-weight: 600;
}

.table-secondary {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.table-action {
    text-align: right !important;
}

.code-value,
.code-input {
    font-family:
        Consolas,
        "Courier New",
        monospace;
}

.feature-pills {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.feature-pill {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.feature-pill.on {
    color: var(--success);
    background: var(--success-soft);
}

.feature-pill.off {
    color: #8b949f;
    background: #f1f3f5;
}

.badge-muted {
    color: #667085;
    background: #f2f4f7;
}

.text-muted {
    color: var(--muted);
}

.empty-cell,
.empty-block {
    padding: 25px !important;
    color: var(--muted);
    text-align: center;
}

.page-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field {
    min-width: 0;
}

.field-full {
    grid-column: 1 / -1;
}

textarea.form-control {
    min-height: 86px;
    height: auto;
    resize: vertical;
    padding-top: 9px;
    padding-bottom: 9px;
}

select.form-control {
    appearance: auto;
}

.form-control:disabled {
    color: #697386;
    background: #f4f6f8;
    cursor: not-allowed;
}

.readonly-value {
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #e3e7ed;
    border-radius: 7px;
    background: #f7f9fb;
}

.readonly-value strong,
.readonly-value span {
    display: block;
}

.readonly-value span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.form-section-title {
    margin: 19px 0 9px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    font-size: 12px;
}

.toggle-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.toggle-card {
    min-height: 68px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fafbfc;
    cursor: pointer;
}

.toggle-card input {
    margin-top: 2px;
}

.toggle-card span {
    display: block;
}

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

.toggle-card small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.status-toggle-card {
    max-width: 400px;
}

.button-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.profile-relations {
    align-items: start;
}

.relation-card {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.relation-card:first-of-type {
    padding-top: 0;
}

.relation-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.relation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.relation-title {
    margin-top: 5px;
    font-weight: 600;
}

.relation-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.json-box {
    margin: 8px 0 0;
    padding: 8px;
    max-height: 170px;
    overflow: auto;
    border-radius: 6px;
    background: #f4f6f8;
    color: #344054;
    font-size: 10px;
    white-space: pre-wrap;
}

.profile-system-info .detail-row strong {
    text-align: right;
    word-break: break-all;
}

@media (max-width: 1100px) {

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

@media (max-width: 760px) {

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

    .field-full {
        grid-column: auto;
    }

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

    .profile-system-info .detail-row {
        display: block;
    }

    .profile-system-info .detail-row strong {
        display: block;
        margin-top: 4px;
        text-align: left;
    }
}

@media (max-width: 480px) {

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


/* ==========================================================
   SIMPLE ADMIN UX V1
   ========================================================== */

.simple-profile-table {
    min-width: 760px;
}

.friendly-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.friendly-feature {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #f0f5fb;
    color: #315f91;
    font-size: 10px;
    font-weight: 600;
}

.simple-switch-card {
    min-height: 40px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fafbfc;
}

.simple-switch-card input {
    margin-top: 3px;
}

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

.simple-switch-card small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.friendly-toggle-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.friendly-toggle-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-height: 82px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
}

.friendly-toggle-card input {
    margin-top: 3px;
}

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

.friendly-toggle-card strong {
    font-size: 12px;
}

.friendly-toggle-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.advanced-box {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    overflow: hidden;
}

.advanced-box summary {
    padding: 13px 14px;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
}

.advanced-box[open] summary {
    border-bottom: 1px solid var(--border);
}

.advanced-box-content {
    padding: 14px;
}

.advanced-help {
    padding: 9px 11px;
    margin-bottom: 12px;
    border-radius: 7px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 10px;
}

.profile-save-row {
    margin: 4px 0 14px;
}

.technical-box {
    margin-top: 5px;
}

.technical-section {
    margin-bottom: 18px;
}

.technical-section:last-child {
    margin-bottom: 0;
}

.technical-section h3 {
    margin: 0 0 9px;
    font-size: 12px;
}

@media (max-width: 900px) {

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

@media (max-width: 600px) {

    .friendly-toggle-grid {
        grid-template-columns: 1fr;
    }
}

