body {
    background: #f6f3ee;
    color: #1f2723;
}

#page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    z-index: 12000;
    background: #34d399;
    pointer-events: none;
}

#page-loading-bar.is-loading {
    width: 72%;
}

.shell-loading #page-loading-bar,
#page-loading-bar.is-loading {
    width: 72%;
}

.page-main {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 18px 60px;
}

.page-transition {
    min-height: 280px;
}

.shell-loading .page-main {
    cursor: progress;
}

.admin-top-nav {
    position: sticky;
    top: 0;
    z-index: 9990;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: #16221d;
    color: #eef8f1;
    box-shadow: 0 1px 4px rgba(14, 22, 18, .12);
}

.admin-nav-brand a {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}

.admin-nav-groups {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-group {
    position: relative;
    display: inline-block;
}

.nav-trigger {
    border: 0;
    cursor: pointer;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    color: #effaf2;
    font-size: 13px;
    user-select: none;
    line-height: 1.25;
}

.nav-group.active .nav-trigger,
.nav-group.is-open .nav-trigger {
    background: #dff3e7;
    color: #14231c;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10000;
    min-width: 230px;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #d6e2db;
    box-shadow: 0 2px 8px rgba(16, 24, 20, .12);
}

.nav-group.is-open .nav-dropdown {
    display: block;
}

.nav-dropdown[hidden] {
    display: none !important;
}

.nav-link {
    display: block;
    color: #1d2b24;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
    background: #edf7f1;
    color: #0f5132;
    font-weight: 700;
}

.admin-nav-user {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #e5e7eb;
    font-size: 13px;
    white-space: nowrap;
}

.admin-nav-user a {
    color: #bbf7d0;
    text-decoration: none;
    font-weight: 700;
}

.admin-page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 18px 60px;
}

.admin-card {
    border: 0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(31, 39, 35, .07);
}

.admin-action-card {
    display: block;
    height: 100%;
    padding: 18px;
    border-radius: 20px;
    color: #1e2c25;
    text-decoration: none;
    background: linear-gradient(135deg, #ffffff, #eef7f2);
    border: 1px solid #d9e7df;
}

.admin-action-card:hover {
    box-shadow: 0 4px 16px rgba(31, 39, 35, .10);
}

.admin-status-pass,
.status-pass {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.admin-status-warning,
.status-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.admin-status-fail,
.status-fail {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.admin-status-running,
.status-running {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.admin-status-pending,
.status-pending {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.admin-table {
    font-size: 14px;
}

.admin-table td,
.admin-table th {
    vertical-align: middle;
}

.admin-quick-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 18px;
}

.admin-quick-links a {
    padding: 6px 10px;
    border-radius: 10px;
    background: #edf7f1;
    border: 1px solid #cfe2d8;
    color: #143326;
    text-decoration: none;
    font-size: 13px;
}

.skeleton {
    min-height: 44px;
    border-radius: 12px;
    background: linear-gradient(90deg, #eef2ef 25%, #f8faf8 50%, #eef2ef 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.2s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 760px) {
    .admin-top-nav {
        align-items: flex-start;
    }
    .page-hero,
    .section-heading {
        display: block;
    }
    .page-actions {
        justify-content: flex-start;
        margin-top: 14px;
    }
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .nav-dropdown {
        position: static;
        margin-top: 8px;
        width: min(92vw, 360px);
    }
}

.nav-section-label {
    font-size: 12px;
    color: #6b7c72;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.card {
    border: 0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(31, 39, 35, .07);
    padding: 22px;
    margin-bottom: 18px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    background: linear-gradient(135deg, #ffffff, #eef7f2);
    border: 1px solid #d9e7df;
}

.page-hero h1 {
    margin: 0 0 8px;
    font-weight: 800;
}

.page-actions,
.status-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.page-actions {
    justify-content: flex-end;
}

.muted {
    color: #647067;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 12px;
    padding: 9px 13px;
    border: 1px solid #cfe2d8;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
}

.btn-primary {
    background: #174c39;
    border-color: #174c39;
    color: #fff;
}

.btn-secondary {
    background: #edf7f1;
    border-color: #cfe2d8;
    color: #143326;
}

.btn-outline {
    background: #fff;
    border-color: #b9cec3;
    color: #143326;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    text-align: left;
    vertical-align: top;
    padding: 9px 8px;
    border-bottom: 1px solid #e8eee9;
}

.table-sm th,
.table-sm td {
    padding: 7px 6px;
    font-size: 13px;
}

.code-block {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 12px 0 0;
    padding: 14px;
    border-radius: 14px;
    background: #102019;
    color: #e5f4eb;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    max-height: 320px;
    overflow: auto;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

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

.prompt-block-toolbar {
    display: flex;
    gap: 8px;
    margin: 10px 0 14px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-on {
    background: #dcfce7;
    color: #166534;
}

.status-on .status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.status-off {
    background: #fee2e2;
    color: #991b1b;
}

.status-off .status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.btn-danger {
    border-color: #ef4444;
    color: #b91c1c;
    background: #fff;
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-success {
    border-color: #22c55e;
    color: #166534;
    background: #fff;
}

.btn-success:hover {
  background: #dcfce7;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfe2d8;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: #10231b;
    font: inherit;
}

.form-control:focus {
    outline: 2px solid rgba(23, 76, 57, .18);
    border-color: #174c39;
}

.alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin: 12px 0;
    border: 1px solid transparent;
}

.alert-success {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    display: inline;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.permission-module {
    border: 1px solid #d8e2dc;
    border-radius: 14px;
    margin: 10px 0;
    padding: 10px 12px;
    background: #fff;
}

.permission-module summary {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-sm {
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 13px;
}

.permission-inherit {
    border-color: #cbd5e1;
}

.permission-allow {
    border-color: #22c55e;
    background: #f0fdf4;
}

.permission-deny {
    border-color: #ef4444;
    background: #fef2f2;
}

.login-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(34, 197, 94, .12), transparent 32%),
        linear-gradient(135deg, #f7f4ec 0%, #eef7f2 100%);
    display: grid;
    place-items: center;
}

.login-shell {
    width: min(94vw, 520px);
    padding: 24px;
}

.login-card {
    background: #fff;
    border: 1px solid #d9e7df;
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 12px 32px rgba(31, 39, 35, .10);
}

.login-brand {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    background: #10231b;
    color: #dcfce7;
    font-weight: 800;
    margin-bottom: 18px;
}

.login-kicker {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    background: #10231b;
    color: #dcfce7;
    font-weight: 800;
    margin-bottom: 18px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 5vw, 42px);
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.login-submit {
    width: 100%;
    padding: 12px 16px;
}

.login-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    color: #647067;
    font-size: 13px;
}

.login-footer a {
    color: #174c39;
    font-weight: 800;
    text-decoration: none;
}
