/* See2ru Burj HMS — Main Stylesheet */

:root {
    --navy-900: #0a1628;
    --navy-800: #0f2240;
    --navy-700: #152d52;
    --navy-600: #1c3a66;
    --gold-500: #c9a227;
    --gold-400: #d4b545;
    --gold-300: #e8d48a;
    --cream-100: #faf8f3;
    --cream-200: #f5f0e6;
    --white: #ffffff;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #868e96;
    --gray-700: #495057;
    --gray-900: #212529;
    --success: #2b8a3e;
    --danger: #c92a2a;
    --warning: #e67700;
    --info: #1971c2;
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(10, 22, 40, 0.08);
    --shadow-lg: 0 8px 40px rgba(10, 22, 40, 0.12);
    --transition: 0.25s ease;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--gray-900);
    line-height: 1.6;
    background: var(--cream-100);
}

a {
    color: var(--navy-700);
    text-decoration: none;
}

/* ===== App Layout ===== */

.app-body {
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    box-sizing: border-box;
    padding-top: var(--app-safe-top, env(safe-area-inset-top, 0px));
    padding-bottom: var(--app-safe-bottom, env(safe-area-inset-bottom, 0px));
    height: 100vh;
    height: 100dvh;
    z-index: 1000;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--navy-900);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.brand-sub {
    font-size: 0.72rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    transition: all var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.2), transparent);
    color: var(--gold-300);
    border-left: 3px solid var(--gold-500);
    scroll-margin-block: 8px;
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.version-tag {
    font-size: 0.72rem;
    opacity: 0.4;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
}

/* Topbar */
.topbar {
    box-sizing: border-box;
    min-height: calc(var(--topbar-height) + var(--app-safe-top, env(safe-area-inset-top, 0px)));
    height: auto;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding-top: var(--app-safe-top, env(safe-area-inset-top, 0px));
    padding-right: calc(28px + var(--app-safe-right, env(safe-area-inset-right, 0px)));
    padding-left: calc(28px + var(--app-safe-left, env(safe-area-inset-left, 0px)));
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--navy-800);
    border-radius: 2px;
}

.topbar-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy-900);
}

.topbar-subtitle {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--cream-200);
    transition: background var(--transition);
}

.topbar-btn:hover {
    background: var(--gray-200);
}

.badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--gold-500);
    color: var(--navy-900);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--cream-200);
    border-radius: 50px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
    color: var(--gold-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.user-role {
    font-size: 0.72rem;
    color: var(--gray-500);
}

.logout-link {
    font-size: 1.1rem;
    color: var(--gray-500);
    padding: 4px 8px;
    transition: color var(--transition);
}

.logout-link:hover {
    color: var(--danger);
}

/* Page Content */
.page-content {
    flex: 1;
    min-width: 0;
    padding: 28px;
    overflow-x: auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.back-link:hover {
    color: var(--navy-700);
}

/* ===== Cards ===== */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-narrow {
    max-width: 640px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy-900);
}

.card-body {
    padding: 24px;
}

.card-body-flush {
    padding: 0;
}

/* ===== Stats Grid ===== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon-navy { background: rgba(10, 22, 40, 0.1); }
.stat-icon-gold { background: rgba(201, 162, 39, 0.15); color: var(--gold-500); }
.stat-icon-green { background: rgba(43, 138, 62, 0.1); color: var(--success); }
.stat-icon-blue { background: rgba(25, 113, 194, 0.1); color: var(--info); }
.stat-icon-orange { background: rgba(230, 119, 0, 0.1); color: var(--warning); }
.stat-icon-red { background: rgba(201, 42, 42, 0.1); color: var(--danger); }

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1.2;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.overview-bars {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.overview-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy-700), var(--navy-600));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-fill-gold {
    background: linear-gradient(90deg, var(--gold-500), var(--gold-400));
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 10px;
    height: 10px;
    background: var(--gold-500);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-content strong {
    font-size: 0.88rem;
    text-transform: capitalize;
    color: var(--navy-800);
}

.activity-content span {
    font-size: 0.85rem;
    color: var(--gray-700);
}

.activity-content small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ===== Tables ===== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

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

.data-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    background: var(--cream-100);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--cream-100);
}

.table-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.table-avatar {
    width: 32px;
    height: 32px;
    background: var(--navy-800);
    color: var(--gold-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ===== Badges ===== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-role {
    background: rgba(21, 45, 82, 0.1);
    color: var(--navy-700);
}

.badge-success {
    background: rgba(43, 138, 62, 0.12);
    color: var(--success);
}

.badge-danger {
    background: rgba(201, 42, 42, 0.12);
    color: var(--danger);
}

.badge-muted {
    background: var(--gray-200);
    color: var(--gray-500);
}

/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
    box-shadow: 0 4px 12px rgba(10, 22, 40, 0.3);
}

.btn-secondary {
    background: var(--cream-200);
    color: var(--navy-800);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--navy-700);
    color: var(--navy-700);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-outline-success {
    background: transparent;
    border: 1px solid var(--success);
    color: var(--success);
}

.btn-outline-success:hover {
    background: var(--success);
    color: var(--white);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
}

.inline-form {
    display: inline;
}

/* ===== Forms ===== */

.form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

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

.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h4 {
    font-size: 0.95rem;
    color: var(--navy-800);
    margin-bottom: 16px;
}

.form-check {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: var(--gray-700);
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    min-width: 16px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--gold-500);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ===== Alerts ===== */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(43, 138, 62, 0.1);
    color: var(--success);
    border: 1px solid rgba(43, 138, 62, 0.2);
}

.alert-error {
    background: rgba(201, 42, 42, 0.1);
    color: var(--danger);
    border: 1px solid rgba(201, 42, 42, 0.2);
}

.alert-warning {
    background: rgba(230, 119, 0, 0.1);
    color: var(--warning);
    border: 1px solid rgba(230, 119, 0, 0.2);
}

/* ===== Notifications Page ===== */

.notification-list {
    list-style: none;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}

.notification-item:hover {
    background: var(--cream-100);
}

.notification-item.is-unread {
    background: rgba(201, 162, 39, 0.04);
    border-left: 3px solid var(--gold-500);
}

.notification-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-content {
    flex: 1;
}

.notification-content strong {
    display: block;
    font-size: 0.95rem;
    color: var(--navy-900);
    margin-bottom: 4px;
}

.notification-content p {
    font-size: 0.88rem;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.notification-content small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ===== Roles ===== */

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.permissions-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin: 16px 0 10px;
    font-weight: 700;
}

.permission-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.permission-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.perm-check {
    color: var(--success);
    font-weight: 700;
}

.role-perm-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
}

.role-perm-group {
    margin-bottom: 14px;
}

.role-perm-group h5 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 0 0 8px;
}

.permission-matrix-table .perm-group-cell {
    vertical-align: top;
    background: rgba(10, 22, 40, 0.02);
    font-weight: 600;
}

.permission-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.permission-group-card .card-body {
    max-height: 420px;
    overflow-y: auto;
}

.permission-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.permission-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.permission-check-label input {
    margin-top: 4px;
}

.permission-check-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.permission-check-text code {
    font-size: 0.78rem;
}

.permission-editor-actions {
    position: sticky;
    bottom: 0;
    background: var(--cream-50, #fff);
    padding: 16px 0;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

code {
    background: var(--cream-200);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--navy-700);
}

/* ===== Auth Pages ===== */

.auth-body {
    min-height: 100vh;
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

.auth-brand-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 50%, var(--navy-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(201, 162, 39, 0.08) 0%, transparent 70%);
}

.auth-brand-content {
    position: relative;
    text-align: center;
    color: var(--white);
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--navy-900);
    margin: 0 auto 24px;
}

.auth-brand-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-brand-content > p {
    opacity: 0.7;
    font-size: 1rem;
    margin-bottom: 32px;
}

.auth-features {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-features span {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 0.82rem;
    opacity: 0.8;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--cream-100);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.auth-card h2 {
    font-size: 1.5rem;
    color: var(--navy-900);
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-footer-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 24px;
}

/* ===== Utilities ===== */

.text-muted {
    color: var(--gray-500);
    font-size: 0.88rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state-sm {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.mt-4 {
    margin-top: 24px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ===== Responsive ===== */

@media (max-width: 992px) {
    .main-content {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
    }
}

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
    }

    .sidebar-toggle {
        display: flex;
    }

    .topbar {
        padding-top: var(--app-safe-top, env(safe-area-inset-top, 0px));
        padding-right: calc(16px + var(--app-safe-right, env(safe-area-inset-right, 0px)));
        padding-left: calc(16px + var(--app-safe-left, env(safe-area-inset-left, 0px)));
    }

    .page-content {
        padding: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .user-info {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-wrapper {
        flex-direction: column;
    }

    .auth-brand-panel {
        padding: 32px 24px;
        min-height: auto;
    }

    .auth-brand-content h1 {
        font-size: 1.5rem;
    }

    .auth-form-panel {
        padding: 24px;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }
}

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

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

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

/* ===== Room Management ===== */

.room-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}

.room-stat-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--gray-300);
}

.room-stat-icon {
    font-size: 1.2rem;
    opacity: 0.85;
}

.room-stat-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: 700;
}

.room-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy-900);
    line-height: 1.2;
}

.room-stat-available   { border-left-color: var(--success); }
.room-stat-reserved    { border-left-color: var(--info); }
.room-stat-occupied    { border-left-color: var(--navy-700); }
.room-stat-cleaning    { border-left-color: #7048e8; }
.room-stat-maintenance { border-left-color: var(--warning); }
.room-stat-inactive    { border-left-color: var(--gray-500); }

.badge-room-available {
    background: rgba(43, 138, 62, 0.12);
    color: var(--success);
}

.badge-room-reserved {
    background: rgba(25, 113, 194, 0.12);
    color: var(--info);
}

.badge-room-occupied {
    background: rgba(21, 45, 82, 0.12);
    color: var(--navy-700);
}

.badge-room-cleaning {
    background: rgba(112, 72, 232, 0.12);
    color: #5f3dc4;
}

.badge-room-maintenance {
    background: rgba(230, 119, 0, 0.12);
    color: var(--warning);
}

.badge-room-inactive {
    background: var(--gray-200);
    color: var(--gray-500);
}

.room-board {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.floor-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--cream-100);
}

.floor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(90deg, var(--navy-900), var(--navy-800));
    color: #ffffff;
}

.floor-label {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.floor-count {
    font-size: 0.78rem;
    opacity: 0.7;
}

.room-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 20px;
}

.room-board-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--gray-300);
    transition: transform var(--transition), box-shadow var(--transition);
}

.room-board-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.room-board-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy-900);
    margin-bottom: 4px;
}

.room-board-type {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-bottom: 6px;
    line-height: 1.3;
}

.room-board-price {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gold-500);
    margin-bottom: 10px;
}

.room-board-meta {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.room-board-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy-800);
    margin-bottom: 10px;
    line-height: 1.3;
    min-height: 1.25rem;
}

.room-board-guest span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.room-board-guest--muted {
    color: var(--gray-500);
    font-weight: 500;
    font-style: italic;
}

.room-board-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.room-board-card-link:hover {
    color: inherit;
}

.dashboard-room-board {
    margin-bottom: 8px;
}

.dashboard-room-board-sub {
    margin-top: 4px;
    font-size: 0.88rem;
}

.dashboard-room-board-inner {
    gap: 20px;
}

.dashboard-room-board-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
    padding: 16px;
}

.dashboard-room-board-grid .room-board-card {
    padding: 14px 12px;
}

.dashboard-room-board-grid .room-board-number {
    font-size: 1.35rem;
}

.dashboard-room-board-empty {
    padding: 28px;
    text-align: center;
}

.room-card-available   { border-top-color: var(--success); }
.room-card-reserved    { border-top-color: var(--info); }
.room-card-occupied    { border-top-color: var(--navy-700); background: rgba(21, 45, 82, 0.03); }
.room-card-cleaning    { border-top-color: #7048e8; }
.room-card-maintenance { border-top-color: var(--warning); background: rgba(230, 119, 0, 0.04); }
.room-card-inactive    { border-top-color: var(--gray-500); opacity: 0.65; }

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.room-status-preview {
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    border-top: 4px solid var(--gray-300);
}

.status-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.status-pick-btn {
    cursor: pointer;
    border: none;
    font-family: inherit;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    transition: transform 0.15s ease;
}

.status-pick-btn:hover {
    transform: scale(1.05);
}

.progress-fill-reserved {
    background: linear-gradient(90deg, var(--info), #74c0fc);
}

.progress-fill-warning {
    background: linear-gradient(90deg, var(--warning), #ffa94d);
}

@media (max-width: 768px) {
    .room-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .room-board-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 14px;
    }

    .dashboard-room-board-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .dashboard-room-board-grid .room-board-number {
        font-size: 1.2rem;
    }

    .room-board-guest {
        font-size: 0.72rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Guests & Reservations ===== */

.search-form {
    margin: 0;
}

.search-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 220px;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
    color: var(--gold-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    flex-shrink: 0;
}

.profile-name {
    font-size: 1.35rem;
    color: var(--navy-900);
    margin-bottom: 4px;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-item dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    font-weight: 700;
    margin-bottom: 2px;
}

.detail-item dd {
    font-size: 0.95rem;
    color: var(--gray-900);
}

.text-balance-due {
    color: var(--danger);
    font-weight: 700;
}

.input-readonly {
    background: var(--cream-200);
    color: var(--gray-700);
}

.charges-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.charge-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
}

.charge-row span:last-child {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.charge-total {
    border-bottom: 2px solid var(--navy-800);
    padding-top: 10px;
    font-size: 1rem;
}

.charge-balance {
    color: var(--danger);
    font-weight: 700;
}

/* Booking Folio */
.folio-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.reservation-folio,
.invoice-card.folio-card {
    max-width: 900px;
}

.folio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    color: var(--white);
}

.folio-brand {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.folio-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    color: var(--navy-900);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.folio-brand h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.folio-brand p {
    font-size: 0.82rem;
    opacity: 0.75;
    line-height: 1.5;
}

.folio-meta {
    text-align: right;
}

.folio-code {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold-300);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.folio-status {
    margin-bottom: 8px;
}

.folio-date {
    font-size: 0.78rem;
    opacity: 0.7;
}

.folio-body {
    padding: 32px;
}

.folio-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--gray-200);
}

.folio-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.folio-section h3 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--navy-700);
    margin-bottom: 16px;
    font-weight: 700;
}

.folio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.folio-grid dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: 700;
    margin-bottom: 2px;
}

.folio-grid dd {
    font-size: 0.92rem;
    color: var(--gray-900);
}

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

.folio-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.92rem;
}

.folio-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.folio-deduct {
    color: var(--success);
}

.folio-total-row td {
    border-bottom: none;
    padding-top: 16px;
    font-size: 1rem;
}

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

.folio-payment-item {
    background: var(--cream-100);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.folio-payment-item span {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 6px;
    font-weight: 700;
}

.folio-payment-item strong {
    font-size: 1.4rem;
    color: var(--navy-900);
}

.folio-payment-due {
    border-color: rgba(201, 42, 42, 0.3);
    background: rgba(201, 42, 42, 0.04);
}

.folio-payment-due strong {
    color: var(--danger);
}

.folio-payment-clear strong {
    color: var(--success);
}

.folio-footer {
    padding: 20px 32px;
    background: var(--cream-100);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.folio-footer p {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-style: italic;
}

.folio-currency-tag {
    font-size: 0.78rem;
    color: var(--gold-300);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

.folio-ngn-hint {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.folio-currency-notice {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--navy-700);
    font-style: normal;
}

.folio-table-head th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.folio-table-head .folio-amount {
    text-align: right;
}

@media print {
    .sidebar, .topbar, .page-header, .sidebar-overlay, .no-print, .print-toolbar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    body {
        background: #fff !important;
    }

    .folio-card {
        box-shadow: none;
        max-width: 100%;
        border: none;
    }

    .print-receipt {
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .folio-header {
        flex-direction: column;
        padding: 24px;
    }

    .folio-meta {
        text-align: left;
    }

    .folio-body {
        padding: 20px;
    }

    .folio-payment-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Check-in / Check-out Operations ===== */

.ops-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.ops-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 32px;
    color: var(--white);
}

.ops-header-checkin {
    background: linear-gradient(135deg, var(--navy-800), var(--info));
}

.ops-header-checkout {
    background: linear-gradient(135deg, var(--navy-900), var(--warning));
}

.ops-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    display: block;
    margin-bottom: 6px;
}

.ops-card-header h2 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.ops-card-header p {
    opacity: 0.85;
    font-size: 0.9rem;
}

.ops-card-body {
    padding: 32px;
}

.ops-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ops-summary-compact {
    margin-bottom: 0;
}

.ops-summary-item {
    background: var(--cream-100);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--gray-200);
}

.ops-summary-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: 700;
    margin-bottom: 4px;
}

.ops-summary-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--navy-900);
}

.ops-summary-item small {
    display: block;
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.ops-note {
    background: rgba(201, 162, 39, 0.08);
    border-left: 3px solid var(--gold-500);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.ops-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
}

.row-overdue {
    background: rgba(201, 42, 42, 0.04) !important;
}

.text-success {
    color: var(--success);
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.checkout-section h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--navy-700);
    margin-bottom: 12px;
}

.checkout-charges {
    margin-bottom: 24px;
}

.checkout-charges h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--navy-700);
    margin-bottom: 12px;
}

.checkout-payment {
    margin-bottom: 24px;
}

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

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

    .ops-card-header {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
    }
}

/* Phase 5A — Housekeeping */
.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.stat-icon-purple {
    background: rgba(112, 72, 232, 0.12);
    color: #7048e8;
}

.badge-hk-inspection {
    background: rgba(25, 113, 194, 0.12);
    color: var(--info);
}

.room-stat-inspection { border-left-color: var(--info); }
.room-card-inspection   { border-top-color: var(--info); background: rgba(25, 113, 194, 0.04); }

.btn-gold {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    color: var(--navy-900);
    border: none;
    font-weight: 700;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
    color: var(--navy-900);
}

.hk-summary-grid,
.hk-dashboard-widgets {
    margin-top: 0;
}

.dashboard-hk-link {
    margin: -8px 0 20px;
    font-size: 0.88rem;
}

.hk-readiness-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hk-readiness-column {
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    min-height: 280px;
}

.hk-column-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--gray-200);
}

.hk-column-header h4 {
    margin: 0 0 2px;
    font-size: 1rem;
}

.hk-column-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.hk-column-cleaning .hk-column-header { background: rgba(112, 72, 232, 0.06); }
.hk-column-inspection .hk-column-header { background: rgba(25, 113, 194, 0.06); }
.hk-column-available .hk-column-header { background: rgba(43, 138, 62, 0.06); }

.hk-room-cards {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hk-empty-column {
    text-align: center;
    padding: 24px 12px;
    font-size: 0.88rem;
}

.hk-room-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    border-top: 4px solid var(--gray-300);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.hk-room-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.hk-room-number {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy-800);
}

.hk-room-type {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.hk-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.hk-task-type {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.hk-staff {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 10px;
}

.hk-card-link {
    width: 100%;
    text-align: center;
}

.hk-detail-grid {
    align-items: start;
}

.hk-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hk-timeline h4 {
    margin: 0 0 14px;
    font-size: 0.95rem;
}

.hk-timeline-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 8px;
}

.hk-timeline-step {
    display: flex;
    gap: 14px;
    padding: 10px 0 10px 0;
    position: relative;
    opacity: 0.55;
}

.hk-timeline-step.done,
.hk-timeline-step.current {
    opacity: 1;
}

.hk-timeline-step.current .hk-step-dot {
    background: var(--gold-500);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2);
}

.hk-timeline-step.done .hk-step-dot {
    background: var(--success);
}

.hk-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-400);
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.hk-timeline-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 22px;
    bottom: -2px;
    width: 2px;
    background: var(--gray-200);
}

.hk-timeline-step strong {
    display: block;
    font-size: 0.88rem;
}

.hk-timeline-step span {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.hk-inspection-panel {
    padding: 16px;
    background: rgba(25, 113, 194, 0.05);
    border: 1px solid rgba(25, 113, 194, 0.15);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.hk-inspection-panel h4 {
    margin: 0 0 8px;
}

.hk-inspection-forms {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.hk-my-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.hk-my-task-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px;
    background: #fff;
    border-top: 4px solid var(--gold-500);
}

.hk-my-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hk-task-notes {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: 10px 0;
    padding: 10px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.hk-my-task-actions {
    margin-top: 14px;
}

.hk-awaiting-label {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    padding: 10px;
}

.row-highlight {
    background: rgba(201, 162, 39, 0.08);
}

@media (max-width: 992px) {
    .hk-readiness-board {
        grid-template-columns: 1fr;
    }
}

/* Phase 6 — Payments & Invoices */
.billing-summary-grid,
.billing-dashboard-widgets {
    margin-top: 0;
}

.input-readonly {
    background: var(--gray-50);
    color: var(--gray-700);
    cursor: not-allowed;
}

.input-balance-due {
    font-weight: 700;
    color: var(--danger);
}

.text-balance-clear {
    color: var(--success);
    font-weight: 700;
}

.receipt-card .receipt-amount {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--success);
}

.receipt-badge {
    margin-top: 6px;
}

.checkout-payment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 20px;
}

.folio-balance-section {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 16px;
}

.folio-discount-row td {
    color: var(--success);
}

.invoice-card {
    margin-bottom: 24px;
}

.payment-activity-list .activity-dot-gold {
    background: var(--gold-500);
}

.print-body {
    background: #fff;
    padding: 24px;
}

.print-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.print-invoice {
    max-width: 800px;
    margin: 0 auto;
}

.print-invoice .folio-payment-grid {
    grid-template-columns: repeat(3, 1fr);
}

.print-body-a4 {
    background: #f3f4f6;
}

.print-invoice-a4 {
    max-width: 210mm;
    min-height: 260mm;
    margin: 0 auto;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.print-totals-section {
    border: 1px solid var(--gray-200);
}

.print-signature-section {
    margin-top: 32px;
}

.print-signature-line {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 280px;
}

.print-signature-line span {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.signature-space {
    border-bottom: 1px solid var(--gray-400);
    height: 1px;
}

.print-generated-by {
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--gray-500);
}

.receipt-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.payment-reservation-summary {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
}

.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px 20px;
}

.payment-summary-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.payment-amount-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.form-error {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 4px;
    display: block;
}

@media (max-width: 768px) {
    .print-invoice .folio-payment-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .print-body-a4 {
        background: #fff;
        padding: 0;
    }

    .print-invoice-a4 {
        box-shadow: none;
        max-width: 100%;
        min-height: auto;
    }

    @page {
        size: A4;
        margin: 12mm;
    }
}

.card-header .btn-sm {
    margin-left: auto;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ===== Phase 7 — Reports ===== */

.report-page {
    max-width: 100%;
}

.report-exec-grid {
    margin-bottom: 28px;
}

.report-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.report-hub-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border-top: 4px solid var(--gold-500);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-hub-card h3 {
    font-size: 1.1rem;
    color: var(--navy-900);
    margin: 0;
}

.report-hub-card p {
    color: var(--gray-500);
    font-size: 0.88rem;
    flex: 1;
    margin: 0;
}

.report-hub-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.report-hub-icon-gold   { background: rgba(201, 162, 39, 0.15); }
.report-hub-icon-navy   { background: rgba(21, 45, 82, 0.12); }
.report-hub-icon-green  { background: rgba(47, 158, 68, 0.12); }
.report-hub-icon-red    { background: rgba(224, 49, 49, 0.12); }
.report-hub-icon-purple { background: rgba(112, 72, 232, 0.12); }
.report-hub-icon-blue   { background: rgba(25, 113, 194, 0.12); }

.report-quick-links {
    margin-top: 8px;
}

.report-filters {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.report-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.report-filter-form .form-group {
    margin: 0;
}

.report-filter-form label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.report-filter-form input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.report-print-header {
    display: none;
}

.report-print-brand {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.report-print-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy-900);
    margin: 4px 0;
}

.report-print-range,
.report-print-generated {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 2px 0;
}

.report-charts-grid {
    margin-top: 20px;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-chart-row {
    display: grid;
    grid-template-columns: 100px 1fr 90px;
    gap: 10px;
    align-items: center;
}

.bar-chart-label {
    font-size: 0.82rem;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-chart-track {
    height: 22px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.bar-chart-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy-700), var(--gold-500));
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.bar-chart-value {
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.chart-empty {
    padding: 20px 0;
    text-align: center;
}

.aged-balance-grid {
    margin-top: 16px;
}

.aged-bucket-warning .stat-value { color: var(--warning); }
.aged-bucket-critical .stat-value { color: var(--danger); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
}

@media print {
    .report-print-header {
        display: block;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 2px solid var(--navy-800);
    }

    .report-page .card {
        box-shadow: none;
        break-inside: avoid;
    }

    .report-page .data-table th,
    .report-page .data-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .bar-chart-fill {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

@media (max-width: 768px) {
    .bar-chart-row {
        grid-template-columns: 80px 1fr 70px;
    }

    .report-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== Phase 8 — Shifts & Attendance ===== */

.shift-status-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    border-left: 4px solid var(--gray-300);
}

.shift-status-open {
    border-left-color: var(--success);
}

.shift-status-closed {
    border-left-color: var(--gray-400);
}

.shift-status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.shift-status-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    display: block;
    margin-bottom: 6px;
}

.shift-status-header h2 {
    font-size: 1.35rem;
    color: var(--navy-900);
    margin-bottom: 4px;
}

.shift-status-actions {
    flex-shrink: 0;
}

.shift-notes-block {
    margin-top: 20px;
    padding: 16px;
    background: var(--cream-100);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold-500);
}

.shift-notes-block strong {
    display: block;
    margin-bottom: 6px;
    color: var(--navy-800);
}

.shift-open-info {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.shift-activity-grid {
    margin-bottom: 8px;
}

.shift-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shift-timeline-item {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.shift-timeline-dot {
    width: 10px;
    height: 10px;
    background: var(--gold-500);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.shift-timeline-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shift-timeline-content span {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.handover-panel .handover-card {
    padding: 16px;
    background: var(--cream-100);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--gold-500);
    margin-bottom: 12px;
}

.handover-panel .handover-card:last-child {
    margin-bottom: 0;
}

.handover-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.handover-card-meta span {
    color: var(--gray-500);
}

.handover-card {
    padding: 16px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), rgba(21, 45, 82, 0.04));
    border-radius: var(--radius-sm);
    border: 1px solid rgba(201, 162, 39, 0.25);
}

.handover-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--navy-800);
}

.shift-dashboard-widgets {
    margin-top: 0;
}

.attendance-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.attendance-inline-form select,
.attendance-inline-form input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
}

@media (max-width: 768px) {
    .shift-status-header {
        flex-direction: column;
    }
}

/* ── Phase 9: Maintenance ── */

.mt-summary-grid .stat-card-mt-critical.stat-card-critical-alert {
    border-color: var(--danger-500);
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08), rgba(220, 53, 69, 0.02));
    animation: mt-pulse-critical 2s ease-in-out infinite;
}

@keyframes mt-pulse-critical {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}

.stat-card-critical-alert .stat-value {
    color: var(--danger-600);
}

.row-critical-ticket {
    background: rgba(220, 53, 69, 0.06);
    border-left: 3px solid var(--danger-500);
}

.row-critical-ticket td:first-child {
    font-weight: 600;
}

.mt-critical-banner {
    border-left: 4px solid var(--danger-500);
    margin-bottom: 20px;
}

.mt-detail-grid {
    grid-template-columns: 1.4fr 1fr;
}

.mt-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mt-timeline .hk-timeline-steps {
    padding-left: 4px;
}

.mt-resolution-notes {
    background: var(--gray-50);
    padding: 12px;
    border-radius: var(--radius);
    border-left: 3px solid var(--gold-500);
}

.mt-actions-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mt-my-tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.mt-my-ticket-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px;
    background: #fff;
    border-top: 4px solid var(--navy-600);
}

.mt-my-ticket-card.mt-card-critical {
    border-top-color: var(--danger-500);
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.04), #fff 40%);
}

.mt-my-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mt-ticket-number {
    font-weight: 700;
    color: var(--navy-800);
}

.mt-room-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.mt-ticket-title {
    margin: 0 0 6px;
    color: var(--gray-700);
}

.mt-task-meta {
    margin: 10px 0;
}

.mt-my-ticket-actions {
    margin-top: 14px;
}

.mt-awaiting-label {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    padding: 10px;
}

.mt-move-room-panel,
.mt-close-room-panel {
    padding: 14px;
    background: rgba(201, 162, 39, 0.06);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: var(--radius);
}

.mt-close-resolution {
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--gold-500);
}

.mt-close-resolution h4 {
    margin: 0 0 8px;
}

.mt-dashboard-widgets {
    margin-top: 8px;
}

.mt-critical-panel .activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.activity-dot-danger {
    background: var(--danger-500);
}

.badge-sm {
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-left: 6px;
}

@media (max-width: 992px) {
    .mt-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Phase 10: Inventory ── */

.inv-summary-grid .stat-card-warning-alert {
    border-color: var(--gold-500);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), rgba(201, 162, 39, 0.02));
}

.row-low-stock {
    background: rgba(201, 162, 39, 0.06);
    border-left: 3px solid var(--gold-500);
}

.row-critical-stock {
    background: rgba(220, 53, 69, 0.06);
    border-left: 3px solid var(--danger-500);
}

.inv-critical-banner,
.inv-low-banner {
    margin-bottom: 20px;
}

.inv-low-banner {
    border-left: 4px solid var(--gold-500);
}

.inv-critical-banner {
    border-left: 4px solid var(--danger-500);
}

.inv-detail-grid {
    grid-template-columns: 1.3fr 1fr;
}

.inv-supply-panel {
    border-top: 4px solid var(--navy-600);
}

.inv-supply-history h4 {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.inv-override-panel {
    padding: 14px;
    background: rgba(220, 53, 69, 0.04);
    border: 1px solid rgba(220, 53, 69, 0.15);
    border-radius: var(--radius);
}

.inv-dashboard-widgets {
    margin-top: 8px;
}

.inv-critical-panel .activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.sku-code {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-left: 6px;
}

.form-static {
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin: 0;
}

@media (max-width: 992px) {
    .inv-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Phase 11A: POS Charge Bridge ── */

.pos-summary-grid .stat-details small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
}

.pos-detail-grid {
    grid-template-columns: 1.4fr 1fr;
}

.pos-actions-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-guest-preview {
    padding: 14px;
    background: rgba(201, 162, 39, 0.06);
    border: 1px solid rgba(201, 162, 39, 0.15);
    border-radius: var(--radius);
}

.pos-override-panel {
    padding: 14px;
    background: rgba(220, 53, 69, 0.04);
    border: 1px solid rgba(220, 53, 69, 0.15);
    border-radius: var(--radius);
}

.pos-folio-section {
    border-top: 2px solid var(--gold-500);
    padding-top: 20px;
}

.pos-folio-section h3 {
    color: var(--navy-800);
}

.pos-dashboard-widgets {
    margin-top: 8px;
}

.row-reversed {
    opacity: 0.75;
    background: rgba(201, 41, 41, 0.04);
}

.pos-folio-reversed td {
    color: var(--text-muted, #6b7280);
}

.folio-subtotal-row td {
    border-top: 2px solid var(--border-color, #e5e7eb);
    padding-top: 0.75rem;
}

@media (max-width: 992px) {
    .pos-detail-grid {
        grid-template-columns: 1fr;
    }
}
