:root {
    --side-bg: #002d5a;
    --main-blue: #004a99;
    --success: #2ecc71;
    --body-bg: #f4f7f9;
    --border: #e2e8f0;
}

body { font-family: 'Montserrat', sans-serif; margin: 0; background: var(--body-bg); color: #2d3436; }

/* Авторизація */
.modal { position: fixed; inset: 0; background: white; display: flex; justify-content: center; align-items: center; z-index: 2000; }
.login-box { width: 360px; text-align: center; padding: 20px; }
.login-gerb { width: 90px; height: auto; margin-bottom: 15px; }
.login-title { font-size: 16px; margin-bottom: 25px; color: var(--side-bg); font-weight: 700; }
.login-box input { width: 100%; padding: 12px; margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; outline: none; }
.btn-primary { width: 100%; padding: 12px; background: var(--main-blue); color: white; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.3s; }

/* Бічна панель */
.app-container { display: flex; height: 100vh; }
.sidebar { width: 280px; background: var(--side-bg); color: white; display: flex; flex-direction: column; flex-shrink: 0; }
.logo-area { padding: 25px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.main-sidebar-logo { width: 100%; max-width: 200px; height: auto; }
.menu { flex: 1; padding: 20px 10px; }
.menu-item { display: flex; align-items: center; padding: 12px 15px; color: #cbd5e1; text-decoration: none; border-radius: 10px; margin-bottom: 4px; font-size: 14px; transition: 0.2s; }
.menu-item.active, .menu-item:hover { background: rgba(255,255,255,0.1); color: white; }
.menu-item i { margin-right: 12px; font-size: 18px; width: 25px; text-align: center; }

/* Основний контент */
.main-content { flex: 1; padding: 40px; overflow-y: auto; }
.profile-card, .card { background: white; border-radius: 15px; padding: 30px; border: 1px solid var(--border); box-shadow: 0 4px 6px rgba(0,0,0,0.02); overflow-x: auto; }

/* Таблиці та Ідеальне вирівнювання */
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th { text-align: left; font-size: 11px; color: #64748b; padding: 12px 15px; border-bottom: 2px solid #f1f5f9; text-transform: uppercase; background: #fafbfc; letter-spacing: 0.5px; }
.data-table td { padding: 16px 15px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; line-height: 1.5; }
.text-center { text-align: center !important; }
.text-muted { color: #94a3b8; font-size: 13px; }
.time-cell { font-weight: 600; color: var(--main-blue); white-space: nowrap; }
.subject-tag { font-weight: 700; color: #1e293b; }

/* Ефект наведення на рядки */
.data-table tbody tr:hover { background-color: #f8fafc; transition: 0.2s; }

/* Стиль кнопки-посилання у таблиці */
.table-link-btn { 
    display: inline-block; 
    padding: 6px 12px; 
    background: #ebf5ff; 
    color: var(--main-blue); 
    text-decoration: none; 
    border-radius: 6px; 
    font-weight: 700; 
    font-size: 12px; 
    transition: 0.2s; 
    border: 1px solid #cfe3ff; 
    white-space: nowrap;
}
.table-link-btn:hover { background: var(--main-blue); color: white; border-color: var(--main-blue); }

/* Профіль та інші елементи... */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
#profile-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.avatar-holder { position: relative; }
.edit-photo-btn { position: absolute; bottom: 0; right: 0; background: var(--main-blue); color: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid white; }
.status-badge { background: #dcfce7; color: #166534; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field.full { grid-column: span 2; }
.field label { display: block; font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; margin-bottom: 5px; }
.field input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; box-sizing: border-box; outline: none; }
.save-btn { grid-column: span 2; background: var(--success); color: white; border: none; padding: 15px; border-radius: 8px; font-weight: 700; cursor: pointer; margin-top: 10px; transition: 0.3s; }

.polls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.poll-item { background: white; padding: 20px; border-radius: 10px; border-left: 5px solid var(--success); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-mini { display: flex; align-items: center; gap: 10px; }
#mini-avatar { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; }
#logout-btn { color: #fca5a5; cursor: pointer; font-size: 11px; text-decoration: underline; }

.content-section { display: none; }
.content-section.active { display: block; }
.error-msg { color: #e74c3c; font-size: 12px; margin-top: 10px; font-weight: 600; }