:root {
    --bg: #f5f5f1;
    --surface: #ffffff;
    --surface-strong: #111111;
    --text: #171717;
    --muted: #6f6f68;
    --line: #deded6;
    --accent: #e73f2d;
    --accent-dark: #b9281c;
    --green: #12805c;
    --yellow: #a86f00;
    --red: #ba2a1d;
    --blue: #2e5d86;
    --shadow: 0 18px 45px rgba(17, 17, 17, 0.08);
}

[x-cloak] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

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

.dark-dashboard {
    position: relative;
    min-height: calc(100vh - 90px);
    padding: 30px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(167, 139, 250, 0.16), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(59, 227, 116, 0.08), transparent 22%),
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        #0b0b0d;
    background-size: auto, auto, 42px 42px, 42px 42px, auto;
    color: #e8e8ec;
}

.dark-dashboard::before {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 70%);
}

.dark-orbit {
    position: absolute;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(167, 139, 250, 0.14);
    border-radius: 999px;
    pointer-events: none;
}

.dark-orbit-one {
    top: 80px;
    right: -120px;
}

.dark-orbit-two {
    bottom: -180px;
    left: 12%;
}

.dark-hero,
.dark-kpi-grid,
.dark-analytics-grid,
.dark-task-panel {
    position: relative;
    z-index: 1;
}

.dark-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.dark-hero h2 {
    margin: 6px 0 0;
    color: #f3f3f5;
    font-size: 34px;
    line-height: 1.08;
}

.dark-eyebrow {
    margin: 0;
    color: rgba(232, 232, 236, 0.55);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.dark-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    color: #f3f3f5;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.dark-button:hover {
    transform: translateY(-2px);
}

.dark-button-primary {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.95), rgba(59, 227, 116, 0.18));
    border: 1px solid rgba(167, 139, 250, 0.45);
}

.dark-button-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background: rgba(20, 20, 24, 0.88);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.dark-card:hover {
    transform: translateY(-3px);
    border-color: rgba(167, 139, 250, 0.22);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.dark-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dark-kpi-card {
    display: grid;
    gap: 10px;
    min-height: 164px;
    padding: 22px;
}

.dark-kpi-card span,
.dark-kpi-card small {
    color: rgba(232, 232, 236, 0.56);
    font-weight: 800;
}

.dark-kpi-card span {
    font-size: 12px;
    text-transform: uppercase;
}

.dark-kpi-card strong {
    color: #f4f4f6;
    font-size: 48px;
    line-height: 0.95;
}

.tone-red {
    color: #ff4d4f !important;
}

.tone-purple {
    color: #a78bfa !important;
}

.dark-analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
    gap: 16px;
    margin-bottom: 16px;
}

.dark-chart-card,
.dark-insight-card,
.dark-task-panel {
    padding: 22px;
}

.dark-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.dark-card-header h3,
.dark-insight-card h3 {
    margin: 5px 0 0;
    color: #f2f2f5;
    font-size: 22px;
}

.dark-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.09);
    color: #d8ceff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.minimal-chart {
    display: grid;
    gap: 16px;
}

.chart-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;
}

.chart-row span,
.chart-row strong,
.dark-task-card p {
    color: rgba(232, 232, 236, 0.62);
}

.chart-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    overflow: hidden;
}

.chart-fill {
    height: 100%;
    border-radius: inherit;
    box-shadow: 0 0 22px currentColor;
}

.chart-red {
    background: #ff4d4f;
    color: rgba(255, 77, 79, 0.42);
}

.chart-purple {
    background: #a78bfa;
    color: rgba(167, 139, 250, 0.42);
}

.chart-green {
    background: #3be374;
    color: rgba(59, 227, 116, 0.35);
}

.flow-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.flow-line span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #a78bfa;
    box-shadow: 0 0 18px rgba(167, 139, 250, 0.58);
}

.dark-insight-card {
    background:
        linear-gradient(145deg, rgba(167, 139, 250, 0.16), transparent 55%),
        rgba(20, 20, 24, 0.92);
}

.dark-insight-card p:not(.dark-eyebrow) {
    margin: 14px 0 0;
    color: rgba(232, 232, 236, 0.64);
    line-height: 1.6;
}

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

.dark-task-card {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 170px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
}

.dark-task-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dark-task-card h4 {
    margin: 0;
    color: #f1f1f4;
    font-size: 15px;
}

.dark-task-card header span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: #f1f1f4;
    font-weight: 900;
}

.dark-task-card.task-critical {
    border-color: rgba(255, 77, 79, 0.22);
}

.dark-task-card.task-warning {
    border-color: rgba(167, 139, 250, 0.2);
}

.dark-task-card.task-info {
    border-color: rgba(59, 227, 116, 0.18);
}

.dark-task-list {
    display: grid;
    gap: 8px;
}

.dark-task-list a {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(11, 11, 13, 0.38);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.dark-task-list a:hover {
    border-color: rgba(167, 139, 250, 0.3);
    background: rgba(167, 139, 250, 0.08);
}

.dark-task-list strong {
    color: #ededf0;
}

.dark-task-list small {
    color: rgba(232, 232, 236, 0.58);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    width: 260px;
    height: 100vh;
    padding: 22px;
    background: var(--surface-strong);
    color: #ffffff;
}

.brand,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 800;
}

.brand strong,
.auth-brand h1 {
    display: block;
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
}

.brand small,
.eyebrow {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar .brand small {
    color: #b8b8ae;
}

.nav-list {
    display: grid;
    gap: 6px;
    margin-top: 36px;
}

.nav-link {
    display: block;
    padding: 11px 12px;
    border-radius: 8px;
    color: #ecece7;
    text-decoration: none;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.disabled {
    color: #8f8f86;
    cursor: default;
}

.main-panel {
    flex: 1;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 245, 241, 0.9);
}

.topbar h1,
.toolbar h2,
.section-heading h2 {
    margin: 0;
    font-size: 24px;
}

.content-stack {
    display: grid;
    gap: 22px;
    padding: 30px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.button {
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
}

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

.button-primary:hover {
    background: var(--accent-dark);
}

.button-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

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

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

.metric-card,
.work-panel,
.auth-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.metric-card span {
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    font-size: 34px;
}

.metric-critical {
    border-top: 4px solid var(--red);
}

.metric-warning {
    border-top: 4px solid var(--yellow);
}

.metric-muted {
    border-top: 4px solid var(--muted);
}

.metric-info {
    border-top: 4px solid var(--blue);
}

.metric-green {
    border-top: 4px solid var(--green);
}

.work-panel {
    display: grid;
    gap: 22px;
    padding: 22px;
}

.empty-state {
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
}

.empty-state strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    margin: 0;
}

.flash-message {
    margin: 18px 30px 0;
    padding: 12px 14px;
    border: 1px solid #b9dccd;
    border-radius: 8px;
    background: #eef9f4;
    color: var(--green);
    font-weight: 700;
}

.search-bar {
    display: flex;
    align-items: end;
    flex: 1;
    gap: 10px;
}

.compact-field {
    flex: 1;
    min-width: 260px;
}

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

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

.field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    resize: vertical;
}

.field textarea:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(231, 63, 45, 0.14);
}

.field select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
}

.field-error {
    color: var(--red);
}

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

.switch-row {
    display: flex;
    align-items: center;
    min-height: 48px;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbf8;
    font-weight: 700;
}

.switch-row input {
    width: 18px;
    height: 18px;
}

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

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

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

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

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.text-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    color: var(--accent-dark);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.status-green {
    background: #e7f6ef;
    color: var(--green);
}

.status-muted {
    background: #efefea;
    color: var(--muted);
}

.status-info {
    background: #e8f1f8;
    color: var(--blue);
}

.status-warning {
    background: #fff5d8;
    color: var(--yellow);
}

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

.summary-item {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbf8;
}

.summary-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.summary-item strong {
    font-size: 21px;
}

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

.task-card {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 170px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbf8;
}

.task-critical {
    border-top: 4px solid var(--red);
}

.task-warning {
    border-top: 4px solid var(--yellow);
}

.task-info {
    border-top: 4px solid var(--blue);
}

.task-muted {
    border-top: 4px solid var(--muted);
}

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

.task-header h3 {
    margin: 0;
    font-size: 17px;
}

.task-header span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    border-radius: 8px;
    background: var(--surface-strong);
    color: #ffffff;
    font-weight: 800;
}

.task-list {
    display: grid;
    gap: 8px;
}

.task-item {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.task-item:hover {
    border-color: var(--accent);
}

.task-item small,
.task-empty {
    color: var(--muted);
}

.task-empty {
    margin: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.detail-list {
    display: grid;
    gap: 16px;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 5px;
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    line-height: 1.55;
}

.status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.compact-status {
    max-width: 190px;
}

.status-note {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.button-full {
    width: 100%;
}

.bulk-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) minmax(140px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.inline-pricing-form {
    display: grid;
    grid-template-columns: 62px 92px 92px 70px auto;
    gap: 6px;
    min-width: 390px;
}

.inline-pricing-form input {
    min-height: 34px;
    width: 100%;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.mini-button,
.text-button {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
}

.mini-button {
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.stacked-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

.pay-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pay-form input {
    width: 96px;
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.mobile-card-list {
    display: none;
}

.month-tabs {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 8px 0 10px;
}

.month-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 0 26px;
    border-radius: 999px;
    background: #e7e7e4;
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.month-tab.active {
    background: #111111;
    color: #ffffff;
}

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

.cycle-summary-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.cycle-summary-card span,
.cycle-summary-card small {
    color: var(--muted);
    font-weight: 800;
}

.cycle-summary-card span {
    font-size: 12px;
    text-transform: uppercase;
}

.cycle-summary-card strong {
    font-size: 28px;
}

.compact-panel {
    padding: 16px;
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cycles-work-table {
    min-width: 980px;
}

.cycles-work-table .paid-row td,
.mobile-cycle-card.paid-row {
    background: #edf8f0;
}

.row-checkbox {
    width: 18px;
    height: 18px;
}

.cell-subtext {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.table-input {
    width: 108px;
    min-height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
}

.short-input {
    width: 76px;
}

.paid-toggle-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font-weight: 800;
}

.paid-toggle-button.is-paid {
    border-color: #b9dccd;
    background: #dff3e8;
    color: var(--green);
}

.compact-pay-form {
    display: inline-flex;
}

.resend-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.resend-form select {
    max-width: 118px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.template-list {
    display: grid;
    gap: 12px;
}

.template-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) 130px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbf8;
}

.template-row > span:first-child {
    font-weight: 800;
    text-transform: capitalize;
}

.template-row input[type="text"] {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.compact-switch {
    min-height: 40px;
}

.auth-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 22px;
}

.auth-panel {
    width: min(100%, 430px);
    padding: 28px;
}

.auth-brand {
    margin-bottom: 26px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
}

.field input:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(231, 63, 45, 0.14);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.alert {
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
}

.alert-error {
    background: #fff0ed;
    color: var(--red);
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.icon-button span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
}

.mobile-only {
    display: none;
}

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

    .dark-dashboard {
        padding: 20px;
    }

    .dark-hero,
    .dark-card-header {
        flex-direction: column;
    }

    .dark-kpi-grid,
    .dark-analytics-grid,
    .dark-task-grid {
        grid-template-columns: 1fr;
    }

    .dark-kpi-card {
        min-height: 138px;
    }

    .dark-kpi-card strong {
        font-size: 40px;
    }

    .sidebar {
        position: fixed;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform 160ms ease;
    }

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

    .mobile-only {
        display: inline-grid;
    }

    .topbar,
    .toolbar {
        align-items: flex-start;
    }

    .toolbar,
    .topbar {
        flex-direction: column;
    }

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

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

    .month-tab {
        min-height: 48px;
        padding: 0 20px;
        font-size: 18px;
    }

    .table-wrap {
        display: none;
    }

    .mobile-card-list {
        display: grid;
        gap: 14px;
    }

    .mobile-cycle-card,
    .mobile-client-card {
        display: grid;
        gap: 14px;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #ffffff;
        box-shadow: var(--shadow);
    }

    .mobile-cycle-card.paid-row {
        border-color: #b9dccd;
    }

    .mobile-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
    }

    .mobile-card-header h3 {
        margin: 3px 0 0;
        font-size: 18px;
    }

    .mobile-card-header strong {
        white-space: nowrap;
        font-size: 18px;
    }

    .mobile-card-meta {
        display: grid;
        gap: 5px;
        color: var(--muted);
        font-size: 14px;
    }

    .mobile-pricing-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fbfbf8;
    }

    .mobile-pricing-form label {
        display: grid;
        gap: 5px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .mobile-pricing-form input {
        width: 100%;
        min-height: 38px;
        padding: 0 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #ffffff;
        color: var(--text);
    }

    .mobile-pricing-form .button {
        grid-column: 1 / -1;
    }

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

    .mobile-actions form,
    .mobile-actions .button {
        width: 100%;
    }

    .mobile-actions .pay-form {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .mobile-actions .pay-form input {
        width: 100%;
        min-height: 40px;
    }

    .search-bar,
    .detail-grid,
    .summary-grid,
    .task-grid,
    .template-row,
    .bulk-form,
    .switch-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        display: grid;
        width: 100%;
    }

    .compact-field {
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .content-stack,
    .topbar {
        padding: 18px;
    }

    .dark-dashboard {
        padding: 16px;
    }

    .dark-hero h2 {
        font-size: 28px;
    }

    .chart-row {
        grid-template-columns: 78px minmax(0, 1fr) 28px;
        gap: 8px;
        font-size: 12px;
    }

    .metric-grid,
    .cycle-summary-grid,
    .toolbar-actions {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .metric-card {
        min-height: 120px;
    }

    .metric-card strong {
        font-size: 28px;
    }

    .toolbar-actions,
    .button {
        width: 100%;
    }

    .mobile-actions {
        grid-template-columns: 1fr;
    }

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

/* Premium dark theme applied globally across MONO-YEAR. */
:root {
    --bg: #0b0b0d;
    --surface: #141418;
    --surface-strong: #101014;
    --text: #e8e8ec;
    --muted: rgba(232, 232, 236, 0.58);
    --line: rgba(255, 255, 255, 0.08);
    --accent: #a78bfa;
    --accent-dark: #8b6ff0;
    --green: #3be374;
    --yellow: #a78bfa;
    --red: #ff4d4f;
    --blue: #a78bfa;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

body {
    background:
        radial-gradient(circle at 18% 12%, rgba(167, 139, 250, 0.14), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(59, 227, 116, 0.07), transparent 22%),
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        #0b0b0d;
    background-size: auto, auto, 42px 42px, 42px 42px, auto;
    color: var(--text);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 72%);
}

.sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 13, 16, 0.92);
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(18px);
}

.main-panel,
.topbar {
    background: transparent;
}

.topbar {
    border-bottom: 1px solid var(--line);
}

.topbar h1,
.toolbar h2,
.section-heading h2,
.auth-brand h1,
.mobile-card-header h3,
.task-header h3 {
    color: #f3f3f5;
}

.brand-mark {
    background: linear-gradient(135deg, #a78bfa, rgba(59, 227, 116, 0.78));
    box-shadow: 0 0 28px rgba(167, 139, 250, 0.22);
}

.nav-link {
    border: 1px solid transparent;
    color: rgba(232, 232, 236, 0.72);
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link.active,
.nav-link:hover {
    border-color: rgba(167, 139, 250, 0.22);
    background: rgba(167, 139, 250, 0.1);
    color: #f3f3f5;
    transform: translateX(2px);
}

.nav-link.disabled {
    color: rgba(232, 232, 236, 0.32);
}

.button,
.dark-button,
.paid-toggle-button,
.mini-button,
.text-button,
.month-tab,
.task-item,
.mobile-cycle-card,
.mobile-client-card,
.metric-card,
.work-panel,
.auth-panel,
.task-card,
.summary-item,
.template-row,
.cycle-summary-card {
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.button:hover,
.paid-toggle-button:hover,
.mini-button:hover,
.task-item:hover,
.mobile-cycle-card:hover,
.mobile-client-card:hover,
.metric-card:hover,
.work-panel:hover,
.auth-panel:hover,
.task-card:hover,
.summary-item:hover,
.template-row:hover,
.cycle-summary-card:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.24);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.button-primary {
    border-color: rgba(167, 139, 250, 0.45);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.96), rgba(59, 227, 116, 0.2));
    color: #ffffff;
}

.button-primary:hover {
    background: linear-gradient(135deg, rgba(139, 111, 240, 0.98), rgba(59, 227, 116, 0.24));
}

.button-secondary,
.mini-button,
.paid-toggle-button {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.045);
    color: #f3f3f5;
}

.button-danger {
    border-color: rgba(255, 77, 79, 0.34);
    background: rgba(255, 77, 79, 0.12);
    color: #ff8a8b;
}

.work-panel,
.auth-panel,
.metric-card,
.task-card,
.summary-item,
.template-row,
.mobile-cycle-card,
.mobile-client-card,
.cycle-summary-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(20, 20, 24, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.metric-card {
    border-top-width: 1px;
}

.metric-card span,
.metric-card small,
.cycle-summary-card span,
.cycle-summary-card small,
.summary-item span,
.field,
.task-empty,
.empty-state,
.mobile-card-meta,
.detail-list dt,
.cell-subtext,
.status-note,
.eyebrow,
.brand small {
    color: var(--muted);
}

.metric-card strong,
.cycle-summary-card strong,
.summary-item strong,
.detail-list dd,
.empty-state strong,
.task-item strong,
.data-table strong {
    color: #f4f4f6;
}

.auth-screen {
    background: transparent;
}

.field input,
.field textarea,
.field select,
.template-row input[type="text"],
.inline-pricing-form input,
.mobile-pricing-form input,
.table-input,
.pay-form input,
.resend-form select {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.045);
    color: #f3f3f5;
}

.field input::placeholder,
.field textarea::placeholder {
    color: rgba(232, 232, 236, 0.34);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.table-input:focus {
    border-color: rgba(167, 139, 250, 0.52);
    outline: 3px solid rgba(167, 139, 250, 0.14);
}

.switch-row,
.mobile-pricing-form {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.035);
    color: #f3f3f5;
}

.data-table th,
.data-table td {
    border-bottom-color: var(--line);
}

.data-table th {
    color: rgba(232, 232, 236, 0.48);
}

.data-table tr:hover td {
    background: rgba(167, 139, 250, 0.045);
}

.table-wrap {
    border-radius: 18px;
}

.text-link,
.text-button {
    color: #c4b5fd;
}

.text-link:hover,
.text-button:hover {
    color: #ddd6fe;
}

.status-pill {
    border: 1px solid transparent;
}

.status-green,
.paid-toggle-button.is-paid {
    border-color: rgba(59, 227, 116, 0.24);
    background: rgba(59, 227, 116, 0.12);
    color: #3be374;
}

.status-warning {
    border-color: rgba(167, 139, 250, 0.22);
    background: rgba(167, 139, 250, 0.11);
    color: #c4b5fd;
}

.status-muted {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.055);
    color: rgba(232, 232, 236, 0.58);
}

.status-info {
    border-color: rgba(167, 139, 250, 0.24);
    background: rgba(167, 139, 250, 0.11);
    color: #c4b5fd;
}

.status-red {
    border-color: rgba(255, 77, 79, 0.28);
    background: rgba(255, 77, 79, 0.12);
    color: #ff8a8b;
}

.alert-error {
    border: 1px solid rgba(255, 77, 79, 0.26);
    background: rgba(255, 77, 79, 0.1);
    color: #ff8a8b;
}

.flash-message {
    border-color: rgba(59, 227, 116, 0.24);
    background: rgba(59, 227, 116, 0.1);
    color: #3be374;
}

.month-tab {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(232, 232, 236, 0.76);
}

.month-tab.active {
    background: #f3f3f5;
    color: #0b0b0d;
    box-shadow: 0 0 28px rgba(167, 139, 250, 0.22);
}

.cycles-work-table .paid-row td,
.mobile-cycle-card.paid-row {
    background: rgba(59, 227, 116, 0.1);
}

.cycles-work-table .cancelled-row td,
.data-table .cancelled-row td,
.mobile-cycle-card.cancelled-row,
.mobile-client-card.cancelled-row {
    background: rgba(255, 77, 79, 0.1);
}

.move-cycle-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.move-cycle-form input,
.move-cycle-form select {
    min-height: 34px;
    width: 78px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: #f3f3f5;
}

.task-item,
.mobile-card-list .task-item {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.035);
    color: inherit;
}

.task-header span {
    background: rgba(167, 139, 250, 0.14);
    color: #ddd6fe;
}

.icon-button {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.045);
}

.icon-button span {
    background: #f3f3f5;
}
