:root {
    --primary: #1a252f;
    --secondary: #3498db;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #333;
    --white: #ffffff;
    --border: #ddd;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: #f5f6fa; color: var(--text); height: 100vh; display: flex; }

/* Login */
.login-container {
    width: 100%; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
    background: var(--white); padding: 2.5rem; border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); width: 100%; max-width: 380px; text-align: center;
}
.login-card h2 { color: var(--primary); margin-bottom: 5px; font-size: 1.8rem; }
.login-card p { color: #7f8c8d; margin-bottom: 25px; font-size: 0.9rem; }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--dark); font-weight: 600; }
.input-group input, .input-group select, .input-group textarea {
    width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px;
    font-size: 0.95rem; transition: 0.3s;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    border-color: var(--secondary); outline: none;
}
.btn {
    background: var(--secondary); color: white; padding: 12px 24px;
    border: none; border-radius: 8px; cursor: pointer; width: 100%;
    font-size: 1rem; font-weight: 600; transition: 0.3s; margin-top: 10px;
}
.btn:hover { background: #2980b9; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--accent); }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: var(--warning); }

/* Dashboard */
.sidebar {
    width: 260px; background: var(--primary); color: white;
    display: flex; flex-direction: column; padding: 1rem; flex-shrink: 0;
    overflow-y: auto;
}
.sidebar h2 { margin-bottom: 1.5rem; text-align: center; font-size: 1.5rem; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar .user-info { text-align: center; padding: 10px; margin-bottom: 20px; background: rgba(255,255,255,0.1); border-radius: 8px; }
.sidebar .user-info h4 { font-size: 0.9rem; }
.sidebar .user-info small { color: #bdc3c7; font-size: 0.75rem; text-transform: uppercase; }
.nav-link {
    color: #bdc3c7; text-decoration: none; padding: 12px 15px;
    margin-bottom: 5px; border-radius: 8px; display: flex; align-items: center;
    transition: 0.3s; font-size: 0.9rem;
}
.nav-link i { margin-right: 10px; width: 20px; text-align: center; }
.nav-link:hover, .nav-link.active { background: var(--secondary); color: white; }
.nav-link.logout { background: var(--accent); margin-top: auto; }
.nav-link.logout:hover { background: #c0392b; }

.main-content { flex: 1; padding: 2rem; overflow-y: auto; background: #f5f6fa; }

/* Cards */
.card { background: var(--white); padding: 1.5rem; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.05); margin-bottom: 1.5rem; }
.card h3 { color: var(--primary); margin-bottom: 15px; font-size: 1.1rem; border-bottom: 2px solid var(--light); padding-bottom: 10px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); padding: 1.5rem; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.05); display: flex; align-items: center; }
.stat-icon {
    width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-right: 15px; color: white;
}
.stat-icon.blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-icon.green { background: linear-gradient(135deg, #27ae60, #219a52); }
.stat-icon.red { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.stat-icon.orange { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-content h4 { font-size: 0.85rem; color: #7f8c8d; margin-bottom: 5px; }
.stat-content h1 { font-size: 1.8rem; color: var(--primary); }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; color: var(--dark); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; }
tr:hover { background: #f8f9fa; }
.badge {
    padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    display: inline-block;
}
.badge-available, .badge-done, .badge-fixed { background: #d4edda; color: #155724; }
.badge-occupied, .badge-checked_in, .badge-pending { background: #f8d7da; color: #721c24; }
.badge-booked { background: #fff3cd; color: #856404; }
.badge-maintenance, .badge-reported, .badge-in_progress { background: #fcefd3; color: #856404; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.form-row { display: flex; gap: 15px; flex-wrap: wrap; }
.form-row .input-group { flex: 1; min-width: 150px; }

/* Buttons Inline */
.action-buttons { display: flex; gap: 8px; }
.action-buttons a, .action-buttons button {
    padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; text-decoration: none; border: none; cursor: pointer;
}
.action-buttons a.edit { background: var(--secondary); color: white; }
.action-buttons a.delete { background: var(--accent); color: white; }
.action-buttons a.view { background: var(--warning); color: white; }

.btn-sm { padding: 8px 16px; width: auto; font-size: 0.85rem; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h1 { color: var(--primary); font-size: 1.5rem; }

/* Alert */
.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #27ae60; }
.alert-error { background: #f8d7da; color: #721c24; border-left: 4px solid #e74c3c; }

/* Responsive */
@media (max-width: 768px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; padding: 10px; overflow-x: auto; flex-direction: row; white-space: nowrap; }
    .sidebar h2, .sidebar .user-info { display: none; }
    .nav-link { display: inline-block; margin-right: 5px; font-size: 0.8rem; padding: 10px; }
    .nav-link i { margin-right: 5px; }
    .main-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; gap: 10px; align-items: flex-start; }
}