* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #a05e5e;        /* серый */
    --primary-dark: rgb(153, 65, 65);   /* тёмно-серый */
    --secondary: rgb(224, 150, 150);      /* светло-серый */
    --success: #10b981;        /* зелёный (остаётся) */
    --danger: #ef4444;         /* красный (остаётся) */
    --warning: #f59e0b;        /* оранжевый (остаётся) */
    --info: #06b6d4;           /* голубой (остаётся) */
    --dark: #612626;           /* тёмно-серый */
    --darker: #632e2e;         /* почти чёрный */
    --light: #fcf8f8;          /* светлый серый */
    --gray: #94a3b8;           /* серый */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--darker) 0%, #1a1a1a 50%, #271111 100%);
    min-height: 100vh;
    color: var(--light);
    line-height: 1.6;
}

/* Основной контейнер */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Шапка */
.app-header {
    background: rgba(42, 15, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-button:active {
    transform: translateX(-50%);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-stats {
    display: flex;
    gap: 1rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    backdrop-filter: blur(10px);
    text-align: center;
    min-width: 120px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-top: 0.25rem;
}

.auth-button {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.4);
}

.auth-button:active {
    transform: translateY(0);
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-header h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--light), var(--gray));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Кнопка добавления */
.add-button {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.3);
}

.add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.add-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* Таблица */
.table-container {
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.glass-morphism {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: var(--glass-shadow);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

th {
    background: rgba(59, 30, 30, 0.5);
    color: var(--light);
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

tr {
    cursor: pointer;
}

.position-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
    background: rgba(32, 41, 64, 0.5);
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: default;
    color: #d6e4ff;
}

.position-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.position-badge::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 138, 138, 0.08), transparent);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.position-badge:hover::after {
    opacity: 1;
}

/* Красный (Chief) */
.badge-chief {
    background: #ef4444;
    color: white;
    border: 1px solid #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/* Бордовый (Deputy) */
.badge-deputy {
    background: #991b1b;
    color: white;
    border: 1px solid #7f1d1d;
    box-shadow: 0 2px 8px rgba(153, 27, 27, 0.3);
}

/* Темно-красный (Senior) */
.badge-senior {
    background: linear-gradient(135deg, #d12626, #5c0b0b);
    color: #f8fafc;
    border: 1px solid #b62323;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.25);
}

/* Светло-красный (Recruiter) */
.badge-recruiter {
    background: #a02929;
    color: #ffffff;
    border: 1px solid #721818;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.25);
}

/* Очень светло-красный (Junior) */
.badge-junior {
    background: #922d2d;
    color: #ffffff;
    border: 1px solid #b15252;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.25);
}

.calls-count {
    font-weight: 700;
    color: var(--success);
    font-size: 1.1rem;
}

.action-cell {
    display: flex;
    gap: 0.5rem;
}

.action-icon {
    padding: 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
}

.action-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.no-actions-placeholder {
    color: #94a3b8;
    font-size: 0.9rem;
    min-height: 24px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0; /* Для лучшего визуального центрирования */
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
    z-index: 1001;
}

.detail-modal {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
}

.modal-body {
    padding: 1.5rem;
}

.user-avatar {
    text-align: center;
    margin-bottom: 2rem;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto;
}

.user-info-grid {
    display: grid;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-item span {
    font-size: 1.1rem;
    font-weight: 500;
}

.edit-field {
    display: none;
    margin-top: 0.5rem;
}

.info-item.editing span {
    display: none;
}

.info-item.editing .edit-field {
    display: block;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 140px;
    padding: 1rem;
    border: none;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.increment-btn {
    background: linear-gradient(45deg, var(--success), #059669);
    color: white;
}

.reset-btn {
    background: linear-gradient(45deg, var(--warning), #d97706);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--light);
    font-size: 0.9rem;
}

.input-field, .select-field {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.5);
    color: var(--light);
    font-size: 1rem;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.input-field:focus, .select-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.3);
}

.input-field::placeholder {
    color: var(--gray);
}

/* Кнопки в модальных окнах */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.right-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border: 1px solid var(--glass-border);
}

.btn-danger {
    background: linear-gradient(45deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.1rem;
}

.error-message {
    color: var(--danger);
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-button {
        position: static;
        transform: none;
        margin: 1rem 0;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-stats {
        justify-content: center;
        width: 100%;
    }
    
    .content-header {
        flex-direction: column;
        text-align: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .right-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .user-info-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    th, td {
        padding: 0.8rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .position-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .content-header h2 {
        font-size: 1.5rem;
    }
    
    .add-button {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .stat-card {
        padding: 0.6rem 0.8rem;
        min-width: 100px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-container {
    animation: fadeIn 0.6s ease-out;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Градиентные эффекты */
.glass-morphism::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--primary-dark));
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-morphism:hover::before {
    opacity: 0.1;
}

/* Плавные переходы */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}