/* style.css - Основные стили для панели мастера */

/* =====================================================
   Базовые стили
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
}

/* =====================================================
   Login Page
   ===================================================== */
.bg-gradient {
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    padding: 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: bold;
    color: var(--gray-800);
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   Dashboard Layout
   ===================================================== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--gray-800);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--gray-700);
    text-align: center;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: bold;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.2s;
    gap: 12px;
}

.nav-item:hover {
    background: var(--gray-700);
    color: white;
}

.nav-item.active {
    background: var(--gray-700);
    color: white;
    border-left: 3px solid var(--primary);
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-700);
}

.user-info {
    margin-bottom: 12px;
    text-align: center;
}

.user-name {
    display: block;
    font-weight: 500;
}

.logout-btn {
    display: block;
    text-align: center;
    background: var(--gray-700);
    color: white;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: var(--gray-600);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: bold;
    color: var(--gray-800);
}

.user-badge {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid;
}

.stat-card.stat-purple { border-left-color: var(--primary); }
.stat-card.stat-green { border-left-color: var(--success); }
.stat-card.stat-blue { border-left-color: var(--info); }

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--gray-800);
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 20px;
}

/* Appointments List */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
}

.appointment-item strong {
    display: block;
    font-size: 16px;
}

.service-name {
    font-size: 13px;
    color: var(--gray-500);
    margin-left: 8px;
}

.appointment-time {
    text-align: right;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
}

.status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.data-table tr:hover {
    background: var(--gray-50);
}

.actions-cell {
    white-space: nowrap;
}

.empty-row {
    text-align: center;
    padding: 40px !important;
    color: var(--gray-400);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0e7ff; color: #3730a3; }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-control.bg-gray {
    background: var(--gray-50);
    color: var(--gray-500);
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.flex-1 { flex: 1; }
.w-32 { width: 128px; }
.w-64 { width: 256px; }

.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.flex-grow {
    flex: 1;
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--gray-100);
}

.btn-danger:hover {
    background: #fee2e2;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

/* Schedule Grid */
.schedule-grid {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.schedule-header {
    display: flex;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-500);
    font-size: 12px;
    text-transform: uppercase;
}

.schedule-time-col {
    width: 100px;
    padding: 12px 16px;
}

.schedule-events-col {
    flex: 1;
    padding: 12px 16px;
}

.schedule-row {
    display: flex;
    border-bottom: 1px solid var(--gray-100);
}

.schedule-time {
    width: 100px;
    padding: 12px 16px;
    font-weight: 500;
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
}

.schedule-events {
    flex: 1;
    padding: 8px 16px;
    min-height: 60px;
}

.event-blocked {
    background: #fee2e2;
    color: #991b1b;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 4px 0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-appointment {
    background: #d1fae5;
    color: #065f46;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 4px 0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-empty {
    color: var(--gray-400);
    padding: 6px 12px;
    font-size: 13px;
    font-style: italic;
}

.event-time {
    font-size: 12px;
    font-weight: 500;
}

/* Date Navigation */
.date-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-date {
    font-size: 16px;
    font-weight: 500;
    background: white;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    z-index: 1001;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-400);
}

.modal-form {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--gray-200);
}

.hidden {
    display: none;
}

/* Utilities */
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.text-center { text-align: center; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-logo, .nav-item span:last-child, .user-info {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .nav-icon {
        margin: 0;
    }
    .main-content {
        margin-left: 70px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .schedule-time-col, .schedule-time {
        width: 70px;
    }
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    .form-inline .form-group {
        margin-bottom: 12px;
    }
}