/* ===== StayHubThai — Design System ===== */
/* Navy #1a2744 · Gold #c9a84c · Cream #f5f0e8 */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garant:ital,wght@0,400;0,600;0,700;1,400&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --navy:        #1a2744;
    --navy-dark:   #0f1b30;
    --navy-mid:    #243459;
    --gold:        #c9a84c;
    --gold-light:  #dfc278;
    --gold-dark:   #a8863a;
    --cream:       #f5f0e8;
    --cream-dark:  #e8e2d6;
    --sidebar-w:   252px;
    --radius:      12px;
    --shadow-sm:   0 1px 4px rgba(0,0,0,.07);
    --shadow-md:   0 4px 20px rgba(0,0,0,.10);
    --shadow-lg:   0 12px 40px rgba(0,0,0,.15);
}

* { box-sizing: border-box; }

body {
    font-family: 'Sarabun', sans-serif;
    background: #f2ede5;
    margin: 0;
    color: #2c3347;
}

/* ===== Brand Typography ===== */
.brand-wordmark {
    font-family: 'Cormorant Garant', Georgia, serif;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
}
.brand-wordmark .hub { color: var(--gold); }
.brand-sub {
    font-family: 'Sarabun', sans-serif;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    margin-top: .15rem;
}
.brand-sub.dark { color: rgba(26,39,68,.45); }

/* ===== Roof SVG motif ===== */
.roof-motif {
    display: block;
    margin: 0 auto .35rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--navy);
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 2px 0 20px rgba(0,0,0,.18);
}

.sidebar-brand {
    padding: 1.4rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.sidebar-brand-logo {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.sidebar-brand-icon {
    width: 36px; height: 36px;
    background: var(--navy-dark);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(201,168,76,.3);
}

.sidebar-brand .brand-wordmark {
    font-size: 1.15rem;
    color: #fff;
}

.sidebar-brand .brand-sub {
    padding-left: .1rem;
    margin-top: .35rem;
}

.sidebar-hotel-name {
    font-size: .78rem;
    color: rgba(255,255,255,.6);
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(255,255,255,.07);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu {
    flex: 1;
    padding: .6rem 0;
}

.sidebar-section {
    font-size: .65rem;
    font-weight: 700;
    color: rgba(255,255,255,.3);
    text-transform: uppercase;
    letter-spacing: .12em;
    padding: 1rem 1.2rem .3rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1.2rem;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: .875rem;
    transition: all .15s;
    border-left: 3px solid transparent;
    margin: .05rem 0;
}
.sidebar-link i { font-size: .95rem; width: 1.1rem; flex-shrink: 0; }
.sidebar-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
    border-left-color: rgba(201,168,76,.4);
}
.sidebar-link.active {
    background: rgba(201,168,76,.12);
    color: #fff;
    border-left-color: var(--gold);
    font-weight: 600;
}
.sidebar-link.active i { color: var(--gold); }

.sidebar-footer {
    padding: .85rem 1.2rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.user-info {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: rgba(255,255,255,.75);
    margin-bottom: .6rem;
}
.user-info > div:last-child { overflow: hidden; }
.user-info .fw-semibold { font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    color: var(--navy);
    font-size: .9rem;
    flex-shrink: 0;
    font-family: 'Cormorant Garant', serif;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.07);
    padding: .8rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.topbar h5 {
    margin: 0;
    font-weight: 600;
    color: var(--navy);
    font-size: .95rem;
    letter-spacing: .01em;
}

.page-body { padding: 1.5rem 1.75rem; }

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid transparent;
    transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card.border-success { border-left-color: #198754; }
.stat-card.border-danger  { border-left-color: #dc3545; }
.stat-card.border-warning { border-left-color: var(--gold); }
.stat-card.border-primary { border-left-color: var(--navy); }
.stat-card.border-info    { border-left-color: #0dcaf0; }
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.stat-label { font-size: .76rem; color: #8590a2; margin-bottom: .1rem; font-weight: 500; }
.stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1; color: var(--navy); }

/* ===== CARDS ===== */
.card {
    border: 0;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,.06);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-size: .9rem;
}

/* ===== TABLES ===== */
.table th { font-weight: 600; color: #5a6272; font-size: .82rem; letter-spacing: .02em; }
.table td { vertical-align: middle; font-size: .88rem; }
.table-hover tbody tr:hover { background: #fafaf8; }

/* ===== FORMS ===== */
.form-label { font-weight: 600; font-size: .82rem; color: #4a5568; margin-bottom: .35rem; }
.form-control, .form-select {
    font-size: .875rem;
    border-color: #dde1e9;
    border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--navy);
    border-color: var(--navy);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--navy-mid);
    border-color: var(--navy-mid);
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--navy-dark);
}

.login-left {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 60% 40%, rgba(201,168,76,.08) 0%, transparent 70%);
}

.login-left-content {
    position: relative;
    text-align: center;
    max-width: 380px;
}

.login-brand-large {
    color: #fff;
    text-align: center;
}

.login-brand-large .brand-wordmark {
    font-size: 3rem;
    color: #fff;
    display: block;
    margin: .5rem 0 .2rem;
}

.login-brand-large .sub {
    font-family: 'Sarabun', sans-serif;
    font-size: .72rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--gold);
    display: block;
    margin-bottom: 1rem;
}

.login-brand-large .thai-sub {
    font-size: .9rem;
    color: rgba(255,255,255,.45);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.2rem 0;
    color: var(--gold);
    opacity: .6;
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gold);
    opacity: .3;
}

.login-right {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}
.login-logo .brand-wordmark {
    font-size: 2rem;
    color: var(--navy);
    display: block;
    margin: .4rem 0 .15rem;
}
.login-logo .sub {
    font-size: .66rem;
    font-family: 'Sarabun', sans-serif;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

/* ===== ROOM GRID ===== */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: .75rem; }
.room-cell {
    border-radius: 10px; padding: .85rem; text-align: center;
    border: 2px solid transparent; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.room-cell:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.room-cell.available  { background: #d1e7dd; border-color: #198754; }
.room-cell.occupied   { background: #f8d7da; border-color: #dc3545; }
.room-cell.reserved   { background: #fff3cd; border-color: #ffc107; }
.room-cell.cleaning   { background: #cff4fc; border-color: #0dcaf0; }
.room-cell.maintenance{ background: #e2e3e5; border-color: #6c757d; }
.room-cell .room-num  { font-size: 1.1rem; font-weight: 700; }
.room-cell .room-type { font-size: .72rem; color: #555; margin-top: .15rem; }

/* ===== MISC ===== */
.badge { font-size: .73rem; font-weight: 500; }
.btn-sm { font-size: .8rem; }
a { color: var(--navy); }

/* Gold line decoration */
.gold-line {
    display: flex;
    align-items: center;
    gap: .8rem;
    color: var(--gold);
    font-size: .7rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    margin: .75rem 0;
}
.gold-line::before, .gold-line::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

@media (min-width: 992px) {
    .login-left { display: flex; }
    .login-right { width: 420px; flex-shrink: 0; }
    .login-wrapper { align-items: stretch; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .page-body { padding: 1rem; }
}
