/* ==========================================================================
   Google Stitch Luxury Design System - Hotel Property Management System (PMS)
   Foundational CSS Tokens, Components & Utilities
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Stitch Core Color Tokens - Modern Clean SaaS (Linear / WHBMP style) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-dark: #1e40af;
    --primary-accent: #3b82f6;

    /* Semantic Status Tokens - Modern Crisp */
    --secondary: #475569;
    --secondary-light: #f1f5f9;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --success-border: #bbf7d0;
    --warning: #ea580c;
    --warning-light: #fff7ed;
    --warning-border: #fed7aa;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;
    --info: #0284c7;
    --info-light: #f0f9ff;
    --info-border: #bae6fd;

    /* Slate Neutral Surfaces */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #0b1329;

    /* Dark Midnight Sidebar Tokens */
    --sidebar-bg: #0b1329;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: #2563eb;

    /* Layout Geometry */
    --sidebar-width: 240px;
    --header-height: 62px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Elevation Shadows - Clean, Subtle, Minimalist */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);

    /* Stitch Typography Stacks */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--slate-50);
    color: var(--slate-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Monospace & Tabular Helpers */
.stitch-mono, code, kbd, samp {
    font-family: var(--font-mono);
}

.stitch-serif {
    font-family: var(--font-serif);
}

/* Super Admin Impersonation Top Banner */
.impersonation-banner {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    color: #f8fafc;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.impersonation-banner a {
    color: #ffffff;
    background: #1e293b;
    border: 1px solid #334155;
    padding: 3px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}
.impersonation-banner a:hover {
    background: #334155;
    color: #ffffff;
}

/* Layout Architecture */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* Sidebar - Clean Midnight Navy SaaS */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    border-right: 1px solid var(--sidebar-border);
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 16px 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--sidebar-border);
    background: transparent;
}

.sidebar-brand-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #0b1329;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sidebar-brand h1 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.sidebar-brand span {
    font-size: 0.65rem;
    color: #64748b;
    display: block;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.sidebar-close-btn {
    display: none !important;
    background: transparent;
    border: none;
    color: var(--slate-400);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
}
.sidebar-close-btn:hover {
    color: #ffffff;
    background: var(--slate-800);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 2500;
}
.sidebar-backdrop.active {
    display: block;
}

.sidebar-nav {
    padding: 12px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-title {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    padding: 12px 10px 4px;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 8px;
    transition: all 0.15s ease-in-out;
    border: none;
}

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

.nav-link.active {
    background-color: #2563eb;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: color 0.15s ease-in-out;
    flex-shrink: 0;
}

.nav-icon .svg-icon {
    width: 15px;
    height: 15px;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    color: #ffffff !important;
}

/* Sidebar Collapsible Submenu Groups */
.nav-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.nav-group-trigger {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 9px 12px;
    color: #94a3b8;
    background: transparent;
    border: none;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease-in-out;
}

.nav-group-trigger:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.nav-group.active > .nav-group-trigger {
    color: #ffffff;
    font-weight: 600;
}

.nav-group.active > .nav-group-trigger .nav-icon {
    color: #ffffff;
}

.nav-group-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.nav-chevron .svg-icon {
    width: 12px;
    height: 12px;
}

.nav-group.open .nav-chevron {
    transform: rotate(180deg);
    color: #ffffff;
}

.nav-sub-menu {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 4px 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 20px;
    margin-top: 2px;
}

.nav-group.open .nav-sub-menu {
    display: flex;
}

.nav-sub-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.80rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
    line-height: 1.3;
}

.nav-sub-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-sub-link.active {
    color: #ffffff !important;
    background-color: #2563eb;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.09);
    font-weight: 600;
}

.nav-sub-link::before {
    display: none;
}

.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background-color: transparent;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Lucide Icons Pack & SVG Icons Utility */
.svg-icon, .lucide, [data-lucide] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 1.1em;
    height: 1.1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.svg-icon-xs, .lucide-xs { width: 0.8em; height: 0.8em; }
.svg-icon-sm, .lucide-sm { width: 0.95em; height: 0.95em; }
.svg-icon-md, .lucide-md { width: 1.15em; height: 1.15em; }
.svg-icon-lg, .lucide-lg { width: 1.35em; height: 1.35em; }
.svg-icon-xl, .lucide-xl { width: 1.8em; height: 1.8em; }
.svg-icon-2xl, .lucide-2xl { width: 2.2em; height: 2.2em; }

/* Main Workspace */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    box-sizing: border-box;
}

/* Topbar - Modern Clean SaaS Style */
.topbar {
    height: var(--header-height);
    background-color: #ffffff;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    width: 100%;
    box-sizing: border-box;
    gap: 16px;
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 360px;
}

.topbar-search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.topbar-search-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    font-size: 0.82rem;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
}

.topbar-search-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.topbar-search-input::placeholder {
    color: #94a3b8;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    border: 1px solid transparent;
}

.user-profile-pill:hover {
    background-color: #f8fafc;
    border-color: #edf2f7;
}

.user-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1.5px solid #bfdbfe;
}

.user-profile-details {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
}

.user-profile-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.user-profile-role {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.2;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.topbar-icon-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--slate-200);
    border-radius: 6px;
    color: var(--slate-700);
    padding: 5px 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn:hover {
    background-color: var(--slate-100);
    color: var(--slate-900);
}

/* Visibility Utilities */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

@media (max-width: 768px) {
    .d-mobile-none { display: none !important; }
}

@media (max-width: 1100px) {
    .d-tablet-none { display: none !important; }
}

@media (max-width: 1280px) {
    .d-laptop-none { display: none !important; }
}

.content-container {
    padding: 24px 28px;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Responsive Grid Helpers */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.toolbar-responsive {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

/* Cards - Google Stitch Surface Container */
.card {
    background-color: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    transition: border-color 0.15s ease;
}

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

.card-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.015em;
}

/* Metric Pulse Cards - Google Stitch Bento Style */
.pulse-card {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--slate-200);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pulse-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -2px rgba(0, 0, 0, 0.08);
    border-color: var(--slate-300);
}

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

.pulse-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--slate-500);
}

.pulse-value {
    font-family: var(--font-mono);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--slate-900);
    line-height: 1.1;
    margin: 4px 0 6px;
    letter-spacing: -0.02em;
}

.pulse-sub {
    font-size: 0.78rem;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Metric Pulse Cards - Clean Minimalist Flat Bento */
.pulse-card {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--slate-200);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pulse-card:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-md);
}

.pulse-card.primary,
.pulse-card.success,
.pulse-card.warning,
.pulse-card.secondary,
.pulse-card.danger,
.pulse-card.gold {
    border-top: 1px solid var(--slate-200);
}

/* Modern Clean SaaS Stat Cards (Reference Image Aesthetic) */
.stat-card-modern {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.15s ease;
}

.stat-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.stat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-box.blue { background: #eff6ff; color: #2563eb; }
.stat-icon-box.green { background: #f0fdf4; color: #16a34a; }
.stat-icon-box.teal { background: #ecfeff; color: #0891b2; }
.stat-icon-box.amber { background: #fff7ed; color: #ea580c; }
.stat-icon-box.purple { background: #faf5ff; color: #9333ea; }
.stat-icon-box.rose { background: #fef2f2; color: #dc2626; }

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 2px;
}

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

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
}
.stat-badge.success { background: #f0fdf4; color: #16a34a; }
.stat-badge.warning { background: #fffbeb; color: #d97706; }
.stat-badge.info { background: #eff6ff; color: #2563eb; }

.stat-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Modern Card Tab Strip (Reference Image 1 Aesthetic) */
.card-tabs-container {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.tab-header-strip {
    display: flex;
    border-bottom: 1px solid #edf2f7;
    background: #ffffff;
    overflow-x: auto;
}

.tab-header-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    text-align: left;
}

.tab-header-item:hover {
    color: #0f172a;
    background: #f8fafc;
}

.tab-header-item.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #ffffff;
}

.tab-header-title {
    font-size: 0.84rem;
    font-weight: 600;
    display: block;
    line-height: 1.2;
}

.tab-header-sub {
    font-size: 0.70rem;
    color: #94a3b8;
    display: block;
    line-height: 1.2;
}

.tab-header-item.active .tab-header-title {
    color: #2563eb;
}

/* Buttons - Modern Minimalist */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 15px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.99);
}

.btn-primary {
    background-color: #2563eb;
    color: #ffffff !important;
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background-color: #ffffff;
    color: #0f172a;
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}
    color: var(--slate-900);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #ffffff !important;
}
.btn-success:hover {
    background-color: #047857;
    border-color: #047857;
}

.btn-danger {
    background-color: #ffffff;
    border-color: var(--danger-border);
    color: var(--danger);
}
.btn-danger:hover {
    background-color: var(--danger-light);
    border-color: var(--danger);
}

.btn-warning {
    background-color: #ffffff;
    border-color: var(--warning-border);
    color: var(--warning);
}
.btn-warning:hover {
    background-color: var(--warning-light);
    border-color: var(--warning);
}

.btn-gold {
    background-color: #ffffff;
    border-color: var(--slate-200);
    color: var(--slate-800);
}
.btn-gold:hover {
    background-color: var(--slate-50);
    border-color: var(--slate-300);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 5px;
}

/* Minimalist Nav Tabs */
.nav-tabs-minimal {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--slate-200);
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto;
}
.nav-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--slate-500);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
}
.nav-tab-link:hover {
    color: var(--slate-900);
}
.nav-tab-link.active {
    color: var(--slate-900);
    font-weight: 600;
    border-bottom-color: var(--slate-900);
}

/* Tables - Google Stitch Enterprise High-Density */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.84rem;
}

.table th {
    padding: 11px 16px;
    background-color: var(--slate-50);
    color: var(--slate-600);
    font-weight: 700;
    border-bottom: 1px solid var(--slate-200);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
    vertical-align: middle;
}

.table tr:hover td {
    background-color: var(--slate-50);
}

/* Badges - Google Stitch Modern Pills */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    line-height: 1.2;
}

.badge-success {
    background-color: var(--success-light);
    color: #047857;
    border-color: var(--success-border);
}
.badge-warning {
    background-color: var(--warning-light);
    color: #b45309;
    border-color: var(--warning-border);
}
.badge-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
    border-color: var(--danger-border);
}
.badge-primary {
    background-color: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.badge-slate {
    background-color: var(--slate-100);
    color: var(--slate-600);
    border-color: var(--slate-200);
}
.badge-gold {
    background-color: var(--slate-100);
    color: var(--slate-700);
    border-color: var(--slate-200);
}

/* Stitch Pulsing Dot */
.stitch-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: stitchPulse 2s infinite;
}

@keyframes stitchPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Tape Chart Matrix - Google Stitch Calendar */
.tape-chart-container {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    overflow: auto;
    max-height: 480px;
}
.tape-chart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}
.tape-chart-table th, .tape-chart-table td {
    border: 1px solid var(--slate-200);
    padding: 10px;
    text-align: center;
    font-size: 0.84rem;
}
.tape-chart-table th.unit-col, .tape-chart-table td.unit-col {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 2;
    text-align: left;
    font-weight: 600;
    min-width: 180px;
}
.tape-slot {
    min-width: 110px;
    height: 48px;
    position: relative;
    padding: 0;
    vertical-align: middle;
    border-right: 1px solid var(--slate-200);
}
.tape-cell-fill {
    width: 100%;
    height: 100%;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    box-sizing: border-box;
    transition: filter 0.12s ease;
    user-select: none;
}
.tape-cell-fill:hover {
    filter: brightness(0.95);
}

/* 1. Booked / Reserved -> Light Blue */
.tape-cell-fill.status-booked,
.tape-cell-fill.status-reserved,
.tape-cell-fill.status-checked_in,
.tape-cell-fill.status-confirmed {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe;
}
.tape-cell-fill.status-booked:hover,
.tape-cell-fill.status-reserved:hover,
.tape-cell-fill.status-checked_in:hover,
.tape-cell-fill.status-confirmed:hover {
    background-color: #bfdbfe !important;
}

/* 2. Available -> Light Green */
.tape-cell-fill.status-available {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0;
}
.tape-cell-fill.status-available:hover {
    background-color: #bbf7d0 !important;
}

/* 3. Dirty / In Progress / Out of Order / Maintenance -> Light Red */
.tape-cell-fill.status-dirty,
.tape-cell-fill.status-in_progress,
.tape-cell-fill.status-out_of_order,
.tape-cell-fill.status-maintenance,
.tape-cell-fill.status-blocked {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca;
}
.tape-cell-fill.status-dirty:hover,
.tape-cell-fill.status-in_progress:hover,
.tape-cell-fill.status-out_of_order:hover,
.tape-cell-fill.status-maintenance:hover,
.tape-cell-fill.status-blocked:hover {
    background-color: #fca5a5 !important;
}
.badge-status-dirty {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    cursor: pointer;
    font-weight: 700;
}
.badge-status-dirty:hover {
    background-color: #dc2626 !important;
}
.badge-status-clean {
    background-color: #10b981 !important;
    color: #ffffff !important;
    font-weight: 700;
}

/* Alert Flashes */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background-color: var(--success-light); color: #065f46; border: 1px solid var(--success-border); }
.alert-danger { background-color: var(--danger-light); color: #991b1b; border: 1px solid var(--danger-border); }
.alert-warning { background-color: var(--warning-light); color: #92400e; border: 1px solid var(--warning-border); }

/* Form Controls - Google Stitch Inputs */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 6px;
}
.form-control, .form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.86rem;
    font-family: inherit;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--slate-900);
    outline: none;
    transition: all 0.15s ease-in-out;
}
.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Compact Forms */
.form-compact .form-group {
    margin-bottom: 8px;
}
.form-compact .form-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--slate-600);
    margin-bottom: 3px;
}
.form-compact .form-control {
    padding: 6px 10px;
    font-size: 0.82rem;
    border-radius: 5px;
}
.form-compact select.form-control {
    padding: 5px 8px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal.open {
    display: flex;
}
.modal-dialog,
.modal-content {
    background: #ffffff;
    border-radius: var(--radius);
    width: 90%;
    max-width: 580px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--slate-200);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--slate-50);
}
.modal-body {
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

/* 1. Large Tablets & Medium Screens (<= 1024px) */
@media (max-width: 1024px) {
    .content-container {
        padding: 18px 20px;
    }
    .topbar {
        padding: 8px 18px;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* 2. Mobile & Small Tablet Drawer Mode (<= 991px) */
@media (max-width: 991px) {
    .app-container {
        position: relative;
        overflow-x: hidden;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: -285px;
        width: 275px;
        height: 100vh;
        height: 100dvh;
        z-index: 3000;
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
    }
    .sidebar.mobile-open {
        left: 0;
    }
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .mobile-menu-btn {
        display: inline-flex !important;
    }
    .sidebar-close-btn {
        display: none !important;
    }
    .topbar {
        padding: 8px 14px;
        gap: 10px;
    }
    .content-container {
        padding: 14px 12px;
    }
    .impersonation-banner {
        padding: 8px 12px;
        font-size: 0.78rem;
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}

/* 3. Small Screens & Mobile Phones (<= 768px) */
@media (max-width: 768px) {
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .pos-grid {
        grid-template-columns: 1fr !important;
    }
    .booking-form-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .booking-form-grid > div:first-child {
        border-right: none !important;
        padding-right: 0 !important;
        border-bottom: 1px solid var(--slate-200);
        padding-bottom: 16px;
    }
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    .pulse-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .pulse-card {
        padding: 12px 14px;
    }
    .pulse-value {
        font-size: 1.45rem;
        margin: 4px 0 2px;
    }
    .pulse-label {
        font-size: 0.7rem;
    }
    .pulse-sub {
        font-size: 0.72rem;
    }
    .card {
        padding: 14px;
        border-radius: 8px;
        margin-bottom: 14px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }
    .toolbar-responsive {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .toolbar-responsive > * {
        width: 100%;
    }
    .modal-dialog,
    .modal-content {
        width: 96% !important;
        max-width: 96% !important;
        margin: 8px auto !important;
        max-height: 94vh !important;
        border-radius: 8px;
    }
    .modal-header {
        padding: 12px 14px;
    }
    .modal-body {
        padding: 14px;
        max-height: calc(94vh - 110px);
    }
    .modal-footer {
        padding: 10px 14px;
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    .modal-footer .btn + .btn {
        margin-left: 0;
    }
    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
    .btn {
        padding: 7px 12px;
        min-height: 38px;
    }
    .form-control {
        font-size: 16px; /* Prevents auto-zoom in iOS Safari */
        padding: 8px 10px;
    }
}

/* 4. Very Small Phones (<= 480px) */
@media (max-width: 480px) {
    .pulse-grid {
        grid-template-columns: 1fr !important;
    }
    .card {
        padding: 12px;
    }
    .btn-sm {
        padding: 6px 10px;
        font-size: 0.76rem;
    }
}

/* ==========================================================================
   Widescreen & Ultra-Wide HD Full-Screen Display (Google Stitch MCP)
   ========================================================================== */
@media (min-width: 1440px) {
    .content-container {
        padding: 26px 36px;
        max-width: 100% !important;
        width: 100% !important;
    }
    .topbar {
        padding: 0 36px;
    }
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    .stitch-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1800px) {
    .content-container {
        padding: 30px 48px;
        max-width: 100% !important;
        width: 100% !important;
    }
    .topbar {
        padding: 0 48px;
    }
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    .stitch-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
    }
    .tape-chart-table th, .tape-chart-table td {
        padding: 12px 14px;
    }
}

@media (min-width: 2400px) {
    .content-container {
        padding: 36px 64px;
        max-width: 100% !important;
        width: 100% !important;
    }
    .topbar {
        padding: 0 64px;
    }
    .stitch-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 28px;
    }
}

/* ==========================================================================
   Topbar User Dropdown Menu
   ========================================================================== */
.user-dropdown-container {
    position: relative;
}

.user-dropdown-trigger {
    transition: all 0.15s ease;
    user-select: none;
}

.user-dropdown-trigger:hover {
    background: #f8fafc !important;
    border-color: var(--slate-300) !important;
}

.user-dropdown-popup {
    animation: userDropdownFadeIn 0.15s ease-out;
}

@keyframes userDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-link:hover {
    background-color: var(--slate-100) !important;
}

/* ==========================================================================
   Print Stylesheet: Clean A4 / Thermal Folio Output
   ========================================================================== */
@media print {
    .sidebar,
    .topbar,
    .impersonation-banner,
    .btn,
    .alert,
    .modal,
    form,
    .no-print,
    header,
    aside {
        display: none !important;
    }

    body, .app-container, .main-wrapper, .content-container {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: auto !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        margin-bottom: 16px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .table th {
        background-color: #f8fafc !important;
        color: #0f172a !important;
        border-bottom: 2px solid #94a3b8 !important;
    }

    .table td, .table th {
        border-color: #cbd5e1 !important;
    }

    .badge {
        border: 1px solid #cbd5e1 !important;
        color: #000000 !important;
    }
}
