*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --dark: #1a2b4c;
    --accent: #ff6b35;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --white: #fff;
    --gray: #666;
    --light: #f0f2f5;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
}

body { font-family: 'Segoe UI', Tahoma, sans-serif; background: var(--light); color: #333; min-height: 100vh; }

/* Логин */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1a2b4c, #2d3f63); }
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: var(--white); border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo i { font-size: 50px; color: var(--accent); }
.login-logo h1 { font-size: 28px; color: var(--dark); margin: 10px 0; }
.login-logo h1 span { color: var(--accent); }
.login-logo p { color: var(--gray); }

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--dark); color: var(--white); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 25px 20px; font-size: 20px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 10px; }
.sidebar-logo i { color: var(--accent); font-size: 24px; }
.sidebar-nav { flex: 1; padding: 15px 0; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: #b0b8c5; text-decoration: none; transition: all 0.3s; font-size: 15px; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: var(--white); background: rgba(255,255,255,0.08); border-left: 3px solid var(--accent); }
.sidebar-nav .logout-link { color: #e74c3c; margin-top: auto; border-top: 1px solid rgba(255,255,255,0.1); }
.main-content { margin-left: 260px; flex: 1; padding: 30px; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.top-bar h1 { font-size: 26px; color: var(--dark); }
.admin-name { color: var(--gray); font-weight: 500; }

/* Статистика */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 25px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; }
.stat-card i { font-size: 40px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--white); }
.stat-new i { background: var(--danger); }
.stat-progress i { background: var(--warning); }
.stat-resume i { background: #9b59b6; }
.stat-users i { background: #3498db; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--dark); display: block; }
.stat-label { color: var(--gray); font-size: 14px; }

/* Таблицы */
.table-container { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--dark); color: var(--white); padding: 14px 15px; text-align: left; font-weight: 600; font-size: 14px; }
td { padding: 12px 15px; border-bottom: 1px solid #eee; font-size: 14px; }
tr:hover { background: #f8f9fa; }

/* Статусы */
.status { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }
.status-new { background: #ffebee; color: #d32f2f; }
.status-in_progress { background: #fff3e0; color: #f57c00; }
.status-completed { background: #e8f5e9; color: #388e3c; }
.status-cancelled { background: #f3e5f5; color: #7b1fa2; }
.status-viewed { background: #e3f2fd; color: #1976d2; }
.status-accepted { background: #e8f5e9; color: #388e3c; }
.status-rejected { background: #ffebee; color: #d32f2f; }

/* Формы */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; color: #333; font-weight: 500; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px;
    font-family: inherit; transition: border-color 0.3s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* Кнопки */
.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s; text-decoration: none; text-align: center; }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: #e55a2b; }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-small { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Карточки */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 25px; margin-bottom: 25px; }
.card h3 { color: var(--dark); margin-bottom: 20px; font-size: 18px; }

/* Алерты */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.alert-error { background: #ffebee; color: #d32f2f; border: 1px solid #ffcdd2; }
.alert-success { background: #e8f5e9; color: #388e3c; border: 1px solid #c8e6c9; }

/* Модалки */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { background: var(--white); border-radius: 12px; max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid #eee; }
.modal-header h3 { color: var(--dark); }
.modal-close { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; }
.modal-body { padding: 20px; }

/* Календарь */
.calendar { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.calendar-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.calendar-nav h3 { color: var(--dark); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-day-header { text-align: center; font-weight: 600; color: var(--gray); padding: 8px; font-size: 13px; }
.calendar-day { text-align: center; padding: 10px; border-radius: 6px; cursor: pointer; transition: 0.2s; min-height: 60px; position: relative; }
.calendar-day:hover { background: #f0f2f5; }
.calendar-day.today { border: 2px solid var(--accent); font-weight: 700; }
.calendar-day.selected { background: var(--accent); color: var(--white); }
.calendar-day.has-requests { font-weight: 700; }
.calendar-day .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); }

/* Адаптив */
@media (max-width: 992px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; }
}
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; position: relative; flex-direction: row; overflow-x: auto; padding: 0; }
    .sidebar-logo { display: none; }
    .sidebar-nav { display: flex; padding: 0; }
    .sidebar-nav a { padding: 12px 15px; white-space: nowrap; border-left: none; font-size: 13px; }
    .main-content { margin-left: 0; padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
/* Ямы */
.bays-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 25px; }
.bay-col { background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); overflow: hidden; }
.bay-header { background: #1a2b4c; color: #fff; padding: 12px; text-align: center; font-weight: 700; font-size: 16px; }
.bay-slots { padding: 10px; min-height: 200px; max-height: 500px; overflow-y: auto; }
.bay-slot { background: #f0f2f5; border-radius: 6px; padding: 10px; margin-bottom: 8px; border-left: 3px solid #ff6b35; font-size: 12px; position: relative; }
.bay-slot .slot-time { font-weight: 700; color: #ff6b35; font-size: 14px; }
.bay-slot .slot-id { position: absolute; top: 8px; right: 10px; background: #1a2b4c; color: #fff; border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.bay-slot .slot-car { font-weight: 600; margin: 3px 0; color: #333; }
.bay-slot .slot-client { color: #666; font-size: 11px; }
.bay-empty { text-align: center; color: #999; padding: 30px; font-size: 13px; }
.bays-title { margin-bottom: 15px; color: #1a2b4c; }
.slot-free-form { margin-top: 5px; }


/* Фильтр */
.filter-bar { display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-form { display: flex; gap: 15px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 2px solid #e0e0e0; border-radius: 6px; font-size: 14px; }

@media (max-width: 900px) {
    .bays-container { grid-template-columns: repeat(2, 1fr); }
    .calendar-section { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
    .bays-container { grid-template-columns: 1fr; }
}