/* ==========================================================================
   VMANIA CONTROL CENTER — Calm Dark Gold UI
   ========================================================================== */

:root {
    --bg: #0b1219;
    --bg-deep: #081017;
    --surface: #111a23;
    --surface-2: #151f2a;
    --surface-3: #192531;
    --surface-hover: #1c2935;
    --border: rgba(222, 181, 94, .15);
    --border-strong: rgba(222, 181, 94, .28);
    --border-soft: rgba(255, 255, 255, .065);
    --gold: #d5a54a;
    --gold-bright: #efc66e;
    --gold-soft: rgba(213, 165, 74, .13);
    --text: #f0f4f7;
    --text-soft: #d1d8df;
    --muted: #96a3af;
    --muted-2: #71808e;
    --success: #43b96b;
    --success-soft: rgba(67, 185, 107, .13);
    --warning: #dcae3d;
    --warning-soft: rgba(220, 174, 61, .13);
    --danger: #e15e5e;
    --danger-soft: rgba(225, 94, 94, .13);
    --info: #4f8bd8;
    --info-soft: rgba(79, 139, 216, .13);
    --purple: #8b70d6;
    --radius-sm: 9px;
    --radius: 14px;
    --radius-lg: 18px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .24);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, .14);
    --sidebar-width: 238px;
    --transition: 180ms ease;
}

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

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Vazirmatn", "IRANSansX", "Dana", "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.75;
    color: var(--text);
    background:
        radial-gradient(circle at 90% -10%, rgba(213, 165, 74, .07), transparent 29rem),
        radial-gradient(circle at 10% 100%, rgba(50, 100, 145, .08), transparent 34rem),
        var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255, 255, 255, .014) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .014) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, black, transparent 84%);
}

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

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

button,
select {
    cursor: pointer;
}

img,
svg {
    display: block;
}

[hidden] {
    display: none !important;
}

::selection {
    background: rgba(213, 165, 74, .34);
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #34414d;
    border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
    background: #465563;
}

.icon {
    flex: 0 0 auto;
}

/* ==========================================================================
   Shell, sidebar, topbar
   ========================================================================== */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    direction: ltr;
}

.sidebar,
.main-area {
    direction: rtl;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 13px 15px;
    border-right: 1px solid var(--border-soft);
    background:
        linear-gradient(180deg, rgba(22, 32, 42, .98), rgba(13, 22, 30, .98)),
        var(--surface);
    box-shadow: 12px 0 34px rgba(0, 0, 0, .12);
}

.brand {
    min-height: 142px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-bottom: 16px;
}

.brand img {
    width: 78px;
    height: 78px;
    object-fit: contain;
    filter: drop-shadow(0 12px 20px rgba(213, 165, 74, .13));
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    color: var(--gold-bright);
}

.brand-text strong {
    font-size: 17px;
    letter-spacing: 4px;
    font-weight: 600;
}

.brand-text span {
    margin-top: 4px;
    font-size: 12px;
    color: var(--gold);
}

.sidebar-nav {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 5px;
    padding: 4px 0;
    overflow-y: auto;
}

.nav-item {
    position: relative;
    min-height: 47px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-soft);
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .035);
    transform: translateX(-2px);
}

.nav-item.is-active {
    color: var(--gold-bright);
    border-color: rgba(213, 165, 74, .38);
    background:
        linear-gradient(90deg, rgba(213, 165, 74, .18), rgba(213, 165, 74, .06));
    box-shadow:
        inset 0 0 25px rgba(213, 165, 74, .045),
        0 8px 24px rgba(0, 0, 0, .12);
}

.nav-item.is-active::after {
    content: "";
    position: absolute;
    top: 11px;
    right: -14px;
    width: 3px;
    height: 25px;
    border-radius: 10px 0 0 10px;
    background: var(--gold-bright);
    box-shadow: 0 0 16px rgba(213, 165, 74, .5);
}

.nav-item span {
    white-space: nowrap;
}

.nav-badge {
    margin-right: auto;
    min-width: 24px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 99px;
    color: #17130a;
    background: var(--gold);
    font-size: 11px;
    font-weight: 800;
}

.sidebar-user {
    min-height: 69px;
    display: grid;
    grid-template-columns: 39px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-top: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 13px;
    background: rgba(255, 255, 255, .025);
}

.sidebar-user > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
}

.sidebar-user small {
    color: var(--muted);
    font-size: 11px;
}

.avatar {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(213, 165, 74, .3);
    border-radius: 50%;
    color: var(--gold-bright);
    background:
        linear-gradient(135deg, rgba(213, 165, 74, .22), rgba(213, 165, 74, .06));
    font-weight: 700;
}

.avatar.small {
    width: 34px;
    height: 34px;
    font-size: 11px;
}

.avatar.tiny {
    width: 29px;
    height: 29px;
    font-size: 12px;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(11, 18, 25, .98);
    backdrop-filter: none;
}

.global-search {
    position: relative;
    width: min(420px, 46vw);
    height: 45px;
    display: flex;
    direction: rtl;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255, 255, 255, .025);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.global-search:focus-within {
    border-color: rgba(213, 165, 74, .36);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(213, 165, 74, .07);
}

.global-search svg {
    color: var(--muted);
}

.global-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.global-search input::placeholder {
    color: #75828e;
}

.global-search kbd {
    direction: ltr;
    padding: 2px 8px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--muted);
    background: rgba(255, 255, 255, .03);
    font: 11px/1.8 monospace;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 80;
    max-height: 420px;
    padding: 7px;
    overflow: auto;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #121c25;
    box-shadow: var(--shadow);
}

.search-results a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px;
    border-radius: 9px;
    transition: background var(--transition);
}

.search-results a:hover {
    background: rgba(213, 165, 74, .09);
}

.search-results a > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.search-results strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-results small {
    color: var(--muted);
}

.search-type {
    width: 58px;
    flex: 0 0 auto;
    padding: 2px 5px;
    border-radius: 6px;
    color: var(--gold-bright);
    background: var(--gold-soft);
    text-align: center;
    font-size: 12px;
}

.topbar-meta {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-button {
    position: relative;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-soft);
    background: rgba(255, 255, 255, .025);
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.notification-button:hover {
    color: var(--gold-bright);
    border-color: var(--border-strong);
    background: var(--gold-soft);
}

.notification-button > span {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border: 2px solid var(--bg);
    border-radius: 99px;
    color: #fff;
    background: var(--danger);
    font-size: 12px;
    font-weight: 800;
}

.notification-panel {
    position: absolute;
    top: 54px;
    left: 0;
    z-index: 90;
    width: min(390px, 90vw);
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: #111b24;
    box-shadow: var(--shadow);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 8px 12px;
    border-bottom: 1px solid var(--border-soft);
}

.link-button {
    padding: 2px;
    border: 0;
    color: var(--gold-bright);
    background: transparent;
    font-size: 11px;
}

.notification-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px;
    margin-top: 5px;
    border-right: 2px solid transparent;
    border-radius: 9px;
    transition: background var(--transition);
}

.notification-row:hover {
    background: rgba(255, 255, 255, .035);
}

.notification-row strong {
    font-size: 12px;
}

.notification-row span,
.notification-row small {
    color: var(--muted);
    font-size: 11px;
}

.notification-row.severity-danger {
    border-color: var(--danger);
}

.notification-row.severity-warning {
    border-color: var(--warning);
}

.notification-row.severity-success {
    border-color: var(--success);
}

.date-time {
    min-width: 170px;
    display: flex;
    align-items: center;
    gap: 17px;
    color: var(--muted);
}

.date-time strong {
    direction: ltr;
    color: var(--gold-bright);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .5px;
}

.mobile-menu {
    display: none !important;
}

/* ==========================================================================
   Layout and base components
   ========================================================================== */

.page-content {
    width: min(100%, 1660px);
    min-height: calc(100vh - 78px);
    padding: 25px 32px 42px;
    margin-inline: auto;
}

.page-heading {
    min-height: 74px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 19px;
}

.page-heading h1 {
    margin: 1px 0 2px;
    font-size: clamp(24px, 2.5vw, 31px);
    line-height: 1.4;
    letter-spacing: -.5px;
}

.page-heading p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    display: block;
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: 9px;
}

.card {
    position: relative;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .018), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow-soft);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 17px;
    left: 17px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
}

.card-header {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.card-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

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

.card-toolbar {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    outline: none;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(239, 198, 110, .44);
    outline-offset: 2px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.btn-primary {
    color: #171107;
    border-color: #d0a044;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    box-shadow: 0 8px 22px rgba(213, 165, 74, .16);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f7d184, #d9aa50);
    box-shadow: 0 10px 28px rgba(213, 165, 74, .23);
}

.btn-secondary {
    color: var(--text-soft);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, .025);
}

.btn-secondary:hover:not(:disabled) {
    color: var(--gold-bright);
    background: var(--gold-soft);
}

.btn-ghost {
    min-height: 34px;
    color: var(--muted);
    border-color: var(--border-soft);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, .025);
}

.btn-sm {
    min-height: 33px;
    padding: 5px 10px;
    font-size: 11px;
}

.btn-block {
    width: 100%;
}

.icon-button {
    width: 35px;
    height: 35px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
}

.icon-button:hover {
    color: var(--gold-bright);
    border-color: var(--border-strong);
    background: var(--gold-soft);
}

.icon-button.danger:hover {
    color: var(--danger);
    border-color: rgba(225, 94, 94, .32);
    background: var(--danger-soft);
}

.icon-button.is-active {
    color: var(--gold-bright);
    border-color: var(--border-strong);
    background: var(--gold-soft);
}

.icon-button.is-loading svg {
    animation: spin .75s linear infinite;
}

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

.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--muted) !important; }

.stats-grid {
    display: grid;
    gap: 13px;
    margin-bottom: 18px;
}

.stats-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat-card {
    min-height: 113px;
    display: flex;
    direction: ltr;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 5% 0, rgba(213, 165, 74, .045), transparent 45%),
        var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition), border-color var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border);
}

.stat-card > div {
    min-width: 0;
    display: flex;
    direction: rtl;
    flex-direction: column;
}

.stat-card small {
    overflow: hidden;
    color: var(--text-soft);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
}

.stat-card strong {
    direction: ltr;
    align-self: flex-end;
    margin: 3px 0 1px;
    color: #fff;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 600;
}

.stat-card em {
    overflow: hidden;
    color: var(--muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    font-style: normal;
}

.stat-icon {
    width: 47px;
    height: 47px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(213, 165, 74, .18);
    border-radius: 50%;
    color: var(--gold-bright);
    background: var(--gold-soft);
}

.stat-icon.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.stat-icon.danger {
    color: var(--danger);
    border-color: rgba(225, 94, 94, .18);
    background: var(--danger-soft);
}

.round-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--gold-bright);
    background: var(--gold-soft);
}

.badge {
    width: fit-content;
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 12px;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 7px currentColor;
}

.badge-success {
    color: #67d48a;
    border-color: rgba(67, 185, 107, .16);
    background: var(--success-soft);
}
.badge-warning {
    color: #e2b94d;
    border-color: rgba(220, 174, 61, .16);
    background: var(--warning-soft);
}
.badge-danger {
    color: #ee7777;
    border-color: rgba(225, 94, 94, .18);
    background: var(--danger-soft);
}
.badge-info {
    color: #79a8e4;
    border-color: rgba(79, 139, 216, .18);
    background: var(--info-soft);
}
.badge-muted {
    color: #9aa6b1;
    border-color: rgba(255, 255, 255, .07);
    background: rgba(255, 255, 255, .04);
}

.count-chip {
    min-width: 28px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 8px;
    color: var(--gold-bright);
    background: var(--gold-soft);
    font-weight: 700;
}

.count-chip.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.empty-state {
    width: 100%;
    min-height: 140px;
    display: grid;
    place-items: center;
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.empty-state.compact {
    min-height: 82px;
    padding: 12px;
}

.empty-mini {
    padding: 14px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

/* ==========================================================================
   Tables and forms
   ========================================================================== */

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 11px 13px;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

.data-table th {
    color: #86939f;
    background: rgba(255, 255, 255, .012);
    font-size: 12px;
    font-weight: 600;
}

.data-table td {
    color: var(--text-soft);
    font-size: 11px;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, .02);
}

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

.clickable-row {
    cursor: pointer;
}

.identity-cell,
.project-name-cell,
.service-title-cell,
.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.identity-cell > div,
.project-name-cell > div,
.service-title-cell > div,
.file-name > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.identity-cell strong,
.project-name-cell strong,
.service-title-cell strong,
.file-name strong {
    max-width: 220px;
    overflow: hidden;
    color: var(--text);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
}

.identity-cell small,
.project-name-cell small,
.service-title-cell small,
.file-name small,
.table-subtitle {
    color: var(--muted);
    font-size: 11.5px;
}

.project-state {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 8px currentColor;
}

.state-active { color: var(--success); background: var(--success); }
.state-development { color: var(--warning); background: var(--warning); }
.state-critical { color: var(--danger); background: var(--danger); }
.state-support { color: var(--info); background: var(--info); }
.state-pending,
.state-maintenance { color: var(--warning); background: var(--warning); }

.domain-cell,
.domain-link {
    display: inline-flex;
    direction: ltr;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
}

.domain-link:hover {
    color: var(--gold-bright);
}

.service-icons {
    display: flex;
    direction: ltr;
    align-items: center;
    gap: 4px;
}

.service-icons span {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    margin-left: -5px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    color: var(--gold);
    background: var(--surface-3);
}

.copy-cell,
.table-actions {
    display: flex;
    direction: ltr;
    align-items: center;
    gap: 5px;
}

.copy-cell code {
    min-width: 92px;
}

code {
    color: #d7dee4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.toolbar-search {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-search > svg {
    color: var(--muted);
}

.toolbar-search input {
    width: min(300px, 35vw);
}

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

.field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.field label {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 600;
}

.field small {
    color: var(--muted);
    font-size: 11.5px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    outline: 0;
    color: var(--text);
    background: #0f1821;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: #65727e;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(213, 165, 74, .42);
    background: #111c26;
    box-shadow: 0 0 0 3px rgba(213, 165, 74, .06);
}

input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: .65;
}

textarea {
    resize: vertical;
}

select {
    padding-left: 31px;
}

.check-row {
    min-height: 42px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: rgba(255, 255, 255, .018);
}

.check-row input {
    width: 17px;
    min-height: 17px;
    accent-color: var(--gold);
}

.input-icon {
    position: relative;
}

.input-icon svg {
    position: absolute;
    top: 50%;
    right: 12px;
    color: var(--muted);
    transform: translateY(-50%);
}

.input-icon input {
    padding-right: 41px;
}

/* ==========================================================================
   Dashboard and shared content layouts
   ========================================================================== */

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

.card-wide {
    grid-column: span 2;
}

.dashboard-alerts {
    min-height: 405px;
}

.alert-list {
    padding: 5px 15px 13px;
}

.alert-list-item {
    min-height: 63px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--border-soft);
}

.alert-list-item:last-child {
    border-bottom: 0;
}

.alert-list-item > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.alert-list-item strong {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 600;
}

.alert-list-item small {
    color: var(--muted);
    font-size: 11.5px;
}

.alert-symbol {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--warning);
    background: var(--warning-soft);
}

.alert-list-item.is-danger .alert-symbol {
    color: var(--danger);
    background: var(--danger-soft);
}

.alert-list-item.is-info .alert-symbol {
    color: var(--info);
    background: var(--info-soft);
}

.sparkline {
    width: 76px;
    height: 28px;
    display: inline-block;
}

.sparkline svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sparkline polyline {
    fill: none;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.spark-online { stroke: var(--success); }
.spark-slow { stroke: var(--warning); }
.spark-offline { stroke: var(--danger); }

.donut-layout,
.donut-report {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 28px 20px;
}

.donut-chart {
    position: relative;
    width: 145px;
    height: 145px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0 65%, var(--warning) 65% 85%, var(--danger) 85%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 15px 32px rgba(0,0,0,.16);
}

.donut-chart::before {
    content: "";
    position: absolute;
    inset: 22px;
    border: 1px solid var(--border-soft);
    border-radius: inherit;
    background: var(--surface);
}

.donut-chart > div {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.donut-chart strong {
    font-size: 24px;
    font-weight: 600;
}

.donut-chart span {
    color: var(--muted);
    font-size: 12px;
}

.legend-list {
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-list span {
    display: grid;
    grid-template-columns: 9px 1fr auto;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.legend-list i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.legend-list b {
    color: var(--text-soft);
}

.legend-warning { background: var(--warning) !important; }
.legend-danger { background: var(--danger) !important; }
.legend-index-0 { background: var(--success) !important; }
.legend-index-1 { background: var(--warning) !important; }
.legend-index-2 { background: var(--danger) !important; }
.legend-index-3 { background: var(--info) !important; }

.compact-list {
    padding: 4px 15px 13px;
}

.compact-list > a,
.compact-list > .plain-row {
    min-height: 55px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}

.compact-list > a:last-child,
.compact-list > .plain-row:last-child {
    border-bottom: 0;
}

.compact-list > a:hover strong {
    color: var(--gold-bright);
}

.compact-list > a > div,
.compact-list > .plain-row > div {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.compact-list strong,
.plain-row strong {
    overflow: hidden;
    color: var(--text-soft);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
}

.compact-list small,
.plain-row small {
    color: var(--muted);
    font-size: 11.5px;
}

.compact-list b,
.plain-row b {
    white-space: nowrap;
    font-size: 12px;
}

.activity-mini-list {
    padding: 7px 16px 14px;
}

.activity-mini-list > div {
    min-height: 53px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-soft);
}

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

.activity-mini-list > div > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.activity-mini-list strong {
    color: var(--text-soft);
    font-size: 12px;
}

.activity-mini-list small {
    color: var(--muted);
    font-size: 11.5px;
}

.activity-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 8px currentColor;
}

.level-low { color: var(--success); background-color: var(--success); }
.level-medium { color: var(--warning); background-color: var(--warning); }
.level-high,
.level-critical { color: var(--danger); background-color: var(--danger); }

.content-with-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.stacked-aside {
    display: grid;
    gap: 16px;
}

.note-list {
    padding: 7px 15px 14px;
}

.note-list > div {
    position: relative;
    min-height: 70px;
    padding: 10px 12px;
    margin-top: 7px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: rgba(255, 255, 255, .018);
}

.note-list > div > span {
    position: absolute;
    top: 10px;
    right: 0;
    width: 3px;
    height: 30px;
    border-radius: 4px;
    background: var(--gold);
}

.note-list strong {
    font-size: 12px;
}

.note-list p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.6;
}

.quick-metrics {
    padding: 7px 15px 14px;
}

.quick-metrics a {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.quick-metrics a:last-child {
    border-bottom: 0;
}

.quick-metrics a > span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--gold-bright);
    background: var(--gold-soft);
}

.quick-metrics a > div {
    display: flex;
    flex-direction: column;
}

.quick-metrics strong {
    font-size: 12px;
}

.quick-metrics small {
    color: var(--muted);
    font-size: 11.5px;
}

/* ==========================================================================
   Project details
   ========================================================================== */

.project-hero {
    min-height: 148px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    margin-bottom: 13px;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 0, rgba(213, 165, 74, .12), transparent 25rem),
        linear-gradient(145deg, rgba(255,255,255,.02), transparent 60%),
        var(--surface);
}

.project-hero::after {
    content: "";
    position: absolute;
    left: -70px;
    bottom: -140px;
    width: 340px;
    height: 340px;
    border: 1px solid rgba(213, 165, 74, .07);
    border-radius: 50%;
}

.project-hero-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 17px;
}

.project-logo {
    width: 75px;
    height: 75px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(213, 165, 74, .42);
    border-radius: 19px;
    color: var(--gold-bright);
    background:
        linear-gradient(145deg, rgba(213, 165, 74, .18), rgba(213, 165, 74, .035));
    box-shadow: 0 15px 30px rgba(0,0,0,.2);
    font-size: 30px;
    font-weight: 800;
}

.project-title-line {
    display: flex;
    align-items: center;
    gap: 11px;
}

.project-title-line h1 {
    margin: 0;
    font-size: 25px;
}

.project-hero-main p {
    max-width: 690px;
    margin: 3px 0 9px;
    color: var(--muted);
    font-size: 11px;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.project-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 12px;
}

.project-tabs {
    display: flex;
    gap: 3px;
    padding: 5px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.project-tabs a {
    min-width: 105px;
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 9px;
    color: var(--muted);
    white-space: nowrap;
    font-size: 11px;
    transition: color var(--transition), background var(--transition);
}

.project-tabs a:hover {
    color: var(--text);
    background: rgba(255,255,255,.025);
}

.project-tabs a.is-active {
    color: var(--gold-bright);
    background: var(--gold-soft);
}

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

.card-span-2 {
    grid-column: span 2;
}

.project-summary-card,
.project-overview-grid > .card {
    min-height: 246px;
}

.project-health-row {
    min-height: 178px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 35px;
    padding: 20px;
}

.progress-ring {
    --progress: 0deg;
    position: relative;
    width: 138px;
    height: 138px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--gold) var(--progress), rgba(255,255,255,.07) 0);
}

.progress-ring::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    background: var(--surface);
}

.progress-ring > div {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-ring strong {
    font-size: 22px;
    font-weight: 600;
}

.progress-ring span {
    color: var(--muted);
    font-size: 11.5px;
}

.health-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.health-items span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 12px;
}

.health-items i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.health-items i.success { background: var(--success); }
.health-items i.warning { background: var(--warning); }
.health-items i.danger { background: var(--danger); }

.detail-list,
.mini-details {
    margin: 0;
    padding: 8px 17px 17px;
}

.detail-list > div {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--border-soft);
}

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

.detail-list dt,
.mini-details dt {
    color: var(--muted);
    font-size: 12px;
}

.detail-list dd,
.mini-details dd {
    margin: 0;
    color: var(--text-soft);
    font-size: 12px;
    text-align: left;
}

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

.credential-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}

.credential-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.credential-head > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.credential-head strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
}

.credential-head small {
    color: var(--muted);
    font-size: 11.5px;
}

.credential-row {
    min-height: 41px;
    display: grid;
    grid-template-columns: 85px 1fr 34px;
    direction: rtl;
    align-items: center;
    gap: 7px;
    border-top: 1px solid var(--border-soft);
}

.credential-row span {
    color: var(--muted);
    font-size: 11.5px;
}

.credential-row code {
    direction: ltr;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.monitor-summary-list {
    padding: 8px 15px 15px;
}

.monitor-summary-list > div {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--border-soft);
}

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

.monitor-summary-list > div > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.monitor-summary-list > div > div:last-child {
    align-items: flex-end;
}

.monitor-summary-list strong {
    font-size: 12px;
}

.monitor-summary-list small {
    color: var(--muted);
    font-size: 11.5px;
}

.monitor-summary-list b {
    color: var(--text-soft);
    font-size: 12px;
}

.project-context-chip,
.source-chip,
.role-chip,
.level-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid var(--border-soft);
    border-radius: 7px;
    color: var(--text-soft);
    background: rgba(255,255,255,.025);
    font-size: 11.5px;
}

.service-grid,
.monitor-card-grid,
.file-grid-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    padding: 15px;
}

.service-card,
.monitor-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255,255,255,.018);
    transition: border-color var(--transition), transform var(--transition);
}

.service-card:hover,
.monitor-card:hover {
    transform: translateY(-2px);
    border-color: var(--border);
}

.service-card-head,
.monitor-card-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.service-card-head > div,
.monitor-card-top > div {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.service-card-head strong,
.monitor-card-top strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
}

.service-card-head small,
.monitor-card-top small {
    overflow: hidden;
    color: var(--muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11.5px;
}

.mini-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 13px 0;
}

.mini-details > div {
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0,0,0,.12);
}

.service-card-footer {
    display: flex;
    gap: 7px;
    padding-top: 11px;
    border-top: 1px solid var(--border-soft);
}

.monitor-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 13px 0;
}

.monitor-metrics > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0,0,0,.12);
}

.monitor-metrics span {
    color: var(--muted);
    font-size: 11.5px;
}

.monitor-metrics strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
}

.large-status {
    width: 47px;
    height: 47px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--muted);
    background: rgba(255,255,255,.04);
}

.status-online { color: var(--success); background: var(--success-soft); }
.status-slow { color: var(--warning); background: var(--warning-soft); }
.status-offline { color: var(--danger); background: var(--danger-soft); }

.file-preview-card {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}

.file-preview-card:hover {
    border-color: var(--border);
    background: var(--gold-soft);
}

.file-preview-card > span {
    color: var(--gold);
}

.file-preview-card > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-preview-card strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
}

.file-preview-card small {
    color: var(--muted);
    font-size: 11.5px;
}

.notes-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
}

.notes-panel article {
    min-height: 160px;
    padding: 15px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}

.notes-panel h3 {
    margin: 0 0 9px;
    color: var(--gold-bright);
    font-size: 12px;
}

.notes-panel p {
    margin: 0;
    color: var(--text-soft);
    font-size: 12px;
}

/* ==========================================================================
   File explorer
   ========================================================================== */

.file-explorer {
    min-height: 655px;
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr) 235px;
    overflow: hidden;
}

.explorer-sidebar,
.explorer-details {
    min-width: 0;
    padding: 14px;
    background: rgba(0,0,0,.095);
}

.explorer-sidebar {
    border-left: 1px solid var(--border-soft);
}

.explorer-details {
    border-right: 1px solid var(--border-soft);
}

.explorer-project-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 13px;
}

.explorer-project-select label {
    color: var(--muted);
    font-size: 11.5px;
}

.explorer-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 12px;
    margin-bottom: 13px;
    border-bottom: 1px solid var(--border-soft);
}

.explorer-shortcuts a,
.folder-tree a {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 12px;
    transition: background var(--transition), color var(--transition);
}

.explorer-shortcuts a:hover,
.folder-tree a:hover,
.explorer-shortcuts a.is-active,
.folder-tree a.is-active {
    color: var(--gold-bright);
    background: var(--gold-soft);
}

.folder-tree {
    max-height: 300px;
    overflow-y: auto;
}

.folder-tree > strong {
    display: block;
    margin: 0 7px 7px;
    color: var(--muted);
    font-size: 11.5px;
}

.folder-tree a svg:first-child {
    color: var(--muted-2);
}

.folder-tree a span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.storage-meter {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: rgba(255,255,255,.02);
}

.storage-meter > div:first-child {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11.5px;
}

.storage-meter strong {
    color: var(--text-soft);
}

.storage-meter small {
    display: block;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 11.5px;
}

.meter {
    height: 6px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255,255,255,.07);
}

.meter span,
.meter i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
    transition: width .6s ease;
}

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

.explorer-toolbar {
    min-height: 61px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border-bottom: 1px solid var(--border-soft);
}

.explorer-nav-buttons,
.view-switch {
    display: flex;
    gap: 5px;
}

.breadcrumbs {
    min-width: 0;
    display: flex;
    flex: 1;
    align-items: center;
    gap: 5px;
    overflow: hidden;
}

.breadcrumbs a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: var(--text-soft);
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
}

.breadcrumbs a:hover {
    color: var(--gold-bright);
}

.breadcrumbs > span {
    color: var(--muted-2);
}

.explorer-table td:first-child {
    min-width: 260px;
}

.explorer-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
    padding: 16px;
}

.explorer-grid-item {
    min-width: 0;
    min-height: 135px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}

.explorer-grid-item:hover {
    color: var(--gold-bright);
    border-color: var(--border);
    background: var(--gold-soft);
}

.explorer-grid-item svg {
    color: var(--gold);
}

.explorer-grid-item strong {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
}

.explorer-grid-item small {
    color: var(--muted);
    font-size: 11.5px;
}

.details-placeholder {
    min-height: 245px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.details-placeholder svg {
    color: var(--gold);
}

.details-placeholder h3 {
    margin: 10px 0 3px;
    color: var(--text-soft);
    font-size: 12px;
}

.details-placeholder p {
    margin: 0;
    font-size: 11.5px;
}

.backup-policy {
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: rgba(255,255,255,.02);
}

.backup-policy h3 {
    margin: 0 0 8px;
    font-size: 11px;
}

.backup-policy dl {
    margin: 0;
}

.backup-policy dl > div {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
}

.backup-policy dl > div:last-child {
    border: 0;
}

.backup-policy dt {
    color: var(--muted);
    font-size: 11.5px;
}

.backup-policy dd {
    margin: 0;
    color: var(--success);
    font-size: 11.5px;
}

.drop-zone {
    min-height: 185px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(213,165,74,.35);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(213,165,74,.035);
    text-align: center;
    transition: border-color var(--transition), background var(--transition);
}

.drop-zone:hover,
.drop-zone.is-dragging {
    border-color: var(--gold-bright);
    background: var(--gold-soft);
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.drop-zone span {
    color: var(--gold);
}

.drop-zone strong {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 12px;
}

.drop-zone small {
    margin-top: 3px;
}

/* ==========================================================================
   Renewals and calendar
   ========================================================================== */

.renewals-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
}

.days-pill {
    min-width: 70px;
    display: inline-flex;
    justify-content: center;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
}

.days-pill.is-success {
    color: var(--success);
    border-color: rgba(67,185,107,.16);
    background: var(--success-soft);
}

.days-pill.is-warning {
    color: var(--warning);
    border-color: rgba(220,174,61,.16);
    background: var(--warning-soft);
}

.days-pill.is-danger {
    color: var(--danger);
    border-color: rgba(225,94,94,.18);
    background: var(--danger-soft);
}

.calendar-card {
    overflow: hidden;
}

.mini-calendar {
    padding: 10px 13px 15px;
}

.calendar-week,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-week span {
    padding: 5px 0;
    color: var(--muted);
    text-align: center;
    font-size: 11.5px;
}

.calendar-days span {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 11.5px;
}

.calendar-days span.blank {
    visibility: hidden;
}

.calendar-days span.today {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: var(--gold-soft);
}

.calendar-days span.has-event {
    color: #fff;
    background: rgba(220,174,61,.1);
}

.calendar-days span i {
    position: absolute;
    top: -2px;
    left: -2px;
    min-width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #151008;
    background: var(--warning);
    font-size: 7px;
    font-style: normal;
}

/* ==========================================================================
   Monitoring
   ========================================================================== */

.monitoring-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 305px;
    gap: 16px;
    align-items: start;
}

.monitoring-layout > .card-span-2 {
    grid-column: span 2;
}

.monitoring-layout > .stacked-aside {
    grid-column: 3;
    grid-row: 1 / span 2;
}

.chart-card canvas {
    width: calc(100% - 20px);
    margin: 5px 10px 12px;
}

.activities-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.activities-layout > .card-span-2 {
    grid-column: auto;
}

.level-chip.level-low {
    color: var(--success);
    background: var(--success-soft);
}
.level-chip.level-medium {
    color: var(--warning);
    background: var(--warning-soft);
}
.level-chip.level-high,
.level-chip.level-critical {
    color: var(--danger);
    background: var(--danger-soft);
}

.login-list {
    padding: 7px 14px 14px;
}

.login-list > div {
    min-height: 56px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--border-soft);
}

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

.login-list > div > div {
    display: flex;
    flex-direction: column;
}

.login-list strong {
    font-size: 12px;
}

.login-list small,
.login-list time {
    color: var(--muted);
    font-size: 11.5px;
}

/* ==========================================================================
   Members and reports
   ========================================================================== */

.members-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(420px, .75fr);
    gap: 16px;
    margin-bottom: 16px;
}

.role-chip.role-owner {
    color: var(--gold-bright);
    border-color: var(--border-strong);
    background: var(--gold-soft);
}

.role-chip.role-admin {
    color: #c69af2;
    border-color: rgba(139,112,214,.2);
    background: rgba(139,112,214,.12);
}

.role-chip.role-member {
    color: #80aadf;
    border-color: rgba(79,139,216,.2);
    background: var(--info-soft);
}

.permissions-card {
    min-width: 0;
}

.permissions-matrix {
    overflow-x: auto;
    padding: 10px 14px 2px;
}

.permissions-matrix table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-matrix th,
.permissions-matrix td {
    min-width: 60px;
    padding: 9px 5px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--muted);
    text-align: center;
    font-size: 11.5px;
}

.permissions-matrix th:first-child,
.permissions-matrix td:first-child {
    min-width: 120px;
    color: var(--text-soft);
    text-align: right;
}

.permission-mark {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    font-size: 12px;
}

.permission-mark.allowed {
    color: var(--success);
    background: var(--success-soft);
}

.permission-mark.denied {
    color: var(--muted-2);
    background: rgba(255,255,255,.035);
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    margin: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--gold);
    background: var(--gold-soft);
}

.security-note > div {
    display: flex;
    flex-direction: column;
}

.security-note strong {
    color: var(--gold-bright);
    font-size: 12px;
}

.security-note p {
    margin: 2px 0 0;
    color: var(--text-soft);
    font-size: 11.5px;
}

.activity-request-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.activity-request-list > div {
    min-height: 68px;
    display: grid;
    grid-template-columns: 9px 1fr;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: rgba(255,255,255,.018);
}

.activity-request-list strong {
    font-size: 12px;
}

.activity-request-list small {
    grid-column: 2;
    color: var(--muted);
    font-size: 11.5px;
}

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

.reports-grid > .card {
    min-height: 345px;
}

.risk-bars {
    padding: 27px 18px;
}

.risk-bars > div {
    margin-bottom: 20px;
}

.risk-bars > div > span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
}

.risk-bars b {
    color: var(--text-soft);
}

.bar-success { background: var(--success) !important; }
.bar-warning { background: var(--warning) !important; }
.bar-danger { background: var(--danger) !important; }

.storage-big {
    min-height: 270px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
}

.storage-project-list {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.storage-project-list span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 11.5px;
}

.storage-project-list strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.storage-project-list b {
    color: var(--success);
    white-space: nowrap;
}

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-nav {
    position: sticky;
    top: 95px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
}

.settings-nav > strong {
    padding: 5px 9px 12px;
    border-bottom: 1px solid var(--border-soft);
}

.settings-nav a {
    min-height: 41px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
}

.settings-nav a:hover,
.settings-nav a.is-active {
    color: var(--gold-bright);
    background: var(--gold-soft);
}

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

.settings-section {
    padding-bottom: 16px;
}

.settings-section .form-grid,
.settings-toggle-list {
    padding: 15px;
}

.settings-section:nth-of-type(1),
.settings-section:nth-of-type(2) {
    min-height: 290px;
}

.settings-toggle-list > div {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid var(--border-soft);
}

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

.settings-toggle-list > div > div {
    display: flex;
    flex-direction: column;
}

.settings-toggle-list strong {
    font-size: 12px;
}

.settings-toggle-list small {
    color: var(--muted);
    font-size: 11.5px;
}

.switch {
    position: relative;
    width: 38px;
    height: 21px;
    flex: 0 0 auto;
    border-radius: 20px;
    background: #3b4651;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #d5dce2;
    transition: transform var(--transition);
}

.switch.is-on {
    background: var(--gold);
}

.switch.is-on::after {
    transform: translateX(17px);
    background: #1a1409;
}

.settings-save {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
}

/* ==========================================================================
   Modals, flashes, alerts, toasts
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(2, 7, 11, .72);
    backdrop-filter: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition);
}

.modal.is-open {
    opacity: 1;
    transform: none;
}

.modal-card {
    width: min(720px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 17px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 100% 0, rgba(213,165,74,.07), transparent 20rem),
        #111b24;
    box-shadow: var(--shadow);
}

.modal-small .modal-card,
.modal-card.modal-small {
    width: min(500px, 100%);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-soft);
}

.modal-header h2 {
    margin: 0;
    font-size: 17px;
}

.modal-header p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 6px;
}

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

.quick-add-grid button,
.quick-add-grid a {
    min-height: 115px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    color: var(--text-soft);
    background: rgba(255,255,255,.018);
}

.quick-add-grid button:hover,
.quick-add-grid a:hover {
    color: var(--gold-bright);
    border-color: var(--border-strong);
    background: var(--gold-soft);
}

.flash-stack {
    position: fixed;
    top: 90px;
    left: 26px;
    z-index: 95;
    width: min(380px, calc(100vw - 40px));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: #14202a;
    box-shadow: var(--shadow);
    transition: opacity .3s ease, transform .3s ease;
}

.flash.is-fading {
    opacity: 0;
    transform: translateX(-15px);
}

.flash-success {
    color: #72d794;
    border-color: rgba(67,185,107,.25);
}

.flash-danger {
    color: #ed7b7b;
    border-color: rgba(225,94,94,.26);
}

.flash-warning {
    color: #e5bd55;
    border-color: rgba(220,174,61,.25);
}

.flash button {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: currentColor;
    background: rgba(255,255,255,.04);
}

.alert {
    padding: 11px 13px;
    margin-bottom: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    font-size: 11px;
}

.alert-danger {
    color: #ed8585;
    border-color: rgba(225,94,94,.24);
    background: var(--danger-soft);
}

.toast-stack {
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 140;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 250px;
    max-width: 360px;
    padding: 10px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    color: var(--text-soft);
    background: #15212b;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: none;
}

.toast-success { border-color: rgba(67,185,107,.3); }
.toast-warning { border-color: rgba(220,174,61,.3); }
.toast-danger { border-color: rgba(225,94,94,.3); }

/* ==========================================================================
   Login and installer
   ========================================================================== */

.login-page,
.installer-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 25%, rgba(213,165,74,.11), transparent 29rem),
        radial-gradient(circle at 80% 85%, rgba(50,100,145,.11), transparent 34rem),
        #091119;
}

.login-shell,
.installer-shell {
    width: min(1160px, calc(100% - 36px));
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
    align-items: center;
    gap: 40px;
    margin: auto;
    padding: 36px 0;
}

.login-visual,
.installer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-logo-glow {
    position: relative;
    width: 230px;
    height: 230px;
    display: grid;
    place-items: center;
    margin-bottom: 5px;
}

.login-logo-glow::before {
    content: "";
    position: absolute;
    inset: 25px;
    border: 1px solid rgba(213,165,74,.3);
    border-radius: 50%;
    box-shadow: 0 0 80px rgba(213,165,74,.15);
}

.login-logo-glow img,
.installer-brand img {
    position: relative;
    width: 190px;
    height: 190px;
    object-fit: contain;
    filter: drop-shadow(0 18px 30px rgba(0,0,0,.35));
}

.login-visual h1,
.installer-brand h1 {
    margin: 0;
    color: var(--gold-bright);
    font-size: 28px;
}

.login-visual > p,
.installer-brand p {
    max-width: 620px;
    color: var(--muted);
}

.login-feature-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
}

.login-feature-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-size: 12px;
}

.login-feature-row svg {
    color: var(--gold);
}

.login-card,
.installer-card {
    padding: 27px;
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.login-card-head {
    margin-bottom: 20px;
}

.login-card-head h2,
.installer-card h2 {
    margin: 3px 0;
    font-size: 21px;
}

.login-card-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-note {
    display: block;
    margin-top: 14px;
    color: var(--muted-2);
    text-align: center;
    font-size: 11.5px;
}

.requirements {
    display: grid;
    gap: 6px;
    margin: 14px 0 18px;
}

.requirement {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    font-size: 12px;
}

.requirement > span:not(.requirement-text) {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.requirement.is-ok > span:not(.requirement-text) {
    color: var(--success);
    background: var(--success-soft);
}

.requirement.is-bad > span:not(.requirement-text) {
    color: var(--danger);
    background: var(--danger-soft);
}

.install-success {
    min-height: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.success-mark {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #0e1a12;
    background: var(--success);
    font-size: 34px;
}

.install-success h2 {
    margin: 15px 0 2px;
}

.install-success p {
    margin: 0 0 16px;
    color: var(--muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1320px) {
    .stats-grid-6 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .dashboard-alerts {
        min-height: auto;
    }

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

    .monitoring-layout > .stacked-aside {
        grid-column: span 2;
        grid-row: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .file-explorer {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .explorer-details {
        display: none;
    }

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

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

@media (max-width: 1050px) {
    :root {
        --sidebar-width: 210px;
    }

    .page-content {
        padding-inline: 20px;
    }

    .topbar {
        padding-inline: 20px;
    }

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

    .content-with-aside,
    .renewals-layout,
    .activities-layout {
        grid-template-columns: 1fr;
    }

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

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

    .settings-main {
        grid-template-columns: 1fr;
    }

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

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

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(280px, 84vw);
        z-index: 120;
        transform: translateX(-105%);
        transition: transform .24s ease;
    }

    .sidebar.is-open {
        transform: none;
    }

    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 110;
        background: rgba(0,0,0,.62);
        backdrop-filter: none;
    }

    .mobile-menu {
        display: inline-grid !important;
    }

    .topbar {
        height: 68px;
        gap: 10px;
        padding-inline: 13px;
    }

    .global-search {
        width: min(100%, 390px);
    }

    .global-search kbd,
    .date-time span {
        display: none;
    }

    .date-time {
        min-width: auto;
    }

    .page-content {
        padding: 17px 13px 30px;
    }

    .page-heading {
        min-height: auto;
        flex-direction: column;
    }

    .page-heading .heading-actions {
        width: 100%;
        padding-top: 0;
    }

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

    .project-overview-grid {
        grid-template-columns: 1fr;
    }

    .card-span-2 {
        grid-column: auto;
    }

    .credential-cards,
    .notes-panel {
        grid-template-columns: 1fr;
    }

    .file-explorer {
        display: block;
    }

    .explorer-sidebar {
        border: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .folder-tree,
    .storage-meter {
        display: none;
    }

    .explorer-shortcuts {
        flex-direction: row;
        overflow-x: auto;
    }

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

    .settings-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
    }

    .settings-nav > strong {
        display: none;
    }

    .login-shell,
    .installer-shell {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .login-visual,
    .installer-brand {
        padding-top: 10px;
    }

    .login-logo-glow {
        width: 140px;
        height: 140px;
    }

    .login-logo-glow img,
    .installer-brand img {
        width: 125px;
        height: 125px;
    }

    .login-visual h1,
    .installer-brand h1 {
        font-size: 22px;
    }
}

@media (max-width: 620px) {
    body {
        font-size: 13px;
    }

    .global-search {
        height: 42px;
    }

    .topbar-meta {
        gap: 8px;
    }

    .date-time {
        display: none;
    }

    .notification-panel {
        position: fixed;
        top: 68px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .stats-grid-6,
    .stats-grid-5,
    .stats-grid-4,
    .dashboard-grid,
    .service-grid,
    .monitor-card-grid,
    .reports-grid,
    .stacked-aside,
    .monitoring-layout,
    .monitoring-layout > .stacked-aside,
    .activity-request-list {
        grid-template-columns: 1fr;
    }

    .card-wide,
    .monitoring-layout > .card-span-2,
    .monitoring-layout > .stacked-aside {
        grid-column: auto;
    }

    .stat-card {
        min-height: 96px;
    }

    .project-hero-main {
        align-items: flex-start;
    }

    .project-logo {
        width: 58px;
        height: 58px;
        border-radius: 15px;
        font-size: 23px;
    }

    .project-meta {
        flex-direction: column;
        gap: 4px;
    }

    .project-hero .heading-actions {
        width: 100%;
    }

    .project-hero .btn {
        flex: 1;
    }

    .project-tabs {
        justify-content: flex-start;
    }

    .project-tabs a {
        min-width: 95px;
    }

    .project-health-row,
    .storage-big,
    .donut-layout,
    .donut-report {
        flex-direction: column;
    }

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

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

    .toolbar-search {
        flex-wrap: wrap;
    }

    .toolbar-search input,
    .toolbar-search select {
        width: 100%;
    }

    .modal {
        padding: 8px;
    }

    .modal-card {
        padding: 13px;
    }

    .quick-add-grid {
        grid-template-columns: 1fr;
    }

    .flash-stack {
        top: 76px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .toast-stack {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }

    .login-card,
    .installer-card {
        padding: 20px;
    }
}

@media print {
    .sidebar,
    .topbar,
    .heading-actions,
    .settings-nav,
    .btn,
    .flash-stack {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .page-content {
        width: 100%;
        padding: 0;
    }

    body,
    .card,
    .stat-card {
        color: #111;
        background: #fff !important;
        box-shadow: none !important;
    }

    .card,
    .stat-card {
        border-color: #ccc;
        break-inside: avoid;
    }

    .page-heading p,
    .card-header p,
    .stat-card small,
    .stat-card em {
        color: #555 !important;
    }
}

/* Backup explorer selection and details */
.backup-selectable {
    cursor: pointer;
}

.explorer-table tr.backup-selectable {
    outline: none;
    transition: background var(--transition), box-shadow var(--transition);
}

.explorer-table tr.backup-selectable:hover,
.explorer-table tr.backup-selectable:focus-visible,
.explorer-table tr.backup-selectable.is-selected {
    background: rgba(215, 166, 66, .075);
    box-shadow: inset -2px 0 0 var(--gold);
}

button.explorer-grid-item {
    width: 100%;
    font: inherit;
    text-align: center;
    appearance: none;
}

.explorer-grid-item.is-selected {
    border-color: var(--gold);
    background: rgba(215, 166, 66, .09);
    box-shadow: 0 0 0 1px rgba(215, 166, 66, .15);
}

.details-file-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    border: 1px solid rgba(215, 166, 66, .22);
    border-radius: 14px;
    color: var(--gold-bright);
    background: var(--gold-soft);
}

.selected-file-details {
    width: 100%;
    margin: 15px 0 10px;
}

.selected-file-details > div {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    border-bottom: 1px solid var(--border-soft);
}

.selected-file-details dt {
    color: var(--muted);
    font-size: 11.5px;
}

.selected-file-details dd {
    max-width: 125px;
    margin: 0;
    overflow: hidden;
    color: var(--text-soft);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-checksum {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 9px 0 13px;
    padding: 9px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    text-align: right;
    background: rgba(0, 0, 0, .14);
}

.details-checksum span {
    color: var(--muted);
    font-size: 11.5px;
}

.details-checksum code {
    direction: ltr;
    overflow-wrap: anywhere;
    color: var(--text-soft);
    font-size: 11.5px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Readability pass: keep the dense control center calm without tiny text */
@media (min-width: 1100px) {
    .data-table th { font-size: 11px; }
    .data-table td { font-size: 12px; }
    .identity-cell strong,
    .project-name-cell strong,
    .service-title-cell strong,
    .file-name strong { font-size: 12px; }
    .identity-cell small,
    .project-name-cell small,
    .service-title-cell small,
    .file-name small,
    .table-subtitle { font-size: 12px; }
    .stat-card small { font-size: 12px; }
    .stat-card em { font-size: 11px; }
    .badge { font-size: 11px; }
    .detail-list dt,
    .detail-list dd,
    .mini-details dt,
    .mini-details dd,
    .credential-row span,
    .credential-row code,
    .service-card-head small,
    .monitor-card-top small,
    .monitor-summary-list small,
    .monitor-summary-list strong,
    .monitor-summary-list b { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ==========================================================================
   VMANIA 2.0 — Interaction polish, accounting and readability
   ========================================================================== */
:root {
    --bg: #0c141c;
    --bg-deep: #091119;
    --surface: #121c26;
    --surface-2: #16212c;
    --surface-3: #1a2733;
    --surface-hover: #1e2d3a;
    --border: rgba(224, 187, 108, .14);
    --border-strong: rgba(224, 187, 108, .27);
    --border-soft: rgba(231, 238, 244, .075);
    --gold: #d7aa54;
    --gold-bright: #edc574;
    --text: #eef3f7;
    --text-soft: #d2dae1;
    --muted: #98a7b4;
    --muted-2: #748391;
    --focus: 0 0 0 3px rgba(215, 170, 84, .18);
}

body {
    font-family: "Vazirmatn", "IRANSansX", "Dana", "Segoe UI", Tahoma, Arial, sans-serif;
    letter-spacing: -.01em;
}

button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 0; box-shadow: var(--focus); }

.reveal-page > * {
    animation: vmania-enter .42s cubic-bezier(.2,.75,.25,1) both;
}
.reveal-page > *:nth-child(2) { animation-delay: .035s; }
.reveal-page > *:nth-child(3) { animation-delay: .07s; }
.reveal-page > *:nth-child(4) { animation-delay: .105s; }
@keyframes vmania-enter {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

.card,
.stat-card,
.service-card,
.monitor-card,
.credential-card,
.finance-account-card {
    border-color: var(--border-soft);
    background: linear-gradient(145deg, rgba(20,31,42,.97), rgba(14,23,32,.98));
    box-shadow: 0 12px 34px rgba(0,0,0,.14), inset 0 1px rgba(255,255,255,.018);
}
.card:hover { border-color: rgba(224,187,108,.15); }

.data-table tbody tr {
    position: relative;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(215,170,84,.045), rgba(255,255,255,.018));
    box-shadow: inset -2px 0 var(--gold);
}
.data-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    backdrop-filter: none;
    background: #0f1922;
}
.table-subtext { display: block; color: var(--muted); margin-top: 2px; max-width: 40rem; }
.compact-tables .data-table td,
.compact-tables .data-table th { padding-top: 9px; padding-bottom: 9px; }

.btn {
    overflow: hidden;
    isolation: isolate;
    transition: transform .17s ease, border-color .17s ease, background .17s ease, box-shadow .17s ease, opacity .17s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
.btn.is-loading { pointer-events: none; opacity: .72; }
.btn.is-loading::after {
    content: "";
    width: 15px; height: 15px; border: 2px solid currentColor; border-left-color: transparent;
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-danger { color: #ffd6d4; background: rgba(225,94,94,.14); border-color: rgba(225,94,94,.36); }
.btn-danger:hover { background: rgba(225,94,94,.22); }
.icon-button.danger { color: var(--danger); }

.field input,
.field select,
.field textarea,
.compact-select {
    background: rgba(7,14,21,.62);
    border-color: rgba(222,232,240,.11);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: rgba(215,170,84,.22); }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--gold); background: rgba(8,16,23,.86); box-shadow: var(--focus); }
textarea { resize: vertical; min-height: 88px; }

.modal-dialog,
.modal-card {
    width: min(680px, calc(100vw - 28px));
    max-height: min(90vh, 920px);
    overflow: auto;
    border: 1px solid var(--border-strong);
    border-radius: 19px;
    background: linear-gradient(145deg, #17232e, #0e1720);
    box-shadow: 0 28px 100px rgba(0,0,0,.56);
    padding: 22px;
    transform: translateY(16px) scale(.985);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
}
.modal.is-open .modal-dialog,
.modal.is-open .modal-card { transform: none; opacity: 1; }
.modal-lg .modal-dialog, .modal-dialog.modal-lg { width: min(860px, calc(100vw - 28px)); }
.modal-xl .modal-dialog, .modal-dialog.modal-xl { width: min(1120px, calc(100vw - 28px)); }
.modal-head,
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.modal-head h3,
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-head > button,
.modal-header > button { border: 0; color: var(--muted); background: transparent; padding: 6px; }
.modal-body { padding: 0; }

.subnav-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 5px;
    margin: -4px 0 20px;
    border: 1px solid var(--border-soft);
    border-radius: 13px;
    background: rgba(10,18,25,.55);
    scrollbar-width: thin;
}
.subnav-tabs a {
    white-space: nowrap;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 9px;
    color: var(--muted);
    transition: .18s ease;
}
.subnav-tabs a:hover { color: var(--text); background: rgba(255,255,255,.035); }
.subnav-tabs a.is-active { color: #17120a; background: linear-gradient(135deg,var(--gold-bright),var(--gold)); font-weight: 750; box-shadow: 0 8px 24px rgba(215,170,84,.17); }

.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.card-span-2 { grid-column: span 2; }
.card-span-3 { grid-column: 1 / -1; }
.detail-card { min-height: 100%; }
.info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.info-grid > div {
    padding: 13px 15px;
    border-radius: 11px;
    background: rgba(7,14,20,.44);
    border: 1px solid var(--border-soft);
}
.info-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.info-grid strong { color: var(--text-soft); font-weight: 600; }
.info-wide { grid-column: 1 / -1; }
.metric-stack { display: grid; gap: 10px; }
.metric-stack > div { display:flex;justify-content:space-between;align-items:center;padding:14px;border:1px solid var(--border-soft);border-radius:11px;background:rgba(7,14,20,.4); }
.metric-stack b { color: var(--gold-bright); font-size: 19px; }

.project-card-grid.compact-projects { grid-template-columns: repeat(4,minmax(0,1fr)); }
.mini-project-card { display:flex;align-items:center;gap:11px;padding:14px;border:1px solid var(--border-soft);border-radius:12px;background:rgba(7,14,20,.42);transition:.18s ease; }
.mini-project-card:hover { transform:translateY(-2px);border-color:var(--border-strong);background:var(--surface-hover); }
.mini-project-card > div { min-width:0; flex:1; }
.mini-project-card strong,.mini-project-card small { display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }

.contact-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px; }
.contact-card { display:flex;align-items:flex-start;gap:12px;padding:16px;border-radius:13px;border:1px solid var(--border-soft);background:rgba(7,14,20,.42); }
.contact-card > div { flex:1;min-width:0; }
.contact-card strong,.contact-card small { display:block; }
.contact-card p { color:var(--muted);margin:8px 0 0;direction:ltr;text-align:right; }
.avatar.large { width:44px;height:44px;font-size:17px; }
.primary-chip { font-style:normal;font-size: 12px;color:var(--gold-bright);background:var(--gold-soft);border:1px solid var(--border);padding:2px 6px;border-radius:99px; }

.notes-list { display:grid;gap:10px; }
.note-item { display:flex;gap:12px;align-items:flex-start;padding:15px;border:1px solid var(--border-soft);border-radius:12px;background:rgba(7,14,20,.4); }
.note-item.is-pinned { border-color:var(--border-strong);background:linear-gradient(90deg,var(--gold-soft),rgba(7,14,20,.42)); }
.note-item > div { flex:1;min-width:0; }
.note-item strong,.note-item small { display:block; }
.note-item p { color:var(--text-soft);margin:6px 0; }
.two-column-layout { display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,.8fr);gap:16px; }
.helper-card { align-self:start;position:sticky;top:90px; }

.document-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
.document-card { display:flex;align-items:center;gap:12px;border:1px solid var(--border-soft);background:rgba(7,14,20,.4);border-radius:12px;padding:13px; }
.document-card > div:nth-child(2) { flex:1;min-width:0; }
.document-card strong,.document-card small { display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.timeline-list { display:grid;gap:0; }
.timeline-item { display:flex;gap:13px;align-items:flex-start;padding:14px 5px;border-bottom:1px solid var(--border-soft); }
.timeline-item:last-child { border:0; }
.timeline-item strong,.timeline-item small { display:block; }
.progress-line { min-width:120px;display:flex;align-items:center;gap:8px; }
.progress-line::before { content:"";height:6px;flex:1;border-radius:99px;background:rgba(255,255,255,.07); }
.progress-line i { position:absolute;display:none; }
.progress-line span { color:var(--muted);font-size:12px; }

/* Accounting */
.accounting-dashboard-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
.finance-stat strong { font-size:22px; }
.account-balance-list { display:grid;gap:4px; }
.account-balance-list > div { display:flex;align-items:center;gap:10px;padding:11px 4px;border-bottom:1px solid var(--border-soft); }
.account-balance-list > div:last-child { border:0; }
.account-balance-list > div > div { flex:1;min-width:0; }
.account-balance-list strong,.account-balance-list small { display:block; }
.account-balance-list b { color:var(--text-soft);font-size:13px; }
.account-color { width:9px;height:36px;border-radius:99px;background:var(--account-color);box-shadow:0 0 14px color-mix(in srgb,var(--account-color) 35%,transparent); }
.invoice-card-row { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px; }
.invoice-mini-card { display:grid;gap:7px;padding:15px;border:1px solid var(--border-soft);border-radius:12px;background:rgba(7,14,20,.42);transition:.18s ease; }
.invoice-mini-card:hover { transform:translateY(-2px);border-color:var(--border-strong); }
.invoice-mini-card > div { display:flex;justify-content:space-between;align-items:center;gap:8px; }
.invoice-mini-card span { color:var(--gold-bright);font-weight:700; }
.finance-account-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
.finance-account-card { position:relative;overflow:hidden;min-height:210px; }
.finance-account-card::before { content:"";position:absolute;inset:0 auto 0 0;width:4px;background:var(--account-color); }
.finance-account-head { display:flex;align-items:center;justify-content:space-between;color:var(--account-color); }
.finance-account-card h3 { margin:20px 0 4px;font-size:19px; }
.finance-account-card p { color:var(--muted);min-height:48px; }
.finance-account-card > strong { display:block;font-size:22px;color:var(--text);margin-top:18px; }
.category-swatch { display:inline-block;width:22px;height:22px;border-radius:7px;border:1px solid rgba(255,255,255,.15); }
.page-section-actions { display:flex;justify-content:flex-end;margin-bottom:14px; }

.invoice-toolbar { display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px; }
.invoice-toolbar > div { display:flex;gap:8px; }
.invoice-sheet { padding:34px; }
.invoice-sheet > header { display:flex;justify-content:space-between;align-items:flex-start;padding-bottom:24px;border-bottom:1px solid var(--border-soft); }
.invoice-brand { display:flex;align-items:center;gap:13px; }
.invoice-brand img { width:58px;height:58px;object-fit:contain; }
.invoice-brand strong,.invoice-brand span,.invoice-number span,.invoice-number strong { display:block; }
.invoice-brand strong { font-size:20px; }
.invoice-brand span,.invoice-number span { color:var(--muted); }
.invoice-number { text-align:left; }
.invoice-number strong { color:var(--gold-bright);font-size:21px;margin:2px 0 8px;direction:ltr; }
.invoice-parties { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:23px 0; }
.invoice-parties > div { padding:15px;border-radius:11px;background:rgba(7,14,20,.42);border:1px solid var(--border-soft); }
.invoice-parties span,.invoice-parties strong,.invoice-parties small { display:block; }
.invoice-parties span { color:var(--muted);font-size:12px; }
.invoice-parties strong { margin:5px 0; }
.invoice-summary { display:grid;grid-template-columns:1fr minmax(300px,.55fr);gap:28px;margin-top:22px; }
.invoice-notes span { color:var(--muted); }
.totals-box { display:grid;gap:8px;padding:17px;border-radius:12px;background:rgba(7,14,20,.5);border:1px solid var(--border-soft); }
.totals-box > div { display:flex;justify-content:space-between;gap:15px; }
.totals-box .grand { padding:12px 0;border-top:1px solid var(--border-soft);border-bottom:1px solid var(--border-soft);color:var(--gold-bright);font-size:16px; }
.invoice-items-editor { display:grid;gap:8px;margin-bottom:9px; }
.invoice-item-row { display:grid;grid-template-columns:minmax(190px,2fr) 100px minmax(130px,1fr) 36px;gap:8px;align-items:center; }
.invoice-item-row input { min-width:0; }
.invoice-live-total { display:flex;align-items:center;justify-content:flex-end;gap:14px;padding:12px;border-radius:10px;background:var(--gold-soft); }
.invoice-live-total strong { color:var(--gold-bright);font-size:19px; }

/* Profile and settings */
.profile-layout { display:grid;grid-template-columns:minmax(240px,.65fr) minmax(0,2fr);gap:16px;align-items:start; }
.profile-summary { position:sticky;top:88px;text-align:center; }
.profile-avatar { width:82px;height:82px;font-size:30px;margin:0 auto 14px; }
.profile-summary h2 { margin:0 0 2px; }
.profile-summary > p { color:var(--muted);direction:ltr; }
.profile-meta { display:grid;gap:0;margin-top:20px;text-align:right; }
.profile-meta span { display:flex;justify-content:space-between;padding:10px 0;border-top:1px solid var(--border-soft);color:var(--muted); }
.profile-meta b { color:var(--text-soft); }
.profile-content { display:grid;gap:16px; }
.password-rules { color:var(--muted);font-size:12px;padding:10px 12px;border:1px dashed var(--border);border-radius:9px; }
.recovery-codes { margin-top:16px; }
.recovery-grid { display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:13px 0;direction:ltr; }
.recovery-grid code { padding:10px;text-align:center;border:1px solid var(--border-soft);border-radius:9px;background:rgba(7,14,20,.58);color:var(--gold-bright); }
.mfa-secret { display:flex;align-items:center;gap:10px;padding:13px;border:1px solid var(--border);border-radius:10px;background:var(--gold-soft);margin-bottom:12px; }
.mfa-secret code { flex:1;direction:ltr;text-align:left;word-break:break-all; }
.break-code { display:block;direction:ltr;text-align:left;word-break:break-all;padding:12px;margin:8px 0 16px;background:rgba(7,14,20,.55);border-radius:9px; }
.inline-danger-form { display:flex;align-items:end;gap:12px; }
.inline-danger-form .field { flex:1; }

.settings-main > form { display:grid;gap:16px; }
.settings-toggle-list label { cursor:pointer; }
.settings-toggle-list label > input { position:absolute;opacity:0;pointer-events:none; }
.settings-toggle-list label > input:checked + .switch { background:var(--gold); }
.settings-toggle-list label > input:checked + .switch::after { transform:translateX(-17px);background:#16120a; }
.danger-link { color:#ffaaa5!important; }
.danger-zone { border-color:rgba(225,94,94,.35);background:linear-gradient(145deg,rgba(67,24,27,.5),rgba(18,22,28,.98)); }
.danger-zone .card-header { color:#ffaaa5; }
.danger-zone-copy { padding:14px;border:1px solid rgba(225,94,94,.2);background:rgba(225,94,94,.065);border-radius:11px;margin-bottom:16px; }
.danger-zone-copy p { margin:0 0 7px;color:var(--text-soft); }
.danger-note { border-color:rgba(225,94,94,.25)!important;background:rgba(225,94,94,.07)!important; }

.check-field { display:flex;align-items:center;gap:9px;color:var(--text-soft); }
.check-field input { accent-color:var(--gold); }
.form-actions { display:flex;justify-content:flex-end; }
.compact-select { min-height:34px;padding:4px 8px;border-radius:8px;color:var(--text-soft); }
.inline-actions { display:flex;align-items:center;gap:6px; }
.login-back { display:block;text-align:center;margin-top:12px;color:var(--gold-bright); }
.profile-link { display:inline-flex; }
.topbar-logout { margin:0; }

.toast-stack { position:fixed;left:22px;bottom:22px;z-index:5000;display:grid;gap:9px;max-width:min(390px,calc(100vw - 30px)); }
.toast { opacity:0;transform:translateY(10px);padding:12px 15px;border-radius:11px;border:1px solid var(--border-soft);background:#16212b;box-shadow:0 18px 50px rgba(0,0,0,.35);transition:.22s ease; }
.toast.is-visible { opacity:1;transform:none; }
.toast-danger { border-color:rgba(225,94,94,.4);color:#ffc0bc; }
.toast-warning { border-color:rgba(220,174,61,.4);color:#f6d37a; }

@media (max-width: 1180px) {
    .detail-grid,.accounting-dashboard-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .card-span-3 { grid-column:1/-1; }
    .project-card-grid.compact-projects,.contact-grid,.finance-account-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .invoice-card-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .detail-grid,.accounting-dashboard-grid,.profile-layout,.two-column-layout { grid-template-columns:1fr; }
    .card-span-2,.card-span-3 { grid-column:auto; }
    .project-card-grid.compact-projects,.contact-grid,.document-grid,.finance-account-grid,.invoice-card-row { grid-template-columns:1fr; }
    .profile-summary,.helper-card { position:static; }
    .invoice-sheet { padding:18px; }
    .invoice-sheet > header,.invoice-toolbar { align-items:stretch;flex-direction:column; }
    .invoice-number { text-align:right; }
    .invoice-parties { grid-template-columns:1fr; }
    .invoice-summary { grid-template-columns:1fr; }
    .invoice-item-row { grid-template-columns:1fr 80px 1fr 36px; }
    .inline-danger-form { align-items:stretch;flex-direction:column; }
    .recovery-grid { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation:none!important;transition:none!important;scroll-behavior:auto!important; }

@media print {
    .sidebar,.topbar,.page-heading,.subnav-tabs,.invoice-toolbar,.flash-stack,.modal-backdrop { display:none!important; }
    .main-area,.page-content { margin:0!important;padding:0!important; }
    body,.invoice-sheet { background:#fff!important;color:#111!important;box-shadow:none!important;border:0!important; }
    .invoice-sheet * { color:#111!important; }
    .invoice-sheet { padding:15mm!important; }
}
.row-reveal { opacity:0; transform:translateY(6px); }
.row-reveal.row-visible { opacity:1;transform:none;transition:opacity .28s ease var(--row-delay),transform .28s ease var(--row-delay); }

/* ==========================================================================
   Interaction polish — v2.2
   ========================================================================== */
:focus-visible {
    outline: 2px solid rgba(239, 198, 110, .78);
    outline-offset: 3px;
}

.card,
.stat-card,
.service-card,
.monitor-card,
.contact-card,
.finance-account-card {
    isolation: isolate;
}
.card::after,
.stat-card::after {
    content: "";
    position: absolute;
    inset: 0 16px auto;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(239, 198, 110, .2), transparent);
    opacity: .58;
}
.card,
.stat-card { position: relative; }

.btn,
.icon-button,
.nav-item,
.project-tabs a {
    -webkit-tap-highlight-color: transparent;
}
.btn {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
}
.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.12) 50%, transparent 65%);
    transform: translateX(120%);
    transition: transform .5s ease;
}
.btn:hover::after { transform: translateX(-120%); }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
.btn:disabled,
.icon-button:disabled { opacity: .58;cursor: wait; }

.icon-button {
    border-color: rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
    transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.icon-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(213,165,74,.1);
    border-color: rgba(213,165,74,.25);
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.icon-button:active:not(:disabled) { transform: scale(.94); }

input,
select,
textarea {
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input:hover,
select:hover,
textarea:hover { border-color: rgba(213,165,74,.22); }
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(239,198,110,.48);
    box-shadow: 0 0 0 3px rgba(213,165,74,.09), inset 0 1px 0 rgba(255,255,255,.025);
    background: rgba(8,16,23,.8);
}
input:user-invalid,
select:user-invalid,
textarea:user-invalid { border-color: rgba(225,94,94,.55); }

.table-wrap {
    border-radius: 12px;
    scrollbar-gutter: stable;
}
.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: none;
    background: #111b24;
    box-shadow: 0 1px 0 var(--border-soft);
}
.data-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.008); }
.data-table tbody tr {
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.data-table tbody tr:hover {
    background: rgba(213,165,74,.045);
    box-shadow: inset -2px 0 0 rgba(213,165,74,.44);
}
.data-table tbody tr:hover td { background: transparent; }
.table-actions {
    opacity: .74;
    transition: opacity var(--transition), transform var(--transition);
}
.data-table tbody tr:hover .table-actions { opacity: 1;transform: translateX(-2px); }
.table-actions form,
.inline-actions form,
.service-card-footer form,
.monitor-card-actions form,
.account-card-actions form,
.contact-card-actions form,
.invoice-toolbar form { margin: 0; }

.contact-card-actions,
.account-card-actions,
.monitor-card-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}
.contact-card-actions { align-self: flex-start; }
.monitor-card-actions {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
.monitor-card-actions > .btn { flex: 1; }
.finance-account-card .account-card-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}

.service-card,
.monitor-card,
.contact-card,
.document-card,
.finance-account-card,
.invoice-mini-card,
.file-preview-card {
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.service-card:hover,
.monitor-card:hover,
.contact-card:hover,
.document-card:hover,
.finance-account-card:hover,
.invoice-mini-card:hover,
.file-preview-card:hover {
    transform: translateY(-2px);
    border-color: rgba(213,165,74,.22);
    box-shadow: 0 16px 32px rgba(0,0,0,.16);
}

.notification-row { position: relative; }
.notification-row:not(.is-read)::before {
    content: "";
    position: absolute;
    top: 15px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-bright);
    box-shadow: 0 0 12px rgba(239,198,110,.5);
}
.notification-row.is-read { opacity: .62; }

.modal-card,
.modal-dialog {
    box-shadow: 0 28px 90px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.025);
}
.modal.is-open .modal-card,
.modal.is-open .modal-dialog { animation: modalEnter .22s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modalEnter {
    from { opacity: 0;transform: translateY(12px) scale(.985); }
    to { opacity: 1;transform: none; }
}
.modal-wide { width: min(920px, calc(100vw - 28px)); }

.is-loading { color: transparent!important;pointer-events: none; }
.is-loading::before {
    content: "";
    position: absolute;
    width: 16px;height: 16px;
    inset: 50% auto auto 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,.28);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: buttonSpin .72s linear infinite;
    color: var(--gold-bright);
}
@keyframes buttonSpin { to { transform: rotate(360deg); } }

.explorer-table .backup-selectable.is-selected td,
.explorer-grid .backup-selectable.is-selected {
    background: rgba(213,165,74,.09);
    box-shadow: inset -2px 0 0 var(--gold);
}
.explorer-table .backup-selectable:focus-visible td { background: rgba(213,165,74,.08); }

.row-reveal { will-change: opacity, transform; }
.reveal-page { animation: pageEnter .28s ease both; }
@keyframes pageEnter {
    from { opacity: .2; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
    .table-actions { opacity: 1; }
    .modal-wide { width: min(100% - 18px, 920px); }
    .monitor-card-actions { flex-wrap: wrap; }
}

/* Final operational polish — v2.2 */
.toolbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.toolbar-actions form{display:inline-flex;margin:0}.card-toolbar{gap:14px}.card-toolbar>.toolbar-actions{margin-inline-start:auto}@media(max-width:760px){.health-grid{grid-template-columns:1fr}.toolbar-actions{width:100%}.toolbar-actions .btn,.toolbar-actions form{flex:1}.toolbar-actions form .btn{width:100%}}

/* ==========================================================================
   Readable lists & calm motion — v2.2
   ========================================================================== */
.data-table {
    border-collapse: separate;
    border-spacing: 0;
}
.data-table tbody td {
    border-bottom-color: rgba(255,255,255,.052);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:focus-within {
    background: rgba(213,165,74,.055);
    box-shadow: inset -2px 0 0 rgba(239,198,110,.55);
}
.data-table td strong,
.compact-list strong,
.attention-list strong { letter-spacing: -.01em; }
.data-table td small,
.table-subtext { line-height: 1.65; }

.compact-list > *,
.attention-list > *,
.alert-list-item,
.timeline-item,
.note-item {
    position: relative;
    transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.compact-list > *:hover,
.attention-list > *:hover,
.alert-list-item:hover,
.timeline-item:hover,
.note-item:hover {
    background: rgba(213,165,74,.035);
    border-color: rgba(213,165,74,.16);
    transform: translateX(-2px);
}

.row-reveal {
    opacity: 0;
    transform: translateY(8px) scale(.997);
    filter: none;
}
.row-reveal.row-visible {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
        opacity .32s cubic-bezier(.2,.75,.25,1) var(--row-delay),
        transform .32s cubic-bezier(.2,.75,.25,1) var(--row-delay),
        background .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.badge-danger .status-dot,
.status-offline .status-dot {
    animation: statusPulse 2.2s ease-in-out infinite;
}
@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225,90,90,0); }
    50% { box-shadow: 0 0 0 5px rgba(225,90,90,.10); }
}

.stat-card .stat-icon,
.card .card-icon {
    transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.stat-card:hover .stat-icon,
.card:hover .card-icon {
    transform: translateY(-2px) rotate(-2deg);
    border-color: rgba(239,198,110,.26);
}

@media (prefers-reduced-motion: reduce) {
    .row-reveal { opacity: 1!important;transform:none!important;filter:none!important; }
    .badge-danger .status-dot,.status-offline .status-dot { animation:none!important; }
}
.reduce-motion .row-reveal { opacity:1!important;transform:none!important;filter:none!important; }

/* ==========================================================================
   Production visual system — v3.0
   Crisp typography, calm contrast, polished motion and reliable modal layout
   ========================================================================== */
:root {
    --bg: #091119;
    --bg-deep: #071018;
    --surface: #111b25;
    --surface-2: #15212c;
    --surface-3: #192733;
    --surface-hover: #1d2b37;
    --text: #f3f6f8;
    --text-soft: #d8dfe5;
    --muted: #9aa8b5;
    --muted-2: #748391;
    --border-soft: rgba(255,255,255,.075);
    --border: rgba(214,170,82,.16);
    --border-strong: rgba(226,187,108,.30);
    --shadow-soft: 0 12px 32px rgba(0,0,0,.18);
    --focus: 0 0 0 3px rgba(215,170,84,.14);
    --transition: 190ms cubic-bezier(.2,.72,.25,1);
}

html { font-size: 16px; }
body,
button,
input,
select,
textarea {
    font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
    font-variation-settings: "wght" 430;
}
body {
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: -.006em;
    background:
        radial-gradient(circle at 88% -8%, rgba(214,170,82,.055), transparent 31rem),
        radial-gradient(circle at 5% 105%, rgba(55,105,151,.065), transparent 35rem),
        linear-gradient(180deg, #0a131c 0%, #081018 100%);
}
strong, h1, h2, h3, h4, .btn, .badge { font-variation-settings: "wght" 680; }
.icon { display:block; align-self:center; overflow:visible; vector-effect:non-scaling-stroke; }
.btn > .icon,
.icon-button > .icon,
.nav-item > .icon,
.card-header .icon { pointer-events:none; }

.sidebar { background: linear-gradient(180deg, rgba(20,31,42,.99), rgba(11,20,28,.995)); }
.nav-item { min-height: 48px; font-size: 13px; }
.nav-item .icon { color: currentColor; }
.topbar { background: rgba(9,17,25,.92); }
.global-search input { font-size: 13px; }
.page-heading p,
.card-header p { line-height: 1.75; }

.card,
.stat-card {
    box-shadow: 0 12px 34px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.018);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
}
.card:hover,
.stat-card:hover {
    border-color: rgba(226,187,108,.18);
    box-shadow: 0 17px 42px rgba(0,0,0,.20), inset 0 1px rgba(255,255,255,.022);
}
.stat-card:hover { transform: translateY(-2px); }

.btn {
    min-height: 41px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: -.005em;
}
.btn .icon { flex:0 0 auto; }
.icon-button {
    width: 37px;
    height: 37px;
    border-radius: 10px;
    vertical-align: middle;
}
.icon-button:hover:not(:disabled) { transform: translateY(-1px); }
.icon-button:active:not(:disabled) { transform: translateY(0) scale(.96); }

.data-table { font-size: 12.5px; }
.data-table th {
    color: #aeb9c3;
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: 0;
}
.data-table td { color: var(--text-soft); line-height: 1.7; }
.data-table td strong { color: var(--text); font-size: 12.5px; }
.data-table td small,
.table-subtext { color: var(--muted); font-size: 11px; }
.data-table tbody tr:hover { transform:none; }
.table-actions { min-width:max-content; gap:5px; }

.compact-list strong,
.plain-row strong,
.alert-list-item strong,
.attention-list strong { font-size: 12px; }
.compact-list small,
.plain-row small,
.alert-list-item small,
.attention-list small { font-size: 12px; }
.card-header h2 { font-size: 15.5px; }
.card-header p { font-size: 11px; }

.field label { color: #c4cdd5; font-size: 12px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.field input,
.field select,
.field textarea,
.compact-select {
    min-height: 43px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
    border-radius: 10px;
    background: rgba(7,14,20,.68);
}
.field textarea { min-height: 104px; }
.field input::placeholder,
.field textarea::placeholder { color: #6f7e8b; opacity:1; }

/* Modal content remains sharp: no backdrop blur and no scaling rasterization. */
body.modal-open { overflow:hidden; }
.modal-backdrop {
    background: rgba(2,7,11,.82);
    backdrop-filter: none;
    animation: vmaniaBackdropIn .18s ease both;
}
.modal {
    opacity: 0;
    transform: none;
    transition: opacity .18s ease;
    overscroll-behavior: contain;
}
.modal.is-open { opacity:1; transform:none; }
.modal-card,
.modal-dialog {
    transform: translateY(18px);
    opacity: 0;
    filter: none;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(145deg, #16222d, #0e1821);
    box-shadow: 0 34px 110px rgba(0,0,0,.64), 0 0 0 1px rgba(255,255,255,.025);
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
    animation: none !important;
}
.modal.is-open .modal-card,
.modal.is-open .modal-dialog { transform:translateY(0); opacity:1; }
.modal-header,
.modal-head {
    position: sticky;
    top: -22px;
    z-index: 5;
    padding-top: 3px;
    padding-bottom: 15px;
    background: linear-gradient(180deg, rgba(22,34,45,.99) 75%, rgba(22,34,45,0));
}
.modal-header h2,
.modal-head h3 { font-size: 18px; line-height:1.55; }
.modal-header p { font-size: 11px; max-width: 58ch; }
.modal-actions {
    position: sticky;
    bottom: -22px;
    z-index: 4;
    padding: 14px 0 2px;
    margin-top: 8px;
    background: linear-gradient(0deg, rgba(14,24,33,.99) 72%, rgba(14,24,33,0));
}
@keyframes vmaniaBackdropIn { from { opacity:0; } to { opacity:1; } }

/* Motion: more premium without blur or visual fatigue. */
.reveal-page > * { animation: vmaniaPageIn .46s cubic-bezier(.16,.82,.24,1) both; }
@keyframes vmaniaPageIn {
    from { opacity:0; transform:translateY(12px); }
    to { opacity:1; transform:none; }
}
.row-reveal {
    opacity:0;
    transform:translateY(10px);
    filter:none !important;
}
.row-reveal.row-visible {
    opacity:1;
    transform:none;
    filter:none !important;
    transition:
        opacity .38s cubic-bezier(.16,.82,.24,1) var(--row-delay),
        transform .42s cubic-bezier(.16,.82,.24,1) var(--row-delay),
        background .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}
.btn-primary { box-shadow:0 9px 25px rgba(213,165,74,.17); }
.btn-primary:hover:not(:disabled) { box-shadow:0 13px 32px rgba(213,165,74,.25); }
.btn::after { opacity:.72; }

.empty-state {
    color:var(--muted);
    line-height:1.9;
    border-radius:12px;
}
.chart-empty {
    min-height:220px;
    display:grid;
    place-items:center;
    color:var(--muted);
    font-size:12px;
}

@media (max-width: 760px) {
    .page-content { padding-inline:14px; }
    .modal { padding:9px; }
    .modal-card,.modal-dialog { width:100% !important; max-height:calc(100dvh - 18px); padding:18px; border-radius:16px; }
    .modal-header,.modal-head { top:-18px; }
    .modal-actions { bottom:-18px; flex-wrap:wrap; }
    .modal-actions .btn { flex:1; }
    .data-table { font-size:12px; }
}

@media (prefers-reduced-motion: reduce) {
    .modal-backdrop,.modal-card,.modal-dialog,.reveal-page > * { animation:none!important; transition:none!important; transform:none!important; }
}

/* ==========================================================================
   VMANIA production polish — v3.0.0 final
   ========================================================================== */
.modal[hidden],
.modal-backdrop[hidden],
.notification-panel[hidden],
.search-results[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Modal stacking correctness
   .page-content runs an entry animation, which creates a stacking context that
   used to trap fixed-position modals underneath #modalBackdrop. JS relocates
   modals to <body>; these rules keep the order correct even before JS runs and
   stop the page-entry animation from leaking onto modal children.
   -------------------------------------------------------------------------- */
.modal-backdrop { z-index: 900 !important; }
.modal { z-index: 950 !important; }
.reveal-page > .modal,
.reveal-page > .modal-backdrop { animation: none !important; opacity: initial; transform: none; }
.reveal-page > .modal[hidden] { display: none !important; }
body > .modal { position: fixed; inset: 0; }

.modal { cursor: default; }
.modal-card,
.modal-dialog {
    isolation: isolate;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
.modal-card::before,
.modal-dialog::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(circle at 88% 0%, rgba(230,188,102,.085), transparent 22rem),
        linear-gradient(135deg, rgba(255,255,255,.018), transparent 42%);
}
.modal-card,
.modal-dialog { position: relative; }
.modal-close {
    flex: 0 0 auto;
    color: var(--muted);
    border: 1px solid transparent !important;
}
.modal-close:hover {
    color: var(--text);
    background: rgba(255,255,255,.055) !important;
    border-color: var(--border-soft) !important;
}

/* Stronger focus visibility without visual noise. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(239,198,110,.92);
    outline-offset: 2px;
}

/* Premium button feedback and reliable loading state. */
.btn,
.icon-button {
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.btn::before,
.icon-button::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.18), transparent 58%);
    transition: opacity .18s ease;
}
.btn:active::before,
.icon-button:active::after { opacity: .42; }
.is-loading {
    color: transparent !important;
    pointer-events: none !important;
    cursor: wait !important;
}
.is-loading > * { visibility: hidden; }
.is-loading::before {
    content: "" !important;
    position: absolute !important;
    inset: 50% auto auto 50% !important;
    width: 16px !important;
    height: 16px !important;
    margin: -8px 0 0 -8px !important;
    border: 2px solid rgba(255,255,255,.28) !important;
    border-top-color: #d8aa52 !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    background: none !important;
    animation: vmaniaSpin .68s linear infinite !important;
}
.btn-primary.is-loading::before { border-color: rgba(17,23,29,.28) !important; border-top-color: #151a20 !important; }
@keyframes vmaniaSpin { to { transform: rotate(360deg); } }

/* Refined navigation motion. */
.nav-item::before {
    content: "";
    position: absolute;
    inset-inline-start: 8px;
    width: 3px;
    height: 0;
    border-radius: 99px;
    background: linear-gradient(180deg, #f1ca76, #b77a25);
    box-shadow: 0 0 16px rgba(224,178,84,.36);
    transition: height .22s cubic-bezier(.2,.8,.2,1);
}
.nav-item { position: relative; }
.nav-item.is-active::before { height: 24px; }
.nav-item:hover .icon { transform: translateY(-1px) scale(1.04); }
.nav-item .icon { transition: transform .2s ease; }

/* Data lists stay aligned and scannable in RTL. */
.data-table th,
.data-table td { vertical-align: middle; }
.data-table tbody tr { transition: background .18s ease, box-shadow .18s ease; }
.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(213,165,74,.025), rgba(255,255,255,.018));
    box-shadow: inset -2px 0 rgba(213,165,74,.22);
}
.table-actions,
.inline-actions,
.heading-actions,
.toolbar-actions {
    align-items: center;
}
.table-actions form,
.inline-actions form { display: inline-flex; align-items: center; margin: 0; }
.identity-cell { min-width: max-content; }

/* Icons remain optically centred at every size. */
.icon-button,
.stat-icon,
.card-icon,
.nav-item,
.btn {
    align-items: center;
    justify-content: center;
}
.icon-button .icon { margin: 0; }
.btn .icon { margin-block: 0; }

/* Iranian date helper shown under native ISO inputs. */
.iran-date-hint {
    display: block;
    margin-top: 5px;
    color: #c7a85f;
    font-size: 12px;
    line-height: 1.6;
}
.iran-date-hint[hidden] { display: none !important; }

.donut-chart.is-empty {
    filter: saturate(.3);
    opacity: .76;
}
.line-chart {
    width: 100%;
    display: block;
}

/* Polished empty states for a truly empty production installation. */
.empty-state,
.empty-mini {
    background:
        linear-gradient(135deg, rgba(255,255,255,.018), transparent),
        rgba(6,13,19,.28);
    border: 1px dashed rgba(255,255,255,.09);
}
.empty-state::before {
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    margin: 0 auto 10px;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, rgba(213,165,74,.65), transparent);
}

/* Subtle page and card choreography; no blur is used. */
.reveal-page > :nth-child(1) { animation-delay: 0ms; }
.reveal-page > :nth-child(2) { animation-delay: 35ms; }
.reveal-page > :nth-child(3) { animation-delay: 65ms; }
.reveal-page > :nth-child(4) { animation-delay: 90ms; }
.reveal-page > :nth-child(n+5) { animation-delay: 110ms; }
.stat-card::after,
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    background: linear-gradient(115deg, transparent 25%, rgba(235,197,116,.035) 48%, transparent 70%);
    transform: translateX(18%);
    transition: opacity .25s ease, transform .5s cubic-bezier(.2,.75,.25,1);
}
.stat-card,
.card { position: relative; }
.stat-card:hover::after,
.card:hover::after { opacity: 1; transform: translateX(-8%); }

/* Prevent long values from breaking cards and modals. */
.card,
.modal-card,
.modal-dialog,
.data-table td,
.selected-file-details dd { min-width: 0; }
.break-code,
code,
.data-table td { overflow-wrap: anywhere; }

@media (max-width: 980px) {
    .topbar-meta .date-time span { display: none; }
    .global-search kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .btn::before,.icon-button::after,.stat-card::after,.card::after,.nav-item::before { transition: none !important; }
    .is-loading::before { animation-duration: 1.2s !important; }
}
.reduce-motion .btn::before,
.reduce-motion .icon-button::after,
.reduce-motion .stat-card::after,
.reduce-motion .card::after { transition: none !important; }


/* Production rendering guards: sharp text and stable icon/button alignment. */
.topbar,
.data-table thead th,
body.sidebar-open::after,
.modal-backdrop { -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }
.modal,
.modal-card,
.modal-dialog,
.modal-card *,
.modal-dialog * { filter:none !important; text-shadow:none; }
.btn,
.icon-button,
.nav-item,
.notification-button,
.link-button { gap:8px; line-height:1.45; }
.btn > svg,
.icon-button > svg,
.nav-item > svg,
.notification-button > svg { flex:none; transform-origin:center; }
button:disabled,
.btn:disabled { cursor:not-allowed; opacity:.58; }
.data-table td > .badge,
.data-table td > .status-badge { vertical-align:middle; }
@supports (font-variation-settings: normal) {
    body { font-optical-sizing:auto; }
}

/* ==========================================================================
   VMANIA v3.1 — Settings redesign
   Two balanced columns, readable type scale, non-overlapping toggle rows
   and a sticky save bar. Replaces the cramped 9–10px layout.
   ========================================================================== */

.settings-form { display: block; }

.settings-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.settings-nav {
    position: sticky;
    top: 94px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px;
}

.settings-nav > strong {
    padding: 4px 10px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    color: var(--text);
}

.settings-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

.settings-nav a .icon { flex: 0 0 auto; opacity: .85; }
.settings-nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.settings-nav a.is-active {
    color: var(--gold-bright);
    background: var(--gold-soft);
    box-shadow: inset 0 0 0 1px rgba(215,170,84,.2);
}
.settings-nav a.is-active .icon { opacity: 1; }

.settings-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.settings-section {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    min-height: 0;
}

.settings-section .card-header {
    padding: 17px 19px 15px;
    margin: 0;
    border-bottom: 1px solid var(--border-soft);
}

.settings-section .card-header h2 { font-size: 16px; margin: 0 0 3px; }
.settings-section .card-header p { font-size: 12px; margin: 0; color: var(--muted); }

.settings-section .settings-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 19px 20px;
}

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

.settings-section .field-full { grid-column: 1 / -1; }
.settings-section .field label { font-size: 12.5px; margin-bottom: 7px; color: var(--text); }
.settings-section .field input,
.settings-section .field select { font-size: 13.5px; min-height: 42px; }
.settings-section .field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.75;
}
.settings-section .field input:disabled {
    opacity: .62;
    cursor: not-allowed;
    background: rgba(255,255,255,.02);
}

.settings-section-wide { grid-column: 1 / -1; }

/* Toggle rows: grid keeps the switch, text and tag from ever overlapping. */
.settings-toggle-list {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.toggle-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 14px 2px;
    border-bottom: 1px solid var(--border-soft);
    cursor: pointer;
}
.toggle-row:first-child { padding-top: 2px; }
.toggle-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.toggle-row.is-static { cursor: default; }

.toggle-row > input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.toggle-text strong { font-size: 13.5px; font-weight: 600; line-height: 1.6; }
.toggle-text small { font-size: 11.5px; line-height: 1.8; color: var(--muted); }

.toggle-tag {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid rgba(72,185,120,.28);
    background: var(--success-soft);
    color: var(--success);
    font-size: 10.5px;
    white-space: nowrap;
}

.switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 20px;
    background: #3b4651;
    transition: background var(--transition);
}
.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d5dce2;
    transition: transform var(--transition), background var(--transition);
}
.switch.is-on { background: var(--gold); }
.switch.is-on::after { transform: translateX(-18px); background: #16120a; }
.switch.is-locked { opacity: .78; }

.toggle-row > input:checked ~ .switch { background: var(--gold); }
.toggle-row > input:checked ~ .switch::after { transform: translateX(-18px); background: #16120a; }
.toggle-row > input:focus-visible ~ .switch { box-shadow: var(--focus); }
.toggle-row:hover .switch:not(.is-locked) { background: #48545f; }
.toggle-row > input:checked ~ .switch:hover { background: var(--gold-bright); }

/* Health grid */
.settings-section .health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 10px;
}
.settings-section .requirement {
    min-height: 56px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    font-size: 13px;
}
.requirement-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.requirement-text strong { font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.requirement-text small { font-size: 11px; color: var(--muted); line-height: 1.7; }
.settings-section .requirement span[aria-hidden] {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    font-size: 13px;
}

.settings-section .security-note {
    align-items: flex-start;
    gap: 12px;
    padding: 14px 15px;
    border-radius: 12px;
}
.settings-section .security-note strong { font-size: 13px; }
.settings-section .security-note p { font-size: 11.5px; line-height: 1.85; margin: 4px 0 0; }
.settings-section .security-note code {
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255,255,255,.06);
    font-size: 11px;
    direction: ltr;
    display: inline-block;
}

/* Health summary pill in the page heading */
.health-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 99px;
    font-size: 12.5px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,.03);
}
.health-pill.is-ok { color: var(--success); border-color: rgba(72,185,120,.3); background: var(--success-soft); }
.health-pill.is-warn { color: var(--warning); border-color: rgba(224,157,72,.3); background: var(--warning-soft); }

/* Sticky save bar */
.settings-savebar {
    position: sticky;
    bottom: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 14px 19px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(23,35,46,.98), rgba(16,26,35,.98));
    box-shadow: 0 16px 46px rgba(0,0,0,.42);
}
.savebar-text {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12.5px;
}
.savebar-text .icon { flex: 0 0 auto; opacity: .8; }
.settings-savebar .btn { min-height: 44px; padding-inline: 24px; }

@media (max-width: 1180px) {
    .settings-main { grid-template-columns: 1fr; }
    .settings-section-wide { grid-column: auto; }
}
@media (max-width: 900px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding: 10px;
    }
    .settings-nav > strong { display: none; }
    .settings-nav a { white-space: nowrap; min-height: 38px; }
}
@media (max-width: 620px) {
    .settings-section .form-grid { grid-template-columns: 1fr; }
    .toggle-row { grid-template-columns: auto minmax(0, 1fr); }
    .toggle-tag { grid-column: 2; justify-self: start; }
    .settings-savebar { position: static; }
    .settings-savebar .btn { width: 100%; }
}

/* ==========================================================================
   VMANIA v3.1 — Iranian (Jalali) calendar
   ========================================================================== */

.jalali-calendar { padding: 0; overflow: hidden; }

.calendar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 17px 13px;
    border-bottom: 1px solid var(--border-soft);
}
.calendar-title h2 { margin: 0 0 3px; font-size: 15.5px; }
.calendar-title p { margin: 0; font-size: 11.5px; color: var(--muted); }

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}
.calendar-nav strong {
    min-width: 104px;
    text-align: center;
    font-size: 12.5px;
    color: var(--gold-bright);
}
.calendar-nav .icon-button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
}
.calendar-nav .icon-button:hover { background: rgba(255,255,255,.05); border-color: var(--gold); }
.calendar-nav .flip .icon { transform: scaleX(-1); }

.mini-calendar { padding: 14px 15px 16px; }

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 7px;
}
.calendar-week span {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding-bottom: 5px;
}
.calendar-week span.is-weekend { color: var(--danger); }

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-days > span {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 12.5px;
    color: var(--text);
    transition: background var(--transition), border-color var(--transition);
}
.calendar-days > span.blank { visibility: hidden; }
.calendar-days > span:not(.blank):hover { background: rgba(255,255,255,.045); }

.calendar-days > span.is-holiday { color: #ff8b84; font-weight: 600; }
.calendar-days > span.today {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--gold-bright);
    font-weight: 700;
}
.calendar-days > span.has-event {
    background: rgba(224,157,72,.13);
    border-color: rgba(224,157,72,.35);
}
.calendar-days > span.today.has-event { background: var(--gold-soft); }

/* renewal-count badge */
.calendar-days > span > i {
    position: absolute;
    top: -3px;
    inset-inline-end: -3px;
    min-width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    padding: 0 3px;
    border-radius: 99px;
    background: var(--warning);
    color: #17120a;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
/* occasion marker */
.calendar-days > span > u {
    position: absolute;
    bottom: 4px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--info, #5b8def);
    text-decoration: none;
}
.calendar-days > span.is-holiday > u { background: var(--danger); }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: var(--muted);
}
.calendar-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.calendar-legend .dot.is-today { background: var(--gold); }
.calendar-legend .dot.is-holiday { background: var(--danger); }
.calendar-legend .dot.is-occasion { background: var(--info, #5b8def); }
.calendar-legend .dot.is-renewal { background: var(--warning); }

/* Occasion lists */
.occasion-list { display: flex; flex-direction: column; }
.occasion-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
}
.occasion-row:last-child { border-bottom: 0; }
.occasion-row strong { display: block; font-size: 13px; line-height: 1.6; }
.occasion-row small { color: var(--muted); font-size: 11px; }
.occasion-row.is-holiday strong { color: #ff8b84; }

.occasion-month-list { max-height: 320px; overflow-y: auto; }
.occasion-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-soft);
}
.occasion-item:last-child { border-bottom: 0; }
.occasion-day {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border-soft);
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 auto;
}
.occasion-item.is-holiday .occasion-day {
    background: var(--danger-soft);
    border-color: rgba(224,106,100,.32);
    color: #ff8b84;
}
.occasion-item strong { display: block; font-size: 12.5px; line-height: 1.65; }
.occasion-item small { color: var(--muted); font-size: 10.5px; }
.holiday-tag {
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--danger-soft);
    border: 1px solid rgba(224,106,100,.3);
    color: #ff8b84;
    font-size: 10px;
    font-weight: 600;
}

/* Expiry date cell with weekday context */
.date-cell { display: flex; flex-direction: column; gap: 2px; }
.date-cell strong { font-size: 12.5px; font-weight: 600; }
.date-cell small { color: var(--muted); font-size: 10.5px; }

/* Monitoring status hints (suspended / unstable / parked content) */
.status-hint {
    display: block;
    margin-top: 5px;
    font-size: 10.5px;
    line-height: 1.6;
    max-width: 24ch;
}
[data-monitor-status] { min-width: 150px; }
.badge-danger .status-dot { background: var(--danger); }

/* ==========================================================================
   VMANIA v3.1 — Global readability & table polish
   Persian glyphs need more vertical room than Latin; the previous 9–11px
   scale was unreadable on normal monitors. This raises the whole UI to a
   comfortable scale without changing the layout structure.
   ========================================================================== */

/* ---- Tables ---- */
.data-table th,
.data-table td {
    padding: 13px 15px;
    vertical-align: middle;
}
.data-table th {
    font-size: 12px;
    font-weight: 600;
    color: #93a1ad;
    letter-spacing: 0;
    background: rgba(255,255,255,.022);
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.data-table td {
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-soft);
}
.data-table td strong { font-size: 13px; font-weight: 600; color: var(--text); }
.data-table td small,
.table-subtext,
.table-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.65;
    color: var(--muted);
}
.data-table tbody tr:hover { background: rgba(255,255,255,.028); }

/* Long text columns should wrap instead of stretching the table. */
.data-table td.wrap,
.data-table td .wrap { white-space: normal; }
.data-table .service-title-cell strong,
.data-table .identity-cell strong,
.data-table .project-name-cell strong { white-space: normal; }

.compact-tables .data-table th,
.compact-tables .data-table td { padding: 9px 13px; }
.compact-tables .data-table td { font-size: 12.5px; }

/* ---- Cards & headings ---- */
.card-header h2 { font-size: 16px; line-height: 1.6; }
.card-header p { font-size: 12px; line-height: 1.7; color: var(--muted); }
.page-heading p { font-size: 13.5px; line-height: 1.8; }
.eyebrow { font-size: 11px; letter-spacing: .06em; }

/* ---- Stat cards ---- */
.stat-card small { font-size: 12px; line-height: 1.7; }
.stat-card strong { font-size: 25px; line-height: 1.4; }
.stat-card em { font-size: 11.5px; line-height: 1.7; }

/* ---- Badges, pills, chips ---- */
.badge {
    font-size: 11.5px;
    padding: 5px 11px;
    line-height: 1.6;
    border-radius: 99px;
    white-space: nowrap;
}
.days-pill { font-size: 11.5px; padding: 5px 11px; }
.source-chip { font-size: 10.5px; padding: 4px 9px; letter-spacing: .04em; }

/* ---- Buttons ---- */
.btn { font-size: 13px; min-height: 40px; }
.btn-sm { font-size: 12px; min-height: 34px; padding-inline: 14px; }
.icon-button { width: 34px; height: 34px; border-radius: 9px; }
.table-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-start; }
.table-actions form { display: inline-flex; margin: 0; }

/* ---- Forms ---- */
.field label { font-size: 12.5px; margin-bottom: 7px; }
.field input,
.field select,
.field textarea { font-size: 13.5px; }
.field small { font-size: 11.5px; line-height: 1.75; }

/* ---- Sidebar & topbar ---- */
.nav-item { font-size: 13.5px; min-height: 44px; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { font-size: 11px; }
.global-search input { font-size: 13px; }
.date-time span { font-size: 11.5px; }
.date-time strong { font-size: 15px; }

/* ---- Lists & empty states ---- */
.compact-list strong,
.plain-row strong { font-size: 13px; line-height: 1.65; }
.compact-list small,
.plain-row small { font-size: 11px; line-height: 1.65; }
.empty-state { font-size: 13px; line-height: 1.9; padding: 30px 20px; }
.empty-state.compact { padding: 20px 16px; font-size: 12.5px; }
.empty-mini { font-size: 12.5px; padding: 16px; }

/* ---- Alerts & flashes ---- */
.flash { font-size: 13px; line-height: 1.75; }
.alert { font-size: 12.5px; line-height: 1.8; }
.alert-list-item strong { font-size: 12.5px; }
.alert-list-item small { font-size: 11px; line-height: 1.65; }

/* ---- Notifications ---- */
.notification-row strong { font-size: 12.5px; }
.notification-row span { font-size: 11.5px; line-height: 1.7; }
.notification-row small { font-size: 10.5px; }

/* ---- Toasts ---- */
.toast { font-size: 13px; line-height: 1.75; max-width: 380px; }

/* ---- Modals ---- */
.modal-head h3, .modal-header h2 { font-size: 17px; }
.modal-header p { font-size: 12px; line-height: 1.75; }

/* ---- Tabs ---- */
.subnav-tabs a { font-size: 13px; min-height: 38px; display: inline-flex; align-items: center; }

/* ---- Numbers stay LTR inside RTL text ---- */
code, kbd, .mono, [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }

/* ---- Scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.14);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); background-clip: content-box; }

/* ---- Selection ---- */
::selection { background: rgba(215,170,84,.28); color: #fff; }

/* Donut legend + suspended callout */
.legend-list .legend-muted { background: #5b6874; }
.donut-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 16px 16px;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid rgba(224,106,100,.3);
    background: var(--danger-soft);
    color: #ff9d97;
    font-size: 12px;
    line-height: 1.7;
}
.donut-alert .icon { flex: 0 0 auto; }
.donut-alert:hover { border-color: rgba(224,106,100,.5); }

/* Domain cell with name + host */
.domain-link { display: inline-flex; align-items: center; gap: 8px; }
.domain-link span { display: flex; flex-direction: column; gap: 2px; }
.domain-link strong { font-size: 13px; font-weight: 600; }
.domain-link small { font-size: 10.5px; color: var(--muted); direction: ltr; }

/* ==========================================================================
   VMANIA v3.1 — Readability sweep
   Anything below ~11px is unreadable for Persian glyphs. These selectors
   were found by an automated pass over every page.
   ========================================================================== */

.role-chip, .level-chip, .source-chip, .toggle-tag,
.perm-table th, .perm-table td,
.chip, .tag, .mini-chip { font-size: 11px !important; line-height: 1.65; }

.role-chip, .level-chip { padding: 4px 10px; border-radius: 99px; }

code, .mono { font-size: 11.5px; }
.data-table code { font-size: 11.5px; }

/* generic small text floor */
small, .muted-text, figcaption { font-size: 11.5px; line-height: 1.7; }
.legend-list span, .calendar-legend span { font-size: 11.5px; }
.stat-mini span, .stat-mini small { font-size: 11.5px; }

/* headings inside cards never below 12px */
.card strong, .card h3, .card h4 { font-size: 13px; }
.card p, .card span { line-height: 1.7; }

/* explorer / backups chips */
.explorer-tabs a, .explorer-tabs span,
.subnav-tabs a, .filter-chip { font-size: 12.5px; }

/* table headers in permission matrix */
.perm-table th { font-size: 11.5px !important; font-weight: 600; }

/* profile + MFA hints */
.mfa-setup strong, .mfa-hint strong { font-size: 13px; }
.mfa-setup p, .mfa-hint p, .mfa-setup small { font-size: 11.5px; line-height: 1.8; }

/* invoice code chips */
.invoice-mini-card code, .invoice-number { font-size: 12px; }

/* Tablet: stat grids must collapse before they overflow */
@media (max-width: 1024px) {
    .stats-grid-4, .stats-grid-5, .stats-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-grid, .monitoring-layout, .content-with-aside,
    .renewals-layout, .accounting-layout { grid-template-columns: minmax(0, 1fr); }
    .card-span-2, .card-span-3, .card-wide { grid-column: auto; }
    .stacked-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
}
@media (max-width: 860px) {
    .stats-grid, .stats-grid-4, .stats-grid-5, .stats-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stacked-aside { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .stats-grid, .stats-grid-4, .stats-grid-5, .stats-grid-6 { grid-template-columns: minmax(0, 1fr); }
    .page-heading { flex-direction: column; align-items: stretch; gap: 14px; }
    .heading-actions { flex-wrap: wrap; }
    .heading-actions .btn { flex: 1; }
}

/* Tables must scroll inside their card, never widen the page. */
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card, .stat-card, .settings-section { min-width: 0; }
.dashboard-grid > *, .monitoring-layout > *, .content-with-aside > * { min-width: 0; }

/* Final readability floor — catches remaining legacy 8–10px declarations.
   Scoped to text-bearing elements so icons and decorative bits are untouched. */
.app-body b,
.app-body time,
.app-body small,
.app-body th,
.app-body figcaption,
.app-body .chip,
.app-body .pill,
.app-body dt,
.app-body dd { font-size: 11.5px; }

.app-body .data-table th,
.app-body table th { font-size: 11.5px; }

.app-body .holiday-tag,
.app-body .days-pill,
.app-body .compact-list b,
.app-body .plain-row b,
.app-body .attention-list b { font-size: 11.5px; }

.app-body .activity-row small,
.app-body .activity-row time,
.app-body .timeline-item small,
.app-body .timeline-item time { font-size: 11px; }

.app-body .donut-legend span,
.app-body .legend-list span,
.app-body .bar-legend span,
.app-body .risk-chip { font-size: 11.5px; }

.app-body p { line-height: 1.85; }
.app-body .mfa-setup p,
.app-body .security-note p { font-size: 11.5px; }
