:root {
    --primary: #0c1929;
    --primary-soft: #152238;
    --accent: #c9a227;
    --accent-hover: #b08f1f;
    --accent-muted: rgba(201, 162, 39, 0.12);
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 10px 24px -4px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.15);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.app-body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

body.app-body--public {
    background: var(--bg);
}

/* Compact hotel-style layout */
body.app-body--compact {
    font-size: 0.875rem;
}

/* Top bar */
.app-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.92);
}

.app-topbar .brand {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.app-topbar .brand-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
    color: var(--accent);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.app-topbar .brand {
    font-size: 0.85rem;
}

/* Main card */
.app-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.65rem 0.75rem 1rem;
}

.app-shell--wide {
    max-width: 1200px;
}

.app-card {
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

/* Slim hotel header (replaces large hero) */
.app-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
    color: #fff;
    padding: 0.55rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    border-bottom: 2px solid var(--accent);
}

.app-hero h1 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.app-hero .subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
    margin: 0;
}

.app-hero .tagline {
    font-size: 0.68rem;
    opacity: 0.7;
    margin: 0;
    text-align: right;
}

.app-hero-center {
    flex: 1;
    min-width: 140px;
}

.app-card-body {
    padding: 0.75rem 1rem 0.85rem;
}

@media (max-width: 576px) {
    .app-card-body {
        padding: 0.65rem 0.75rem;
    }
    .app-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .app-hero .tagline {
        text-align: left;
    }
}

/* Form sections */
.form-section {
    margin-bottom: 0.65rem;
}

.form-section:last-of-type {
    margin-bottom: 0.35rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

.section-title .section-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--accent-muted);
    color: var(--accent-hover);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.app-body .form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.app-body .form-control,
.app-body .form-select {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    font-size: 0.8125rem;
    min-height: 32px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.app-body .row.g-compact {
    --bs-gutter-y: 0.4rem;
    --bs-gutter-x: 0.5rem;
}

.app-body .form-control:focus,
.app-body .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.app-body .form-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    line-height: 1.3;
}

/* Buttons */
.btn-app-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.45rem 1.25rem;
    border-radius: 6px;
    transition: background 0.15s;
    box-shadow: none;
}

.btn-app-primary:hover {
    color: #fff;
    transform: none;
    box-shadow: none;
    filter: brightness(1.08);
}

.btn-app-outline {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s, border-color 0.15s;
}

.btn-app-outline:hover {
    background: var(--bg);
    border-color: #cbd5e1;
    color: var(--text);
}

.btn-app-accent {
    background: var(--accent);
    border: none;
    color: var(--primary);
    font-weight: 700;
}

.btn-app-accent:hover {
    background: var(--accent-hover);
    color: var(--primary);
}

.form-actions {
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
    margin-top: 0.35rem;
    text-align: right;
}

/* Admin layout */
.admin-navbar {
    background: var(--primary);
    padding: 0.45rem 0;
    box-shadow: 0 2px 8px rgba(12, 25, 41, 0.15);
    margin-bottom: 0.5rem !important;
}

.admin-navbar .navbar-brand {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-navbar .nav-actions .btn {
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.28rem 0.65rem;
}

.admin-navbar .btn-nav-light {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: transparent;
}

.admin-navbar .btn-nav-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.admin-navbar .btn-nav-accent {
    background: var(--accent);
    color: var(--primary);
    border: none;
}

.admin-navbar .btn-nav-accent:hover {
    background: var(--accent-hover);
    color: var(--primary);
}

/* Admin table */
.table-card {
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.table-card .table {
    margin: 0;
    font-size: 0.78rem;
}

.table-card thead th {
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: none;
    padding: 0.45rem 0.6rem;
    white-space: nowrap;
}

.table-card tbody td {
    padding: 0.4rem 0.6rem;
    vertical-align: middle;
    border-color: var(--border);
}

.table-card tbody tr:hover {
    background: #f8fafc;
}

.badge-invoice {
    font-family: ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--accent-muted);
    color: var(--primary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.amount-cell {
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.btn-table {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
}

.empty-state {
    padding: 1.25rem 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.empty-state i {
    font-size: 1.25rem;
    opacity: 0.35;
    display: inline;
    margin-bottom: 0;
    margin-right: 0.35rem;
}

/* Info panel */
.info-panel {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
}

.info-panel .info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.info-panel .info-value {
    font-weight: 700;
    color: var(--primary);
    font-family: ui-monospace, monospace;
}

.alert-app-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.alert-app-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(201, 162, 39, 0.12), transparent),
        linear-gradient(180deg, #e8eef4, var(--bg));
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    color: #fff;
    padding: 2rem 1.75rem;
    text-align: center;
}

.login-card-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.login-card-header p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.75;
}

.login-card-body {
    padding: 1.75rem;
}

/* Admin list toolbar */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.45rem;
    padding: 0.35rem 0;
}

.list-toolbar .page-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.list-toolbar .page-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
}

.page-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.15rem;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 0.45rem;
}

/* Invoice browser preview */
.invoice-view-toolbar {
    margin-bottom: 0.5rem;
}

.invoice-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.invoice-preview .card {
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}
