/* ==========================================================================
   CabinCare Pro — Premium Design System
   Inspired by mc.gensqq.cfd (dark #15151F, glassmorphism, indigo/violet accents)
   ========================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f0f17;
    color: #e2e4e9;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 10% 20%, rgba(99,102,241,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 300px at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 50% 50%, rgba(94,226,181,0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- Dot Grid Background --- */
.dot-grid {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* --- Ambient Orbs --- */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
.orb-1 { width: 500px; height: 500px; background: rgba(99,102,241,0.10); top: -10%; left: -5%; }
.orb-2 { width: 400px; height: 400px; background: rgba(139,92,246,0.08); bottom: -5%; right: -5%; }
.orb-3 { width: 300px; height: 300px; background: rgba(94,226,181,0.04); top: 40%; left: 60%; }

/* --- Glass Card --- */
.glass {
    background: rgba(31, 31, 43, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.glass-light {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { font-family: 'Inter Tight', sans-serif; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
code, .mono { font-family: 'JetBrains Mono', monospace; }

.font-xs { font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* --- Colors --- */
.text-accent { color: #6366f1; }
.text-accent-2 { color: #8B5CF6; }
.text-mint { color: #5EE2B5; }
.text-amber { color: #F5B544; }
.text-rose { color: #f43f5e; }
.text-muted { color: rgba(255,255,255,0.4); }
.text-muted-2 { color: rgba(255,255,255,0.55); }
.bg-accent { background: #6366f1; }
.bg-accent-2 { background: #8B5CF6; }
.bg-mint { background: #5EE2B5; }
.bg-amber { background: #F5B544; }
.bg-rose { background: #f43f5e; }
.bg-surface { background: rgba(31, 31, 43, 0.55); }
.bg-surface-2 { background: rgba(255,255,255,0.03); }

/* --- Status Badges --- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-pending { background: rgba(245,181,68,0.15); color: #F5B544; }
.badge-in-progress { background: rgba(99,102,241,0.15); color: #6366f1; }
.badge-completed { background: rgba(94,226,181,0.12); color: #5EE2B5; }
.badge-inspected { background: rgba(139,92,246,0.15); color: #8B5CF6; }
.badge-maintenance { background: rgba(244,63,94,0.15); color: #f43f5e; }
.badge-available { background: rgba(94,226,181,0.12); color: #5EE2B5; }
.badge-occupied { background: rgba(99,102,241,0.15); color: #6366f1; }
.badge-departure { background: rgba(245,181,68,0.15); color: #F5B544; }
.badge-arrival { background: rgba(94,226,181,0.12); color: #5EE2B5; }
.badge-stayover { background: rgba(139,92,246,0.15); color: #8B5CF6; }
.badge-vacant { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
.badge-low { background: rgba(94,226,181,0.10); color: #5EE2B5; }
.badge-medium { background: rgba(245,181,68,0.12); color: #F5B544; }
.badge-high { background: rgba(244,63,94,0.12); color: #f43f5e; }
.badge-urgent { background: rgba(244,63,94,0.20); color: #ff6b7d; }
.badge-reported { background: rgba(245,181,68,0.15); color: #F5B544; }
.badge-fixed { background: rgba(94,226,181,0.12); color: #5EE2B5; }
.badge-verified { background: rgba(99,102,241,0.15); color: #6366f1; }
.badge-danger { background: rgba(244,63,94,0.15); color: #f43f5e; }

/* --- Priority Indicators --- */
.priority-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.priority-dot.low { background: #5EE2B5; }
.priority-dot.medium { background: #F5B544; }
.priority-dot.high { background: #f43f5e; }
.priority-dot.urgent { background: #ff6b7d; box-shadow: 0 0 8px rgba(244,63,94,0.5); }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border: none; border-radius: 12px;
    font-family: 'Inter Tight', sans-serif; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    transform: translateY(0);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8B5CF6);
    color: white; box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(99,102,241,0.4); transform: translateY(-1px); }
.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: #e2e4e9; border: 1px solid rgba(255,255,255,0.08);
}
.btn-secondary:hover { background: rgba(255,255,255,0.10); }
.btn-success {
    background: linear-gradient(135deg, #10b981, #5EE2B5);
    color: white; box-shadow: 0 4px 15px rgba(94,226,181,0.3);
}
.btn-success:hover { box-shadow: 0 6px 25px rgba(94,226,181,0.4); transform: translateY(-1px); }
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    color: white; box-shadow: 0 4px 15px rgba(244,63,94,0.3);
}
.btn-danger:hover { box-shadow: 0 6px 25px rgba(244,63,94,0.4); transform: translateY(-1px); }
.btn-amber {
    background: linear-gradient(135deg, #F5B544, #f59e0b);
    color: #1a1a2e; box-shadow: 0 4px 15px rgba(245,181,68,0.3);
}
.btn-amber:hover { box-shadow: 0 6px 25px rgba(245,181,68,0.4); transform: translateY(-1px); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; border-radius: 8px; }
.btn-icon {
    width: 36px; height: 36px; padding: 0; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* --- Inputs --- */
input, select, textarea {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px 16px;
    color: #e2e4e9;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
input::placeholder { color: rgba(255,255,255,0.25); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }

/* --- Tabs --- */
.tab-bar {
    display: flex; gap: 2px;
    background: rgba(0,0,0,0.2);
    padding: 3px; border-radius: 14px;
    overflow-x: auto;
}
.tab-btn {
    padding: 8px 16px; border: none; border-radius: 11px;
    background: transparent; color: rgba(255,255,255,0.5);
    font-family: 'Inter Tight', sans-serif; font-size: 0.8rem; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: all 0.2s;
}
.tab-btn:hover { color: rgba(255,255,255,0.8); }
.tab-btn.active {
    background: rgba(99,102,241,0.2);
    color: #6366f1; box-shadow: 0 1px 8px rgba(99,102,241,0.15);
}

/* --- Stat Cards --- */
.stat-card {
    background: rgba(31,31,43,0.55);
    backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.04);
    border-radius: 20px; padding: 24px;
    border-top: 3px solid transparent;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.indigo { border-top-color: #6366f1; }
.stat-card.violet { border-top-color: #8B5CF6; }
.stat-card.mint { border-top-color: #5EE2B5; }
.stat-card.amber { border-top-color: #F5B544; }
.stat-card.rose { border-top-color: #f43f5e; }
.stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 2rem; font-weight: 800; margin-top: 8px; line-height: 1; }
.stat-sub { font-size: 0.8rem; color: rgba(255,255,255,0.35); margin-top: 4px; }

/* --- Room Cards --- */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.room-card {
    background: rgba(31,31,43,0.55);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.room-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 20px 20px 0 0;
}
.room-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.room-card.pending::before { background: #F5B544; }
.room-card.in-progress::before { background: #6366f1; }
.room-card.completed::before { background: #5EE2B5; }
.room-card.inspected::before { background: #8B5CF6; }
.room-card.maintenance::before { background: #f43f5e; }
.room-number { font-size: 1.3rem; font-weight: 800; }
.room-type { font-size: 0.75rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.04em; }

/* --- Modal --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-close {
    width: 32px; height: 32px; border: none; border-radius: 10px;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.1); }

/* --- Layout --- */
.app-header {
    background: rgba(15,15,23,0.8);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 16px 24px;
    position: sticky; top: 0; z-index: 100;
}
.app-header-content {
    max-width: 1440px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
}
.app-main { max-width: 1440px; margin: 0 auto; padding: 24px; z-index: 1; position: relative; }

/* --- Sidebar --- */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px;
    background: rgba(15,15,23,0.95);
    backdrop-filter: blur(24px);
    border-right: 1px solid rgba(255,255,255,0.04);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 24px 16px;
    overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
    display: none;
}
.sidebar-overlay.open { display: block; }

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,0.45);
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    margin-bottom: 2px;
}
.nav-btn:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.7); }
.nav-btn.active { background: rgba(99,102,241,0.12); color: #6366f1; }
.nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* --- Table --- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}
.data-table td {
    padding: 12px 16px;
    background: rgba(31,31,43,0.35);
    border-top: 1px solid rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.data-table tr td:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid rgba(255,255,255,0.03); }
.data-table tr td:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid rgba(255,255,255,0.03); }
.data-table tr:hover td { background: rgba(31,31,43,0.5); }

/* --- Filter Bar --- */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
}
.filter-bar select, .filter-bar input {
    padding: 8px 14px; font-size: 0.8rem;
    width: auto; min-width: 140px;
}

/* --- Loading --- */
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.06);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toast --- */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: rgba(31,31,43,0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px 20px;
    color: #e2e4e9;
    font-size: 0.85rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}
.toast.success { border-left: 3px solid #5EE2B5; }
.toast.error { border-left: 3px solid #f43f5e; }
.toast.warning { border-left: 3px solid #F5B544; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Login --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: rgba(31,31,43,0.6);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 32px;
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.login-logo {
    text-align: center; margin-bottom: 32px;
}
.login-logo h1 { font-size: 2rem; }
.login-logo p { font-size: 0.85rem; color: rgba(255,255,255,0.4); }

/* --- Checklist --- */
.checklist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.checklist-item:hover { background: rgba(255,255,255,0.05); }
.checklist-item.checked { opacity: 0.6; }
.checkbox-custom {
    width: 22px; height: 22px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: 12px; color: transparent;
}
.checkbox-custom.checked {
    background: #6366f1; border-color: #6366f1; color: white;
}

/* --- Deck Map --- */
.deck-map {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 6px;
    padding: 16px;
}
.deck-cabin {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: transform 0.2s;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.7);
}
.deck-cabin:hover { transform: scale(1.15); z-index: 2; }
.deck-cabin.pending { background: rgba(245,181,68,0.15); border-color: rgba(245,181,68,0.3); }
.deck-cabin.in-progress { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); }
.deck-cabin.completed { background: rgba(94,226,181,0.12); border-color: rgba(94,226,181,0.2); }
.deck-cabin.inspected { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.2); }
.deck-cabin.maintenance { background: rgba(244,63,94,0.12); border-color: rgba(244,63,94,0.2); }
.deck-cabin.occupied { background: rgba(99,102,241,0.08); }
.deck-cabin.vacant { opacity: 0.4; }

/* --- SVG Icons --- */
.icon-3d {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: filter 0.2s;
}
.icon-3d:hover { filter: drop-shadow(0 3px 8px rgba(99,102,241,0.3)); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .app-main { padding: 12px; }
    .room-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .room-card { padding: 14px; }
    .stat-value { font-size: 1.5rem; }
    .modal { padding: 20px; margin: 10px; }
    .login-card { padding: 32px 24px; }
    .tab-btn { font-size: 0.7rem; padding: 6px 12px; }
    .filter-bar select { min-width: 100px; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* --- Animations --- */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.scale-in { animation: scaleIn 0.3s ease; }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* --- Other --- */
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* --- Section Header --- */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}

/* --- Maintenance Section --- */
.maintenance-card {
    background: rgba(31,31,43,0.55);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 12px;
}
.maintenance-severity {
    width: 4px; border-radius: 2px; flex-shrink: 0;
}
.maintenance-severity.low { background: #5EE2B5; }
.maintenance-severity.medium { background: #F5B544; }
.maintenance-severity.high { background: #f43f5e; }
.maintenance-severity.urgent { background: #ff6b7d; }
