/* =====================================================================
   Ngosha Hotels — Shared Design System
   Inatumika na kurasa zote za dashboard, admin na setup.
   Ondoa <style> blocks zilizorudiwa; tumia hii badala yake.
   © 2026 Ngosha Multimedia | Dodoma, Tanzania
   ===================================================================== */

:root {
    --hms-primary: #8BC34A;
    --hms-primary-dark: #689F38;
    --hms-primary-light: #F1F8E9;
    --hms-secondary: #1a1a2e;
    --hms-accent: #f8b500;
    --hms-danger: #dc2626;
    --hms-warning: #b45309;
    --hms-info: #185FA5;
    --hms-success: #3B6D11;
    --hms-text: #1e293b;
    --hms-muted: #64748b;
    --hms-border: #e2e8f0;
    --hms-bg: #f6f8fb;
    --hms-card: #ffffff;
    --hms-radius: 14px;
    --hms-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .04);
    --hms-sidebar-w: 260px;
}

/* --- Base ---------------------------------------------------------- */
body.hms {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--hms-bg);
    color: var(--hms-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.hms a { text-decoration: none; }

/* Focus ring — ilikuwa haipo kabisa (accessibility) */
.hms :focus-visible {
    outline: 3px solid rgba(139, 195, 74, .55);
    outline-offset: 2px;
    border-radius: 6px;
}

/* --- Sidebar ------------------------------------------------------- */
.hms-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--hms-sidebar-w);
    background: var(--hms-secondary);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .25s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hms-sidebar-header {
    padding: 22px 18px;
    text-align: center;
    background: linear-gradient(135deg, var(--hms-primary), var(--hms-primary-dark));
}

.hms-sidebar-header h1 {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
    line-height: 1.3;
    word-break: break-word;
}

.hms-sidebar-header .hms-plan {
    display: inline-block;
    margin-top: 8px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
}

.hms-sidebar-menu { padding: 10px 0 30px; flex: 1; }

.hms-sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    font-size: .93rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}

.hms-sidebar-menu a i { width: 20px; text-align: center; font-size: 1rem; }
.hms-sidebar-menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.hms-sidebar-menu a.active {
    background: rgba(139, 195, 74, .16);
    color: #fff;
    border-left-color: var(--hms-primary);
}

.hms-sidebar-menu .hms-group {
    padding: 16px 20px 6px;
    font-size: .68rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 800;
}

.hms-sidebar-menu .hms-badge {
    margin-left: auto;
    background: var(--hms-danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
}

/* --- Topbar (mobile) ----------------------------------------------- */
.hms-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1030;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--hms-card);
    border-bottom: 1px solid var(--hms-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.hms-topbar .hms-burger {
    border: 1px solid var(--hms-border);
    background: #fff;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    color: var(--hms-text);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.hms-topbar .hms-title {
    font-weight: 800;
    font-size: .98rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hms-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 1040;
    display: none;
}

/* --- Main ---------------------------------------------------------- */
.hms-main {
    margin-left: var(--hms-sidebar-w);
    padding: 26px 30px 60px;
    min-height: 100vh;
}

.hms-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.hms-page-head h2 { font-weight: 800; margin: 0; font-size: 1.5rem; }
.hms-page-head .hms-sub { color: var(--hms-muted); font-size: .9rem; margin: 4px 0 0; }

/* --- Cards & stats -------------------------------------------------- */
.hms-card {
    background: var(--hms-card);
    border: 1px solid var(--hms-border);
    border-radius: var(--hms-radius);
    box-shadow: var(--hms-shadow);
}

.hms-card-body { padding: 20px; }

.hms-stat {
    background: var(--hms-card);
    border: 1px solid var(--hms-border);
    border-radius: var(--hms-radius);
    padding: 18px;
    box-shadow: var(--hms-shadow);
    height: 100%;
}

.hms-stat .hms-stat-label {
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hms-muted);
    margin: 0 0 6px;
}

.hms-stat .hms-stat-value { font-size: 1.55rem; font-weight: 800; margin: 0; line-height: 1.2; }
.hms-stat .hms-stat-foot { font-size: .8rem; color: var(--hms-muted); margin: 6px 0 0; }
.hms-stat .hms-stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.05rem;
}
.hms-delta-up   { color: var(--hms-success); font-weight: 700; }
.hms-delta-down { color: var(--hms-danger);  font-weight: 700; }

/* --- Status pills --------------------------------------------------- */
.hms-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: .76rem; font-weight: 700; white-space: nowrap;
}
.hms-pill-available    { background: #EAF3DE; color: #3B6D11; }
.hms-pill-reserved     { background: #E6F1FB; color: #185FA5; }
.hms-pill-occupied     { background: #FAECE7; color: #993C1D; }
.hms-pill-cleaning     { background: #FAEEDA; color: #854F0B; }
.hms-pill-maintenance  { background: #EEEDFE; color: #534AB7; }
.hms-pill-out_of_order { background: #E5E7EB; color: #374151; }

.hms-pill-pending     { background: #FAEEDA; color: #854F0B; }
.hms-pill-confirmed   { background: #E6F1FB; color: #185FA5; }
.hms-pill-checked_in  { background: #EAF3DE; color: #3B6D11; }
.hms-pill-checked_out { background: #E5E7EB; color: #374151; }
.hms-pill-cancelled   { background: #FAECE7; color: #993C1D; }

/* --- Tables ---------------------------------------------------------- */
.hms-table { width: 100%; border-collapse: collapse; }
.hms-table thead th {
    background: #f8fafc;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--hms-muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--hms-border);
    white-space: nowrap;
}
.hms-table tbody td { padding: 13px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: .9rem; }
.hms-table tbody tr:hover { background: #fbfdf8; }

/* --- Empty state ----------------------------------------------------- */
.hms-empty { text-align: center; padding: 52px 20px; color: var(--hms-muted); }
.hms-empty i { font-size: 2.6rem; opacity: .35; margin-bottom: 14px; display: block; }
.hms-empty h5 { font-weight: 700; color: var(--hms-text); margin-bottom: 6px; }

/* --- Buttons --------------------------------------------------------- */
.btn-hms {
    background: var(--hms-primary); border-color: var(--hms-primary); color: #fff; font-weight: 700;
}
.btn-hms:hover, .btn-hms:focus { background: var(--hms-primary-dark); border-color: var(--hms-primary-dark); color: #fff; }
.btn-hms:disabled { opacity: .6; }

/* --- Room grid -------------------------------------------------------- */
.hms-room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 14px;
}

.hms-room-card {
    background: #fff; border: 1px solid var(--hms-border); border-radius: 12px;
    padding: 14px; text-align: center; transition: transform .12s, box-shadow .12s;
}
.hms-room-card:hover { transform: translateY(-2px); box-shadow: var(--hms-shadow); }
.hms-room-card .hms-room-no { font-size: 1.2rem; font-weight: 800; }

/* Vitendo vionekane daima kwenye simu (vilikuwa opacity:0 hadi hover) */
.hms-row-actions { opacity: 0; transition: opacity .15s; }
tr:hover .hms-row-actions, .hms-room-card:hover .hms-row-actions { opacity: 1; }
@media (hover: none), (max-width: 992px) {
    .hms-row-actions { opacity: 1 !important; }
}

/* --- Alerts ----------------------------------------------------------- */
.hms .alert { border: 0; border-radius: 12px; font-weight: 600; }

/* --- Banner ya usajili ------------------------------------------------- */
.hms-sub-banner {
    border-radius: 12px; padding: 12px 16px; margin-bottom: 18px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-weight: 600; font-size: .9rem;
}
.hms-sub-warn { background: #FAEEDA; color: #854F0B; }
.hms-sub-danger { background: #FAECE7; color: #993C1D; }

/* --- Mobile ------------------------------------------------------------ */
@media (max-width: 992px) {
    .hms-sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .hms-sidebar.open { transform: translateX(0); }
    .hms-backdrop.show { display: block; }
    .hms-topbar { display: flex; }
    .hms-main { margin-left: 0; padding: 16px 14px 70px; }
    .hms-page-head h2 { font-size: 1.25rem; }

    /* Meza ndefu ziwe za kusogeza, na safu ya kwanza ibaki */
    .hms-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hms-table thead th:first-child,
    .hms-table tbody td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
    .hms-table thead th:first-child { background: #f8fafc; }
}

@media (max-width: 576px) {
    .hms-stat .hms-stat-value { font-size: 1.3rem; }
    .hms-room-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* --- Print (risiti) ------------------------------------------------------ */
@media print {
    .hms-sidebar, .hms-topbar, .hms-backdrop, .no-print { display: none !important; }
    .hms-main { margin: 0; padding: 0; }
    body { background: #fff; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
