/* Система табеля и KPI - Стили */

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --border-color: #ddd;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--dark-text);
    background-color: #f4f6f9;
    line-height: 1.6;
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.sidebar-header i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 30px;
}

.sidebar-menu a.active {
    background: var(--primary-color);
    border-left: 4px solid #fff;
}

.sidebar-menu a i {
    margin-right: 15px;
    font-size: 18px;
    width: 20px;
}

.menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 20px;
}

.menu-title {
    padding: 15px 20px 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #95a5a6;
    letter-spacing: 1px;
}

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

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark-text);
    cursor: pointer;
}

.topbar h2 {
    font-size: 24px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-btn:hover {
    background: var(--light-bg);
}

.user-btn i.fa-user-circle {
    font-size: 32px;
    color: var(--primary-color);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    min-width: 220px;
    display: none;
    margin-top: 10px;
}

.user-dropdown.show {
    display: block;
}

.user-info {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.user-info strong {
    display: block;
    margin-bottom: 5px;
}

.user-info small {
    color: #7f8c8d;
}

.user-dropdown a {
    display: block;
    padding: 12px 15px;
    color: var(--dark-text);
    text-decoration: none;
    transition: background 0.3s;
}

.user-dropdown a:hover {
    background: var(--light-bg);
}

.user-dropdown a i {
    margin-right: 10px;
    width: 20px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

/* Content */
.content {
    flex: 1;
    padding: 30px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

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

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

/* Dashboard */
.dashboard-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-header {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-card-blue .stat-icon {
    background: #e3f2fd;
    color: #2196f3;
}

.stat-card-green .stat-icon {
    background: #e8f5e9;
    color: #4caf50;
}

.stat-card-orange .stat-icon {
    background: #fff3e0;
    color: #ff9800;
}

.stat-card-purple .stat-icon {
    background: #f3e5f5;
    color: #9c27b0;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-content p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 30px;
}

.quick-actions h2 {
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.action-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.action-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.action-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.action-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.action-card i {
    font-size: 40px;
    margin-bottom: 15px;
}

.action-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.action-card p {
    font-size: 14px;
    opacity: 0.9;
}

/* Recent Activity */
.recent-activity h2 {
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-list {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon i {
    color: var(--primary-color);
    font-size: 8px;
}

.activity-content {
    flex: 1;
}

.activity-time {
    display: block;
    font-size: 12px;
    color: #95a5a6;
    margin-top: 5px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
}

.btn-info {
    background: var(--info-color);
    color: #fff;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-block {
    width: 100%;
    display: block;
    text-align: center;
}

/* Badge */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-danger {
    background: #fee;
    color: var(--danger-color);
}

.badge-warning {
    background: #fff3cd;
    color: var(--warning-color);
}

.badge-secondary {
    background: #e9ecef;
    color: #6c757d;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

.alert-dismissible {
    position: relative;
    padding-right: 50px;
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table thead {
    background: var(--light-bg);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-total {
    background: var(--light-bg);
    font-weight: 600;
}

/* Timesheet specific */
.timesheet-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-item {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 150px;
}

.stat-work { border-left: 4px solid #27ae60; }
.stat-weekend { border-left: 4px solid #95a5a6; }
.stat-sick { border-left: 4px solid #e67e22; }
.stat-vacation { border-left: 4px solid #3498db; }
.stat-absence { border-left: 4px solid #e74c3c; }

.timesheet-calendar {
    background: #fff;
}

.calendar-header {
    display: grid;
    grid-template-columns: 80px 150px 1fr;
    gap: 10px;
    padding: 15px;
    background: var(--light-bg);
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.calendar-row {
    display: grid;
    grid-template-columns: 80px 150px 1fr;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.calendar-row:hover {
    background: #f8f9fa;
}

.weekend-row {
    background: #fafafa;
}

.calendar-cell {
    display: flex;
    align-items: center;
}

.day-type-select {
    width: 100%;
    max-width: 300px;
}

.employee-info {
    display: flex;
    gap: 30px;
}

.quick-actions-timesheet {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* KPI specific */
.kpi-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.kpi-summary-item label {
    display: block;
    margin-bottom: 8px;
    color: #7f8c8d;
    font-size: 14px;
}

.kpi-summary-item strong {
    font-size: 20px;
    font-weight: 700;
}

.kpi-table th {
    font-size: 13px;
}

.kpi-table td {
    vertical-align: middle;
}

.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-primary { color: var(--primary-color); }
.text-danger { color: var(--danger-color); }
.text-muted { color: #7f8c8d; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.login-box {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-logo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 40px 20px;
}

.login-logo i {
    font-size: 60px;
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.login-form {
    padding: 40px;
}

.login-form h2 {
    margin-bottom: 25px;
    text-align: center;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.login-footer {
    text-align: center;
    color: #fff;
    margin-top: 20px;
}

/* Footer */
.footer {
    background: #fff;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    margin-top: auto;
}

.footer-content p {
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .btn-menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 15px;
    }
    
    .content {
        padding: 15px;
    }
    
    .calendar-header,
    .calendar-row {
        grid-template-columns: 60px 120px 1fr;
        font-size: 13px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
