:root {
    --primary: #6366f1; /* Purple */
    --primary-light: #e0e7ff;
    --free: #10b981; /* Green */
    --free-light: #d1fae5;
    --reserved: #ef4444; /* Red */
    --reserved-light: #fee2e2;
    --bg-color: #f8fafc;
    --panel-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.free { background-color: var(--free); }
.dot.reserved { background-color: var(--reserved); }

/* Main Dashboard */
.dashboard {
    display: flex;
    flex: 1;
    padding: 2rem;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Left Panel */
.left-panel {
    flex: 3;
    background: var(--panel-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.panel-header h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.building-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.building-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.building-card.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.building-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.building-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.stat-group {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-weight: 600;
    font-size: 1rem;
}

.other-areas {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.other-areas h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Right Panel */
.right-panel {
    flex: 2;
    background: var(--panel-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    min-width: 350px;
}

.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

.hidden {
    display: none !important;
}

.building-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.icon-btn:hover {
    color: var(--text-main);
}

.boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
}

.box {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
    background-color: var(--free-light);
    color: var(--free);
    border-color: var(--free);
}

.box:hover {
    transform: scale(1.05);
}

.box.reserved {
    background-color: var(--reserved-light);
    color: var(--reserved);
    border-color: var(--reserved);
}

/* Footer */
.footer {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: flex-end;
}

.btn-outline {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-outline:hover {
    background: #f1f5f9;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.right-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: white;
    color: var(--reserved);
    border: 1px solid var(--reserved);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-danger:hover {
    background: var(--reserved-light);
}