/* House Management System — Blazor WASM */

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Sidebar layout */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: #1e293b;
    color: #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar .brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #334155;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
}

.sidebar .brand i {
    color: #3b82f6;
}

.sidebar .nav-section-title {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 0;
    transition: background-color 0.15s, color 0.15s;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    background-color: #334155;
    color: #f8fafc;
}

.sidebar .nav-link.active {
    background-color: #3b82f6;
    color: #fff;
}

.sidebar .nav-link i {
    width: 1.2rem;
    text-align: center;
    font-size: 0.9rem;
}

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: #f8fafc;
}

.top-bar {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-content {
    padding: 1.5rem;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Tables */
.table-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-card .table-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Badges */
.badge-active    { background-color: #dcfce7; color: #166534; }
.badge-inactive  { background-color: #f1f5f9; color: #475569; }
.badge-warning   { background-color: #fef9c3; color: #854d0e; }
.badge-danger    { background-color: #fee2e2; color: #991b1b; }
.badge-info      { background-color: #dbeafe; color: #1e40af; }

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Form styles */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
}

.validation-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Collapsible nav sections */
.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem 0.25rem;
    cursor: pointer;
    user-select: none;
}

.nav-section-header:hover .nav-section-title {
    color: #94a3b8;
}

.nav-section-header .nav-section-title {
    padding: 0;
    flex: 1;
}

.nav-section-chevron {
    font-size: 0.65rem;
    color: #64748b;
    transition: transform 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.nav-section-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.2s ease;
}

.nav-section-items.expanded {
    max-height: 600px;
}

/* Hamburger button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: background-color 0.15s;
}

.hamburger-btn:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-account {
    flex-shrink: 0;
    border-top: 1px solid #334155;
    background-color: #1e293b;
}

.sidebar-version {
    font-size: 0.75rem;
    opacity: 0.5;
    color: inherit;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .hamburger-btn {
        display: flex;
    }
    .sidebar-overlay {
        display: block;
    }
}
