/* ==========================================================================
   STORM SP WORK — Unified Stylesheet
   All theme variables, component styles, and status/dropdown/filter styles
   consolidated into a single file. No inline CSS in templates.
   
   DROPDOWN REFERENCE: Все выпадающие списки привязаны к Справочникам
   с такими же названиями колонок (см. COLUMN_HANDBOOK_MAP в JS).
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES / THEMES
   ========================================================================== */

html {
    --bg-color: #121212;
    --sidebar-bg: #1f1f1f;
    --header-bg: #1f1f1f;
    --text-color: #ffffff;
    --accent-color: #4caf50;
    --accent-hover: #66bb6a;
    --border-color: #444;
    --input-bg: #2d2d2d;
    --item-bg: #333;
    --item-hover: #444;
    --modal-bg: #2b2b2b;
    --font-main: 'Century Gothic', 'Segoe UI', sans-serif;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --context-bg: #2a2a2a;
    --delete-color: #d32f2f;
    --gold: #FFD700;
    --btn-text: #ddd;
}

html.light-theme,
body.light-theme {
    --bg-color: #f5f5f5 !important;
    --sidebar-bg: #ffffff !important;
    --header-bg: #ffffff !important;
    --text-color: #333333 !important;
    --accent-color: #2e7d32 !important;
    --accent-hover: #4caf50 !important;
    --border-color: #ccc !important;
    --input-bg: #ffffff !important;
    --item-bg: #e8e8e8 !important;
    --item-hover: #d5d5d5 !important;
    --modal-bg: #ffffff !important;
    --shadow-color: rgba(0, 0, 0, 0.12) !important;
    --context-bg: #ffffff !important;
    --btn-text: #333333 !important;
    --delete-color: #c62828 !important;
}

html.black-theme,
body.black-theme {
    --bg-color: #000000 !important;
    --sidebar-bg: #0a0a0a !important;
    --header-bg: #0a0a0a !important;
    --text-color: #e0e0e0 !important;
    --accent-color: #4caf50 !important;
    --accent-hover: #66bb6a !important;
    --border-color: #222 !important;
    --input-bg: #111 !important;
    --item-bg: #141414 !important;
    --item-hover: #1a1a1a !important;
    --modal-bg: #0e0e0e !important;
    --shadow-color: rgba(0, 0, 0, 0.9) !important;
    --context-bg: #0a0a0a !important;
    --btn-text: #e0e0e0 !important;
    --delete-color: #d32f2f !important;
}

html.cyberpunk-theme,
body.cyberpunk-theme {
    --bg-color: #0a0014 !important;
    --sidebar-bg: #0d0021 !important;
    --header-bg: #0d0021 !important;
    --text-color: #e0d4ff !important;
    --accent-color: #ff00ff !important;
    --accent-hover: #ff66ff !important;
    --border-color: #2a0045 !important;
    --input-bg: #150028 !important;
    --item-bg: #1a0033 !important;
    --item-hover: #2a0050 !important;
    --modal-bg: #120020 !important;
    --shadow-color: rgba(255, 0, 255, 0.15) !important;
    --context-bg: #0d0021 !important;
    --btn-text: #e0d4ff !important;
    --delete-color: #ff1744 !important;
}

/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */

* {
    box-sizing: border-box;
}

/* Custom green checkbox */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    max-width: 16px;
    min-height: 16px;
    max-height: 16px;
    box-sizing: border-box;
    padding: 0;
    border: 2px solid #666;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
    margin: 0;
}

input[type="checkbox"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-size: 13px;
    overflow: hidden;
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */

header {
    background-color: var(--header-bg);
    padding: 10px 20px;
    border-bottom: 2px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px var(--shadow-color);
    flex-shrink: 0;
    z-index: 100;
    height: 55px;
}

.site-branding {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--accent-color);
    gap: 10px;
}

.site-branding h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 72px);
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s;
}

.sidebar-top {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.sidebar-bottom {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    background-color: var(--bg-color);
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

/* ==========================================================================
   5. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    font-size: 14px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ==========================================================================
   6. FORM ELEMENTS (Inputs, Selects, Textareas)
   ========================================================================== */

input,
select,
textarea {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: var(--font-main);
    width: 100%;
    box-sizing: border-box;
    transition: border 0.3s;
}

input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Fix Dropdown Options in Dark Mode */
select option {
    background-color: var(--modal-bg);
    color: var(--text-color);
    padding: 10px;
}

/* ==========================================================================
   7. BUTTONS
   ========================================================================== */

.btn {
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: var(--item-bg);
    color: var(--btn-text, #ddd);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--item-hover);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-danger {
    background: var(--delete-color);
    color: #fff;
}

.btn-danger:hover {
    background: #b71c1c;
}

/* ADD ROW button — unified */
.btn-add-row {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-add-row:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

/* ==========================================================================
   8. NAVIGATION (Sidebar)
   ========================================================================== */

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: #e1f5fe !important;
    color: #0277bd !important;
    border: 1px solid #81d4fa !important;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(129, 212, 250, 0.5);
}

.nav-section {
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
}

.nav-header {
    color: var(--accent-color) !important;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   9. DATA TABLES
   ========================================================================== */

.data-table-wrapper {
    overflow: auto;
    position: relative;
    max-height: calc(100vh - 180px);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.data-table {
    width: max-content;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 11px;
    background: var(--sidebar-bg);
    table-layout: auto;
}

#kc-partners-table-el {
    width: 100% !important;
    table-layout: fixed !important;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    text-align: left;
    border: 1px solid var(--border-color);
    position: relative;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    vertical-align: middle !important;
}

.data-table th {
    position: sticky !important;
    top: 0;
    z-index: 100 !important;
    background-color: var(--item-bg) !important;
    color: var(--accent-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    user-select: none;
    padding: 10px 15px;
    font-size: 11px;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.5);
}

.data-table th:last-child,
.data-table td:last-child {
    border-right: none;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.header-controls {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-edit-btn {
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
    transition: opacity 0.2s;
}

.header-edit-btn:hover {
    opacity: 1;
}

/* Column Resizer */
.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    cursor: col-resize;
    user-select: none;
    height: 100%;
    z-index: 10;
    transition: background-color 0.2s;
}

.resizer:hover,
.resizing {
    background-color: var(--accent-color);
    opacity: 0.5;
}

/* Editable Cells — unified */
.editable-cell {
    outline: none;
}

.editable-cell:focus {
    outline: none !important;
    background: rgba(76, 175, 80, 0.05) !important;
    box-shadow: inset 0 0 0 2px var(--accent-color) !important;
    border-radius: 2px;
    text-align: left;
    display: table-cell;
}

.editable-cell:empty:before {
    content: "\00a0";
}

/* ==========================================================================
   10. TABS
   ========================================================================== */

.tabs-nav {
    display: flex;
    margin-bottom: 0;
    background: #252526;
    padding: 0 10px;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.tab-link {
    padding: 12px 20px;
    cursor: pointer;
    color: #888;
    font-weight: bold;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-link:hover {
    color: #ccc;
}

.tab-link.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    background: var(--sidebar-bg);
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    border-top: none;
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   11. MODALS
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--modal-bg);
    color: var(--text-color);
    margin: auto;
    padding: 25px;
    border: 2px solid var(--accent-color);
    width: 90%;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: 0.2s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Modal Form Groups — outlined style */
.modal-content .form-group {
    position: relative;
    margin-bottom: 20px;
}

.modal-content .form-group label {
    position: absolute;
    top: 0;
    left: 10px;
    transform: translateY(-50%);
    background-color: var(--modal-bg);
    padding: 0 5px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-color);
    z-index: 10;
    pointer-events: none;
    line-height: 1;
}

.modal-content .form-group input:not([type="checkbox"]),
.modal-content .form-group select,
.modal-content .form-group textarea {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    width: 100%;
    color: var(--text-color);
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: none;
}

/* ==========================================================================
   12. UNIFIED DROPDOWNS (storm-select)
   All table cell dropdowns use this unified class.
   Each dropdown references its corresponding Справочник.
   ========================================================================== */

.cell-select {
    background: var(--input-bg, #2d2d2d) !important;
    color: var(--text-color, #fff) !important;
    border: 1px solid var(--border-color, #444) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    cursor: pointer !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    background-size: 18px !important;
    padding-right: 28px !important;
    width: 100%;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cell-select option {
    background: var(--modal-bg, #2b2b2b) !important;
    color: var(--text-color, #fff) !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
}

.cell-select:focus {
    background: var(--input-bg);
    outline: 1px solid var(--accent-color);
    border-radius: 2px;
}

/* ==========================================================================
   13. UNIFIED STATUS SYSTEM
   Single source of truth for all status badges and status selects.
   ========================================================================== */

/* Base: status select (editable dropdown) */
.status-select,
.engineer-status-select {
    border-radius: 4px;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    letter-spacing: 0.3px;
    appearance: auto;
}

.engineer-status-select {
    font-weight: bold !important;
    text-align-last: left !important;
}

/* Base: status badge (read-only label) */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Status Colors (unified — one definition each) --- */

/* Active / Работаем / Основной */
.status-active,
.status-badge.status-active {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.4) !important;
}

/* Stopped / Не работает */
.status-stopped,
.status-badge.status-stopped {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

/* Reserve / Запасной */
.status-reserve,
.status-badge.status-reserve {
    background: rgba(234, 179, 8, 0.15) !important;
    color: #facc15 !important;
    border: 1px solid rgba(234, 179, 8, 0.4) !important;
}

/* Blacklisted / Чёрный список */
.status-blacklisted,
.status-badge.status-blacklisted {
    background: rgba(100, 116, 139, 0.15) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(100, 116, 139, 0.4) !important;
}

/* Agreed / Согласован */
.status-agreed,
.status-badge.status-agreed {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.2), rgba(0, 200, 83, 0.1)) !important;
    color: #00c853 !important;
    border: 1px solid #00c853 !important;
}

/* Declined / Отклонён */
.status-declined,
.status-badge.status-declined {
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.2), rgba(255, 23, 68, 0.1)) !important;
    color: #ff1744 !important;
    border: 1px solid #ff1744 !important;
}

/* Pending / На рассмотрении */
.status-pending,
.status-badge.status-pending {
    background: linear-gradient(135deg, rgba(255, 214, 0, 0.2), rgba(255, 214, 0, 0.1)) !important;
    color: #ffd600 !important;
    border: 1px solid #ffd600 !important;
}

/* Dynamic status-val classes for select onchange */
.status-val-agreed {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.2), rgba(0, 200, 83, 0.1)) !important;
    color: #00c853 !important;
    border-color: #00c853 !important;
}

.status-val-declined {
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.2), rgba(255, 23, 68, 0.1)) !important;
    color: #ff1744 !important;
    border-color: #ff1744 !important;
}

.status-val-pending {
    background: linear-gradient(135deg, rgba(255, 214, 0, 0.2), rgba(255, 214, 0, 0.1)) !important;
    color: #ffd600 !important;
    border-color: #ffd600 !important;
}

/* Badge aliases */
.badge.blacklisted,
.badge.cherny_spisok {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid #9e9e9e;
}

/* Centering for status columns */
.data-table td:has(.status-select),
.data-table th:has(.status-select) {
    text-align: center !important;
}

/* ==========================================================================
   14. UNIFIED FILTER DROPDOWN
   Used by toggleFilterDropdown() — replaces inline styles.
   ========================================================================== */

.filter-dropdown {
    position: fixed;
    background: var(--modal-bg, #2b2b2b);
    border: 1px solid var(--accent-color);
    padding: 8px;
    border-radius: 8px;
    z-index: 9999;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 350px;
    overflow-y: auto;
    animation: fadeIn 0.15s ease;
}

.filter-dropdown .filter-header {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.filter-dropdown .filter-header label {
    display: block;
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text-color);
}

.filter-dropdown .filter-search {
    width: 100%;
    padding: 4px 8px;
    margin-bottom: 6px;
    font-size: 11px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
}

.filter-dropdown .filter-values {
    max-height: 180px;
    overflow-y: auto;
}

.filter-dropdown .filter-values label {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-bottom: 2px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.15s;
    color: var(--text-color);
}

.filter-dropdown .filter-values label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-dropdown .filter-values label span {
    margin-left: 6px;
}

.filter-dropdown .filter-actions {
    padding: 8px 0 0 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

.filter-dropdown .filter-actions .filter-right-btns {
    display: flex;
    gap: 8px;
}

.filter-dropdown .filter-hint {
    font-size: 10px;
    color: var(--accent-color);
    opacity: 0.7;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}

/* ==========================================================================
   15. LOGIN PAGE
   ========================================================================== */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: url('../img/bg-login.jpg') no-repeat center center fixed;
    background-size: cover;
    background-color: var(--bg-color);
}

.login-card {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 520px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.login-card h2 {
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.login-card .form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.login-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
}

.login-card input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.login-card input:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.login-card .btn-primary {
    padding: 12px;
    font-size: 0.9rem;
    width: 100%;
    margin-top: 1rem;
    border-radius: 8px;
    letter-spacing: 1px;
}

.login-card .auth-toggle {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #666;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.login-card .auth-toggle a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
    transition: color 0.2s;
}

.login-card .auth-toggle a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ==========================================================================
   16. LOGS TABLE
   ========================================================================== */

#logs-table th {
    width: 200px;
}

#logs-table th:first-child {
    width: 50px !important;
}

/* ==========================================================================
   17. ROLE BADGES
   ========================================================================== */

.badge-role {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: bold;
    display: inline-block;
}

.role-admin {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #ef4444;
}

.role-usp_head {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid #3b82f6;
}

.role-usp_emp {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border: 1px solid #0ea5e9;
}

.role-kc_head {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid #a855f7;
}

.role-kc_emp {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid #eab308;
}

.role-user {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid #64748b;
}

/* ==========================================================================
   18. ANIMATIONS
   ========================================================================== */

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================================================
   19. THEME-SPECIFIC OVERRIDES
   ========================================================================== */

/* --- Light Theme --- */
.light-theme .btn-add-row {
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

.light-theme .nav-section {
    border-color: #ddd;
    background: rgba(0, 0, 0, 0.02);
}

.light-theme .data-table tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Light Theme: High contrast statuses */
.light-theme .status-select,
.light-theme .status-badge {
    font-weight: 800 !important;
    color: #000 !important;
    border-width: 2px !important;
    opacity: 1 !important;
}

.light-theme .status-active,
.light-theme .status-select.active {
    background: #4ade80 !important;
    color: #004d40 !important;
}

.light-theme .status-stopped,
.light-theme .status-select.stopped {
    background: #f87171 !important;
    color: #3b0000 !important;
}

.light-theme .status-reserve,
.light-theme .status-select.reserve {
    background: linear-gradient(135deg, #facc15 0%, #fde047 100%) !important;
    color: #422006 !important;
    border: 1px solid #eab308 !important;
}

.light-theme .status-agreed {
    background: linear-gradient(135deg, #c8e6c9 0%, #e8f5e9 100%) !important;
    color: #1b5e20 !important;
    border: 2px solid #4caf50 !important;
}

.light-theme .status-declined {
    background: linear-gradient(135deg, #ffcdd2 0%, #ffebee 100%) !important;
    color: #b71c1c !important;
    border: 2px solid #ef5350 !important;
}

.light-theme .status-pending {
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 100%) !important;
    color: #f57f17 !important;
    border: 2px solid #fbc02d !important;
}

/* --- Black Theme --- */
.black-theme .nav-item.active {
    background: rgba(76, 175, 80, 0.12) !important;
    color: #4caf50 !important;
    border: 1px solid #4caf50 !important;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

/* --- Cyberpunk Theme --- */
.cyberpunk-theme .nav-item.active {
    background: rgba(255, 0, 255, 0.15) !important;
    color: #ff00ff !important;
    border: 1px solid #ff00ff !important;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4), inset 0 0 10px rgba(255, 0, 255, 0.1);
}

.cyberpunk-theme .nav-item:hover {
    background: rgba(255, 0, 255, 0.08);
}

.cyberpunk-theme .btn-primary {
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

.cyberpunk-theme .btn-primary:hover {
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

.cyberpunk-theme header {
    border-bottom: 2px solid #ff00ff;
}

.cyberpunk-theme .sidebar-bottom {
    background: rgba(255, 0, 255, 0.05);
}

.cyberpunk-theme .modal-content {
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.3);
}