:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-strong: #eef2ff;
    --text: #111827;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --accent: #635bff;
    --accent-dark: #4f46e5;
    --accent-soft: rgba(99, 91, 255, 0.12);
    --teal: #14b8a6;
    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.14);
    --warning: #f4b740;
    --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

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

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    padding: 22px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    margin-bottom: 22px;
    border-radius: 10px;
    padding: 8px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    color: #ffffff;
    font-weight: 800;
}

.brand strong,
.brand small,
.user-badge strong,
.user-badge small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav-label {
    margin: 18px 10px 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.nav a {
    display: flex;
    align-items: center;
    min-height: 40px;
    border-radius: 9px;
    color: #475569;
    padding: 9px 11px;
    font-size: 14px;
    font-weight: 700;
}

.nav a:hover,
.nav a.active {
    background: #eef2ff;
    color: var(--accent-dark);
}

.main {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    padding: clamp(16px, 2.1vw, 30px);
}

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

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.16;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    display: grid;
    gap: 1px;
    min-width: 190px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    padding: 9px 12px;
}

.user-badge strong {
    font-size: 13px;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    padding: 0 15px;
    cursor: pointer;
    font-weight: 800;
}

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

.button.primary {
    width: 100%;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #ffffff;
}

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

.button.ghost {
    background: #ffffff;
}

.button.compact {
    width: auto;
    min-height: 38px;
}

.button.danger {
    width: 100%;
    border-color: #f4c7c3;
    background: var(--danger-soft);
    color: var(--danger);
}

.button.warning {
    border-color: rgba(244, 183, 64, 0.48);
    background: rgba(244, 183, 64, 0.14);
    color: #b7791f;
}

.button.danger.compact,
.button.warning.compact {
    width: auto;
}

.alert,
.notice {
    margin-bottom: 16px;
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 700;
}

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

.notice {
    border: 1px solid #b8dfd8;
    background: rgba(35, 199, 165, 0.12);
    color: #0f766e;
}

.auth-panel {
    display: grid;
    max-width: 440px;
}

.form-card,
.metric-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.form-card,
.form-panel {
    display: grid;
    gap: 16px;
}

.form-card,
.panel {
    padding: 20px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #ffffff;
    color: var(--text);
    padding: 10px 11px;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(115, 103, 240, 0.2);
}

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

.checkbox input {
    width: 16px;
    height: 16px;
}

.form-link,
.actions a,
.stack-list a,
.service-group a {
    color: #b9b3ff;
    font-weight: 800;
}

.link-button {
    border: 0;
    background: transparent;
    color: #b9b3ff;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.form-link {
    text-align: center;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metric-card {
    display: grid;
    gap: 5px;
    min-height: 122px;
    padding: 18px;
}

.metric-card span,
.metric-card small,
.detail-list dt {
    color: var(--muted);
}

.metric-card span {
    font-size: 13px;
    font-weight: 800;
}

.metric-card strong {
    font-size: 25px;
    line-height: 1.15;
}

.metric-card-accent {
    border-color: rgba(35, 199, 165, 0.45);
    background:
        linear-gradient(135deg, rgba(35, 199, 165, 0.12), rgba(115, 103, 240, 0.1)),
        #ffffff;
}

.work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
    gap: 18px;
}

.panel-heading h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.panel-heading.split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

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

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #f8fafc;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    white-space: nowrap;
}

.platform-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 360px;
}

.platform-actions form {
    margin: 0;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #ffffff;
    color: #4f46e5;
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.table-action:hover {
    border-color: #a5b4fc;
    background: #eef2ff;
}

.table-action.danger {
    color: #be123c;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #d8d5ff;
    font-size: 12px;
    font-weight: 800;
    padding: 0 9px;
}

.stack-list,
.service-grid,
.appointment-list {
    display: grid;
    gap: 10px;
}

.stack-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
}

.stack-list small,
.price-block small,
.appointment-item small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.price-block {
    min-width: 110px;
    text-align: right;
    font-weight: 800;
}

.service-group h3 {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.platform-service-catalog {
    display: grid;
    gap: 18px;
}

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

.catalog-summary article {
    display: grid;
    gap: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
    padding: 14px 16px;
}

.catalog-summary span {
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.catalog-summary strong {
    color: #0f172a;
    font-size: 22px;
    font-weight: 950;
    line-height: 1;
}

.platform-service-sections {
    display: grid;
    gap: 18px;
}

.platform-service-section {
    display: grid;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
}

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

.platform-service-section h3 {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.platform-service-section header span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 950;
}

.platform-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.platform-service-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 12px;
    min-height: 150px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.platform-service-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 16px 32px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.platform-service-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

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

.platform-service-name strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 16px;
    font-weight: 950;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.platform-service-name small {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.platform-service-card p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.platform-service-price {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.platform-service-price strong {
    color: #0f172a;
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
}

.platform-service-price span {
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 950;
}

@media (max-width: 900px) {
    .catalog-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .catalog-summary,
    .platform-service-grid {
        grid-template-columns: 1fr;
    }
}

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

.inline-edit {
    display: grid;
    grid-template-columns: minmax(170px, 1.4fr) repeat(5, minmax(110px, 1fr)) minmax(170px, 1.2fr) auto;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 12px;
}

.inline-edit label {
    font-size: 12px;
}

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

.align-end {
    align-self: end;
    min-height: 42px;
}

.date-filter {
    display: flex;
    align-items: end;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.appointment-item {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 12px;
}

.nested-panel {
    box-shadow: none;
}

.invoice-line-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(100px, 140px));
    gap: 12px;
    margin-bottom: 12px;
}

.totals {
    display: grid;
    gap: 8px;
    max-width: 320px;
    margin: 18px 0 0 auto;
}

.totals div,
.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.totals dd,
.detail-list dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

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

.module-list a {
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 14px;
    font-weight: 800;
}

.module-list a:hover,
.appointment-item:hover,
.stack-list div:hover {
    border-color: var(--accent);
}

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

.hero-panel {
    background:
        linear-gradient(135deg, rgba(115, 103, 240, 0.2), rgba(35, 199, 165, 0.08)),
        #ffffff;
}

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

.platform-dashboard-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
}

.platform-visual-grid {
    grid-template-columns: minmax(250px, 0.7fr) minmax(280px, 1fr);
}

.chart-card {
    display: grid;
    gap: 16px;
    min-height: 170px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 16px;
}

.chart-card-hero {
    justify-items: center;
}

.chart-header,
.progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chart-header span,
.progress-row span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.mini-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(18px, 1fr));
    align-items: end;
    gap: 9px;
    min-height: 102px;
}

.mini-bars span {
    min-height: 22px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, var(--teal), var(--accent));
    box-shadow: 0 10px 24px rgba(35, 199, 165, 0.12);
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #9f98ff);
}

.progress-track.teal span {
    background: linear-gradient(90deg, var(--teal), #66efd4);
}

.progress-track.rose span {
    background: linear-gradient(90deg, #fb7185, #f4b740);
}

.performance-panel {
    align-content: start;
}

.performance-list {
    display: grid;
    gap: 10px;
}

.performance-summary {
    margin-top: 16px;
}

.donut-chart {
    display: grid;
    width: 154px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, #ffffff 0 58%, transparent 59%),
        conic-gradient(var(--teal) 0 var(--active), var(--danger) var(--active) calc(var(--active) + var(--blocked)), #e2e8f0 0);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.donut-chart span {
    font-size: 24px;
    font-weight: 900;
}

.chart-legend,
.status-grid,
.control-list,
.platform-insight-grid,
.ranked-bars {
    display: grid;
    gap: 10px;
}

.chart-legend {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-legend span,
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: 999px;
}

.legend-dot.teal {
    background: var(--teal);
}

.legend-dot.danger {
    background: var(--danger);
}

.status-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.status-row {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fafc;
    padding: 8px 10px;
}

.status-row strong {
    color: var(--text);
}

.platform-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.chart-span {
    grid-column: 1 / -1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
    gap: 18px;
    margin-bottom: 18px;
}

.chart-panel-large {
    min-height: 360px;
}

.empty-state {
    display: grid;
    min-height: 220px;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    color: var(--muted);
    font-weight: 800;
}

.real-chart {
    min-width: 0;
    overflow: hidden;
}

.real-chart svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 240px;
}

.chart-grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.chart-axis-label,
.chart-x-label,
.chart-bar-value {
    fill: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.chart-x-label,
.chart-bar-value {
    text-anchor: middle;
}

.chart-area {
    fill: var(--chart-fill, rgba(99, 91, 255, 0.1));
}

.chart-line {
    fill: none;
    stroke: var(--chart-color, var(--accent));
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-dot {
    fill: #ffffff;
    stroke: var(--chart-color, var(--accent));
    stroke-width: 4;
}

.chart-bar {
    fill: url("#chartBarGradient");
}

.real-chart svg .chart-bar {
    fill: var(--chart-color, var(--accent));
}

.ranked-bars div {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
}

.ranked-bars span,
.ranked-bars strong {
    position: relative;
    z-index: 1;
}

.ranked-bars span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.ranked-bars i {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 4px;
    background: linear-gradient(90deg, rgba(35, 199, 165, 0.18), rgba(115, 103, 240, 0.1));
}

.control-list a {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
}

.control-list a:hover {
    border-color: var(--accent);
}

.control-list small {
    color: var(--muted);
}

.account-panel {
    margin-top: 16px;
}

.calendar-board {
    display: grid;
    grid-template-columns: clamp(44px, 5vw, 66px) minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
}

.calendar-shell {
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    color: #111827;
    padding: clamp(10px, 1.4vw, 16px);
    box-shadow: var(--shadow);
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.calendar-toolbar h2 {
    margin: 0;
    text-align: center;
}

.calendar-nav,
.segmented-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.segmented-control {
    justify-content: flex-end;
}

.segmented-control a,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #ffffff;
    color: #253044;
    padding: 0 14px;
    font-weight: 800;
}

.icon-button {
    width: 42px;
    padding: 0;
    font-size: 22px;
}

.segmented-control a.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.calendar-axis,
.calendar-column {
    min-width: 0;
}

.calendar-axis-head,
.calendar-column-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    min-height: 62px;
    align-content: center;
    border: 1px solid #dde6f2;
    border-radius: 10px;
    background: #f1f5f9;
    padding: 12px;
}

.calendar-axis-head {
    color: #64748b;
    font-weight: 800;
    text-align: center;
}

.calendar-axis-slot {
    display: grid;
    min-height: clamp(64px, 7.2vh, 88px);
    place-items: start center;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    padding-top: 12px;
}

.calendar-columns {
    display: grid;
    grid-template-columns: repeat(var(--calendar-columns), minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.calendar-column {
    display: grid;
    gap: 8px;
}

.calendar-column-head strong,
.calendar-column-head span {
    display: block;
}

.calendar-column-head span {
    color: #64748b;
    font-size: 12px;
}

.calendar-slot {
    display: grid;
    gap: 8px;
    min-height: clamp(64px, 7.2vh, 88px);
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
    cursor: copy;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.calendar-slot.drag-over {
    border-color: var(--teal);
    background: rgba(35, 199, 165, 0.12);
}

.calendar-slot.is-closed {
    border-style: dashed;
    background: repeating-linear-gradient(
        135deg,
        #f1f5f9,
        #f1f5f9 8px,
        #e8eef6 8px,
        #e8eef6 16px
    );
    cursor: not-allowed;
}

.calendar-column.is-today .calendar-slot.is-closed {
    background: repeating-linear-gradient(
        135deg,
        #e7ecfb,
        #e7ecfb 8px,
        #dfe6f7 8px,
        #dfe6f7 16px
    );
}

.calendar-week .calendar-column-head {
    min-height: 72px;
}

.calendar-day .calendar-columns {
    grid-template-columns: repeat(var(--calendar-columns), minmax(170px, 1fr));
    overflow-x: auto;
}

.calendar-day .calendar-slot {
    min-height: 92px;
}

.calendar-column.is-today .calendar-column-head,
.calendar-column.is-today .calendar-slot {
    background: #eef2ff;
}

.calendar-event {
    display: grid;
    gap: 3px;
    width: 100%;
    min-height: 58px;
    border: 1px solid rgba(115, 103, 240, 0.55);
    border-left: 4px solid var(--teal);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.24), rgba(35, 199, 165, 0.12));
    color: #111827;
    padding: 8px;
    text-align: left;
    cursor: grab;
}

.calendar-event:active {
    cursor: grabbing;
}

.calendar-event span,
.calendar-event small,
.slot-empty {
    color: #64748b;
    font-size: 12px;
}

.calendar-event small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event strong {
    overflow-wrap: anywhere;
}

.slot-empty {
    align-self: center;
    justify-self: center;
}

.appointment-popover[hidden] {
    display: none;
}

.appointment-popover {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.56);
    padding: 18px;
}

.popover-panel {
    position: relative;
    display: grid;
    gap: 16px;
    width: min(460px, 100%);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: 22px;
}

.popover-panel h2 {
    margin: 0;
}

.popover-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.pricing-grid,
.subscription-builder,
.module-check-grid {
    display: grid;
    gap: 14px;
}

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

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

.pricing-card,
.builder-card,
.module-check-card {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 16px;
}

.pricing-head {
    display: grid;
    gap: 2px;
}

.pricing-head span {
    color: #b9b3ff;
    font-weight: 900;
}

.pricing-head strong,
.builder-card > strong {
    font-size: 25px;
}

.pricing-head small,
.builder-card small,
.feature-list span,
.addon-list small,
.module-check-card em {
    color: var(--muted);
}

.module-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.module-status-grid article {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
}

.module-status-grid article.is-enabled {
    border-color: rgba(20, 184, 166, 0.35);
    background: #f0fdfa;
}

.module-status-grid article.is-locked {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.module-status-grid span,
.module-status-grid small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.feature-list,
.addon-list {
    display: grid;
    gap: 8px;
}

.feature-list span {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(115, 103, 240, 0.12);
    padding: 8px 10px;
    font-weight: 800;
}

.addon-list div,
.pricing-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.pricing-total {
    border-bottom: 0;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    padding-bottom: 0;
}

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

.module-check-card {
    grid-template-columns: 18px 1fr;
    align-items: start;
}

.module-check-card input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
}

.module-check-card.is-enabled {
    border-color: rgba(35, 199, 165, 0.45);
}

.module-check-card.is-blocked {
    opacity: 0.76;
}

.module-check-card span,
.module-check-card small,
.module-check-card em {
    display: block;
}

.module-check-card em {
    font-style: normal;
    font-weight: 800;
}

.availability-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.availability-strip a {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
}

.availability-strip a:hover {
    border-color: var(--teal);
}

.availability-strip span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.working-hours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.working-hour-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
}

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

.working-hour-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.tablet-register-shell {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1.28fr);
    gap: 20px;
    align-items: start;
}

.tablet-register-intro,
.tablet-register-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: clamp(18px, 3vw, 30px);
}

.tablet-register-intro h2 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 46px);
}

.tablet-register-intro p {
    color: var(--muted);
}

.tablet-register-card {
    display: grid;
    gap: 18px;
}

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

.consent-card {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
}

.consent-card input {
    width: 20px;
    height: 20px;
    margin-top: 3px;
}

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

.consent-card small {
    color: var(--muted);
}

.calendar-focus-shell {
    display: grid;
    gap: 12px;
    min-height: calc(100vh - 120px);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: clamp(12px, 1.6vw, 18px);
}

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

.subscription-console {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
    gap: 14px;
}

.settings-split {
    display: grid;
    grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
    gap: 14px;
}

.color-preset-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.color-preset {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 9px 10px;
    color: var(--text);
    font-weight: 850;
    text-align: left;
}

.color-preset span {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--preset-color);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65), 0 0 0 1px rgba(15, 23, 42, 0.12);
}

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

.calendar-focus-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
}

.calendar-focus-toolbar h2 {
    margin: 0;
    font-size: clamp(24px, 2.2vw, 34px);
}

.calendar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.calendar-preview-toggle {
    display: grid;
    min-width: 136px;
    gap: 4px;
    font-size: 11px;
}

.calendar-preview-toggle select {
    min-height: 38px;
    padding-block: 8px;
}

.calendar-compact-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr)) auto auto;
    gap: 10px;
    align-items: end;
}

.calendar-compact-filters label {
    min-width: 0;
}

.calendar-filter-drawer {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc;
}

.calendar-filter-drawer summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 12px 14px;
    color: #334155;
    font-weight: 950;
    cursor: pointer;
    list-style: none;
}

.calendar-filter-drawer summary::-webkit-details-marker {
    display: none;
}

.calendar-filter-drawer summary strong {
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    padding: 5px 10px;
    font-size: 12px;
}

.calendar-filter-drawer .calendar-compact-filters {
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 18px 18px;
    background: transparent;
    padding: 14px;
}

.room-occupancy-board {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    padding: 14px;
}

.room-occupancy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.room-occupancy-grid article {
    display: grid;
    gap: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
}

.room-occupancy-grid small {
    color: var(--muted);
    font-weight: 800;
}

.occupancy-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
    align-items: end;
    gap: 7px;
    min-height: 104px;
    padding-top: 10px;
}

.occupancy-bars div {
    display: grid;
    grid-template-rows: minmax(68px, 1fr) auto;
    gap: 5px;
    align-items: end;
    min-width: 0;
}

.occupancy-bars span {
    display: block;
    width: 100%;
    border-radius: 999px 999px 6px 6px;
    background: linear-gradient(180deg, var(--accent), var(--teal));
    min-height: 8px;
}

.occupancy-bars em {
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    font-style: normal;
    font-weight: 850;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pro-calendar {
    --minute-height: clamp(0.62px, 0.085vh, 0.9px);
    display: grid;
    grid-template-columns: clamp(54px, 5vw, 72px) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
    color: #111827;
    padding: 10px;
}

.pro-calendar-axis,
.pro-calendar-column {
    display: grid;
    grid-template-rows: 76px minmax(0, 1fr);
    min-width: 0;
}

.pro-calendar-corner,
.pro-calendar-column-head {
    display: grid;
    align-content: center;
    min-height: 76px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #f1f5f9;
    padding: 10px;
}

.pro-calendar-column.is-today .pro-calendar-column-head {
    background: #eef2ff;
}

.pro-calendar-column-head strong,
.pro-calendar-column-head span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pro-calendar-column-head span {
    color: #55708f;
    font-size: 12px;
}

.calendar-capacity-pill {
    justify-self: start;
    overflow: hidden;
    max-width: 100%;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-capacity-pill.is-open {
    background: #ecfdf5;
    color: #047857;
}

.calendar-capacity-pill.is-full {
    background: #fff1f2;
    color: #be123c;
}

.pro-calendar-axis-body,
.pro-calendar-lane {
    position: relative;
    height: calc(var(--timeline-minutes) * var(--minute-height));
    min-height: clamp(410px, 58vh, 640px);
}

.pro-calendar-axis-body span {
    position: absolute;
    top: calc(var(--label-start) * var(--minute-height));
    left: 0;
    color: #506580;
    font-size: 12px;
    font-weight: 900;
}

.pro-calendar-columns {
    display: grid;
    grid-template-columns: repeat(var(--calendar-columns), minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.pro-calendar-lane {
    overflow: hidden;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(60 * var(--minute-height) - 1px),
            #dbe4f0 calc(60 * var(--minute-height) - 1px),
            #dbe4f0 calc(60 * var(--minute-height))
        ),
        #ffffff;
    cursor: crosshair;
}

.pro-calendar-lane.drag-over {
    outline: 2px solid var(--teal);
    outline-offset: -2px;
}

.pro-calendar-lane.drag-invalid {
    outline: 2px solid var(--danger);
    outline-offset: -2px;
}

.pro-calendar.is-dragging .pro-calendar-lane {
    cursor: grabbing;
}

.calendar-drop-guide {
    position: absolute;
    inset-inline: 6px;
    top: calc(var(--guide-start) * var(--minute-height));
    z-index: 4;
    display: grid;
    align-content: start;
    min-height: 36px;
    height: max(36px, calc(var(--guide-duration) * var(--minute-height)));
    border: 2px dashed rgba(20, 184, 166, 0.9);
    border-radius: 10px;
    background: rgba(240, 253, 250, 0.92);
    color: #0f766e;
    padding: 7px 9px;
    pointer-events: none;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.calendar-drop-guide[data-valid="false"] {
    border-color: rgba(251, 113, 133, 0.9);
    background: rgba(255, 241, 242, 0.94);
    color: #be123c;
}

.calendar-drop-guide strong,
.calendar-drop-guide span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-drop-guide strong {
    font-size: 12px;
    font-weight: 950;
}

.calendar-drop-guide span {
    font-size: 11px;
    font-weight: 850;
}

.calendar-closed-block {
    position: absolute;
    inset-inline: 0;
    top: calc(var(--closed-start) * var(--minute-height));
    height: calc(var(--closed-duration) * var(--minute-height));
    z-index: 1;
    display: grid;
    place-items: center;
    background: repeating-linear-gradient(
        135deg,
        rgba(226, 232, 240, 0.78),
        rgba(226, 232, 240, 0.78) 8px,
        rgba(241, 245, 249, 0.78) 8px,
        rgba(241, 245, 249, 0.78) 16px
    );
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    pointer-events: none;
}

.pro-calendar .calendar-event {
    position: absolute;
    left: 6px;
    right: 6px;
    top: calc(var(--event-start) * var(--minute-height));
    z-index: 2;
    height: max(34px, calc(var(--event-duration) * var(--minute-height)));
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: start;
    gap: 1px 7px;
    border: 1px solid rgba(99, 91, 255, 0.24);
    border-left: 5px solid var(--event-color, var(--accent));
    border-radius: 9px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    padding: 7px 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.pro-calendar .calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
}

.pro-calendar .calendar-event.is-dragging {
    opacity: 0.45;
    transform: scale(0.98);
    cursor: grabbing;
}

.calendar-drag-ghost {
    width: 220px;
    max-width: 220px;
    border: 1px solid rgba(99, 91, 255, 0.45);
    border-left: 5px solid var(--teal);
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    padding: 9px 10px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
    opacity: 0.96;
}

.calendar-toast {
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: clamp(16px, 3vw, 32px);
    z-index: 60;
    max-width: min(360px, calc(100vw - 32px));
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    padding: 12px 14px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    font-size: 14px;
    font-weight: 850;
}

.calendar-toast[data-type="success"] {
    border-color: rgba(20, 184, 166, 0.35);
    background: #f0fdfa;
    color: #0f766e;
}

.calendar-toast[data-type="error"] {
    border-color: rgba(251, 113, 133, 0.35);
    background: #fff1f2;
    color: #be123c;
}

.calendar-toast[hidden] {
    display: none;
}

.pro-calendar .calendar-event strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 950;
}

.pro-calendar .calendar-event .event-time {
    grid-row: span 3;
    align-self: start;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 950;
}

.pro-calendar .calendar-event small {
    overflow: hidden;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-payment {
    position: absolute;
    right: 7px;
    bottom: 6px;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 950;
}

.event-payment.is-paid {
    background: #dcfce7;
    color: #15803d;
}

.event-payment.is-pending {
    background: #fff7ed;
    color: #c2410c;
}

.event-resize-handle {
    position: absolute;
    right: 10px;
    bottom: 4px;
    left: 10px;
    height: 10px;
    border-radius: 999px;
    cursor: ns-resize;
}

.event-resize-handle::after {
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    margin: 4px auto 0;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.38);
}

.calendar-event.is-resizing {
    opacity: 0.75;
    cursor: ns-resize;
}

.pro-calendar[data-preview-mode="compact"] .calendar-event {
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
}

.pro-calendar[data-preview-mode="compact"] .event-client,
.pro-calendar[data-preview-mode="compact"] .event-meta {
    display: none;
}

.pro-calendar[data-preview-mode="compact"] .event-time {
    font-size: 11px;
    font-weight: 900;
}

.pro-calendar[data-preview-mode="client"] .event-meta {
    display: none;
}

.pro-calendar[data-preview-mode="full"] .calendar-event {
    gap: 2px;
}

.event-meta {
    color: #475569;
}

.quick-appointment-panel[hidden] {
    display: none;
}

.quick-appointment-panel {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    justify-content: end;
    background: rgba(15, 23, 42, 0.32);
}

.quick-panel-card {
    position: relative;
    width: min(560px, 100vw);
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid var(--line-strong);
    background: #ffffff;
    padding: clamp(18px, 3vw, 28px);
    box-shadow: var(--shadow);
}

.quick-panel-card h2 {
    margin: 0 0 14px;
}

.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.service-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 16px;
}

.service-card-head {
    display: grid;
    gap: 5px;
}

.service-card-head strong {
    font-size: 20px;
}

.service-card-head small {
    color: var(--muted);
    font-weight: 900;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 14px;
    }

    .brand {
        margin-bottom: 10px;
    }

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

    .nav-label {
        grid-column: 1 / -1;
        margin-top: 10px;
    }

    .main {
        padding: 22px 16px;
    }

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

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

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

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

    .platform-dashboard-grid,
    .platform-visual-grid,
    .platform-insight-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .pricing-grid,
    .subscription-builder,
    .subscription-console,
    .settings-split,
    .module-check-grid {
        grid-template-columns: 1fr;
    }

    .tablet-register-shell {
        grid-template-columns: 1fr;
    }

    .calendar-focus-toolbar {
        grid-template-columns: 1fr;
    }

    .calendar-actions,
    .segmented-control {
        justify-content: flex-start;
    }

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

    .pro-calendar {
        overflow-x: auto;
    }

    .calendar-week .pro-calendar-columns {
        min-width: min(860px, calc(100vw - 106px));
    }
}

@media (max-width: 620px) {
    .nav,
    .metric-grid,
    .module-list,
    .form-grid,
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .user-menu,
    .date-filter {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .user-menu form,
    .user-menu .button,
    .user-badge {
        width: 100%;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        border: 1px solid var(--line);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 10px;
    }

    td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 0;
        padding: 7px 0;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 800;
    }

    .actions {
        justify-content: flex-start;
    }

    .actions::before {
        content: '';
    }

    .inline-edit,
    .invoice-line-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .impersonation-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-board {
        grid-template-columns: 46px minmax(0, 1fr);
        overflow-x: auto;
    }

    .calendar-week .calendar-columns {
        min-width: 760px;
    }

    .calendar-toolbar {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar h2 {
        text-align: left;
    }

    .segmented-control {
        justify-content: flex-start;
    }

    .calendar-axis-slot,
    .calendar-slot {
        min-height: 76px;
    }

    .calendar-compact-filters {
        grid-template-columns: 1fr;
    }

    .pro-calendar {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 7px;
    }

    .calendar-week .pro-calendar-columns {
        min-width: 680px;
    }

    .calendar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .platform-actions {
        min-width: 0;
    }

    .room-week-strip {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .room-analytics-grid-clean {
        grid-template-columns: 1fr;
    }

    .room-analytics-head {
        align-items: start;
    }

    .room-config-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .calendar-actions .button,
    .calendar-actions .segmented-control,
    .calendar-preview-toggle {
        width: 100%;
    }

    .segmented-control a {
        flex: 1;
    }

    .quick-panel-card {
        width: 100vw;
    }
}

/* Premium SaaS polish layer: pairs with Tailwind utilities in the Blade layout. */
html {
    background: #f5f7fb;
}

body {
    background:
        radial-gradient(circle at 82% 0%, rgba(20, 184, 166, 0.12), transparent 28rem),
        radial-gradient(circle at 18% 0%, rgba(99, 91, 255, 0.1), transparent 30rem),
        #f5f7fb;
    letter-spacing: 0;
}

.app-shell {
    background: transparent;
}

.sidebar {
    width: 17rem;
    backdrop-filter: blur(18px);
}

.brand {
    margin-bottom: 28px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 950;
}

.nav {
    gap: 6px;
}

.nav-label {
    margin: 22px 10px 7px;
    color: #94a3b8;
    letter-spacing: 0;
}

.nav a {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #475569;
    padding: 10px 13px;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav a:hover {
    border-color: #e0e7ff;
    background: #f8fafc;
    color: #4338ca;
    transform: translateX(2px);
}

.nav a.active {
    border-color: #c7d2fe;
    background: linear-gradient(135deg, #eef2ff, #f0fdfa);
    color: #4338ca;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.1);
}

.main {
    padding: clamp(18px, 2.2vw, 34px);
}

.topbar {
    margin-bottom: 22px;
}

.eyebrow {
    color: #64748b;
    letter-spacing: 0.04em;
}

.button,
.icon-button,
.segmented-control a {
    border-radius: 14px;
    letter-spacing: 0;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.button:hover,
.icon-button:hover,
.segmented-control a:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.button.primary,
.segmented-control a.active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #635bff, #4f46e5);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.18);
}

.button.ghost {
    color: #334155;
}

.panel,
.metric-card,
.form-card,
.chart-card,
.pricing-card,
.builder-card,
.module-check-card,
.service-card,
.working-hour-card,
.consent-card {
    border-color: #e2e8f0;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 36px rgba(15, 23, 42, 0.06);
}

.panel,
.form-card {
    padding: clamp(18px, 2vw, 26px);
}

.nested-panel {
    background: #f8fafc;
    box-shadow: none;
}

.metric-grid {
    gap: 16px;
}

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

.metric-card span,
.chart-header span,
.progress-row span,
th,
label,
.nav-label {
    text-transform: uppercase;
}

.metric-card strong {
    color: #0f172a;
    font-weight: 950;
}

.metric-card small,
.notes,
.detail-list dt,
.chart-header span,
.progress-row span {
    color: #64748b;
}

input,
textarea,
select {
    min-height: 44px;
    border-color: #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #94a3b8;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #635bff;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.14);
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th {
    color: #64748b;
    background: #f8fafc;
}

th:first-child {
    border-top-left-radius: 14px;
}

th:last-child {
    border-top-right-radius: 14px;
}

td,
th {
    border-bottom: 1px solid #e2e8f0;
}

tbody tr {
    transition: background 0.14s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

.badge {
    min-height: 26px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
}

.badge.danger,
.is-blocked .badge {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #be123c;
}

.is-enabled .badge {
    border-color: #99f6e4;
    background: #f0fdfa;
    color: #0f766e;
}

.module-list a,
.control-list a,
.stack-list div,
.availability-strip a,
.ranked-bars div,
.status-row {
    border-color: #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.module-list a:hover,
.control-list a:hover,
.stack-list div:hover,
.availability-strip a:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.08);
}

.real-chart {
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 8px;
}

.chart-grid-line {
    stroke: #e5e7eb;
}

.chart-line {
    stroke: #4f46e5;
}

.chart-area {
    fill: rgba(99, 91, 255, 0.12);
}

.chart-dot {
    fill: #ffffff;
    stroke: #4f46e5;
}

.real-chart svg .chart-bar {
    fill: #635bff;
}

.donut-chart {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 18px 34px rgba(20, 184, 166, 0.12);
}

.calendar-focus-shell {
    border-color: #e2e8f0;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
}

.calendar-compact-filters {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #f8fafc;
    padding: 14px;
}

.calendar-filter-drawer .calendar-compact-filters {
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 18px 18px;
    background: transparent;
}

.pro-calendar {
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.pro-calendar-corner,
.pro-calendar-column-head {
    border-color: #e2e8f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
}

.pro-calendar-lane {
    border-color: #e2e8f0;
    border-radius: 16px;
}

.pro-calendar .calendar-event {
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 91, 255, 0.16), rgba(20, 184, 166, 0.13));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.appointment-popover,
.quick-appointment-panel {
    backdrop-filter: blur(8px);
}

.popover-panel,
.quick-panel-card {
    border-color: #e2e8f0;
    background: #ffffff;
    color: #0f172a;
}

/* Focused premium pass: keep dashboards clean and move admin contract state to navigation. */
.nav a {
    justify-content: space-between;
    gap: 8px;
}

.nav a > span,
.nav-locked > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav a small {
    border-radius: 999px;
    background: #ecfeff;
    color: #0f766e;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 950;
}

.nav-locked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    border: 1px dashed #dbe4f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #94a3b8;
    padding: 9px 11px;
    font-size: 14px;
    font-weight: 850;
}

.nav-locked small {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #eef2ff;
    color: #64748b;
    font-size: 12px;
}

.calendar-focus-shell {
    min-height: auto;
    gap: 10px;
    padding: clamp(8px, 1vw, 14px);
}

.calendar-focus-toolbar {
    grid-template-columns: minmax(170px, 1fr) auto auto;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    padding: 10px 12px;
}

.calendar-focus-toolbar h2 {
    font-size: clamp(20px, 1.7vw, 26px);
    line-height: 1.15;
}

.calendar-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-inline-filters {
    grid-template-columns: repeat(5, minmax(104px, 1fr)) auto auto;
    padding: 10px;
    border-radius: 18px;
}

.calendar-inline-filters label {
    font-size: 10px;
}

.calendar-inline-filters input,
.calendar-inline-filters select {
    min-height: 38px;
    border-radius: 12px;
    font-size: 13px;
}

.pro-calendar {
    --minute-height: clamp(0.72px, 0.105vh, 0.9px);
    background: #ffffff;
    padding: 8px;
    max-height: calc(100vh - 245px);
    min-height: 500px;
    overflow: auto;
}

.pro-calendar-axis,
.pro-calendar-column {
    grid-template-rows: 48px minmax(0, 1fr);
}

.pro-calendar-corner,
.pro-calendar-column-head {
    min-height: 48px;
    padding: 8px 10px;
}

.pro-calendar-column-head strong {
    font-size: 14px;
}

.pro-calendar-axis-body,
.pro-calendar-lane {
    min-height: calc(var(--calendar-height-minutes, 600) * var(--minute-height));
}

.pro-calendar-lane {
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(15 * var(--minute-height) - 1px),
            rgba(226, 232, 240, 0.55) calc(15 * var(--minute-height) - 1px),
            rgba(226, 232, 240, 0.55) calc(15 * var(--minute-height))
        ),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(60 * var(--minute-height) - 1px),
            rgba(148, 163, 184, 0.45) calc(60 * var(--minute-height) - 1px),
            rgba(148, 163, 184, 0.45) calc(60 * var(--minute-height))
        ),
        #ffffff;
}

.pro-calendar .calendar-event {
    left: 5px;
    right: 5px;
    border: 1px solid rgba(79, 70, 229, 0.26);
    border-left: 4px solid var(--event-color, var(--accent));
    border-radius: 10px;
    background: #ffffff;
    padding: 5px 7px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    min-height: 38px;
}

.pro-calendar .calendar-event .event-time {
    background: #f1f5f9;
    color: #334155;
}

.pro-calendar .calendar-event strong {
    font-size: 11px;
    line-height: 1.12;
}

.pro-calendar .calendar-event small {
    font-size: 10px;
    line-height: 1.12;
}

.pro-calendar .calendar-event .event-time {
    font-size: 10px;
    padding: 3px 6px;
}

.calendar-filter-drawer:not([open]) {
    background: #ffffff;
}

.calendar-filter-drawer:not([open]) summary {
    min-height: 42px;
}

.calendar-day .pro-calendar-columns {
    min-width: max(760px, calc(var(--calendar-columns) * 280px));
}

.calendar-week .pro-calendar-columns {
    min-width: max(1180px, calc(var(--calendar-columns) * 170px));
}

.room-analytics-panel {
    overflow: hidden;
}

.room-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 14px;
}

.room-analytics-grid-clean {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 18px;
}

.room-analytics-card {
    display: grid;
    gap: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 20px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.room-week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(72px, 1fr));
    gap: 8px;
}

.room-week-strip span {
    display: block;
    min-width: 0;
}

.room-week-strip i {
    overflow: hidden;
    display: block;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
}

.room-week-strip b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #635bff);
}

.room-week-strip .is-empty b {
    background: #94a3b8;
}

.room-week-strip .is-full b {
    background: linear-gradient(90deg, #fb7185, #f97316);
}

.room-section-label {
    margin: 0 0 -8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.room-analytics-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.room-analytics-head strong,
.room-analytics-head small {
    display: block;
}

.room-analytics-head small {
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.room-score {
    display: grid;
    justify-items: end;
    min-width: 92px;
}

.room-score strong {
    color: #0f172a;
    font-size: 34px;
    line-height: 1;
}

.room-score small {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.room-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 10px;
}

.room-heatmap span {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 9px;
    font-size: 12px;
    font-weight: 950;
    text-align: center;
}

.room-config-grid {
    display: grid;
    gap: 14px;
}

.room-config-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    padding: 16px;
}

.room-config-card strong,
.room-config-card p {
    margin: 0;
}

.room-config-card p,
.room-resource-list {
    color: #64748b;
    font-size: 13px;
}

.room-config-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-config-meta > span:first-child {
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 900;
}

.room-resource-list {
    grid-column: 1 / -1;
}

.room-resource-list small {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.room-resource-list span {
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    padding: 5px 9px;
    color: #475569;
    font-size: 12px;
    font-weight: 850;
}

.room-heatmap .is-free {
    background: #ecfdf5;
    color: #047857;
}

.room-heatmap .is-medium {
    background: #fffbeb;
    color: #b45309;
}

.room-heatmap .is-full {
    background: #fff1f2;
    color: #be123c;
}

.room-occupancy-summary {
    display: grid;
    gap: 12px;
}

.room-occupancy-summary article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    padding: 13px 14px;
}

.room-occupancy-summary strong,
.room-occupancy-summary small {
    display: block;
}

.room-occupancy-summary strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-occupancy-summary small {
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.room-occupancy-summary span {
    color: #0f766e;
    font-size: 24px;
    font-weight: 950;
}

.room-occupancy-track {
    grid-column: 1 / -1;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.room-occupancy-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #635bff);
}

.status-mini-chart {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.status-mini-chart div {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
}

.status-mini-chart span,
.status-mini-chart strong {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.status-mini-chart i {
    grid-column: 1 / -1;
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: #e2e8f0;
}

.status-mini-chart b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #635bff, #14b8a6);
}

.status-mini-chart .payment-row b {
    background: linear-gradient(90deg, #14b8a6, #22c55e);
}

.auth-panel {
    max-width: none;
}

.auth-experience {
    display: grid;
    grid-template-columns: minmax(320px, 0.82fr) minmax(320px, 1.18fr);
    gap: 22px;
    align-items: stretch;
}

.auth-hero {
    display: grid;
    align-content: space-between;
    min-height: 520px;
    border: 1px solid #c7d2fe;
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(99, 91, 255, 0.92), rgba(20, 184, 166, 0.78)),
        #4f46e5;
    color: #ffffff;
    padding: clamp(24px, 3vw, 38px);
    box-shadow: 0 24px 60px rgba(79, 70, 229, 0.22);
}

.auth-hero h2 {
    margin: 0;
    max-width: 560px;
    font-size: clamp(34px, 4vw, 58px);
    line-height: 1.02;
    font-weight: 950;
}

.auth-hero p {
    max-width: 520px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
}

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

.auth-highlights span {
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    padding: 12px;
    font-size: 12px;
    font-weight: 900;
}

.auth-panel .form-card {
    align-content: center;
    min-height: 520px;
}

@media (max-width: 980px) {
    .sidebar {
        width: 100%;
    }

    .auth-experience {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: 360px;
    }
}

@media (max-width: 620px) {
    .main {
        padding: 14px;
    }

    .auth-highlights {
        grid-template-columns: 1fr;
    }

    .panel-heading.split,
    .topbar {
        align-items: stretch;
    }
}

/* Phase 27 premium consistency layer */
:root {
    --radius-control: 14px;
    --radius-card: 20px;
    --radius-panel: 24px;
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 32px rgba(15, 23, 42, 0.055);
    --shadow-hover: 0 16px 34px rgba(79, 70, 229, 0.1);
}

body {
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.main {
    max-width: 1680px;
}

.topbar,
.panel,
.metric-card,
.chart-card,
.builder-card,
.service-card,
.room-config-card,
.room-analytics-card,
.module-check-card,
.inline-edit,
.form-card {
    border-radius: var(--radius-panel);
    border-color: #dbe3ee;
    box-shadow: var(--shadow-soft);
}

.panel-heading {
    margin-bottom: 14px;
}

.panel-heading h2,
.service-card strong,
.room-config-card strong,
.builder-card strong,
.chart-header strong {
    letter-spacing: 0;
}

.panel-heading.split {
    gap: 14px;
}

.button,
.table-action,
.icon-button,
.segmented-control a {
    min-height: 38px;
    border-radius: var(--radius-control);
    white-space: nowrap;
}

.button.primary {
    width: auto;
    padding-inline: 18px;
}

.button:disabled,
.table-action:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.button:focus-visible,
.table-action:focus-visible,
.icon-button:focus-visible,
.segmented-control a:focus-visible,
.nav a:focus-visible {
    outline: 3px solid rgba(99, 91, 255, 0.22);
    outline-offset: 2px;
}

.table-action {
    min-width: 0;
    padding: 7px 10px;
    font-size: 12px;
}

.actions,
.platform-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    justify-content: flex-end;
}

.platform-actions form {
    margin: 0;
}

.table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
}

.table-wrap table {
    min-width: 760px;
}

th,
td {
    padding: 13px 14px;
    vertical-align: middle;
}

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

.form-grid {
    gap: 14px;
}

label {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

input,
textarea,
select {
    margin-top: 6px;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-card {
    min-height: 118px;
    padding: 18px;
}

.metric-card strong {
    font-size: clamp(24px, 2vw, 34px);
}

.dashboard-grid,
.work-grid,
.platform-insight-grid {
    gap: 18px;
}

.ranked-bars div {
    min-height: 48px;
}

.ranked-bars span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-focus-shell {
    padding: 10px;
}

.calendar-focus-toolbar {
    align-items: center;
}

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

.calendar-filter-drawer {
    border-radius: 18px;
}

.pro-calendar {
    border-radius: 18px;
}

.quick-panel-card,
.popover-panel {
    border-radius: 22px;
}

.room-analytics-grid-clean {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.room-heatmap {
    gap: 8px;
}

.room-heatmap span {
    min-height: 34px;
}

.service-cards-grid,
.room-config-grid,
.module-check-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.service-card,
.room-config-card,
.module-check-card {
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.service-card:hover,
.room-config-card:hover,
.module-check-card:hover,
.metric-card:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

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

    .calendar-focus-toolbar {
        grid-template-columns: 1fr;
    }

    .calendar-nav,
    .calendar-actions {
        justify-content: flex-start;
    }
}

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

    .sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .nav-label {
        grid-column: 1 / -1;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .user-menu {
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .main {
        padding: 12px;
    }

    .panel,
    .metric-card,
    .chart-card,
    .builder-card,
    .service-card,
    .room-config-card {
        border-radius: 18px;
        padding: 16px;
    }

    .panel-heading.split,
    .form-actions,
    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }

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

    .table-wrap {
        border: 0;
        background: transparent;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tr {
        margin-bottom: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 18px;
        background: #ffffff;
        padding: 10px;
        box-shadow: var(--shadow-soft);
    }

    .table-wrap td {
        display: grid;
        grid-template-columns: minmax(104px, 0.42fr) minmax(0, 1fr);
        gap: 10px;
        border: 0;
        padding: 8px 4px;
    }

    .table-wrap td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 11px;
        font-weight: 950;
        text-transform: uppercase;
    }

    .actions,
    .platform-actions {
        justify-content: stretch;
    }

    .platform-actions .table-action,
    .platform-actions form,
    .platform-actions button {
        width: 100%;
    }

    .room-analytics-grid-clean,
    .service-cards-grid,
    .room-config-grid,
    .module-check-grid,
    .platform-insight-grid {
        grid-template-columns: 1fr;
    }
}

/* Calendar emergency simplification: agenda first, chrome second */
.main:has(.calendar-focus-shell) {
    max-width: none;
    padding: 10px 12px;
}

@media (min-width: 981px) {
    .app-shell:has(.calendar-focus-shell) {
        display: grid;
        grid-template-columns: 17rem minmax(0, 1fr);
    }

    .app-shell:has(.calendar-focus-shell) .sidebar {
        display: block;
    }
}

.main:has(.calendar-focus-shell) .topbar {
    display: none;
}

.main:has(.calendar-focus-shell) .impersonation-banner {
    margin-bottom: 8px;
    min-height: 44px;
    padding: 8px 12px;
}

.calendar-focus-shell {
    position: relative;
    display: grid;
    gap: 8px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.calendar-focus-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 6px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    padding: 7px 9px;
    box-shadow: var(--shadow-soft);
}

.calendar-focus-toolbar .eyebrow {
    display: none;
}

.calendar-focus-toolbar h2:not(.calendar-focus-title) {
    display: none;
}

.calendar-focus-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(20px, 1.65vw, 25px);
    font-weight: 950;
    line-height: 1.15;
}

.calendar-focus-toolbar .calendar-nav,
.calendar-focus-toolbar .calendar-actions {
    gap: 6px;
}

.calendar-focus-toolbar .calendar-actions .segmented-control {
    display: none;
}

.calendar-focus-toolbar .button,
.calendar-focus-toolbar .icon-button,
.calendar-focus-toolbar .segmented-control a {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 12px;
}

.calendar-filter-drawer {
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: none;
}

.calendar-filter-drawer:not([open]) {
    width: max-content;
    max-width: 104px;
    justify-self: start;
    opacity: 0.94;
}

.calendar-filter-drawer:not([open]) summary {
    min-height: 30px;
    padding: 5px 8px;
}

.calendar-filter-drawer summary span {
    font-size: 12px;
}

.calendar-filter-drawer summary strong {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 10px;
}

.calendar-filter-drawer[open] {
    margin-top: 0;
}

.calendar-filter-drawer[open] summary {
    min-height: 34px;
    padding: 7px 10px;
}

.calendar-filter-drawer[open] + .pro-calendar {
    min-height: calc(100vh - 208px);
}

.pro-calendar {
    --minute-height: clamp(0.78px, 0.098vh, 0.9px);
    grid-template-columns: 42px minmax(0, 1fr);
    max-height: none;
    min-height: calc(100vh - 132px);
    overflow: auto;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #ffffff;
    padding: 0;
    box-shadow: var(--shadow-soft);
}

.pro-calendar-axis,
.pro-calendar-column {
    grid-template-rows: 44px minmax(0, 1fr);
}

.pro-calendar-axis {
    position: sticky;
    left: 0;
    z-index: 7;
    background: #ffffff;
    border-right: 1px solid #dbe3ee;
}

.pro-calendar-corner,
.pro-calendar-column-head {
    min-height: 44px;
    border-bottom: 1px solid #dbe3ee;
    background: #f8fafc;
    padding: 6px 10px;
}

.pro-calendar-column-head {
    border-radius: 0;
    background: #ffffff;
}

.pro-calendar-corner {
    justify-items: end;
    border-radius: 0;
    background: #ffffff;
    color: #64748b;
    padding: 8px 7px 0 0;
    font-size: 11px;
    font-weight: 900;
}

.pro-calendar-column-head strong {
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 950;
    line-height: 1.1;
}

.pro-calendar-column-head span {
    margin-top: 2px;
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
}

.pro-calendar-column-head {
    overflow: visible;
}

.pro-calendar-axis-body,
.pro-calendar-lane {
    min-height: calc(var(--calendar-height-minutes, 600) * var(--minute-height));
}

.pro-calendar-axis-body {
    border-right: 0;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(30 * var(--minute-height) - 1px),
            rgba(226, 232, 240, 0.58) calc(30 * var(--minute-height) - 1px),
            rgba(226, 232, 240, 0.58) calc(30 * var(--minute-height))
        ),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(60 * var(--minute-height) - 1px),
            rgba(148, 163, 184, 0.5) calc(60 * var(--minute-height) - 1px),
            rgba(148, 163, 184, 0.5) calc(60 * var(--minute-height))
        ),
        linear-gradient(180deg, #ffffff, #fbfdff);
}

.pro-calendar-axis-body span {
    left: auto;
    right: 7px;
    width: max-content;
    transform: translateY(-7px);
    color: #475569;
    font-size: 10.5px;
    font-weight: 900;
}

.pro-calendar-lane {
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(30 * var(--minute-height) - 1px),
            rgba(226, 232, 240, 0.58) calc(30 * var(--minute-height) - 1px),
            rgba(226, 232, 240, 0.58) calc(30 * var(--minute-height))
        ),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(60 * var(--minute-height) - 1px),
            rgba(148, 163, 184, 0.5) calc(60 * var(--minute-height) - 1px),
            rgba(148, 163, 184, 0.5) calc(60 * var(--minute-height))
        ),
        #ffffff;
}

.calendar-closed-block {
    background: rgba(248, 250, 252, 0.88);
}

.calendar-closed-block span {
    font-size: 12px;
}

.pro-calendar .calendar-event {
    left: 7px;
    right: auto;
    width: calc(100% - 14px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) max-content;
    grid-template-rows: auto auto;
    column-gap: 7px;
    row-gap: 1px;
    align-items: center;
    min-height: 34px;
    border: 1px solid rgba(99, 91, 255, 0.22);
    border-left: 4px solid var(--event-color, var(--accent));
    border-radius: 8px;
    background: #ffffff;
    padding: 5px 7px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.pro-calendar .calendar-event .event-time {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    border-radius: 8px;
    background: #eef2ff;
    color: #334155;
    padding: 3px 5px;
    font-size: 10px;
    font-weight: 950;
}

.pro-calendar .calendar-event strong {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    color: #0f172a;
    font-size: 10.5px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pro-calendar .calendar-event small {
    grid-column: 2;
    grid-row: 2;
    overflow: hidden;
    color: #475569;
    font-size: 9.5px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pro-calendar .calendar-event .event-meta {
    display: none;
}

.event-payment {
    position: static;
    right: auto;
    bottom: auto;
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    max-width: 54px;
    border-radius: 999px;
    padding: 3px 6px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.calendar-week .pro-calendar .calendar-event {
    grid-template-columns: auto minmax(0, 1fr) 9px;
    column-gap: 5px;
    min-height: 28px;
    padding: 4px 5px;
}

.calendar-week .pro-calendar .calendar-event .event-time {
    padding: 3px 5px;
    font-size: 9px;
}

.calendar-week .pro-calendar .calendar-event strong {
    font-size: 9.5px;
}

.calendar-week .pro-calendar .calendar-event small {
    font-size: 8.5px;
}

.calendar-week .event-payment {
    width: 8px;
    height: 8px;
    max-width: 8px;
    padding: 0;
    color: transparent;
}

.event-resize-handle {
    position: absolute;
    right: 8px;
    bottom: 3px;
    grid-column: 1 / -1;
    height: 3px;
    width: 38px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pro-calendar .calendar-event:hover .event-resize-handle,
.pro-calendar .calendar-event:focus-visible .event-resize-handle {
    opacity: 1;
}

@media (max-width: 1180px) {
    .calendar-focus-toolbar {
        grid-template-columns: 1fr;
    }

    .calendar-filter-drawer:not([open]) {
        max-width: none;
    }

    .pro-calendar {
        overflow-x: auto;
    }

    .calendar-day .pro-calendar-columns {
        min-width: max(720px, calc(var(--calendar-columns) * 250px));
    }

    .calendar-week .pro-calendar-columns {
        min-width: max(1050px, calc(var(--calendar-columns) * 150px));
    }
}

/* Premium UX pass: compact sidebar, sharper controls and clearer navigation */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    margin: -10px 0 14px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.sidebar-toggle:hover {
    border-color: #c7d2fe;
    color: #4338ca;
}

.nav a,
.nav-locked {
    gap: 10px;
}

.nav-icon {
    display: inline-grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 8px;
    background: #f1f5f9;
    font-size: 15px;
    line-height: 1;
}

.nav a.active .nav-icon {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.16);
}

.nav-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: 5.25rem minmax(0, 1fr) !important;
}

body.sidebar-collapsed .sidebar {
    padding: 18px 12px;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    padding: 6px;
}

body.sidebar-collapsed .brand-title,
body.sidebar-collapsed .brand-subtitle,
body.sidebar-collapsed .sidebar-toggle-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav a small,
body.sidebar-collapsed .nav-locked small {
    display: none;
}

body.sidebar-collapsed .sidebar-toggle {
    justify-content: center;
    padding-inline: 0;
}

body.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

body.sidebar-collapsed .nav {
    gap: 8px;
}

body.sidebar-collapsed .nav a,
body.sidebar-collapsed .nav-locked {
    justify-content: center;
    min-height: 44px;
    padding: 8px;
}

body.sidebar-collapsed .nav-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
}

.button,
.table-action,
.icon-button,
.segmented-control a,
.sidebar-toggle,
input,
select,
textarea {
    border-radius: 8px !important;
}

.button.primary,
.segmented-control a.active {
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.18);
}

.badge,
.event-payment {
    border-radius: 7px !important;
}

@media (max-width: 980px) {
    body.sidebar-collapsed .app-shell {
        display: block !important;
    }

    body.sidebar-collapsed .brand-title,
    body.sidebar-collapsed .brand-subtitle,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .nav-text {
        display: inline;
    }
}

.dashboard-operations-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 18px;
}

.agenda-list-compact,
.hour-occupancy-list {
    display: grid;
    gap: 10px;
}

.agenda-list-compact article {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px 12px;
}

.agenda-list-compact time {
    display: inline-grid;
    min-height: 34px;
    place-items: center;
    border-radius: 8px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 950;
}

.agenda-list-compact strong,
.agenda-list-compact small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-list-compact small {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.hour-occupancy-list div {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 150px;
    align-items: center;
    gap: 10px;
}

.hour-occupancy-list span,
.hour-occupancy-list strong {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.hour-occupancy-list i {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.hour-occupancy-list b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #635bff);
}

@media (max-width: 1180px) {
    .dashboard-operations-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .agenda-list-compact article,
    .hour-occupancy-list div {
        grid-template-columns: 1fr;
    }
}

/* Luxury minimalist redesign: quiet surfaces, SVG navigation and practical density */
:root {
    --lux-bg: #f6f7f9;
    --lux-surface: rgba(255, 255, 255, 0.92);
    --lux-border: #e2e8f0;
    --lux-text: #0b1220;
    --lux-muted: #64748b;
    --lux-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 48px rgba(15, 23, 42, 0.06);
    --lux-hover: 0 1px 2px rgba(15, 23, 42, 0.06), 0 24px 60px rgba(15, 23, 42, 0.08);
}

body {
    background: radial-gradient(circle at top left, rgba(99, 91, 255, 0.08), transparent 34rem), var(--lux-bg) !important;
    color: var(--lux-text);
    letter-spacing: 0;
}

.app-shell {
    grid-template-columns: 15.5rem minmax(0, 1fr) !important;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px !important;
    border-right: 1px solid rgba(226, 232, 240, 0.9) !important;
    background: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: blur(18px);
    box-shadow: none !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 8px !important;
    border-radius: 14px !important;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px !important;
    box-shadow: 0 14px 32px rgba(20, 184, 166, 0.18) !important;
}

.brand-title {
    font-size: 15px !important;
    letter-spacing: 0 !important;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--lux-muted) !important;
    font-size: 11px !important;
}

.sidebar-toggle {
    justify-content: center;
    min-height: 38px;
    margin: -6px 0 4px !important;
    border: 1px solid var(--lux-border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #475569 !important;
    padding: 8px 10px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-toggle:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe !important;
    box-shadow: 0 14px 30px rgba(99, 91, 255, 0.12);
}

.sidebar-toggle-icon svg,
.nav-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 5px !important;
}

.nav-label {
    margin: 16px 8px 5px !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    letter-spacing: 0.08em !important;
}

.nav a,
.nav-locked {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    color: #475569 !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    font-weight: 760 !important;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav a:hover {
    transform: translateX(2px);
    background: #f8fafc !important;
    color: #111827 !important;
}

.nav a.active {
    border-color: rgba(99, 91, 255, 0.18) !important;
    background: linear-gradient(135deg, rgba(99, 91, 255, 0.1), rgba(20, 184, 166, 0.08)) !important;
    color: #3730a3 !important;
    box-shadow: none !important;
}

.nav-icon {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    border-radius: 10px !important;
    background: #f1f5f9 !important;
    color: #64748b;
    font-size: 0 !important;
}

.nav a.active .nav-icon {
    background: #fff !important;
    color: #4f46e5;
    box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.16);
}

.main {
    max-width: none !important;
    padding: 24px clamp(18px, 2vw, 32px) !important;
    background: transparent !important;
}

.topbar,
.panel,
.metric-card,
.chart-card,
.table-card,
.form-card,
.work-card,
.notice,
.alert {
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 18px !important;
    background: var(--lux-surface) !important;
    box-shadow: var(--lux-soft) !important;
    backdrop-filter: blur(14px);
}

.topbar {
    min-height: 78px;
    margin-bottom: 18px;
    padding: 16px 20px !important;
}

.eyebrow,
.metric-card span,
.panel-heading .notes,
.notes {
    letter-spacing: 0 !important;
}

.topbar h1,
.calendar-focus-title,
.panel h2,
.metric-card strong {
    color: var(--lux-text) !important;
    letter-spacing: 0 !important;
}

.metric-grid {
    gap: 14px !important;
}

.metric-card {
    min-height: 132px;
    padding: 22px !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--lux-hover) !important;
}

.button,
.table-action,
.icon-button,
.segmented-control a,
input,
select,
textarea {
    border-radius: 11px !important;
    letter-spacing: 0 !important;
}

.button.primary,
.segmented-control a.active {
    background: #111827 !important;
    color: #fff !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16) !important;
}

.button.primary:hover,
.segmented-control a.active:hover {
    background: #020617 !important;
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: 4.75rem minmax(0, 1fr) !important;
}

body.sidebar-collapsed .sidebar {
    align-items: center;
    padding: 18px 10px !important;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    width: 52px;
    padding: 5px !important;
}

body.sidebar-collapsed .brand-mark {
    width: 40px;
    height: 40px;
}

body.sidebar-collapsed .sidebar-toggle {
    width: 42px;
    padding: 0 !important;
}

body.sidebar-collapsed .nav {
    align-items: center;
}

body.sidebar-collapsed .nav a,
body.sidebar-collapsed .nav-locked {
    width: 42px;
    min-height: 42px;
    justify-content: center;
    padding: 0 !important;
}

body.sidebar-collapsed .nav-icon {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
}

body.sidebar-collapsed .brand-title,
body.sidebar-collapsed .brand-subtitle,
body.sidebar-collapsed .sidebar-toggle-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav a small,
body.sidebar-collapsed .nav-locked small {
    display: none !important;
}

.app-shell,
.sidebar,
.main,
.brand,
.brand > span,
.brand-mark,
.sidebar-toggle,
.sidebar-toggle-icon,
.nav,
.nav a,
.nav-locked,
.nav-icon,
.nav-text,
.nav-label {
    transition:
        grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        margin 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.18s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

body.sidebar-collapsed .brand > span:not(.brand-mark),
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-toggle-text {
    max-width: 0;
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
}

body.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

body:not(.sidebar-collapsed) .brand > span:not(.brand-mark),
body:not(.sidebar-collapsed) .nav-text,
body:not(.sidebar-collapsed) .nav-label,
body:not(.sidebar-collapsed) .sidebar-toggle-text {
    max-width: 180px;
    opacity: 1;
    transform: translateX(0);
}

/* Calendar as a daily work board */
.main:has(.calendar-focus-shell) {
    padding: 12px 14px !important;
}

.calendar-focus-toolbar {
    grid-template-columns: minmax(260px, 1fr) auto auto !important;
    align-items: center;
    gap: 10px !important;
    border-radius: 18px !important;
    padding: 10px 12px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: var(--lux-soft) !important;
}

.calendar-focus-title {
    display: none !important;
}

.calendar-hero-title {
    display: block !important;
    margin: 0;
    font-size: clamp(24px, 2vw, 34px) !important;
    font-weight: 760 !important;
    line-height: 1.1;
}

.calendar-focus-toolbar .button,
.calendar-focus-toolbar .icon-button {
    min-height: 44px !important;
    min-width: 44px;
    border-radius: 14px !important;
    font-size: 14px !important;
}

.calendar-focus-toolbar .calendar-actions .segmented-control {
    display: none !important;
}

.calendar-focus-toolbar .button.primary {
    min-width: 92px;
}

.calendar-filter-drawer {
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.88) !important;
}

.calendar-filter-drawer:not([open]) {
    width: 116px !important;
    max-width: 116px !important;
}

.pro-calendar {
    --minute-height: clamp(0.9px, 0.112vh, 1.08px) !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    min-height: calc(100vh - 154px) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--lux-soft) !important;
}

.pro-calendar-axis,
.pro-calendar-column {
    grid-template-rows: 52px minmax(0, 1fr) !important;
}

.pro-calendar-corner,
.pro-calendar-column-head {
    min-height: 52px !important;
    padding: 9px 12px !important;
    background: #fbfdff !important;
}

.pro-calendar-corner {
    justify-items: center !important;
    color: #94a3b8 !important;
    font-size: 12px !important;
    font-weight: 650 !important;
}

.pro-calendar-axis-body span {
    right: 12px !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 650 !important;
}

.pro-calendar-column-head strong {
    font-size: 14px !important;
    font-weight: 760 !important;
}

.pro-calendar-column-head span {
    font-size: 11px !important;
    font-weight: 620 !important;
}

.pro-calendar .calendar-event {
    left: 10px !important;
    width: calc(100% - 20px) !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    min-height: 42px !important;
    border: 1px solid rgba(99, 91, 255, 0.18) !important;
    border-left: 4px solid var(--event-color, var(--accent)) !important;
    border-radius: 13px !important;
    padding: 7px 9px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07) !important;
}

.pro-calendar .calendar-event .event-time {
    border-radius: 9px !important;
    background: #f1f5f9 !important;
    color: #334155 !important;
    padding: 4px 7px !important;
    font-size: 11px !important;
}

.pro-calendar .calendar-event strong {
    font-size: 12px !important;
    font-weight: 760 !important;
}

.pro-calendar .calendar-event small {
    color: #64748b !important;
    font-size: 11px !important;
    font-weight: 650 !important;
}

.event-payment {
    max-width: 64px !important;
    background: #fff7ed !important;
    color: #c2410c !important;
    font-size: 10px !important;
    font-weight: 760 !important;
}

.calendar-week .pro-calendar .calendar-event {
    grid-template-columns: auto minmax(0, 1fr) !important;
}

@media (max-width: 1100px) {
    .app-shell,
    body.sidebar-collapsed .app-shell {
        display: block !important;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .calendar-focus-toolbar {
        grid-template-columns: 1fr !important;
    }
}

/* SAS Clinic 2.0: minimal, proportional, responsive and calmer */
:root {
    --v2-bg: #f7f8fa;
    --v2-panel: #ffffff;
    --v2-panel-soft: #fbfcfd;
    --v2-line: #e4e9f0;
    --v2-line-strong: #d4dce7;
    --v2-text: #111827;
    --v2-muted: #687386;
    --v2-primary: #111827;
    --v2-accent: #5b5cf6;
    --v2-success: #0f9f8f;
    --v2-warning: #c76a21;
    --v2-radius: 14px;
    --v2-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 12px 28px rgba(17, 24, 39, 0.045);
    --v2-shadow-hover: 0 1px 2px rgba(17, 24, 39, 0.06), 0 16px 36px rgba(17, 24, 39, 0.065);
    --v2-sidebar: 232px;
    --v2-sidebar-collapsed: 72px;
}

html {
    background: var(--v2-bg);
}

body {
    background: var(--v2-bg) !important;
    color: var(--v2-text);
    font-size: 14px;
    line-height: 1.45;
}

body,
button,
input,
select,
textarea {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif !important;
    letter-spacing: 0 !important;
}

.app-shell {
    grid-template-columns: var(--v2-sidebar) minmax(0, 1fr) !important;
    transition: grid-template-columns 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: var(--v2-sidebar-collapsed) minmax(0, 1fr) !important;
}

.sidebar {
    width: var(--v2-sidebar);
    padding: 18px 12px !important;
    overflow-x: hidden;
    border-right: 1px solid var(--v2-line) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: none !important;
    transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1), padding 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.sidebar-collapsed .sidebar {
    width: var(--v2-sidebar-collapsed);
    padding: 16px 10px !important;
}

.brand {
    min-height: 44px;
    margin-bottom: 14px !important;
    padding: 5px 6px !important;
    gap: 10px;
}

.brand-mark {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px;
    border-radius: 11px !important;
    font-size: 14px;
    box-shadow: 0 10px 22px rgba(20, 184, 166, 0.12) !important;
}

.brand-title {
    font-size: 14px !important;
    font-weight: 760 !important;
}

.brand-subtitle {
    font-size: 11px !important;
    font-weight: 560 !important;
}

body.sidebar-collapsed .brand {
    width: 48px;
    justify-content: center;
}

.sidebar-toggle {
    width: 100%;
    min-height: 34px !important;
    margin: 0 0 12px !important;
    border-radius: 11px !important;
    padding: 0 10px !important;
    color: #5f6b7a !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.sidebar-toggle:focus,
.sidebar-toggle:focus-visible {
    outline: 0 !important;
    box-shadow: 0 0 0 3px rgba(91, 92, 246, 0.12) !important;
}

body.sidebar-collapsed .sidebar-toggle {
    width: 42px;
    min-width: 42px;
    padding: 0 !important;
}

.nav {
    gap: 3px !important;
}

.nav-label {
    margin: 16px 10px 6px !important;
    font-size: 9px !important;
    font-weight: 720 !important;
    color: #98a2b3 !important;
    letter-spacing: 0.06em !important;
}

.nav a,
.nav-locked {
    min-height: 38px !important;
    border-radius: 11px !important;
    padding: 5px 8px !important;
    gap: 9px !important;
    color: #4b5565 !important;
    font-size: 13px !important;
    font-weight: 620 !important;
}

.nav a:hover {
    transform: none !important;
    background: #f4f6f8 !important;
}

.nav a.active {
    border-color: transparent !important;
    background: #eef2ff !important;
    color: #3730a3 !important;
}

.nav-icon {
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
    border-radius: 9px !important;
    background: transparent !important;
}

.nav a.active .nav-icon {
    background: #ffffff !important;
}

.nav-icon svg {
    width: 17px !important;
    height: 17px !important;
}

body.sidebar-collapsed .brand > span:not(.brand-mark),
body.sidebar-collapsed .sidebar-toggle-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav a small,
body.sidebar-collapsed .nav-locked small {
    display: none !important;
}

body.sidebar-collapsed .nav a,
body.sidebar-collapsed .nav-locked {
    width: 44px;
    min-height: 42px !important;
    justify-content: center;
    padding: 0 !important;
}

body.sidebar-collapsed .nav-icon {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
}

.main {
    padding: 20px clamp(18px, 2.2vw, 28px) !important;
}

.topbar {
    min-height: 68px !important;
    margin-bottom: 18px !important;
    padding: 14px 18px !important;
}

.topbar,
.panel,
.metric-card,
.chart-card,
.builder-card,
.form-card,
.auth-panel,
.table-wrap,
.room-analytics-card,
.room-config-card,
.platform-service-card,
.control-list a {
    border: 1px solid var(--v2-line) !important;
    border-radius: var(--v2-radius) !important;
    background: var(--v2-panel) !important;
    box-shadow: var(--v2-shadow) !important;
}

.topbar h1,
.panel-heading h2,
.chart-header strong {
    font-size: clamp(20px, 1.6vw, 26px) !important;
    font-weight: 720 !important;
    line-height: 1.12;
}

.eyebrow,
.metric-card span,
.chart-header span,
th,
.nav-label {
    font-size: 10px !important;
    font-weight: 680 !important;
    letter-spacing: 0.055em !important;
}

.notes,
.metric-card small,
.chart-card small,
.control-list small,
.detail-list dt {
    color: var(--v2-muted) !important;
    font-size: 13px !important;
    font-weight: 480 !important;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
    gap: 12px !important;
}

.metric-card {
    min-height: 106px !important;
    padding: 18px !important;
}

.metric-card strong {
    font-size: clamp(28px, 2.4vw, 38px) !important;
    font-weight: 720 !important;
}

.button,
.table-action,
.icon-button,
.segmented-control a,
.user-badge {
    min-height: 36px !important;
    border-radius: 11px !important;
    padding-inline: 13px !important;
    font-size: 13px !important;
    font-weight: 650 !important;
}

.button.compact,
.table-action,
.icon-button {
    min-height: 34px !important;
}

.button:hover,
.table-action:hover,
.icon-button:hover,
.segmented-control a:hover,
.control-list a:hover {
    transform: none !important;
    box-shadow: var(--v2-shadow-hover) !important;
}

.button.primary,
.table-action.primary,
.segmented-control a.active {
    background: var(--v2-primary) !important;
    border-color: var(--v2-primary) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.12) !important;
}

.user-menu {
    gap: 8px !important;
}

.user-badge {
    min-width: 180px !important;
    padding: 8px 12px !important;
}

.user-badge strong {
    font-size: 13px !important;
    font-weight: 680 !important;
}

.user-badge small {
    font-size: 12px !important;
    font-weight: 480 !important;
}

input,
select,
textarea {
    min-height: 38px !important;
    border-radius: 11px !important;
    padding: 8px 11px !important;
    font-size: 14px !important;
    font-weight: 480 !important;
}

input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(91, 92, 246, 0.12) !important;
}

label {
    font-size: 12px;
    font-weight: 650;
}

.dashboard-grid,
.platform-dashboard-grid,
.work-grid {
    gap: 14px !important;
}

.panel {
    padding: 18px !important;
}

.visual-grid,
.platform-insight-grid {
    gap: 12px !important;
}

.chart-card {
    padding: 16px !important;
}

.donut-chart {
    width: 150px !important;
    height: 150px !important;
    margin: 12px auto !important;
}

.donut-chart span {
    font-size: 22px !important;
    font-weight: 720 !important;
}

.progress-row {
    font-size: 13px !important;
}

.status-grid {
    gap: 8px !important;
}

.status-row {
    min-height: 34px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
}

.control-list {
    gap: 10px !important;
}

.control-list a {
    padding: 14px !important;
}

.control-list strong {
    font-size: 14px !important;
    font-weight: 680 !important;
}

.is-guest .app-shell {
    grid-template-columns: 80px minmax(0, 1fr) !important;
}

.is-guest .sidebar {
    width: 80px;
    padding: 18px 14px !important;
}

.is-guest .brand {
    justify-content: center;
}

.is-guest .brand > span:not(.brand-mark) {
    display: none !important;
}

.main:has(.auth-experience) {
    display: grid;
    min-height: 100vh;
    align-items: center;
    padding: clamp(20px, 4vw, 42px) !important;
}

.main:has(.auth-experience) .topbar {
    display: none !important;
}

.auth-minimal {
    width: min(980px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1fr);
    gap: 16px;
}

.auth-copy,
.auth-login-card {
    border: 1px solid var(--v2-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--v2-shadow) !important;
    padding: clamp(22px, 3vw, 34px) !important;
}

.auth-copy {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-copy h2 {
    max-width: 430px;
    margin: 0 0 12px;
    color: var(--v2-text);
    font-size: clamp(28px, 3.4vw, 46px);
    font-weight: 680;
    line-height: 1.04;
}

.auth-copy p:not(.eyebrow) {
    max-width: 430px;
    margin: 0;
    color: var(--v2-muted);
    font-size: 15px;
    line-height: 1.55;
}

.auth-login-card {
    gap: 14px !important;
}

.auth-login-card h2 {
    margin: 0;
    font-size: 24px !important;
    font-weight: 680 !important;
}

.auth-login-card .button.primary {
    width: 100%;
    min-height: 42px !important;
}

.auth-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.auth-highlights span {
    min-height: 30px;
    border: 1px solid var(--v2-line);
    border-radius: 999px;
    background: var(--v2-panel-soft);
    color: #485568;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 620;
}

.form-link {
    color: #6d63ff !important;
    font-size: 13px !important;
    font-weight: 620 !important;
}

.v2-platform-shell {
    display: grid;
    gap: 14px;
}

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

.v2-kpi-strip article {
    min-height: 98px;
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-radius);
    background: #fff;
    padding: 16px;
    box-shadow: var(--v2-shadow);
}

.v2-kpi-strip span,
.v2-health-card > span {
    display: block;
    margin-bottom: 8px;
    color: #8a96a8;
    font-size: 10px;
    font-weight: 680;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.v2-kpi-strip strong {
    display: block;
    color: var(--v2-text);
    font-size: clamp(24px, 2vw, 34px);
    font-weight: 720;
    line-height: 1.05;
}

.v2-kpi-strip small {
    display: block;
    margin-top: 8px;
    color: var(--v2-muted);
    font-size: 12px;
}

.v2-command-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: stretch;
}

.v2-revenue-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.v2-health-card,
.v2-line-chart-card {
    border: 1px solid var(--v2-line);
    border-radius: 13px;
    background: var(--v2-panel-soft);
    padding: 14px;
}

.v2-ring {
    width: 126px;
    height: 126px;
    display: grid;
    place-items: center;
    margin: 8px auto 12px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, #fff 0 56%, transparent 57%),
        conic-gradient(var(--v2-success) var(--value), #e6ebf2 0);
}

.v2-ring strong {
    color: var(--v2-text);
    font-size: 25px;
    font-weight: 720;
}

.v2-mini-legend {
    display: grid;
    gap: 6px;
}

.v2-mini-legend span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--v2-muted);
    font-size: 12px;
    font-weight: 560;
}

.v2-mini-legend i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--v2-success);
}

.v2-mini-legend i.danger {
    background: #f0657a;
}

.v2-line-chart-card .real-chart {
    min-height: 220px;
}

.v2-admin-actions {
    min-width: 0;
}

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

.v2-panel-number {
    color: var(--v2-text);
    font-size: 24px;
    font-weight: 720;
}

.v2-progress-stack {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.v2-progress-stack div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.v2-progress-stack span {
    color: var(--v2-muted);
    font-size: 13px;
    font-weight: 560;
}

.v2-progress-stack strong {
    font-size: 13px;
    font-weight: 720;
}

.v2-progress-stack i {
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6ebf2;
}

.v2-progress-stack b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--v2-accent);
}

.v2-progress-stack b.danger {
    background: #f0657a;
}

.ranked-bars {
    gap: 9px !important;
}

.ranked-bars div {
    min-height: 30px;
}

.ranked-bars span,
.ranked-bars strong {
    font-size: 12px !important;
}

.ranked-bars i {
    height: 7px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--v2-primary), var(--v2-accent)) !important;
}

@media (max-width: 1200px) {
    .v2-kpi-strip,
    .v2-analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v2-command-grid,
    .v2-revenue-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .v2-kpi-strip,
    .v2-analytics-grid {
        grid-template-columns: 1fr;
    }
}

.main:has(.calendar-focus-shell) {
    padding: 10px 12px !important;
}

.calendar-focus-toolbar {
    top: 10px;
    min-height: 56px;
    padding: 8px 10px !important;
    border-radius: 14px !important;
}

.calendar-hero-title {
    font-size: clamp(22px, 1.65vw, 28px) !important;
    font-weight: 620 !important;
}

.calendar-focus-toolbar .button,
.calendar-focus-toolbar .icon-button {
    min-height: 38px !important;
    min-width: 38px !important;
    border-radius: 11px !important;
}

.pro-calendar {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    border-radius: 14px !important;
}

.pro-calendar-axis,
.pro-calendar-column {
    grid-template-rows: 46px minmax(0, 1fr) !important;
}

.pro-calendar-corner,
.pro-calendar-column-head {
    min-height: 46px !important;
}

.pro-calendar .calendar-event {
    min-height: 36px !important;
    border-radius: 11px !important;
}

@media (max-width: 1280px) {
    :root {
        --v2-sidebar: 216px;
    }

    .platform-dashboard-grid,
    .work-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 900px) {
    .app-shell,
    body.sidebar-collapsed .app-shell,
    .is-guest .app-shell {
        display: block !important;
    }

    .sidebar,
    body.sidebar-collapsed .sidebar,
    .is-guest .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 12px !important;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    }

    .auth-minimal {
        grid-template-columns: 1fr;
    }

    .auth-copy h2 {
        font-size: 30px;
    }

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

/* Premium interface renewal: cleaner surfaces, denser data, calmer hierarchy */
body {
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
}

.main {
    background: transparent !important;
}

.topbar,
.panel,
.metric-card,
.chart-card,
.builder-card,
.form-card,
.auth-panel,
.table-wrap {
    border-color: #dbe3ee !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 34px rgba(15, 23, 42, 0.06) !important;
}

.metric-card {
    min-height: 132px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
}

.metric-card span,
.panel-heading h2,
.chart-header span,
th,
.nav-label {
    letter-spacing: 0 !important;
}

.metric-card span,
.chart-header span,
th {
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.metric-card strong {
    color: #08111f;
}

.metric-card small,
.notes {
    color: #64748b !important;
    font-weight: 750;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: #f8fafc;
}

tbody tr {
    transition: background 0.14s ease;
}

tbody tr:hover {
    background: #fbfdff;
}

.table-action,
.button,
.icon-button,
.segmented-control a {
    min-height: 36px;
    border-color: #cbd6e2;
    font-weight: 900;
}

.button.primary,
.table-action.primary {
    background: linear-gradient(135deg, #635bff, #4f46e5);
}

.button.ghost,
.table-action,
.icon-button {
    background: #ffffff;
}

.badge {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 950;
}

input,
select,
textarea {
    min-height: 42px;
    border-color: #cbd6e2 !important;
    background: #ffffff !important;
    font-weight: 800;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #635bff !important;
    box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.12);
}

.sidebar {
    background: rgba(255, 255, 255, 0.96) !important;
}

.brand-mark {
    border-radius: 10px !important;
}

@media (min-width: 981px) {
    .main {
        padding: 20px;
    }
}

/* Final product polish pass: this must win over older visual layers */
body {
    background: radial-gradient(circle at 12% 0%, rgba(99, 91, 255, 0.08), transparent 34rem), #f6f7f9 !important;
    color: #0b1220;
}

.app-shell {
    grid-template-columns: 15.5rem minmax(0, 1fr) !important;
}

.main {
    padding: 24px clamp(18px, 2vw, 32px) !important;
    background: transparent !important;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(18px);
}

.topbar,
.panel,
.metric-card,
.chart-card,
.builder-card,
.form-card,
.auth-panel,
.table-wrap,
.room-analytics-card,
.room-config-card,
.platform-service-card {
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 48px rgba(15, 23, 42, 0.055) !important;
}

.topbar h1,
.panel-heading h2,
.metric-card strong,
.chart-header strong {
    font-weight: 760 !important;
    letter-spacing: 0 !important;
}

.metric-card span,
.chart-header span,
th,
.nav-label,
.eyebrow {
    color: #8a96a8 !important;
    font-size: 10px !important;
    font-weight: 760 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase;
}

.notes,
.metric-card small,
.chart-card small,
.platform-service-card p {
    color: #64748b !important;
    font-weight: 520 !important;
    line-height: 1.55;
}

.metric-card {
    min-height: 124px !important;
    padding: 22px !important;
}

.button,
.table-action,
.icon-button,
.segmented-control a {
    min-height: 40px;
    border-radius: 12px !important;
    font-weight: 760 !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button:hover,
.table-action:hover,
.icon-button:hover,
.segmented-control a:hover {
    transform: translateY(-1px);
}

.button.primary,
.table-action.primary,
.segmented-control a.active {
    border-color: #111827 !important;
    background: #111827 !important;
    color: #ffffff !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16) !important;
}

.button.ghost,
.table-action,
.icon-button {
    background: rgba(255, 255, 255, 0.92) !important;
}

.badge {
    border-radius: 999px !important;
    border-color: #dbe3ee !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 760 !important;
}

.badge.is-success,
.event-payment.is-paid {
    border-color: rgba(20, 184, 166, 0.22) !important;
    background: rgba(20, 184, 166, 0.09) !important;
    color: #0f766e !important;
}

input,
select,
textarea {
    min-height: 44px !important;
    border-radius: 12px !important;
    border-color: #d7e0ea !important;
    color: #0f172a !important;
    font-weight: 620 !important;
}

.platform-dashboard-grid {
    align-items: start;
}

.empty-state {
    min-height: 96px !important;
    border-radius: 16px !important;
    background: #fbfdff !important;
    color: #64748b !important;
    font-weight: 650 !important;
}

.dashboard-agenda-card .empty-state {
    min-height: 118px !important;
}

.control-list a,
.module-list a {
    border-radius: 16px !important;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.control-list a:hover,
.module-list a:hover {
    transform: translateY(-2px);
    border-color: #c7d2fe !important;
    background: #fbfdff !important;
}

.platform-service-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
}

.platform-service-card {
    min-height: 210px;
    padding: 18px !important;
}

.platform-service-price strong {
    font-weight: 760 !important;
}

.room-analytics-grid-clean {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
}

.room-analytics-card,
.room-config-card {
    padding: 18px !important;
}

.room-heatmap span {
    min-height: 34px;
    border-radius: 999px !important;
    font-weight: 700 !important;
}

.main:has(.calendar-focus-shell) {
    padding: 12px 14px !important;
}

.calendar-focus-toolbar {
    position: sticky;
    top: 12px;
    z-index: 20;
    grid-template-columns: minmax(260px, 1fr) auto auto !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.94) !important;
}

.calendar-hero-title {
    display: block !important;
    color: #0b1220 !important;
    font-size: clamp(24px, 2vw, 32px) !important;
    font-weight: 620 !important;
}

.calendar-focus-title,
.calendar-focus-toolbar h2:not(.calendar-hero-title) {
    display: none !important;
}

.pro-calendar {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    min-height: calc(100vh - 154px) !important;
    border-radius: 18px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 48px rgba(15, 23, 42, 0.055) !important;
}

.pro-calendar-corner,
.pro-calendar-column-head {
    background: #fbfdff !important;
}

.pro-calendar .calendar-event {
    border-radius: 13px !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07) !important;
}

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

@media (max-width: 1100px) {
    .app-shell,
    body.sidebar-collapsed .app-shell {
        display: block !important;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .calendar-focus-toolbar {
        position: static;
        grid-template-columns: 1fr !important;
    }
}
