:root {
    --text: #1f2a37;
    --muted: #6b7280;
    --line: #d6d9de;
    --panel: #ffffff;
    --app-background-image: url("https://coresg-normal.trae.ai/api/ide/v1/text_to_image?prompt=luxury%20tropical%20resort%20at%20blue%20hour%2C%20calm%20lagoon%2C%20cabana%20lights%2C%20lush%20greenery%2C%20elegant%20cinematic%20hotel%20atmosphere%2C%20premium%20hospitality%20background%2C%20realistic%20photography&image_size=landscape_16_9");
    --app-background-overlay: 0.12;
    --app-background-opacity: 0.45;
}

* {
    box-sizing: border-box;
}

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

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

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

/* Auth pages keep resort feel */
.auth-body {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background: #0c1c1e;
}

.auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(
            rgba(9, 25, 28, var(--app-background-overlay)),
            rgba(9, 25, 28, calc(var(--app-background-overlay) * 0.8))
        ),
        var(--app-background-image) center/cover no-repeat;
    opacity: var(--app-background-opacity);
    pointer-events: none;
}

.auth-shell {
    width: min(1080px, 100%);
    position: relative;
    z-index: 1;
}

.auth-panel {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    padding: 28px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.auth-copy {
    min-height: 420px;
    padding: 26px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.auth-copy h2,
.auth-copy .eyebrow,
.auth-copy .muted {
    color: #ffffff;
}

.auth-copy h2 {
    margin: 0;
    max-width: 10ch;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.04;
}

.auth-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

/* App pages exact flat admin rebuild */
.app-body {
    background: #ededed;
    overflow: hidden;
}

.app-body::before {
    display: none;
}

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

.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #080b10, #131722);
    color: #ffffff;
    padding: 0;
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(90deg, #0f88ff, #0c6ce0);
}

.brand-mark__icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    flex-shrink: 0;
}

.brand-card h1 {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

.brand-card .muted {
    margin: 3px 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.nav-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
}

.nav-list::-webkit-scrollbar {
    width: 4px;
}

.nav-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.nav-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    transition: background 0.18s ease;
}

.nav-list::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 136, 255, 0.88);
}

.nav-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) rgba(255, 255, 255, 0.04);
}

.nav-group {
    margin-bottom: 12px;
}

.nav-group__title {
    margin: 12px 14px 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.86rem;
    position: relative;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg, #8fd0ff, #ffffff);
    opacity: 0;
    transform: scaleY(0.6);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active {
    background: #0f88ff;
    color: #ffffff;
}

.nav-link:hover {
    transform: translateX(1px);
}

.nav-link.is-active {
    scroll-margin-block: 48px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-link:hover::before,
.nav-link.is-active::before {
    opacity: 1;
    transform: scaleY(1);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    color: inherit;
    font-size: 0.98rem;
    flex: 0 0 20px;
}

.nav-text {
    flex: 1;
}

.sidebar-foot {
    padding: 12px 14px 18px;
    margin-top: auto;
}

.sidebar-copyright {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 12px 13px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.sidebar-copyright::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(15, 136, 255, 0.18), rgba(255, 255, 255, 0.02) 60%);
    pointer-events: none;
}

.sidebar-copyright::after {
    content: "";
    position: absolute;
    inset: auto -18% -55% -18%;
    height: 70px;
    background: radial-gradient(circle, rgba(15, 136, 255, 0.34), rgba(15, 136, 255, 0));
    pointer-events: none;
}

.sidebar-copyright__label,
.sidebar-copyright strong,
.sidebar-copyright span {
    position: relative;
    z-index: 1;
}

.sidebar-copyright__label {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-copyright strong {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
}

.sidebar-copyright span {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    font-weight: 600;
}

.main-panel {
    background: #f3f3f3;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 16px;
    background: linear-gradient(90deg, #0f88ff, #0f76eb);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 35;
    box-shadow: 0 8px 22px rgba(15, 118, 235, 0.18), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.topbar-title,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title__icon {
    color: #ffffff;
    font-size: 0.9rem;
}

.topbar-menu-button {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.95rem;
}

.topbar-caption {
    margin: 0;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
}

.soft-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.76rem;
}

.lang-switch span {
    opacity: 0.78;
    font-weight: 700;
}

.lang-switch .is-active {
    opacity: 1;
}

.user-pill__avatar {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.user-pill strong,
.user-pill span,
.topbar-caption {
    color: #ffffff;
}

.user-pill div {
    display: flex;
    gap: 4px;
    align-items: center;
}

.button {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.button--ghost {
    padding: 7px 13px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.page-grid {
    padding: 14px 16px 24px;
}

.page-panel {
    padding: 0 0 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
}

.dashboard-heading h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: #232323;
}

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

.stat-card {
    display: flex;
    align-items: stretch;
    min-height: 50px;
    background: #ffffff;
    border: 1px solid #e4e6ea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card__icon {
    width: 48px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 1.05rem;
}

.stat-card__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
}

.stat-label {
    color: #4b5563;
    font-size: 0.79rem;
    font-weight: 500;
}

.stat-card strong {
    font-size: 0.9rem;
    color: #374151;
}

.stat-card--amber .stat-card__icon { background: #ffbf1f; }
.stat-card--pink .stat-card__icon { background: #ff4f93; }
.stat-card--slate .stat-card__icon { background: #8a919a; }
.stat-card--blue .stat-card__icon { background: #178cff; }
.stat-card--red .stat-card__icon { background: #ee4b4b; }
.stat-card--green .stat-card__icon { background: #34c759; }
.stat-card--teal .stat-card__icon { background: #28c7bd; }

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.content-grid--wide {
    grid-template-columns: 1fr 1fr;
}

.surface-card,
.table-card,
.form-card,
.unit-card,
.page-panel--compact,
.glass-card {
    background: #ffffff;
    border: 1px solid #e0e4e8;
    box-shadow: 0 1px 7px rgba(0, 0, 0, 0.06);
}

.table-card,
.form-card,
.unit-card,
.page-panel--compact {
    padding: 14px;
}

.section-head,
.pill-row,
.unit-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.section-head h3,
.unit-card h4 {
    margin: 0;
    color: #1f2937;
}

.eyebrow {
    margin: 0 0 6px;
    color: #7b8490;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.muted {
    color: var(--muted);
    line-height: 1.5;
}

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

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

th,
td {
    padding: 11px 10px;
    text-align: left;
    border-bottom: 1px solid #edf0f2;
    font-size: 0.86rem;
}

th {
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.status {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.status--success { background: #eafaf2; color: #17804f; }
.status--warning { background: #fff6e3; color: #a76f00; }
.status--danger { background: #fff0f1; color: #b73a54; }
.status--neutral { background: #eef1f5; color: #4b5563; }

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

.rate {
    display: block;
    margin-top: 12px;
    font-size: 1.05rem;
    color: #111827;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #6b7280;
    font-size: 0.86rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #d7dde4;
    background: #ffffff;
    color: #111827;
    padding: 11px 12px;
}

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

.field--action {
    align-self: end;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-helper {
    color: #6b7280;
    font-size: 0.82rem;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
}

.empty-state {
    color: #6b7280;
}

.button--primary {
    padding: 10px 16px;
    background: #178cff;
    color: #ffffff;
}

.button--warning {
    padding: 10px 16px;
    background: #f59e0b;
    color: #ffffff;
}

.button--success {
    padding: 10px 16px;
    background: #16a34a;
    color: #ffffff;
}

.button--neutral {
    padding: 10px 16px;
    background: #eef1f5;
    color: #111827;
}

.button--danger {
    padding: 10px 16px;
    background: #e11d48;
    color: #ffffff;
}

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

.menu-group-card {
    border: 1px solid #e5e7eb;
    background: #fafafa;
}

.menu-group-head {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #1f2937;
}

.menu-item-list {
    display: grid;
}

.menu-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f2;
}

.menu-item-row:last-child {
    border-bottom: 0;
}

.menu-item-row strong {
    display: block;
    color: #1f2937;
    font-size: 0.88rem;
}

.menu-item-row span {
    color: #6b7280;
    font-size: 0.78rem;
}

.menu-item-row input {
    width: 100%;
}

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

.kot-card {
    padding: 14px;
}

.kot-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.kot-actions form {
    margin: 0;
}

.preview-card {
    position: relative;
    min-height: 220px;
    background-position: center;
    background-size: cover;
    border: 1px solid #d7dde4;
}

.preview-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.15);
}

.preview-card__badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
}

.settings-info {
    display: grid;
    gap: 8px;
}

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

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

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

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

.metric-card {
    background: #ffffff;
    border: 1px solid #e0e4e8;
    box-shadow: 0 1px 7px rgba(0, 0, 0, 0.06);
    padding: 14px;
}

.metric-card__label {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 0.8rem;
}

.metric-card strong {
    color: #111827;
    font-size: 1rem;
}

.invoice-breakdown {
    display: grid;
    gap: 10px;
}

.invoice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #edf0f2;
    background: #fafafa;
}

.invoice-row--total {
    background: #eef6ff;
    border-color: #bfdbfe;
    font-weight: 700;
}

.notice-banner,
.flash {
    margin: 14px 16px 0;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    background: #fffbe8;
    color: #8a6d00;
    font-size: 0.85rem;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 16, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s ease;
    z-index: 40;
}

.flash--success {
    background: #ecfbf3;
    color: #136c46;
}

.flash--error {
    background: #fff0f3;
    color: #a9364f;
}

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

    .content-grid,
    .content-grid--wide,
    .unit-grid,
    .menu-groups,
    .kot-grid,
    .metric-grid,
    .metric-grid--five,
    .filter-grid,
    .filter-grid--reports {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 260px;
        max-width: 82vw;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

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

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 14px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar-title {
        width: 100%;
    }

    .nav-list {
        padding: 12px 0 16px;
    }

    .nav-group {
        margin-bottom: 14px;
    }

    .nav-group__title {
        margin: 14px 14px 8px;
    }

    .nav-link {
        gap: 12px;
        padding: 11px 14px;
        font-size: 0.92rem;
    }

    .nav-icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
        font-size: 1rem;
    }

    .sidebar-foot {
        padding: 14px 14px 18px;
    }

    .app-body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
    }

    .app-body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .main-panel {
        height: 100vh;
    }
}
