:root {
    --orange: #eb8c0d;
    --gold: #fea805;
    --black: #070707;
    --ink: #151515;
    --muted: #737373;
    --soft: #f2f2ef;
    --line: rgba(7, 7, 7, 0.09);
    --panel: rgba(255, 255, 255, 0.86);
    --white: #ffffff;
    --page: #f7f7f5;
    --danger: #b42318;
    --success: #0d6a2f;
    --shadow: 0 18px 44px rgba(7, 7, 7, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(235, 140, 13, 0.12), transparent 28%),
        linear-gradient(220deg, rgba(254, 168, 5, 0.16), transparent 30%),
        var(--page);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
}

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

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 21px;
    line-height: 1;
}

h2 {
    font-size: 25px;
    line-height: 1.08;
}

h3 {
    font-size: 16px;
}

.app-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 112px;
}

.app-shell {
    min-width: 0;
}

.sidebar,
.panel,
.login-card,
.metric-card {
    border: 1px solid rgba(255, 255, 255, 0.78);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.sidebar {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
    border-radius: 30px;
    padding: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--white);
    font-size: 23px;
    font-weight: 900;
    border-radius: 17px;
    background: linear-gradient(145deg, var(--black), var(--orange) 72%, var(--gold));
    box-shadow: 0 14px 28px rgba(235, 140, 13, 0.28);
}

.brand p,
.topbar p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.side-nav {
    display: grid;
    gap: 8px;
    margin-top: 26px;
}

.side-nav a,
.logout-form button,
.bottom-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    border: 0;
    border-radius: 17px;
    padding: 0 13px;
    color: var(--muted);
    background: rgba(7, 7, 7, 0.04);
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.side-nav a.active,
.bottom-nav a.active {
    color: var(--black);
    background: rgba(254, 168, 5, 0.2);
}

.logout-form {
    margin-top: auto;
}

.logout-form button {
    width: 100%;
    color: var(--danger);
    background: rgba(180, 35, 24, 0.08);
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 24px;
    border-radius: 9px;
    color: var(--black);
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--line);
}

.nav-icon::before {
    font-size: 14px;
    font-weight: 900;
}

.nav-icon.calendar::before {
    content: "[]";
}

.nav-icon.wallet::before {
    content: "$";
}

.nav-icon.gear::before {
    content: "*";
}

.nav-icon.logout::before {
    content: ">";
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 13px 4px 13px 0;
    background: rgba(247, 247, 245, 0.76);
    backdrop-filter: blur(18px);
}

.admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    border-radius: 999px;
    padding: 7px 10px 7px 7px;
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--line);
}

.admin-chip span {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--black);
    font-weight: 900;
}

.admin-chip strong {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.admin-chip.large {
    width: fit-content;
}

.admin-chip.large span {
    width: 42px;
    height: 42px;
}

.eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--orange);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-grid,
.dashboard-grid,
.calendar-grid,
.finance-grid,
.settings-grid {
    display: grid;
    gap: 16px;
}

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

.dashboard-grid,
.calendar-grid,
.finance-grid {
    grid-template-columns: minmax(0, 1.24fr) minmax(340px, 0.76fr);
    align-items: start;
}

.calendar-grid {
    margin-top: 16px;
}

.settings-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
    align-items: start;
}

.metric-card,
.panel {
    border-radius: 28px;
}

.metric-card {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
}

.metric-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.metric-card strong {
    font-size: 26px;
    line-height: 1.1;
}

.metric-card.dark {
    color: var(--white);
    background: var(--black);
}

.metric-card.dark span {
    color: rgba(255, 255, 255, 0.68);
}

.schedule-panel,
.quick-card,
.calendar-panel,
.day-panel,
.finance-list-panel,
.settings-panel {
    padding: 18px;
}

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

.pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 9px 12px;
    color: var(--black);
    background: rgba(254, 168, 5, 0.18);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.schedule-list,
.finance-list,
.settings-list {
    display: grid;
    gap: 10px;
}

.schedule-item {
    display: grid;
    grid-template-columns: 82px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 23px;
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--line);
}

.time-block {
    display: grid;
    place-items: center;
    min-height: 66px;
    border-radius: 19px;
    color: var(--white);
    background: var(--black);
}

.time-block strong {
    font-size: 18px;
}

.time-block span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 750;
}

.booking-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    color: var(--white);
    background: linear-gradient(135deg, var(--orange), var(--black));
    font-weight: 900;
}

.booking-main h3,
.booking-main p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.booking-main p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.booking-side {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.booking-side strong {
    font-size: 15px;
}

.status {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--black);
    background: rgba(254, 168, 5, 0.18);
    font-size: 12px;
    font-weight: 850;
}

.status.paid {
    color: var(--success);
    background: #e8f8ed;
}

.status.dp {
    color: #985900;
    background: #fff2d4;
}

.status.booked {
    background: #eeeeee;
}

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

.field {
    display: grid;
    gap: 7px;
}

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

.field span {
    padding-left: 3px;
    color: #5f5f5f;
    font-size: 12px;
    font-weight: 850;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 17px;
    outline: 0;
    padding: 12px 14px;
    color: var(--black);
    background: rgba(7, 7, 7, 0.06);
}

.time-select-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

textarea {
    min-height: 76px;
    resize: vertical;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 17px;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 850;
    text-decoration: none;
}

.primary-button {
    color: var(--white);
    background: linear-gradient(135deg, var(--orange), var(--gold));
    box-shadow: 0 16px 28px rgba(235, 140, 13, 0.26);
}

.secondary-button {
    width: 100%;
    color: var(--danger);
    background: rgba(180, 35, 24, 0.08);
}

.total-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 13px 15px;
    border-radius: 20px;
    background: var(--black);
    color: var(--white);
}

.total-preview span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.total-preview strong {
    font-size: 21px;
}

.month-nav {
    display: flex;
    gap: 8px;
}

.month-nav a {
    border-radius: 14px;
    padding: 9px 11px;
    color: var(--black);
    background: rgba(7, 7, 7, 0.06);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.calendar-weekdays,
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 8px;
}

.calendar-weekdays span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.day-cell {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 18px;
    padding: 10px;
    color: var(--black);
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--line);
    text-decoration: none;
}

.day-cell.muted {
    background: transparent;
    box-shadow: none;
}

.day-cell small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.day-cell.has-booking {
    background: rgba(254, 168, 5, 0.16);
}

.day-cell.selected {
    color: var(--white);
    background: var(--black);
}

.day-cell.selected small {
    color: rgba(255, 255, 255, 0.74);
}

.day-slots {
    display: grid;
    gap: 9px;
    max-height: 640px;
    overflow: auto;
    padding-right: 2px;
}

.slot-row {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 18px;
    padding: 10px 12px;
    color: inherit;
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--line);
    cursor: pointer;
    text-align: left;
}

.slot-row span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-row em {
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.slot-row.free em {
    color: var(--success);
    background: #e8f8ed;
}

.slot-row.busy {
    background: rgba(254, 168, 5, 0.15);
}

.slot-row.busy em {
    color: #985900;
    background: #fff2d4;
}

.timeline-scroll {
    overflow: auto;
    max-height: 720px;
    padding-bottom: 4px;
}

.timeline-header,
.day-timeline {
    display: grid;
    min-width: 560px;
}

.timeline-header {
    position: sticky;
    top: 0;
    z-index: 6;
    gap: 0;
    padding-bottom: 8px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
}

.timeline-header span,
.timeline-header strong {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.timeline-header strong {
    color: var(--black);
}

.day-timeline {
    position: relative;
}

.timeline-hour-label {
    z-index: 3;
    align-self: start;
    padding-top: 1px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.timeline-line {
    z-index: 1;
    align-self: start;
    height: 1px;
    margin-left: 56px;
    background: rgba(7, 7, 7, 0.08);
    pointer-events: none;
}

.timeline-line.half {
    background: rgba(7, 7, 7, 0.035);
}

.timeline-empty-slot {
    z-index: 2;
    min-width: 0;
    border: 0;
    border-left: 1px solid rgba(7, 7, 7, 0.04);
    background: transparent;
    cursor: pointer;
}

.timeline-empty-slot:hover {
    background: rgba(254, 168, 5, 0.08);
}

.timeline-booking {
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 3px;
    min-width: 0;
    border: 0;
    border-left: 4px solid #20a7d8;
    border-radius: 7px;
    margin: 2px 5px 2px 6px;
    padding: 7px 8px;
    color: #07516f;
    background: rgba(32, 167, 216, 0.17);
    box-shadow: inset 0 0 0 1px rgba(32, 167, 216, 0.12);
    cursor: pointer;
    text-align: left;
}

.timeline-booking strong,
.timeline-booking span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-booking strong {
    color: #063f56;
    font-size: 13px;
}

.timeline-booking span {
    color: #256d85;
    font-size: 12px;
}

.finance-item,
.studio-price-row,
.account-card {
    border-radius: 20px;
    padding: 13px;
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--line);
}

.finance-item,
.studio-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.finance-item strong,
.finance-item span,
.studio-price-row strong,
.studio-price-row small {
    display: block;
}

.finance-item span,
.studio-price-row small,
.account-card p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.finance-item em {
    flex: 0 0 auto;
    font-style: normal;
    font-weight: 900;
}

.finance-item em.expense {
    color: var(--danger);
}

.finance-item em.income {
    color: var(--success);
}

.studio-price-row input {
    max-width: 190px;
    text-align: right;
    font-weight: 850;
}

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

.add-studio-toggle {
    margin-top: 12px;
}

.add-studio-form {
    margin-top: 12px;
}

.is-hidden {
    display: none !important;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 15px;
    color: var(--black);
    background: rgba(7, 7, 7, 0.06);
    cursor: pointer;
    font-weight: 900;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: end center;
    padding: 18px;
    background: rgba(7, 7, 7, 0.34);
    backdrop-filter: blur(18px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(680px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 30px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 80px rgba(7, 7, 7, 0.24);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
    flex: 1;
}

.secondary-button.danger {
    color: var(--danger);
    background: rgba(180, 35, 24, 0.1);
}

.alert {
    margin-bottom: 14px;
    border-radius: 18px;
    padding: 13px 15px;
    font-weight: 750;
}

.alert.success {
    color: var(--success);
    background: #e8f8ed;
}

.alert.error {
    color: #9d1b1b;
    background: #ffecec;
}

.toast {
    position: fixed;
    left: 50%;
    top: 18px;
    z-index: 80;
    width: min(460px, calc(100% - 28px));
    transform: translateX(-50%);
    border-radius: 18px;
    padding: 13px 15px;
    color: var(--black);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(7, 7, 7, 0.2);
    backdrop-filter: blur(20px);
    font-weight: 800;
}

.toast.success {
    color: var(--success);
    box-shadow: 0 18px 48px rgba(13, 106, 47, 0.22);
}

.toast.error {
    color: #9d1b1b;
    box-shadow: 0 18px 48px rgba(180, 35, 24, 0.22);
}

.empty-state {
    padding: 22px;
    border-radius: 22px;
    color: var(--muted);
    background: var(--white);
    text-align: center;
}

.bottom-nav {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    display: none;
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 45px rgba(7, 7, 7, 0.16);
    backdrop-filter: blur(24px);
}

.bottom-nav a {
    flex: 1;
    justify-content: center;
    min-width: 0;
    padding: 8px 5px;
    font-size: 12px;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(420px, 100%);
}

.login-card {
    border-radius: 30px;
    padding: 22px;
}

.login-brand {
    margin-bottom: 28px;
}

.login-title {
    margin-bottom: 16px;
}

.login-form {
    display: grid;
    gap: 12px;
}

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

    .sidebar {
        display: none;
    }

    .topbar {
        top: 0;
    }

    .bottom-nav {
        display: flex;
    }
}

@media (max-width: 900px) {
    .dashboard-grid,
    .calendar-grid,
    .finance-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .app-layout {
        width: min(100% - 24px, 640px);
        padding-top: 8px;
    }

    .topbar {
        padding-right: 0;
    }

    .admin-chip strong {
        max-width: 88px;
    }

    h2 {
        font-size: 22px;
    }

    .schedule-panel,
    .quick-card,
    .calendar-panel,
    .day-panel,
    .finance-list-panel,
    .settings-panel {
        border-radius: 26px;
        padding: 16px;
    }

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

    .stats-grid {
        gap: 8px;
    }

    .metric-card {
        min-height: 100px;
        border-radius: 23px;
        padding: 14px 10px;
    }

    .metric-card span {
        font-size: 11px;
    }

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

    .schedule-item {
        grid-template-columns: 68px 1fr;
    }

    .booking-side {
        grid-column: 2;
        grid-template-columns: 1fr auto;
        justify-items: start;
        align-items: center;
    }

    .calendar-weekdays,
    .month-grid {
        gap: 5px;
    }

    .day-cell {
        min-height: 62px;
        border-radius: 15px;
        padding: 8px;
    }

    .day-cell small {
        display: none;
    }

    .slot-row {
        grid-template-columns: 58px 1fr;
    }

    .slot-row em {
        grid-column: 2;
        width: fit-content;
    }

    .studio-price-row {
        align-items: stretch;
        flex-direction: column;
    }

    .studio-price-row input {
        max-width: none;
    }

    .bottom-nav a {
        flex-direction: column;
        gap: 4px;
    }
}
