@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #FF7A00;      /* оранжевый (акцент как на публичной) */
    --maroon-deep: #E85D00;        /* тёмно-оранжевый */
    --primary-light: #FF9500;      /* светло-оранжевый */
    --gold: #FF9500;
    --gold-soft: #FF7A00;
    --secondary-color: #15803D;    /* success green */
    --danger-color: #B91C1C;
    --warning-color: #FF9500;
    --dark-color: #16181D;         /* основной текст */
    --ink-muted: #6B7280;
    --light-color: #E9EBF0;        /* мягкая граница */
    --surface-alt: #FAFBFC;
    --border-radius: 12px;
    --box-shadow: 0 2px 8px rgba(16,17,20,0.05), 0 12px 28px rgba(16,17,20,0.07);
    --primary-gradient: linear-gradient(135deg, #FF7A00 0%, #E85D00 100%);
    --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background:
        radial-gradient(600px 300px at 78% -20%, rgba(255,255,255,0.20), transparent 60%),
        linear-gradient(135deg, #FF7A00 0%, #E85D00 60%, #C24E00 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--dark-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: var(--dark-color);
    margin-bottom: 10px;
    text-align: center;
}

.login-box h2 {
    color: #666;
    font-size: 1.1em;
    font-weight: 400;
    margin-bottom: 30px;
    text-align: center;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1em;
    transition: border-color 0.3s;
}

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

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

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

.btn-primary-gate {
    width: 100%;
    padding: 12px;
    background: #FF7A00;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary-gate:hover {
    background: #FF9500;
}

.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid var(--danger-color);
}

.footer-links {
    margin-top: 20px;
    text-align: center;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    background: var(--light-color);
}

.dashboard-header {
    background: linear-gradient(135deg, #FF7A00 0%, #FF9500 100%);
    color: white;
    padding: 0;
    box-shadow: 0 4px 20px rgba(255, 122, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dashboard-header h1 {
    font-size: 1.5em;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.dashboard-header h1::before {
    
    font-size: 1.2em;
}

/* Tab Navigation */
.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px;
    border-radius: 12px;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

.nav-tabs-pages {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-tabs-user {
    display: none;
}

.mobile-only {
    display: none;
}

.nav-tab {
    padding: 10px 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 8px;
}

.nav-tab:hover::before {
    opacity: 1;
}

.nav-tab:hover {
    color: white;
    transform: translateY(-2px);
}

.nav-tab.active {
    background: linear-gradient(135deg, #FF7A00 0%, #E85D00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.5);
}

.nav-tab.active::before {
    opacity: 0;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5em;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.hamburger-icon {
    display: block;
    line-height: 1;
}

/* Mobile Navigation Actions */
.nav-action-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s;
    text-align: left;
    margin-top: 5px;
}

.nav-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.nav-action-btn.btn-reset:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
}

.nav-action-btn.btn-logout-mobile {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.3);
}

.nav-action-btn.btn-logout-mobile:hover {
    background: rgba(231, 76, 60, 0.4);
    border-color: rgba(231, 76, 60, 0.6);
}

.mobile-user-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.mobile-username {
    font-weight: 700;
    font-size: 1.1em;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.user-info span {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-reset-db {
    padding: 8px 14px;
    background: rgba(149, 165, 166, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-reset-db:hover {
    background: rgba(231, 76, 60, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-change-password {
    padding: 8px 14px;
    background: rgba(52, 152, 219, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-change-password:hover {
    background: rgba(52, 152, 219, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-logout {
    padding: 8px 14px;
    background: rgba(231, 76, 60, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-logout:hover {
    background: rgba(192, 57, 43, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
}

.dashboard-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

#alert-container {
    position: fixed;
    top: 200px;
    right: 20px;
    z-index: 999;
    max-width: 400px;
}

.section {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.section h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #FF7A00, #FF9500, transparent) 1;
    padding-bottom: 10px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Control Panel */
.control-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-success:hover {
    background: #27ae60;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

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

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

.btn-secondary:hover {
    background: #7f8c8d;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

.btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
    font-weight: 600;
}

/* Vote status styles */
.vote-cancelled {
    background-color: #ffebee !important;
    opacity: 0.7;
}

.cancelled-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.counted-badge {
    background: #27ae60;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.cancelled-reason {
    color: #666;
    font-size: 12px;
    font-style: italic;
    display: block;
    margin-top: 4px;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1em;
}

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

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1em;
    resize: vertical;
    min-height: 80px;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-container::after {
    content: '→';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95), transparent);
    padding: 10px 15px;
    font-size: 1.5em;
    color: #FF7A00;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.table-container.scrollable::after {
    opacity: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table th,
table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--light-color);
}

table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: var(--dark-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

table tr {
    transition: all 0.2s;
}

table tr:hover {
    background: #f8f9fa;
    transform: scale(1.001);
}

/* Votes table specific styles */
#votes-table th:first-child,
#votes-table td:first-child {
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 5;
    font-weight: 600;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

#votes-table th:first-child {
    z-index: 15;
    background: var(--light-color);
}

#votes-table tr:hover td:first-child {
    background: #f8f9fa;
}

#votes-table td {
    min-width: 150px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

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

.btn-icon {
    padding: 6px 10px;
    font-size: 1.1em;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--secondary-color);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning-color);
}

.badge-info {
    background: rgba(52, 152, 219, 0.2);
    color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #FF7A00 0%, #E85D00 100%);
    color: white;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.3);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #C24E00 0%, #E85D00 100%);
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.3);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #FF9500 0%, #ff8c5a 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 122, 0, 0.5);
}

.stat-label {
    font-size: 0.95em;
    opacity: 0.95;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 2.2em;
    font-weight: bold;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.4em;
}

.modal-close {
    background: rgba(231, 76, 60, 0.1);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--danger-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Alert */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    animation: slideInRight 0.3s ease-out;
    margin-top: 70px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border-left: 4px solid var(--secondary-color);
    color: #27ae60;
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger-color);
    color: #c0392b;
}

.alert-info {
    background: rgba(255, 122, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    color: #FF7A00;
}

.alert-warning {
    background: rgba(255, 149, 0, 0.1);
    border-left: 4px solid var(--warning-color);
    color: #E85D00;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Badge secondary */
.badge-secondary {
    background: rgba(149, 165, 166, 0.2);
    color: #7f8c8d;
}

.badge-primary {
    background: rgba(255, 122, 0, 0.2);
    color: var(--primary-color);
}

/* Улучшенные стили для кнопок управления голосованием */
.control-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.control-buttons .btn {
    flex: 1;
    min-width: 150px;
    padding: 14px 24px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.control-buttons .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.control-buttons .btn:hover::before {
    width: 300px;
    height: 300px;
}

.control-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.control-buttons .btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Градиенты для кнопок управления */
.control-buttons .btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
}

.control-buttons .btn-success:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.control-buttons .btn-warning {
    background: linear-gradient(135deg, #FF9F1C 0%, #FF7A00 100%);
    border: none;
}

.control-buttons .btn-warning:hover {
    background: linear-gradient(135deg, #FF7A00 0%, #E85D00 100%);
}

.control-buttons .btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
}

.control-buttons .btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.control-buttons .btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border: none;
}

.control-buttons .btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #65757a 100%);
}

.control-buttons .btn-primary {
    background: linear-gradient(135deg, #FF7A00 0%, #E85D00 100%);
    border: none;
}

.control-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

.control-buttons .btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
}

.control-buttons .btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #0f6674 100%);
}

/* Большая кнопка для "Опубликовать результаты" */
.control-buttons .btn-large {
    font-size: 1.15em;
    padding: 16px 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Анимация пульсации для важных кнопок */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 122, 0, 0.6);
    }
}

.control-buttons .btn-primary.btn-large {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .dashboard-header h1 {
        order: 1;
        text-align: center;
        font-size: 1.3em;
    }

    .nav-tabs {
        order: 2;
        justify-content: center;
    }

    .user-info {
        order: 3;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 12px 15px;
    }

    .dashboard-header h1 {
        font-size: 1.2em;
    }

    /* Показываем кнопку мобильного меню */
    .mobile-menu-toggle {
        display: block;
    }

    /* Скрываем навигацию по умолчанию на мобильных */
    .nav-tabs {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 10px;
        gap: 8px;
        margin-top: 10px;
    }

    /* Показываем меню при активации */
    .nav-tabs.mobile-active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

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

    .nav-tabs-pages {
        width: 100%;
        flex-direction: column;
        gap: 5px;
    }

    .nav-tab {
        width: 100%;
        padding: 12px;
        font-size: 0.9em;
        text-align: left;
    }

    /* Показываем секцию пользователя в мобильном меню */
    .mobile-only {
        display: block !important;
    }

    .nav-tabs-user {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 2px solid rgba(255, 255, 255, 0.2);
    }

    /* Скрываем десктопную версию user-info на мобильных */
    .user-info {
        display: none !important;
    }

    .dashboard-content {
        padding: 15px;
    }

    .section {
        padding: 20px 15px;
    }

    .section h2 {
        font-size: 1.3em;
    }

    .control-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .control-buttons .btn {
        width: 100%;
        min-width: auto;
        padding: 14px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Улучшенная адаптация таблиц */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--border-radius);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    table {
        font-size: 0.85em;
        min-width: 600px;
    }

    table th,
    table td {
        padding: 10px 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.8em;
    }

    /* Модальные окна на мобильных */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

@media (max-width: 480px) {
    .dashboard-header h1::before {
        display: none;
    }

    .dashboard-header h1 {
        font-size: 1.1em;
    }

    .nav-tab {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    .user-info {
        flex-direction: column;
        align-items: stretch;
    }

    .user-info span {
        text-align: center;
    }

    .btn-reset-db,
    .btn-change-password,
    .btn-logout {
        width: 100%;
        padding: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-label {
        font-size: 0.85em;
    }

    .stat-value {
        font-size: 1.6em;
    }

    table {
        font-size: 0.8em;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 0.8em;
    }
}

/* Touch-friendly улучшения */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-tab,
    button {
        min-height: 44px; /* Apple's recommended touch target size */
        min-width: 44px;
    }

    .table-actions {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
    }

    .table-actions .btn {
        flex: 1;
        min-width: 80px;
    }
}
/* ============================================================
   РЕДИЗАЙН 2026 — финальный лоск (бордо + золото)
   Оверрайды в конце файла, чтобы выиграть по каскаду.
   ============================================================ */

/* Дисплейный шрифт для заголовков */
.login-box h1,
.dashboard-header h1,
.section h2,
.modal-header h2,
.stat-value {
    font-family: var(--font-display);
    letter-spacing: 0.3px;
}

/* Шапка дашборда — тонкая золотая линия сверху */
.dashboard-header {
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.dashboard-header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold-soft) 70%, transparent);
}

/* Активная вкладка — золотой акцент */
.nav-tab.active {
    box-shadow: inset 0 -3px 0 var(--gold);
}

/* Карточки-секции: мягкая тень (без градиентной полоски) */
.section {
    border: 1px solid var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

/* Таблицы: нейтральная шапка (не оранжевая) */
table th {
    background: var(--surface-alt);
    color: var(--ink-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
table tr:hover { transform: none; background: #FFF4E9; }

/* Цифры статистики на оранжевых карточках — белые */
.stat-value { color: #ffffff; }

/* --- Аватарки в журнале голосов --- */
.voter-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}
.avatar {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--danger-color));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--light-color);
    overflow: hidden;
    user-select: none;
}
.avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.voter-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.voter-name { font-weight: 600; color: var(--dark-color); }
.voter-vk, a.voter-vk {
    font-size: 0.82rem;
    color: var(--ink-muted);
    font-weight: 500;
    text-decoration: none;
}
a.voter-vk:hover { color: var(--primary-color); text-decoration: underline; }

/* Фокус-кольца для доступности */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(161, 98, 7, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
