:root {
    --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;
    
    --primary: var(--slate-900);
    --primary-fg: #ffffff;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--slate-50);
    color: var(--slate-900);
    line-height: 1.5;
    font-size: 14px; /* Compact base size */
    -webkit-font-smoothing: antialiased;
}

/* Compact Utilities (Redefined for tighter layout) */
.bg-slate-50 { background-color: var(--slate-50); }
.bg-white { background-color: white; }
.text-slate-400 { color: var(--slate-400); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-700 { color: var(--slate-700); }
.text-slate-900 { color: var(--slate-900); }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-2xl { font-size: 1.5rem; letter-spacing: -0.025em; }
.text-3xl { font-size: 1.875rem; letter-spacing: -0.025em; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-tight { letter-spacing: -0.025em; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.flex { display: flex; }
.grid { display: grid; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }

/* Tighter Spacing Scale */
.px-4 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-10 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-\[1600px\] { max-width: 1400px; }
.max-w-xl { max-width: 32rem; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.gap-3 { gap: 0.5rem; }
.gap-4 { gap: 0.75rem; }
.gap-6 { gap: 1rem; }
.gap-8 { gap: 1.25rem; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }

.border { border-width: 1px; }
.border-slate-200 { border-color: var(--slate-200); }
.rounded-2xl { border-radius: var(--radius-lg); } /* Was 1rem */
.rounded-full { border-radius: var(--radius-full); }
.overflow-x-auto { overflow-x: auto; }

.divide-y > :not([hidden]) ~ :not([hidden]) { border-top-width: 1px; }
.divide-slate-100 > :not([hidden]) ~ :not([hidden]) { border-color: var(--slate-100); }
.divide-slate-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--slate-200); }

.text-center { text-align: center; }
.transition { transition: all 0.15s ease; }

/* Responsive Grid */
.sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .form-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 2rem;
    }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:px-10 { padding-left: 2rem; padding-right: 2rem; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Components */

/* Panel / Card */
.panel {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    margin-bottom: 0.25rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--slate-900);
    letter-spacing: -0.025em;
}

.section-hint {
    font-size: 0.875rem;
    color: var(--slate-500);
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    text-align: left;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md); /* 0.5rem */
    padding: 0.5rem 0.75rem; /* Compact padding */
    font-size: 0.875rem;
    color: var(--slate-900);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--slate-900);
    box-shadow: 0 0 0 1px var(--slate-900);
}

.form-group.full-width { grid-column: 1 / -1; }

/* Buttons */
.primary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md); /* 0.5rem */
    padding: 0.5rem 1rem; /* Compact padding */
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0; /* Removed wide spacing */
    cursor: pointer;
    transition: all 0.15s ease;
    height: 2.25rem;
}

.primary-btn {
    background: var(--slate-900);
    color: #fff;
    border: 1px solid var(--slate-900);
}
.primary-btn:hover {
    background: var(--slate-800);
    border-color: var(--slate-800);
}

.primary-btn.danger {
    background: #ef4444;
    border-color: #ef4444;
}
.primary-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.ghost-btn {
    background: #fff;
    color: var(--slate-600);
    border: 1px solid var(--slate-200);
}
.ghost-btn:hover {
    border-color: var(--slate-300);
    background: var(--slate-50);
    color: var(--slate-900);
}

/* Navigation */
.main-nav {
    display: grid;
    gap: 0.5rem;
}

.nav-item {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.nav-item:hover {
    color: var(--slate-900);
    background: var(--slate-100);
}

.nav-item.active {
    background: #fff;
    color: var(--slate-900);
    border-color: var(--slate-200);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* Stats Cards */
.stat-card {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--slate-500);
}

.stat-value {
    font-size: 1.5rem; /* Reduced from 2rem */
    font-weight: 600;
    color: var(--slate-900);
    line-height: 1.2;
}

.stat-metric, .stat-subtext {
    font-size: 0.75rem;
    color: var(--slate-500);
}

/* Compact Stats Cards (Adapted for 2nd Avenue) */
.stat-card-compact {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all 0.15s ease;
}

.stat-card-compact:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.stat-card-occupied {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
    border-color: #86efac;
}

.stat-card-vacant {
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
    border-color: #fca5a5;
}

.stat-card-reserved {
    background: linear-gradient(135deg, #fef3c7 0%, #fff 100%);
    border-color: #fcd34d;
}

.stat-card-primary {
    background: linear-gradient(135deg, #dbeafe 0%, #fff 100%);
    border-color: #93c5fd;
}

.stat-card-revenue {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
    border-color: #86efac;
}

.stat-label-compact {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    font-weight: 600;
}

.stat-value-compact {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-900);
    line-height: 1;
}

.stat-subtext-compact {
    font-size: 0.75rem;
    color: var(--slate-600);
}

.stat-unit-compact {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--slate-400);
}

/* Tables */
table { width: 100%; border-collapse: collapse; }

th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--slate-500);
    padding: 0.75rem 1rem;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
}

td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--slate-700);
    border-bottom: 1px solid var(--slate-100);
}

tr:last-child td { border-bottom: none; }
.table-row-hover:hover { background-color: var(--slate-50); }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.status-vacant { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-occupied { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.status-reserved { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.status-out { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.status-blocked { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.status-active { background: #dbeafe; color: #1e3a8a; border: 1px solid #bfdbfe; }
.status-expired { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-terminated { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Action Buttons in Table */
.action-circle-group { display: flex; gap: 0.25rem; justify-content: center; }
.action-circle {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--slate-400);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-circle:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}
.action-circle svg { width: 1rem; height: 1rem; }

/* Global Loader */
.global-loader {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--slate-200);
    border-top-color: var(--slate-900);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 50;
    padding: 1rem;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    margin: auto;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
}

.toast {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
    min-width: 300px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}
.toast-success::before { background: #22c55e; }
.toast-error::before { background: #ef4444; }

/* Showroom Grid */
.showroom-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.showroom-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.showroom-card {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.showroom-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.showroom-status-vacant {
    border-left: 4px solid #fca5a5;
    background: #fef2f2;
}

.showroom-status-occupied {
    border-left: 4px solid #86efac;
    background: #f0fdf4;
}

.showroom-status-reserved {
    border-left: 4px solid #fcd34d;
    background: #fffbeb;
}

.showroom-status-out {
    border-left: 4px solid var(--slate-300);
    background: #f8fafc;
}

.showroom-status-blocked {
    border-left: 4px solid #fcd34d;
    background: #fffbeb;
}

.showroom-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--slate-100);
}

.showroom-card-code {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-900);
    margin: 0;
}

.showroom-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.showroom-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--slate-900);
    margin: 0;
}

.showroom-card-area {
    font-size: 0.7rem;
    color: var(--slate-600);
    margin: 0;
}

.showroom-card-tenant {
    font-size: 0.75rem;
    color: var(--slate-700);
    font-weight: 500;
    margin: 0.25rem 0 0;
    padding: 0.25rem 0.5rem;
    background: var(--slate-50);
    border-radius: var(--radius-sm);
}

/* Info rows for details pages */
.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--slate-100);
}

.info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-400);
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-900);
}

/* Legend */
.legend-badge {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--slate-200);
}

.legend-vacant { background: #fee2e2; }
.legend-occupied { background: #dcfce7; }
.legend-reserved { background: #fef3c7; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
