/* Hartbeat Energy CRM - Dark/Light Theme with Neon Green Accents */

/* ===== DARK THEME (default) ===== */
[data-theme="dark"], :root {
    --bg-primary: #0f1117;
    --bg-secondary: #161822;
    --bg-surface: #1c1e2d;
    --bg-card: #1a1c2b;
    --text-primary: #eaeaea;
    --text-secondary: #8b8fa3;
    --accent-primary: #39ff14;
    --accent-primary-rgb: 57, 255, 20;
    --accent-secondary: #00e5a0;
    --accent-glow: rgba(57, 255, 20, 0.15);
    --accent-success: #39ff14;
    --accent-warning: #ffb800;
    --accent-danger: #ff4757;
    --border-color: #262838;
    --sidebar-bg: #0b0d14;
    --hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-surface: #eef0f6;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --accent-primary: #16a34a;
    --accent-primary-rgb: 22, 163, 74;
    --accent-secondary: #059669;
    --accent-glow: rgba(22, 163, 74, 0.1);
    --accent-success: #16a34a;
    --accent-warning: #d97706;
    --accent-danger: #dc2626;
    --border-color: #e2e5ee;
    --sidebar-bg: #ffffff;
    --hover-bg: rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100%;
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}

/* ===== APP CONTAINER ===== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease, background 0.3s;
    overflow: hidden;
    height: 100vh;
}

.sidebar-collapsed .app-sidebar {
    width: 60px;
    min-width: 60px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .user-name {
    display: none;
}

.sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
}

.brand-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 12px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-info:hover {
    background: var(--hover-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #0f1117;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== NAV ITEMS ===== */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-primary);
}

.nav-item.nav-sub-item {
    padding-left: 40px;
    font-size: 13px;
}

.nav-item span:first-child {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

/* ===== MAIN AREA ===== */
.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
    transition: background 0.3s;
}

/* ===== TOP BAR ===== */
.top-bar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
    transition: background 0.3s, border-color 0.3s;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: var(--hover-bg);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Show sun icon in dark mode, moon icon in light mode */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.btn-logout, .btn-login {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-logout:hover, .btn-login:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: background 0.3s, border-color 0.3s;
}

.card-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ===== DASHBOARD ===== */
/* ── Home Page ── */
.home-page { padding: 28px 32px; max-width: 1100px; }
.home-header { margin-bottom: 28px; }
.home-header h1 { font-size: 26px; font-weight: 700; color: var(--text-primary); }
.home-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px;
}

.home-section { margin-bottom: 32px; }
.home-section h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 14px; }

.recent-boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.recent-board-card {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.recent-board-card:hover { border-color: var(--accent-primary); transform: translateY(-1px); }
.recent-board-icon { color: var(--text-secondary); }
.recent-board-info { flex: 1; }
.recent-board-name { font-weight: 500; font-size: 14px; color: var(--text-primary); }
.recent-board-meta { font-size: 12px; color: var(--text-secondary); }

.quick-actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-action-card {
    display: flex; align-items: center; gap: 10px; padding: 16px 18px;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 8px; cursor: pointer; transition: all 0.15s;
    color: var(--text-primary); font-size: 14px; font-weight: 500;
}
.quick-action-card:hover { border-color: var(--accent-primary); background: var(--hover-bg); }
.quick-action-card svg { color: var(--accent-primary); flex-shrink: 0; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s, border-color 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 24px rgba(var(--accent-primary-rgb), 0.12);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--accent-primary);
    border: none;
    color: #0f1117;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 0 16px rgba(var(--accent-primary-rgb), 0.3);
}

/* ===== LINKS ===== */
a {
    color: var(--accent-secondary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== VALIDATION ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--accent-success);
}

.invalid {
    outline: 1px solid var(--accent-danger);
}

.validation-message {
    color: var(--accent-danger);
}

/* ===== BLAZOR ERROR UI ===== */
#blazor-error-ui {
    background: var(--accent-danger);
    color: white;
    padding: 12px 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

/* ===== FORMS ===== */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-secondary);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb), 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-primary-rgb), 0.35);
}

/* ===== WORKSPACES PAGE ===== */
.workspaces-page {
    display: flex;
    height: 100%;
    gap: 0;
}

.workspaces-sidebar {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.ws-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.ws-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--hover-bg);
    color: var(--accent-primary);
}

.ws-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.ws-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.ws-item:hover {
    background: var(--hover-bg);
}

.ws-item.active {
    background: var(--accent-glow);
}

.ws-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ws-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.ws-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 2px 8px;
    border-radius: 10px;
}

.workspaces-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.ws-content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.ws-content-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.ws-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.board-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.board-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.12);
    transform: translateY(-1px);
}

.board-card-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.board-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.board-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.empty-state h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* ===== BOARD VIEW PAGE ===== */
.board-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.board-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.board-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 12px;
}

.board-content {
    flex: 1;
    overflow: auto;
    padding: 16px 24px;
}

/* Board Groups */
.board-group {
    margin-bottom: 24px;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px 6px 0 0;
    user-select: none;
}

.group-collapse {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.group-title {
    font-weight: 600;
    font-size: 15px;
}

.group-count {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Board Table */
.group-table {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.table-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    min-height: 38px;
}

.table-row:last-child {
    border-bottom: none;
}

.table-header-row {
    background: var(--bg-surface);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-cell {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-cell:last-child {
    border-right: none;
}

.cell-name {
    flex: 1;
    min-width: 200px;
    font-weight: 500;
}

.item-name {
    cursor: pointer;
    transition: color 0.2s;
}

.item-name:hover {
    color: var(--accent-primary);
}

.cell-name {
    position: relative;
}

.item-delete-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.table-row:hover .item-delete-btn {
    opacity: 1;
}

.item-delete-btn:hover {
    color: var(--accent-danger);
    background: rgba(255, 71, 87, 0.1);
}

/* Cell types */
.cell-clickable {
    cursor: pointer;
    min-height: 28px;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.cell-clickable:hover {
    background: var(--hover-bg);
}

.cell-editable {
    padding: 0 !important;
}

.cell-edit-input {
    width: 100%;
    height: 32px;
    background: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 2px 8px;
    outline: none;
}

.cell-status {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
    display: inline-block;
    cursor: pointer;
    transition: filter 0.15s;
    width: 100%;
}

.cell-status:hover {
    filter: brightness(1.15);
}

.cell-status-dropdown {
    border-radius: 4px;
    min-width: 80px;
    width: 100%;
    transition: filter 0.15s;
}

.cell-status-dropdown:hover {
    filter: brightness(1.15);
}

.status-select {
    width: 100%;
    padding: 4px 8px;
    border: none;
    outline: none;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: white;
}

.status-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.cell-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.cell-number {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.cell-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.cell-email, .cell-link {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 13px;
}

.cell-email:hover, .cell-link:hover {
    text-decoration: underline;
}

.cell-files {
    font-size: 13px;
    color: var(--text-secondary);
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.file-badge:hover {
    background: var(--accent-glow);
    color: var(--accent-primary);
}

.cell-text {
    font-size: 13px;
    color: var(--text-primary);
}

.cell-phone {
    font-size: 13px;
    color: var(--text-primary);
}

/* Add item input */
.add-item-row {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.add-item-row:focus-within {
    opacity: 1;
}

.add-item-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    width: 100%;
    outline: none;
    padding: 0;
}

.add-item-input::placeholder {
    color: var(--text-secondary);
}

/* Add group */
.add-group-area {
    margin-top: 8px;
}

.btn-add-group {
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.btn-add-group:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.add-group-input-area {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-group-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    outline: none;
}

.add-group-input:focus {
    border-color: var(--accent-primary);
}

/* Loading */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60vh;
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===== DIALOGS ===== */
.dialog-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-select {
    width: 100%;
    height: 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    padding: 4px 8px;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}

/* ===== LIGHT THEME SCROLLBAR ===== */
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ===== VIEW TABS ===== */
.view-tabs {
    display: flex;
    gap: 4px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.view-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.view-tab:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.view-tab.active {
    background: var(--accent-glow);
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===== KANBAN VIEW ===== */
.kanban-view {
    padding: 0;
}

.kanban-toolbar {
    display: flex; gap: 4px; margin-bottom: 12px; justify-content: flex-end;
}
.kanban-layout-toggle {
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 6px; padding: 6px 8px; cursor: pointer;
    color: var(--text-secondary); transition: all 0.15s;
}
.kanban-layout-toggle:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.kanban-layout-toggle.active { background: var(--accent-primary); color: #000; border-color: var(--accent-primary); }

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 400px;
}

/* Horizontal layout */
.kanban-board.horizontal {
    flex-direction: column;
    overflow-x: visible;
    min-height: auto;
}
.kanban-board.horizontal .kanban-column {
    flex: none;
    flex-direction: row;
    align-items: stretch;
}
.kanban-board.horizontal .kanban-column-header {
    flex: 0 0 160px;
    border-top: none !important;
    border-left: 3px solid;
    border-left-color: inherit;
}
.kanban-board.horizontal .kanban-column-body {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    min-height: auto;
    overflow-x: auto;
}
.kanban-board.horizontal .kanban-card {
    flex: 0 0 220px;
}

.kanban-column {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.kanban-column-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

.kanban-column-body {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.kanban-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.kanban-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kanban-card-group {
    font-size: 12px;
    color: var(--text-secondary);
}

.kanban-card-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kanban-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.kanban-card-field-label {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 10px;
}

.kanban-card-field-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== KANBAN ADD ITEM ===== */
.kanban-add-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.kanban-add-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.kanban-add-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

/* ===== INLINE NAME EDITING ===== */
.item-name-input {
    width: 100%;
    padding: 2px 6px;
    font-size: 14px;
}

.detail-name-input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    outline: none;
}

.detail-header-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-delete-detail {
    color: var(--text-secondary);
}

.btn-delete-detail:hover {
    color: #df2f4a;
}

/* ===== RECYCLE BIN ===== */
.recycle-bin-page {
    padding: 24px 32px;
}

.recycle-bin-page .page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.recycle-bin-page .page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 24px;
}

.recycle-bin-page .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px;
    color: var(--text-secondary);
    font-size: 16px;
}

.recycle-board-group {
    margin-bottom: 24px;
}

.recycle-board-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    margin: 0 0 12px;
}

.recycle-table {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.recycle-table-header {
    display: flex;
    background: var(--bg-surface);
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.recycle-table-row {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    align-items: center;
    font-size: 14px;
    color: var(--text-primary);
}

.recycle-table-row:hover {
    background: var(--bg-surface);
}

.recycle-table .col-name { flex: 2; font-weight: 500; }
.recycle-table .col-group { flex: 1; color: var(--text-secondary); }
.recycle-table .col-deleted { flex: 1; color: var(--text-secondary); font-size: 13px; }
.recycle-table .col-actions { flex: 1; display: flex; gap: 8px; justify-content: flex-end; }

.btn-restore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.btn-restore:hover {
    background: var(--accent-primary);
    color: #000;
}

.btn-permanent-delete {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #df2f4a;
    border-radius: 4px;
    color: #df2f4a;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.btn-permanent-delete:hover {
    background: #df2f4a;
    color: #fff;
}

/* ===== CALENDAR VIEW ===== */
.calendar-view {
    padding: 0;
}

/* ===== CONTEXT MENU ===== */
.context-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
}

.context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
}

.context-menu-item:hover {
    background: var(--hover-bg);
}

.context-menu-item.danger {
    color: var(--accent-danger);
}

.context-menu-item.danger:hover {
    background: rgba(255, 71, 87, 0.1);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ===== ITEM DETAIL PANEL ===== */
.detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.detail-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.detail-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-field label {
    flex: 0 0 120px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-field-value {
    flex: 1;
    min-width: 0;
}

.detail-field span {
    font-size: 13px;
    color: var(--text-primary);
}

/* Updates / Activity Feed */
.update-compose {
    margin-bottom: 16px;
}

.update-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 10px 12px;
    resize: vertical;
    font-family: var(--font-family);
}

.update-input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.btn-update-send {
    margin-top: 8px;
    padding: 6px 16px;
    background: var(--accent-primary);
    color: #0f1117;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-update-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.update-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.update-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.update-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #0f1117;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.update-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.update-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

.update-body {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.empty-updates {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 16px 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
}

.file-name { flex: 1; }
.file-size { color: var(--text-secondary); font-size: 12px; }

/* ===== DASHBOARDS PAGE ===== */
.dashboards-page {
    padding: 24px 32px;
}

.dashboards-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.dashboards-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.dashboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dashboard-card-icon {
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.dashboard-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dashboard-card-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-toolbar h2 {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
}

.btn-back:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Widget Grid */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.widget-type-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-glow);
    color: var(--accent-primary);
    font-weight: 600;
}

.widget-body {
    padding: 20px 16px;
}

.widget-number {
    text-align: center;
}

.widget-number-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.widget-number-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.widget-battery {
    text-align: center;
}

.battery-bar {
    height: 24px;
    background: var(--bg-surface);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.battery-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    transition: width 0.5s ease-out;
}

.battery-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.widget-placeholder {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 20px 0;
}

/* ── Automations Page ── */
.automations-page { padding: 28px 32px; }
.automations-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.automations-header h1 { font-size: 24px; font-weight: 600; color: var(--text-primary); }

.automations-list { display: flex; flex-direction: column; gap: 10px; }

.automation-card {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 14px 18px; transition: border-color 0.15s;
}
.automation-card:hover { border-color: var(--accent); }
.automation-card.disabled { opacity: 0.55; }

.automation-card-left { display: flex; align-items: center; gap: 14px; min-width: 240px; }
.automation-card-center { flex: 1; display: flex; align-items: center; padding: 0 16px; }
.automation-card-right { display: flex; align-items: center; gap: 6px; }

.automation-info { display: flex; flex-direction: column; gap: 2px; }
.automation-name { font-weight: 500; color: var(--text-primary); font-size: 14px; }
.automation-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }

.automation-type-badge {
    display: inline-block; padding: 1px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 500; text-transform: uppercase;
}
.automation-type-badge.builtin { background: rgba(0,200,83,0.15); color: #00c853; }
.automation-type-badge.n8n { background: rgba(255,145,0,0.15); color: #ff9100; }

/* Toggle switch */
.automation-toggle { background: none; border: none; cursor: pointer; padding: 0; }
.toggle-track {
    width: 38px; height: 20px; border-radius: 10px;
    background: var(--border-color); position: relative; transition: background 0.2s;
}
.automation-toggle.on .toggle-track { background: var(--accent); }
.toggle-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: white; position: absolute; top: 2px; left: 2px;
    transition: transform 0.2s;
}
.automation-toggle.on .toggle-thumb { transform: translateX(18px); }

/* Flow chips */
.automation-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.flow-chip.trigger { background: rgba(33,150,243,0.15); color: #42a5f5; }
.flow-chip.action { background: rgba(0,200,83,0.15); color: #00c853; }
.flow-arrow { color: var(--text-secondary); font-size: 16px; }

.btn-icon {
    background: none; border: none; cursor: pointer; padding: 6px;
    color: var(--text-secondary); border-radius: 6px; transition: all 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.danger:hover { color: #ef5350; }

/* Logs panel */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999;
}
.logs-panel {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 700px; max-height: 80vh; background: var(--bg-surface);
    border: 1px solid var(--border-color); border-radius: 12px;
    z-index: 10000; display: flex; flex-direction: column;
}
.logs-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border-color);
}
.logs-header h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }
.logs-body { padding: 16px 20px; overflow-y: auto; }

.logs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.logs-table th { text-align: left; color: var(--text-secondary); font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--border-color); }
.logs-table td { padding: 8px 10px; color: var(--text-primary); border-bottom: 1px solid var(--border-color); }
.log-status { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.log-status.success { background: rgba(0,200,83,0.15); color: #00c853; }
.log-status.failed { background: rgba(239,83,80,0.15); color: #ef5350; }
.log-details { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted { color: var(--text-secondary); font-size: 13px; }

/* ── Import Page ── */
.import-page { padding: 28px 32px; max-width: 900px; }
.import-header { margin-bottom: 24px; }
.import-header h1 { font-size: 24px; font-weight: 600; color: var(--text-primary); }

.import-sources { display: flex; gap: 16px; margin-bottom: 32px; }
.import-source-card {
    flex: 1; padding: 20px; border: 2px solid var(--border-color);
    border-radius: 10px; cursor: pointer; transition: all 0.15s; text-align: center;
}
.import-source-card:hover { border-color: var(--accent); }
.import-source-card.active { border-color: var(--accent); background: rgba(0,200,83,0.05); }
.import-source-card.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.source-icon { color: var(--text-secondary); margin-bottom: 8px; }
.source-name { font-weight: 600; font-size: 15px; color: var(--text-primary); margin-bottom: 4px; }
.source-desc { font-size: 12px; color: var(--text-secondary); }

.import-config { margin-bottom: 32px; }
.import-config h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }

.repair-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border-color); }
.repair-section h2 svg { color: var(--accent-warning); }
.repair-section .step-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; }

.import-step {
    display: flex; gap: 16px; padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.step-number {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent); color: #000; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.import-step.completed .step-number { background: var(--accent); }
.step-content { flex: 1; }
.step-content h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.step-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }

.api-token-input { display: flex; gap: 10px; align-items: center; max-width: 500px; }
.api-token-input .token-input { flex: 1; }
.import-error { color: #ef5350; font-size: 13px; margin-top: 8px; }

.board-select-list { display: flex; flex-direction: column; gap: 8px; }
.board-select-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 6px; cursor: pointer; font-size: 14px;
}
.board-select-item input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.board-select-name { flex: 1; color: var(--text-primary); }
.board-select-count { font-size: 12px; color: var(--text-secondary); }

/* Import History */
.import-history { margin-top: 32px; }
.import-history h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; }
.import-jobs-list { display: flex; flex-direction: column; gap: 10px; }
.import-job-card {
    display: flex; align-items: center; gap: 16px; padding: 14px 18px;
    background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px;
}
.job-info { display: flex; flex-direction: column; gap: 2px; min-width: 140px; }
.job-source { font-weight: 500; font-size: 14px; color: var(--text-primary); }
.job-date { font-size: 12px; color: var(--text-secondary); }
.job-progress { flex: 1; display: flex; align-items: center; gap: 10px; }
.job-progress-bar {
    flex: 1; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden;
}
.job-progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.job-progress-text { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.job-status-badge {
    padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.job-status-badge.pending { background: rgba(255,193,7,0.15); color: #ffc107; }
.job-status-badge.running { background: rgba(33,150,243,0.15); color: #42a5f5; }
.job-status-badge.completed { background: rgba(0,200,83,0.15); color: #00c853; }
.job-status-badge.failed { background: rgba(239,83,80,0.15); color: #ef5350; }
.job-error { font-size: 12px; color: #ef5350; margin-top: 4px; }

/* Import progress */
.spinner {
    width: 20px; height: 20px; border: 3px solid var(--border-color);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.import-log {
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: 6px; padding: 12px; margin-top: 10px;
    max-height: 300px; overflow-y: auto; font-family: monospace; font-size: 12px;
}
.log-line { color: var(--text-secondary); padding: 2px 0; }
.log-line:last-child { color: var(--accent); }

.import-result {
    margin-top: 16px; padding: 16px; border-radius: 8px;
    border: 1px solid var(--border-color);
}
.import-result.success { border-color: var(--accent); background: rgba(0,200,83,0.05); }
.import-result.has-errors { border-color: #ef5350; background: rgba(239,83,80,0.05); }
.import-result h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.import-result p { font-size: 13px; color: var(--text-secondary); }
.import-errors { margin-top: 8px; }

/* ===== FINANCIAL TRANSACTIONS ===== */
.financials-section { padding: 0; }
.financials-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.financials-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.financials-header-actions { display: flex; gap: 8px; }

.btn-export, .btn-add-transaction {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border-color);
    background: var(--bg-surface); color: var(--text-primary);
    font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.btn-export:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.btn-add-transaction {
    background: var(--accent-primary); color: #000; border-color: var(--accent-primary);
    font-weight: 600;
}
.btn-add-transaction:hover { opacity: 0.85; }

/* Summary Cards */
.financial-summary-cards {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px;
}
.financial-summary-card {
    background: var(--bg-surface); border-radius: 8px; padding: 10px 12px;
    border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 2px;
}
.financial-summary-card.income { border-left: 3px solid #00C853; }
.financial-summary-card.expense { border-left: 3px solid #FF5252; }
.financial-summary-card.positive { border-left: 3px solid #00C853; }
.financial-summary-card.negative { border-left: 3px solid #FF5252; }
.financial-summary-card.count { border-left: 3px solid var(--accent-primary); }
.summary-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.summary-value { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.income-value { color: #00C853 !important; }
.expense-value { color: #FF5252 !important; }

/* Financial Chart */
.financial-chart-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 12px;
    position: relative;
}
.chart-status-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}
.chart-status-label.in-black { color: #00C853; }
.chart-status-label.in-red { color: #FF5252; }

/* Transaction Form Modal */
.transaction-form-overlay {
    z-index: 2000;
}
.transaction-form-modal {
    position: relative;
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.2s ease-out;
}
.transaction-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.transaction-form-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.transaction-form-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.transaction-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
}
.form-row { display: flex; gap: 10px; margin-bottom: 10px; }
.form-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.form-field.flex-2 { flex: 2; }
.form-field label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.form-field input, .form-field select {
    padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border-color);
    background: var(--bg-card); color: var(--text-primary); font-size: 13px;
    outline: none; transition: border-color 0.15s;
}
.form-field input:focus, .form-field select:focus { border-color: var(--accent-primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn-cancel {
    padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border-color);
    background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 12px;
}
.btn-cancel:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.btn-save {
    padding: 6px 14px; border-radius: 6px; border: none;
    background: var(--accent-primary); color: #000; font-weight: 600;
    cursor: pointer; font-size: 12px; transition: opacity 0.15s;
}
.btn-save:hover { opacity: 0.85; }
.btn-save:disabled { opacity: 0.4; cursor: not-allowed; }

/* Transaction Filters */
.transaction-filters { margin-bottom: 8px; }
.filter-select {
    padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border-color);
    background: var(--bg-surface); color: var(--text-primary); font-size: 12px; outline: none;
}

/* Transaction Table */
.transaction-table { font-size: 13px; }
.transaction-table-header {
    display: grid; grid-template-columns: 90px 1fr 70px 100px 100px 90px;
    padding: 6px 8px; font-size: 11px; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.transaction-table-row {
    display: grid; grid-template-columns: 90px 1fr 70px 100px 100px 90px;
    padding: 8px; align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.1s;
}
.transaction-table-row:hover { background: var(--hover-bg); }
.transaction-table-row .col-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-amount-income { color: #00C853; font-weight: 600; }
.transaction-amount-expense { color: #FF5252; font-weight: 600; }

.type-badge {
    display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 500;
}
.type-income { background: rgba(0,200,83,0.12); color: #00C853; }
.type-expense { background: rgba(255,82,82,0.12); color: #FF5252; }

.btn-icon-sm {
    width: 26px; height: 26px; border-radius: 4px; border: none;
    background: transparent; color: var(--text-secondary); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.btn-icon-sm:hover { background: var(--hover-bg); color: var(--text-primary); }
.btn-delete-sm:hover { color: #FF5252; }

.empty-financials {
    text-align: center; padding: 24px; color: var(--text-secondary);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-financials p { margin: 0; font-size: 13px; }

/* Delete Confirm Dialog */
.confirm-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 1100;
}
.confirm-dialog {
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 20px; min-width: 300px; max-width: 400px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.confirm-dialog p { margin: 0 0 8px; color: var(--text-primary); font-size: 14px; font-weight: 600; }
.confirm-detail { font-size: 13px !important; color: var(--text-secondary) !important; font-weight: 400 !important; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-delete-confirm {
    padding: 6px 14px; border-radius: 6px; border: none;
    background: #FF5252; color: #fff; font-weight: 600;
    cursor: pointer; font-size: 12px;
}
.btn-delete-confirm:hover { background: #e04848; }

/* Transaction File Upload */
.transaction-file-upload {
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    padding: 10px;
    background: var(--bg-card);
}
.transaction-file-upload ::deep input[type="file"] {
    font-size: 12px;
    color: var(--text-secondary);
}
.pending-files-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pending-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-primary);
    padding: 4px 6px;
    background: var(--bg-surface);
    border-radius: 4px;
}
.btn-remove-file {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}
.btn-remove-file:hover { color: #FF5252; }

/* Transaction file count badge */
.file-count-mini {
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-primary);
    position: relative;
    top: -2px;
}

/* Expanded transaction files */
.transaction-files-row {
    grid-column: 1 / -1;
    padding: 6px 8px 10px 32px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}
.transaction-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.transaction-file-link {
    color: var(--accent-primary);
    text-decoration: none;
}
.transaction-file-link:hover { text-decoration: underline; }

/* ========== File Management Styles ========== */
.files-section { margin-top: 16px; }

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.files-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.file-count-badge {
    background: var(--accent-primary);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.files-header-actions { display: flex; gap: 6px; }

.btn-manage-classifications {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
}
.btn-manage-classifications:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s;
    background: var(--bg-secondary);
}
.upload-area.drag-over {
    border-color: var(--accent-primary);
    background: rgba(57, 255, 20, 0.05);
}
.upload-area:hover { border-color: var(--text-secondary); }

.upload-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.upload-icon { color: var(--text-secondary); flex-shrink: 0; }

.upload-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-label {
    color: var(--accent-primary);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}
.upload-label:hover { opacity: 0.8; }

.upload-area input[type="file"] { display: none; }

.upload-classification-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.classification-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    min-width: 150px;
}

/* Upload Progress */
.upload-progress {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width 0.3s;
}
.progress-text { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* File Groups */
.file-group {
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.file-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}
.file-group-count { font-size: 12px; color: var(--text-secondary); }

.classification-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}
.classification-badge.uncategorized {
    background: var(--text-secondary);
}

/* File Row */
.file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg-tertiary); }

.file-type-icon { font-size: 16px; flex-shrink: 0; }

.file-preview-link {
    flex: 1;
    color: var(--accent-secondary, #579BFC);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: none;
    border: none;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    padding: 0;
}
.file-preview-link:hover { text-decoration: underline; }

.file-meta {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-download-file {
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.file-row:hover .btn-download-file { opacity: 1; }
.btn-download-file:hover { color: var(--accent-primary); background: var(--accent-glow); }

.btn-delete-file {
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.file-row:hover .btn-delete-file { opacity: 1; }
.btn-delete-file:hover { color: #FF5252; background: rgba(255, 82, 82, 0.1); }

.files-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* File Preview Modal */
.file-preview-overlay { z-index: 1100; }

.file-preview-modal {
    width: 90vw;
    max-width: 1100px;
    height: 85vh;
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.file-preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    min-width: 0;
}
.file-preview-title span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-preview-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-preview-action:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}
.btn-preview-close:hover {
    background: rgba(255, 82, 82, 0.1);
    color: #FF5252;
}

.file-preview-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.file-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.file-preview-pdf {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    display: block;
}

.file-preview-pdf-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #525659;
}

/* When preview body contains a PDF, don't use flexbox centering */
.file-preview-body:has(.file-preview-pdf),
.file-preview-body:has(.file-preview-pdf-container) {
    display: block;
    overflow: hidden;
}

.file-preview-unsupported {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px;
    color: var(--text-secondary);
}

.btn-preview-download-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}
.btn-preview-download-large:hover { opacity: 0.85; }

/* Classification Manager Dialog */
.classification-manager { max-width: 420px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-header h4 { margin: 0; color: var(--text-primary); }
.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}
.btn-close-modal:hover { color: var(--text-primary); }

.classification-form { margin-bottom: 16px; }
.classification-form .form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-field {
    flex: 1;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
}
.input-field:focus { outline: none; border-color: var(--accent-primary); }

.color-picker {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    background: var(--bg-secondary);
}

.btn-add-classification {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    background: var(--accent-primary);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-add-classification:hover { opacity: 0.9; }
.btn-add-classification:disabled { opacity: 0.4; cursor: not-allowed; }

.classification-list { display: flex; flex-direction: column; gap: 6px; }

.classification-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}
.classification-file-count {
    flex: 1;
    text-align: right;
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-delete-small {
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}
.btn-delete-small:hover { color: #FF5252; background: rgba(255, 82, 82, 0.1); }

.empty-text { color: var(--text-secondary); font-size: 12px; text-align: center; margin: 8px 0; }

/* Modal overlay/dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-dialog {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-width: 320px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.modal-dialog h4 { margin: 0 0 12px; color: var(--text-primary); }
.modal-dialog p { font-size: 13px; color: var(--text-secondary); margin: 0 0 16px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-cancel {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
}
.btn-cancel:hover { background: var(--bg-tertiary); }
.btn-danger {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: #FF5252;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
}
.btn-danger:hover { background: #e04848; }

/* ===== LOGIN PAGE ===== */
.login-layout {
    min-height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    width: 100%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.login-forgot {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.login-forgot:hover {
    text-decoration: underline;
}

.login-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.login-submit:hover {
    opacity: 0.9;
    box-shadow: 0 0 20px var(--accent-glow);
}

.login-footer {
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ===== ADMIN / USER MANAGEMENT PAGE ===== */
.admin-page {
    padding: 24px 32px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.admin-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 4px 0 0;
}

.btn-accent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-accent:hover { opacity: 0.85; }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover { background: var(--hover-bg); }

.users-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: var(--bg-surface);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.users-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.users-table tr:last-child td {
    border-bottom: none;
}

.users-table tr:hover td {
    background: var(--hover-bg);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
}

.role-manager {
    background: rgba(255, 184, 0, 0.15);
    color: #ffb800;
}

.role-user {
    background: rgba(57, 255, 20, 0.15);
    color: var(--accent-primary);
}

.status-confirmed {
    color: var(--accent-success);
    font-size: 13px;
    font-weight: 500;
}

.status-pending {
    color: var(--accent-warning);
    font-size: 13px;
    font-weight: 500;
}

.status-active {
    color: var(--accent-success);
    font-size: 13px;
    font-weight: 500;
}

.status-locked {
    color: var(--accent-danger);
    font-size: 13px;
    font-weight: 500;
}

.actions-col {
    width: 120px;
    text-align: right !important;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.btn-icon:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-icon-danger:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border-color: #ff4757;
}

.admin-loading {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Admin Modal */
.admin-modal {
    max-width: 440px;
    width: 100%;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    color: var(--text-primary) !important;
}

.form-error {
    color: var(--accent-danger);
    font-size: 12px;
    margin-top: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* Toast notification */
.admin-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.toast-success {
    background: rgba(57, 255, 20, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(57, 255, 20, 0.3);
}

.toast-error {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.toast-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
}

.toast-close:hover { opacity: 1; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Audit Log */
.audit-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-select {
    width: 160px;
    padding: 6px 10px;
}

.action-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.action-login { background: rgba(46, 213, 115, 0.15); color: #2ed573; }
.action-logout { background: rgba(150, 150, 150, 0.15); color: #999; }
.action-view { background: rgba(30, 144, 255, 0.15); color: #1e90ff; }
.action-create { background: rgba(57, 255, 20, 0.15); color: #39ff14; }
.action-update { background: rgba(255, 184, 0, 0.15); color: #ffb800; }
.action-delete { background: rgba(255, 71, 87, 0.15); color: #ff4757; }
.action-execute { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }

.audit-timestamp { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.audit-details { font-size: 13px; max-width: 400px; overflow: hidden; text-overflow: ellipsis; }
.audit-ip { font-size: 12px; color: var(--text-secondary); font-family: monospace; }

.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
}

.audit-page-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== CONNECTED BOARDS ===== */
.cell-connect-board {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-height: 28px;
    padding: 2px 4px;
}

.connect-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--accent-primary, #39e991);
    color: #0f1117;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.connect-chip-removable {
    padding-right: 4px;
}

.chip-remove {
    background: none;
    border: none;
    color: #0f1117;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.7;
}

.chip-remove:hover {
    opacity: 1;
}

.connect-placeholder {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ConnectBoard Picker Modal */
.connect-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.connect-picker-modal {
    background: var(--bg-secondary, #1a1d27);
    border: 1px solid var(--border-color, #2a2d37);
    border-radius: 12px;
    width: 420px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.connect-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #2a2d37);
}

.connect-picker-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary, #e4e6eb);
}

.connect-picker-search {
    padding: 12px 20px;
}

.connect-picker-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #2a2d37);
    border-radius: 6px;
    background: var(--bg-primary, #0f1117);
    color: var(--text-primary, #e4e6eb);
    font-size: 13px;
    outline: none;
}

.connect-picker-search input:focus {
    border-color: var(--accent-primary, #39e991);
}

.connect-picker-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 20px 12px;
}

.connect-picker-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    max-height: 260px;
}

.connect-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary, #e4e6eb);
    font-size: 13px;
}

.connect-picker-item:hover {
    background: var(--bg-hover, #252830);
}

.connect-picker-item.selected {
    background: rgba(57, 233, 145, 0.1);
}

.connect-picker-check {
    width: 20px;
    text-align: center;
    color: var(--accent-primary, #39e991);
    font-weight: bold;
}

.connect-picker-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary, #8b8d97);
    font-size: 13px;
}

.connect-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #2a2d37);
}

.btn-primary {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: var(--accent-primary, #39e991);
    color: #0f1117;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    padding: 6px 16px;
    border: 1px solid var(--border-color, #2a2d37);
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary, #e4e6eb);
    font-size: 13px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-hover, #252830);
}
