:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #6f7a8f;
    --line: #dce3ef;
    --accent: #163b75;
    --accent-2: #0f766e;
    --sidebar-start: #14233e;
    --sidebar-end: #0f1728;
    --danger: #b42318;
    --success: #067647;
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.08);
    --panel-glow: rgba(255, 255, 255, 0.74);
    --surface-tint: rgba(255, 255, 255, 0.68);
    --input-bg: rgba(255, 255, 255, 0.96);
    --focus-ring: rgba(22, 59, 117, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Aptos", "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.92), transparent 22%),
        radial-gradient(circle at top left, rgba(22, 59, 117, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(244, 247, 251, 0.98), rgba(236, 243, 250, 0.98)),
        var(--bg);
    animation: pageFade 240ms ease-out both;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 180ms ease, opacity 180ms ease;
}

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

.shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.platform-shell {
    display: block;
    min-height: 100vh;
}

.platform-shell .content {
    width: min(1320px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0;
}

.platform-shell .content.platform-dashboard-content {
    width: 100%;
    max-width: none;
    padding: 28px 32px;
}

.platform-shell .page-head {
    margin-top: 0;
}

.sidebar {
    background: linear-gradient(180deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%);
    color: #eef3fb;
    padding: 24px 18px;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 36%),
        linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.03));
    pointer-events: none;
}

.sidebar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand-title {
    font-weight: 700;
}

.brand-sub {
    color: rgba(238, 243, 251, 0.7);
    font-size: 0.9rem;
}

.user-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 18px;
}

.user-name {
    font-weight: 700;
}

.user-meta {
    color: rgba(238, 243, 251, 0.72);
    font-size: 0.92rem;
    margin-top: 4px;
}

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

.nav-group {
    display: grid;
    gap: 6px;
}

.nav-group-title {
    padding: 0 12px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(238, 243, 251, 0.5);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #eef3fb;
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.nav-icon {
    width: 18px;
    text-align: center;
    flex: 0 0 18px;
    color: #ffffff;
    opacity: 1;
}

.nav-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav .muted {
    color: rgba(238, 243, 251, 0.72);
}

.branch-switcher {
    margin: 0 0 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 8px;
}

.branch-switcher-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(238, 243, 251, 0.72);
}

.branch-switcher select {
    width: 100%;
    font-weight: 700;
    color: #eef3fb;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.branch-switcher select option {
    color: #172033;
    font-weight: 600;
}

.content {
    padding: 28px;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 18px;
    padding: 0 2px;
}

.page-head-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(22, 59, 117, 0.18);
    cursor: pointer;
}

.nav-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.sidebar-overlay {
    display: none;
}

.page-head h1 {
    margin: 0;
    font-size: clamp(2rem, 2.7vw, 2.6rem);
    letter-spacing: -0.03em;
}

.page-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.page-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
    text-align: right;
    line-height: 1.1;
}

.page-user-name,
.page-user-meta,
.page-user-logout {
    font-size: 12px;
    font-weight: 700;
}

.page-user-meta {
    color: var(--muted);
}

.page-user-logout {
    color: var(--accent);
}

.page-user-logout:hover {
    text-decoration: underline;
}

.card {
    background:
        linear-gradient(180deg, var(--panel-glow), rgba(255, 255, 255, 0.94)),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
    animation: cardRise 360ms ease both;
    backdrop-filter: blur(14px);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
}

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

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

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

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

.stat {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96)),
        #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow-soft);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.stat:hover {
    transform: translateY(-4px);
    border-color: rgba(22, 59, 117, 0.18);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.10);
}

.stat .label {
    color: var(--muted);
    font-size: 0.92rem;
}

.stat .value {
    font-size: 1.7rem;
    font-weight: 800;
    margin-top: 8px;
}

form {
    display: grid;
    gap: 14px;
}

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

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

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

.field label {
    font-size: 0.92rem;
    color: var(--muted);
}

input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

input:hover, select:hover, textarea:hover {
    border-color: rgba(22, 59, 117, 0.24);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(22, 59, 117, 0.48);
    box-shadow: 0 0 0 4px var(--focus-ring);
    transform: translateY(-1px);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 13px;
    border: 0;
    border-radius: 10px;
    background: var(--button);
    color: white;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    box-shadow: 0 12px 26px rgba(22, 59, 117, 0.16);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(22, 59, 117, 0.20);
    filter: saturate(1.04);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: var(--button-secondary);
    box-shadow: 0 12px 24px rgba(71, 85, 105, 0.16);
}

.btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.btn.danger {
    background: var(--button-danger);
    box-shadow: 0 12px 24px rgba(180, 35, 24, 0.16);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

tbody tr:nth-child(even) td {
    background: #fcffe3;
}

tbody tr:nth-child(odd) td {
    background: #ffffff;
}

tbody tr {
    transition: box-shadow 160ms ease, background-color 160ms ease;
}

tbody tr:hover td {
    background: #eef4fb;
}

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

th {
    font-size: 0.9rem;
    color: var(--muted);
    background: #fbfdff;
}

.alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
}

.alert.success {
    background: #ecfdf3;
    color: var(--success);
    border: 1px solid #abefc6;
}

.alert.error {
    background: #fef3f2;
    color: var(--danger);
    border: 1px solid #fecdca;
}

.alert.warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.muted {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf3f9;
    color: #172033;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge.status-booked {
    background: #e8eef8;
    color: #163b75;
}

.badge.status-completed {
    background: #e7f6ee;
    color: #067647;
}

.badge.status-cancelled {
    background: #fdecec;
    color: #b42318;
}

.badge.status-rescheduled {
    background: #f0ebff;
    color: #6b4eff;
}

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

.tab-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.tab-link:hover {
    transform: translateY(-2px);
    border-color: rgba(22, 59, 117, 0.24);
    box-shadow: var(--shadow-soft);
}

.tab-link.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.page-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    text-align: right;
}

.page-brand-logo,
.page-brand-mark {
    border-radius: 14px;
}

.page-brand-logo {
    width: 70px;
    height: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    padding: 4px;
}

.page-brand-mark {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 800;
}

.page-brand-name {
    font-weight: 800;
    line-height: 1.1;
}

.page-brand-sub {
    font-size: 0.82rem;
    color: var(--muted);
}

.thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #fff;
}

.image-field {
    display: grid;
    gap: 8px;
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.image-preview .thumb {
    width: 100px;
    height: 100px;
}

.image-preview .thumb {
    flex-shrink: 0;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 16px 0 8px;
}

.pagination-meta,
.pagination-page {
    color: var(--muted);
    font-size: 0.95rem;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

main.content > .card,
main.content > .grid,
main.content > .page-head {
    animation: cardRise 360ms ease both;
}

main.content > .page-head {
    animation-name: heroRise;
}

main.content > .card:nth-of-type(2) {
    animation-delay: 40ms;
}

main.content > .card:nth-of-type(3) {
    animation-delay: 80ms;
}

main.content > .card:nth-of-type(4) {
    animation-delay: 120ms;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroRise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

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

.compact {
    font-size: 0.92rem;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

    .platform-shell .content {
        width: min(1320px, calc(100% - 32px));
        padding: 18px 0;
    }

    .platform-shell .content.platform-dashboard-content {
        width: 100%;
        padding: 18px 16px;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 320px);
        max-width: 320px;
        padding: 20px 16px 12px;
        transform: translateX(-102%);
        transition: transform 220ms ease;
        z-index: 1100;
        overflow-y: auto;
        box-shadow: 24px 0 40px rgba(15, 23, 40, 0.25);
    }

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

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(15, 23, 40, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 220ms ease;
        z-index: 1050;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-toggle {
        display: inline-flex;
        order: -1;
    }

    .grid.cols-4,
    .grid.cols-3,
    .grid.cols-2,
    .form-row,
    .form-row.three {
        grid-template-columns: 1fr;
    }

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

    .page-head-right {
        width: 100%;
        align-items: flex-end;
    }

    .page-brand {
        justify-content: flex-start;
        text-align: left;
    }

}

@media (max-width: 640px) {
    .content {
        padding: 16px;
    }

    .card {
        padding: 16px;
        border-radius: 16px;
    }

    .page-head h1 {
        font-size: 1.8rem;
    }

    .tab-link {
        width: 100%;
    }

    .page-brand-logo {
        width: 70px;
        height: auto;
    }

    .actions {
        gap: 8px;
    }
}
