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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Логин страница */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: #ff3333;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 500;
    color: #333;
}

.login-box h2 {
    font-size: 20px;
    margin-bottom: 24px;
    color: #333;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #ffcc00;
    color: #333;
}

.btn-primary:hover {
    background-color: #e6b800;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-danger {
    background-color: #ff3333;
    color: white;
}

.btn-danger:hover {
    background-color: #e62e2e;
}

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

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #888;
}

/* Алерты */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background-color: #2d3436;
    color: white;
    padding: 20px;
    z-index: 100;
}

.sidebar .logo {
    margin-bottom: 40px;
}

.sidebar .logo span {
    color: white;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #b2bec3;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 14px;
}

.nav-item:hover {
    background-color: #636e72;
    color: white;
}

.nav-item.active {
    background-color: #636e72;
    color: white;
}

.nav-item .icon {
    font-size: 18px;
}

.main-content {
    margin-left: 240px;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.header {
    background-color: white;
    padding: 20px 40px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 500;
}

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

.user-info span {
    font-size: 14px;
    font-weight: 500;
}

.user-folder-info {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

.user-folder-info code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.content {
    padding: 40px;
}

/* Панель фильтров */
.filters-panel {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.date-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.filter-btn.active {
    background-color: #ffcc00;
    border-color: #ffcc00;
    font-weight: 500;
}

.date-range-display {
    font-size: 14px;
    color: #666;
}

/* Календарь */
.calendar-modal {
    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;
}

.calendar-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.calendar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.close-calendar {
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close-calendar:hover {
    color: #333;
}

.calendar-body {
    padding: 20px;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
}

.calendar-nav button:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

.calendar-nav span {
    font-weight: 500;
    font-size: 16px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.calendar-day:hover {
    background-color: #f0f0f0;
}

.calendar-day.selected {
    background-color: #ffcc00;
    font-weight: 600;
}

.calendar-day.in-range {
    background-color: #fff4cc;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.disabled:hover {
    background-color: transparent;
}

.calendar-day.weekend {
    color: #ff3333;
}

.calendar-day-header {
    font-weight: 600;
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 8px 0;
}

.calendar-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.selected-range {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
}

.calendar-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Карточки статистики */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

/* Карточки */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.card-body {
    padding: 24px;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-legend {
    display: flex;
    gap: 24px;
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Таблицы */
.users-table,
.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td,
.stats-table th,
.stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.users-table th,
.stats-table th {
    font-weight: 600;
    color: #555;
    background-color: #f8f9fa;
}

.users-table tbody tr:hover,
.stats-table tbody tr:hover {
    background-color: #f8f9fa;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #888;
}

.create-user-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.info-text {
    margin-top: 15px;
    padding: 12px;
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    font-size: 13px;
    color: #1976d2;
}

.info-text code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 20px 10px;
    }
    
    .sidebar .logo span {
        display: none;
    }
    
    .nav-item span:not(.icon) {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .content {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .date-filters {
        flex-direction: column;
    }
}
