:root {
    --primary: #DC2626;
    --primary-dark: #B91C1C;
    --primary-light: #EF4444;
    --secondary: #991B1B;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ffffff;
    --bg-dark: #1e293b;
    --bg-dark-secondary: #334155;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --border: #e2e8f0;
    --border-dark: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
    
    --transition: all 0.2s ease;
}

/* Темная тема */
[data-theme="dark"] {
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    --border: #334155;
    --border-dark: #475569;
}

[data-theme="dark"] body {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .it-line-badge {
    background: rgba(167, 139, 250, 0.22);
    color: #c4b5fd;
}

.profile-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 50%, #991B1B 100%);
    padding: 1rem;
    position: relative;
}

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

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-header .logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    box-sizing: border-box;
}

.login-header .logo-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: #DC2626;
    line-height: 1;
    white-space: nowrap;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input.form-control-readonly {
    cursor: default;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn-warning:hover {
    background: #d97706;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.error-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-size: 0.875rem;
    display: none;
}

.error-message.show {
    display: block;
}

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.test-accounts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.test-account {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* Dashboard */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.sidebar-header .logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.15rem;
    box-sizing: border-box;
}

.sidebar-header .logo-text {
    font-size: 0.5rem;
    font-weight: 700;
    color: #DC2626;
    line-height: 1;
    white-space: nowrap;
}

.sidebar-nav {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    text-align: left;
}

.nav-item:hover {
    background: rgba(220, 38, 38, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary);
    font-weight: 500;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(220, 38, 38, 0.05);
    border-radius: var(--radius);
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Переключатель темы */
.theme-toggle-container {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 56px;
    height: 32px;
    cursor: pointer;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    border-radius: 34px;
    transition: var(--transition);
    border: 2px solid var(--border);
}

.theme-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle input:checked + .theme-toggle-slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

.theme-toggle input:checked + .theme-toggle-slider:before {
    transform: translateX(24px);
}

.theme-toggle-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.theme-icon-sun,
.theme-icon-moon {
    position: absolute;
    transition: var(--transition);
    color: var(--text-secondary);
}

.theme-icon-sun {
    left: 6px;
    opacity: 1;
}

.theme-icon-moon {
    right: 6px;
    opacity: 0;
}

.theme-toggle input:checked ~ .theme-toggle-icon .theme-icon-sun {
    opacity: 0;
}

.theme-toggle input:checked ~ .theme-toggle-icon .theme-icon-moon {
    opacity: 1;
}

.theme-toggle:hover .theme-toggle-slider {
    border-color: var(--primary);
}

[data-theme="dark"] .theme-toggle-slider:before {
    background-color: #f1f5f9;
}

.tabs-container {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tabs-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.report-period-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.report-period-btn {
    flex: 1;
    min-width: 120px;
}

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

.tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    position: relative;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(220, 38, 38, 0.05);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
    background: rgba(220, 38, 38, 0.1);
}

.tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tab-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.tab-label {
    display: inline-block;
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.requests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.request-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    word-wrap: break-word;
}

.request-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.request-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.request-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.it-line-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    background: rgba(139, 92, 246, 0.18);
    color: #7c3aed;
}

.request-id {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
}

.request-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-new {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-in_progress {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-pending.overdue,
.status-new.overdue {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.status-pending {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.request-info {
    margin-bottom: 1rem;
}

.request-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    min-width: 0;
}

.request-info-item strong {
    color: var(--text-secondary);
    min-width: 80px;
    flex-shrink: 0;
}

.request-info-item span {
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.request-actions .btn {
    flex: 1;
    min-width: 100px;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.request-files {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.files-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.files-header .icon {
    color: var(--primary);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    transition: var(--transition);
    max-width: 100%;
}

.file-item:hover {
    border-color: var(--primary);
    background: rgba(220, 38, 38, 0.05);
}

.file-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.file-role {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.7rem;
    white-space: nowrap;
}

.file-download {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.file-download:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.file-item small {
    color: var(--text-secondary);
    font-size: 0.65rem;
    white-space: nowrap;
}

.file-uploader {
    display: none;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    margin-top: 0.5rem;
}

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

/* Компактная кнопка загрузки документа */
.upload-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.upload-doc-btn:hover {
    border-color: var(--primary);
    background: rgba(220, 38, 38, 0.05);
    color: var(--primary);
}

.upload-doc-btn svg {
    width: 14px;
    height: 14px;
}

.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    position: relative;
}

.file-drop-zone:hover {
    border-color: var(--primary);
    background: rgba(220, 38, 38, 0.05);
}

.file-drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(220, 38, 38, 0.1);
}

.file-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.file-drop-content svg {
    color: var(--text-secondary);
}

.file-drop-text {
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin: 0;
}

.file-drop-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.file-drop-hint {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin: 0;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.file-preview span {
    color: var(--text-primary);
    font-size: 0.875rem;
    flex: 1;
}

.btn-icon-small {
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    transition: var(--transition);
}

.btn-icon-small:hover {
    background: #dc2626;
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state.show {
    display: flex;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.2s ease-out;
}

.modal-content.modal-small {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-shrink: 0;
}

/* Approvals */
.approvals {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.approvals-header {
    margin-bottom: 1rem;
}

.approvals-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.approval-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.approval-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
    transition: width 0.3s ease;
    border-radius: 9999px;
}

.approval-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.approval-item.approved {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
}

.approval-role {
    flex: 1;
}

.approval-role strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.approval-comment {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
}

.approval-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.approval-status small {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.approval-overdue {
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: center;
}

.approval-urgent {
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    color: var(--warning);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: center;
}

.approval-deadline {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
}

.rejection-comment {
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Модальное окно документов */
.documents-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.upload-doc-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Секция заявок в main (после обёртки) */
#requestsSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Админ: таблица пользователей */
.users-admin-section {
    flex: 1;
    min-height: 0;
}
.users-toolbar {
    margin-bottom: 1rem;
}
.users-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.data-table tbody tr:hover {
    background: rgba(220, 38, 38, 0.04);
}
.data-table-actions {
    white-space: nowrap;
    width: 1%;
}

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.header-unread-badge {
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.request-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-chat-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-chat-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(220, 38, 38, 0.06);
}

.chat-card-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-primary);
}

.chat-modal-content {
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.chat-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    flex: 1;
}

.chat-modal-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

.chat-empty {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

.chat-messages-list {
    flex: 1;
    min-height: 200px;
    max-height: 45vh;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    max-width: 92%;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
}

.chat-msg-self {
    align-self: flex-end;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.chat-msg-other {
    align-self: flex-start;
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

.chat-msg-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.chat-msg-time {
    font-size: 0.65rem;
    opacity: 0.85;
    margin-top: 0.35rem;
}

.chat-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-textarea {
    resize: vertical;
    min-height: 4rem;
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .requests-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs {
        overflow-x: auto;
        width: 100%;
    }
}
