* {
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --secondary-color: #10b981;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --neon-red: 0 0 10px rgba(239, 68, 68, 0.5), 0 0 5px rgba(239, 68, 68, 0.3);
    --sidebar-width: 400px;
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-fluid {
    max-width: 100%;
    margin: 0;
    padding: 0 1.5rem;
}

/* Navbar Enhancements */
.navbar {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

main {
    padding: 2rem 0;
}

/* Dashboard Header & Widgets */
.dashboard-header {
    margin-bottom: 2.5rem;
}

.dashboard-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #111827;
}

.widget-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.widget-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.widget-card:hover {
    transform: translateY(-2px);
}

.widget-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.widget-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* Dynamic Building Structure */
.building-section {
    margin-bottom: 4rem;
}

.building-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
}

.floor-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.floor-row {
    display: flex;
    background: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    min-height: 120px;
}

.floor-label {
    background: #f8fafc;
    min-width: 80px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.floor-label span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    flex-grow: 1;
}

/* Room Cards */
.room-card {
    background: #fff;
    border: 2px solid #f1f5f9;
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.room-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.room-card.has-debt {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: var(--neon-red);
}

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

.room-header strong {
    font-size: 1.125rem;
    font-weight: 800;
}

.room-type {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Pixel-Art Style Beds */
.bed-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bed-item {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #e2e8f0;
    position: relative;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.bed-item.bed-available {
    background: var(--accent-green);
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.1);
}

.bed-item.bed-occupied {
    background: var(--accent-red);
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.1);
}

.bed-item:hover::after {
    content: attr(data-customer);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
    opacity: 0.9;
}

/* Side Panel / Slide-over Card */
.side-panel {
    position: fixed;
    top: 0;
    right: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
    height: 100%;
    background: white;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    right: 0;
}

.side-panel-content {
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: all 0.2s;
    z-index: 10;
}

.close-btn:hover {
    background: #e2e8f0;
    color: var(--text-color);
}

/* Utility classes */
.p-4 { padding: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Summary Cards (Öztek Style) */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.summary-card .info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .info .value {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
}

.summary-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.summary-card.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.summary-card.clickable:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.summary-card.clickable:active {
    transform: translateY(-2px);
}

/* Financial & Capacity Layout */
.dashboard-grid-secondary {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.capacity-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.donut-chart-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}

.donut-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent-red) calc(var(--percentage) * 1%),
        var(--accent-green) 0
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-chart::before {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    background: white;
    border-radius: 50%;
}

.donut-chart-text {
    position: relative;
    z-index: 1;
}

.donut-chart-text .label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.donut-chart-text .value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
}

/* Financial Tables */
.finance-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.finance-card {
    background: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.finance-card-header {
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bg-danger { background-color: var(--accent-red); }
.bg-success { background-color: var(--accent-green); }
.bg-info { background-color: var(--primary-color); }

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

.finance-table th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.finance-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f8fafc;
}

.finance-table tr:last-child td { border-bottom: none; }

/* Building Selector */
.building-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    background: #e2e8f0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-tab.active {
    background: var(--primary-color);
    color: white;
}

/* Empty State */
.empty-dashboard {
    text-align: center;
    padding: 5rem 2rem;
    background: white;
    border-radius: 1.5rem;
    border: 2px dashed var(--border-color);
}
