:root {
    --primary: #1a472a;
    --primary-light: #2d6a3f;
    --primary-dark: #0d2b17;
    --accent: #c9a84c;
    --accent-hover: #b8943f;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --bg: #f5f7fa;
    --white: #ffffff;
    --border: #e0e6ed;
    --text: #2d3748;
    --text-light: #718096;
    --danger: #e53e3e;
    --success: #38a169;
    --warning: #d69e2e;
    --info: #3182ce;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0,0,0,0.15);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.logo-icon {
    font-size: 28px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 16px 0;
}

.sidebar-nav li {
    margin: 4px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 15px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav li.active a {
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(201,168,76,0.3);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar h2 {
    font-size: 22px;
    color: var(--text);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.content-wrapper {
    padding: 30px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

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

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,71,42,0.3);
}

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(26,71,42,0.05);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 { font-size: 18px; }
.card-body { padding: 24px; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-completed { background: #dbeafe; color: #1e40af; }

/* Login Page */
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
}

.login-container { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header { text-align: center; margin-bottom: 30px; }

.login-header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-header p { color: var(--text-light); }

.login-form .form-group { margin-bottom: 20px; }
.login-form .btn { width: 100%; padding: 14px; font-size: 16px; }
@media (max-width: 768px) {
    .login-form input {
        width: 100% !important;
        padding: 12px 14px !important;
        font-size: 16px !important;
    }
    .login-card {
        padding: 24px;
        margin: 10px;
    }
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: var(--white);
    margin-bottom: 0;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,71,42,0.1);
}

.login-form .form-group {
    margin-bottom: 16px;
}
/* ========== МОБИЛЬНОЕ МЕНЮ ========== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #1a472a;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #1a472a;
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}

.sidebar-overlay.active { display: block; }

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 15px;
}

.logout-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ========== ОБЩИЕ МОБИЛЬНЫЕ СТИЛИ ========== */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: block !important; }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1080;
        width: 280px;
        padding-top: 60px;
    }
    
    .sidebar.open { transform: translateX(0); }
    .sidebar .sidebar-header { padding-top: 0; }
    
    .main-content { margin-left: 0 !important; }
    
    .top-bar {
    padding-left: 60px !important;
    padding-right: 16px !important;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a472a !important;
    flex-wrap: nowrap;
}

.top-bar h2.desktop-title { display: none; }
.top-bar h2.mobile-title {
    display: block !important;
    color: #fff !important;
    font-size: 15px;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.top-bar .user-info span {
    display: none;
}

.top-bar .user-info .btn-outline {
    display: none; /* Скрываем кнопку "Выйти" на мобильных */
}
    
    .form-row { grid-template-columns: 1fr; }
    .modal-dialog { width: 95%; margin: 10px; }
    .content-wrapper { padding: 16px; }
    
    table { font-size: 12px; }
    th, td { padding: 6px 8px; }
    
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { font-size: 24px; }
    .stat-info h3 { font-size: 22px; }
    .stat-info p { font-size: 11px; }
    
    .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    top: 56px;
    z-index: 50;
    margin-bottom: 8px;
	}

	.calendar-container {
		padding: 8px !important;
	}

	#calendar {
		min-height: 400px;
	}
	
	.content-wrapper {
    padding: 8px !important;
	}

	.calendar-toolbar {
		margin-bottom: 8px;
		padding: 8px 12px;
	}
    
    .view-controls, .top-bar > div {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        width: 100%;
    }
    
    .view-btn, #view-hour-btn {
        flex: 1;
        min-width: 50px;
        font-size: 11px;
        padding: 6px 4px;
        text-align: center;
    }
    
    .filters-form {
        flex-direction: column;
        gap: 8px;
    }
    
    .filters-form .form-group { width: 100%; }
    .filters-form input, .filters-form select { width: 100%; }
    
    .filters-form .date-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

.sidebar-mini-calendar {
    padding: 6px 8px;
    margin: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    width: 244px;
    overflow: hidden;
    flex-shrink: 0;
    --mini-cal-width: 228px;  /* ← ширина минус padding */
}

.sidebar-mini-calendar .fc {
    font-size: 10px;
}

/* Заголовок месяца */
.sidebar-mini-calendar .fc-toolbar-title {
    font-size: 20px !important;
    color: #fff !important;
    font-weight: 600;
}

/* Кнопки ◀ ▶ — цвет как у активных ссылок */
.sidebar-mini-calendar .fc-button {
    padding: 3px 8px !important;
    font-size: 12px !important;
    background: var(--accent) !important;
    border: none !important;
    color: var(--primary-dark) !important;
    border-radius: 6px !important;
    font-weight: 700;
    line-height: 1;
}

.sidebar-mini-calendar .fc-button:hover {
    background: var(--accent-hover) !important;
}

/* Ячейки дат */
.sidebar-mini-calendar .fc-daygrid-day {
    cursor: pointer;
    height: 18px !important;
}

.sidebar-mini-calendar .fc-daygrid-day-frame {
    height: 18px !important;
    min-height: 18px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-mini-calendar .fc-daygrid-day-number {
    font-size: 14px;
    padding: 0;
    color: rgba(255,255,255,0.75);
    text-align: center;
    line-height: 1;
}

.sidebar-mini-calendar .fc-daygrid-day:hover {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 4px;
}

.sidebar-mini-calendar .fc-day-today {
    background: rgba(201,168,76,0.2) !important;
    border-radius: 4px;
}

.sidebar-mini-calendar .fc-day-today .fc-daygrid-day-number {
    color: #c9a84c !important;
    font-weight: 700;
}

/* Дни недели — белый фон, зелёный текст */
.sidebar-mini-calendar .fc-col-header-cell {
    background: #fff;
    color: #1a472a;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 0;
    text-transform: uppercase;
}

.sidebar-mini-calendar .fc-scrollgrid,
.sidebar-mini-calendar .fc-theme-standard td,
.sidebar-mini-calendar .fc-theme-standard th {
    border-color: rgba(255,255,255,0.08) !important;
}

.sidebar-mini-calendar .fc-scroller {
    overflow: hidden !important;
}

/* Футер — поднять над календарём */
.sidebar-footer {
    position: relative !important;
    margin-top: auto;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}