/* ══════════════════════════════════════════════
   WebTable — Dark Theme (Accounts Manager)
   ══════════════════════════════════════════════ */

:root {
    --bg-body: #0e0e0e;
    --bg-sidebar: #1a1a1d;
    --bg-header: #111113;
    --bg-card: #1a1a1a;
    --bg-card-alt: #222222;
    --bg-surface: #151515;
    --bg-input: #1e1e1e;
    --border: #2a2a2a;
    --border-hover: #444;
    --text-primary: #e5e5e5;
    --text-secondary: #999;
    --text-muted: #666;
    --accent-green: #28a745;
    --accent-green-hover: #218838;
    --accent-blue: #4a9eff;
    --accent-red: #dc3545;
    --accent-yellow: #ffc107;
    --accent-purple: #8b5cf6;
    --accent-orange: #fd7e14;
    --sidebar-width: 200px;
    --header-height: 56px;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ══════════════════════════════
   Top Bar
   ══════════════════════════════ */
.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.top-bar-left { display: flex; align-items: center; gap: 10px; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }

.btn-sidebar-toggle {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 18px; cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-sidebar-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.logo-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
}

.logo-text h1 { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.logo-text span { font-size: 11px; color: var(--text-muted); }

/* ══════════════════════════════
   Modal
   ══════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 500; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); width: 380px; max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-body .form-group label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.modal-body .form-group input {
    width: 100%; padding: 10px 14px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 14px; font-family: inherit;
    outline: none; transition: border-color var(--transition);
}
.modal-body .form-group input:focus { border-color: var(--accent-purple); }
.modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 14px 20px; border-top: 1px solid var(--border);
}

/* ══════════════════════════════
   App Layout
   ══════════════════════════════ */
.app-layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ══════════════════════════════
   Sidebar
   ══════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar.collapsed {
    width: 0;
    border-right: none;
    overflow: hidden;
}
.sidebar.collapsed ~ .main {
    margin-left: 0;
}

.sidebar-nav { padding: 16px 0; }

.sidebar-section-label {
    padding: 8px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.sidebar-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent-blue);
}

.sidebar-icon { font-size: 16px; width: 20px; text-align: center; }

/* ══════════════════════════════
   Main Content Area
   ══════════════════════════════ */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.25s ease;
}

.page { display: none; }
.page.active { display: block; }

.content {
    padding: 24px 28px;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title { font-size: 20px; font-weight: 700; }

/* ══════════════════════════════
   Cards
   ══════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.card-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ══════════════════════════════
   Buttons
   ══════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 13px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; transition: all var(--transition);
    font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--accent-green); color: white; border-color: var(--accent-green); }
.btn-primary:hover { background: var(--accent-green-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--bg-card-alt); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-icon {
    width: 36px; height: 36px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius); background: var(--bg-card-alt);
    border: 1px solid var(--border); color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition); font-size: 16px;
}
.btn-icon:hover { background: var(--border); color: var(--text-primary); }

.btn-generate {
    padding: 10px 22px; font-size: 14px; font-weight: 600;
    border-radius: 10px; background: var(--accent-green);
    color: white; border: none; cursor: pointer; transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap; font-family: inherit;
}
.btn-generate:hover { background: var(--accent-green-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3); }
.btn-generate:active { transform: translateY(0); }

/* ══════════════════════════════
   Form Elements
   ══════════════════════════════ */
.input-search {
    padding: 8px 14px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 13px; font-family: inherit;
    outline: none; transition: border-color var(--transition);
    flex: 1;
}
.input-search:focus { border-color: var(--accent-blue); }
.input-search::placeholder { color: var(--text-muted); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select {
    padding: 8px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 13px; font-family: inherit;
    outline: none; transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent-blue); }

/* ══════════════════════════════
   Badge
   ══════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: 10px; font-size: 11px; font-weight: 600;
}
.badge-green { background: rgba(40,167,69,0.15); color: var(--accent-green); }
.badge-blue { background: rgba(74,158,255,0.15); color: var(--accent-blue); }
.badge-red { background: rgba(220,53,69,0.15); color: var(--accent-red); }

/* ══════════════════════════════
   Empty State
   ══════════════════════════════ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* ══════════════════════════════
   Spinner
   ══════════════════════════════ */
.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════
   Toast
   ══════════════════════════════ */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 20px; border-radius: var(--radius);
    font-size: 13px; color: white; animation: slideIn 0.3s ease;
    min-width: 250px; display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.info { background: var(--accent-blue); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ══════════════════════════════
   Dashboard Cards
   ══════════════════════════════ */
.dash-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.dash-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: var(--radius-lg);
    background: var(--bg-card); border: 1px solid var(--border);
    transition: border-color var(--transition);
}
.dash-card:hover { border-color: var(--border-hover); }
.dash-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.dash-card-body { min-width: 0; }
.dash-card-value { font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dash-card-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════
   AI Assistant Bar
   ══════════════════════════════ */
.ai-bar { margin-bottom: 16px; }
.ai-bar-input-wrap {
    position: relative; display: flex; align-items: center;
}
.ai-bar-icon {
    position: absolute; left: 14px; font-size: 16px; pointer-events: none;
}
.ai-bar-input {
    width: 100%; padding: 12px 44px 12px 42px;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-primary);
    font-size: 13px; font-family: inherit; outline: none;
    transition: border-color var(--transition);
}
.ai-bar-input:focus { border-color: var(--accent-purple); }
.ai-bar-input::placeholder { color: var(--text-muted); }
.ai-bar-send {
    position: absolute; right: 8px;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--accent-purple); border: none;
    color: #fff; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: opacity var(--transition);
}
.ai-bar-send:hover { opacity: 0.85; }
.ai-bar-send:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-bar-response {
    margin-top: 10px; padding: 14px 18px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); animation: fadeIn 0.2s ease;
}
.ai-bar-response-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; font-weight: 600; color: var(--accent-purple);
    margin-bottom: 8px;
}
.ai-bar-response-body {
    font-size: 13px; color: var(--text-primary); line-height: 1.6;
    white-space: pre-wrap; word-break: break-word;
}
.ai-bar-response-body .ai-loading {
    color: var(--text-muted); font-style: italic;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════
   Accounts Toolbar
   ══════════════════════════════ */
.accounts-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.accounts-toolbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.accounts-toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.search-box {
    position: relative; flex: 1; max-width: 300px;
}
.search-box .search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 13px; pointer-events: none;
}
.search-box input {
    padding-left: 34px; width: 100%;
    border-radius: var(--radius);
}

.btn-filter-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 16px; border-radius: var(--radius);
    font-size: 13px; font-weight: 500; cursor: pointer;
    background: var(--bg-card); color: var(--text-secondary);
    border: 1px solid var(--border); transition: all var(--transition);
    font-family: inherit; white-space: nowrap;
}
.btn-filter-pill:hover { background: var(--bg-card-alt); border-color: var(--border-hover); color: var(--text-primary); }

/* Table card wrapper */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-card .table-container {
    max-height: calc(100vh - 380px);
    overflow-y: auto;
    border: none;
    border-radius: 0;
}

/* Date selector dropdown */
.date-selector { position: relative; }
.dropdown-menu {
    display: none; position: absolute; top: calc(100% + 4px); right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); min-width: 170px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 200;
    padding: 6px 0; max-height: 350px; overflow-y: auto;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
    padding: 8px 16px; font-size: 13px; cursor: pointer;
    color: var(--text-secondary); transition: all var(--transition);
    display: flex; align-items: center; justify-content: space-between;
}
.dropdown-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.dropdown-item.active { color: var(--accent-blue); }
.dropdown-item.active::after { content: '✓'; font-size: 12px; }

/* Column settings panel */
.col-settings-wrap { position: relative; }
.col-settings-panel {
    display: none; position: absolute; top: calc(100% + 4px); right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 200;
    padding: 14px 16px;
}
.col-settings-panel.open { display: block; }
#colSettingsList { max-height: 380px; overflow-y: auto; }
.col-settings-title {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.col-setting-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 4px; font-size: 13px; color: var(--text-primary);
    cursor: grab; border-radius: 6px; transition: background 0.15s, opacity 0.15s;
    margin: 1px 0;
}
.col-setting-item:hover { background: rgba(255,255,255,0.04); }
.col-setting-item.col-dragging { opacity: 0.4; }
.col-setting-item.col-drag-over {
    background: rgba(74,158,255,0.12);
    box-shadow: inset 0 -2px 0 var(--accent-blue);
}
.col-setting-item .drag-handle {
    color: var(--text-muted); font-size: 14px; cursor: grab; margin-right: 8px;
    user-select: none;
}
.col-setting-item label {
    display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer;
    font-size: 13px; color: var(--text-primary); user-select: none;
}
.col-setting-item input[type="checkbox"] {
    -webkit-appearance: none; appearance: none;
    width: 34px; height: 18px; border-radius: 9px;
    background: rgba(255,255,255,0.1); cursor: pointer;
    position: relative; flex-shrink: 0;
    transition: background 0.2s;
}
.col-setting-item input[type="checkbox"]::before {
    content: ''; position: absolute;
    left: 2px; top: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.2s;
}
.col-setting-item input[type="checkbox"]:checked {
    background: rgba(74,158,255,0.3);
}
.col-setting-item input[type="checkbox"]:checked::before {
    transform: translateX(16px);
    background: var(--accent-blue);
}
.col-settings-actions {
    display: flex; gap: 8px; margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.col-settings-actions .btn { flex: 1; justify-content: center; }

/* Filter bar */
.accounts-filter-bar {
    display: flex; align-items: flex-end; gap: 14px;
    padding: 14px 18px; margin-bottom: 14px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.filter-group select {
    padding: 7px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 12px; font-family: inherit;
    outline: none; cursor: pointer; min-width: 150px;
}

/* Custom filter dropdowns (Verification, Ads Status, Spend) */
.custom-filter-wrap { position: relative; }
.custom-filter-btn {
    padding: 6px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-secondary); font-size: 12px; font-family: inherit;
    cursor: pointer; min-width: 150px; text-align: left;
    transition: all var(--transition); white-space: nowrap;
}
.custom-filter-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.custom-filter-btn.custom-filter-active {
    border-color: var(--accent-blue); color: var(--accent-blue);
    background: rgba(74,158,255,0.08);
}
.custom-filter-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 300;
    padding: 6px 0;
}
.custom-filter-dropdown.open { display: block; }
.custom-filter-item {
    padding: 8px 14px; font-size: 13px; cursor: pointer;
    color: var(--text-secondary); transition: background 0.15s;
}
.custom-filter-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.custom-filter-item.active {
    color: var(--accent-blue); background: rgba(74,158,255,0.08);
}

.filter-date-input {
    padding: 6px 10px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 12px; font-family: inherit;
    outline: none; cursor: pointer; min-width: 150px;
    color-scheme: dark;
}
.filter-date-input:focus { border-color: var(--accent-blue); }

/* Tag filter dropdown */
.filter-group-tags { position: relative; }
.tag-filter-wrap { position: relative; }
.tag-filter-btn {
    padding: 6px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-secondary); font-size: 12px; font-family: inherit;
    cursor: pointer; min-width: 150px; text-align: left;
    transition: all var(--transition); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.tag-filter-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.tag-filter-btn.tag-filter-active {
    border-color: var(--accent-blue); color: var(--accent-blue);
    background: rgba(74,158,255,0.08);
}
.tag-filter-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 300;
    padding: 6px 0;
}
.tag-filter-dropdown.open { display: block; }
.tag-filter-list {
    max-height: 220px; overflow-y: auto; padding: 4px 0;
}
.tag-filter-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; font-size: 13px; cursor: pointer;
    color: var(--text-secondary); transition: background 0.15s;
}
.tag-filter-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.tag-filter-item input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--accent-blue); cursor: pointer;
    flex-shrink: 0;
}
.tag-filter-label { flex: 1; }
.tag-filter-actions {
    padding: 6px 10px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end;
}

/* ══════════════════════════════
   Data Table
   ══════════════════════════════ */
.table-container { max-height: 600px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.table-container::-webkit-scrollbar { width: 6px; }
.table-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table thead { position: sticky; top: 0; z-index: 2; }
.data-table th {
    background: var(--bg-surface); padding: 12px 16px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); text-align: left;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid rgba(255,255,255,0.04);
}
.data-table th:first-child { padding-left: 20px; }
.data-table th:last-child { padding-right: 20px; border-right: none; }

.data-table td {
    padding: 14px 16px; font-size: 13px; color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.04);
    transition: background var(--transition);
}
.data-table td:first-child { padding-left: 20px; }
.data-table td:last-child { padding-right: 20px; border-right: none; }

.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table .empty-cell { text-align: center; padding: 40px; color: var(--text-muted); border-bottom: none; }

/* Row number column */
.th-row-num { width: 50px; }
.td-row-num { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Profile name */
.profile-name-cell {
    display: flex; align-items: center;
}
.profile-name-cell span {
    font-weight: 500; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 280px;
}

/* Actions column */
.th-actions { width: 50px; }
.td-actions { width: 50px; text-align: center; padding: 4px !important; }

.btn-delete-row {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 14px; padding: 4px 8px;
    border-radius: 8px; transition: all var(--transition);
    opacity: 0;
}
.data-table tbody tr:hover .btn-delete-row { opacity: 1; }
.btn-delete-row:hover { color: var(--accent-red); background: rgba(220,53,69,0.1); }

/* Empty table state */
.empty-table-state {
    padding: 40px 20px; text-align: center;
}
.empty-table-icon { font-size: 48px; opacity: 0.4; margin-bottom: 12px; }
.empty-table-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.empty-table-sub { font-size: 13px; color: var(--text-muted); }

/* Sortable column headers */
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text-primary); }
.sort-icon { font-size: 10px; margin-left: 4px; opacity: 0.4; }
.data-table th.sorted-asc .sort-icon,
.data-table th.sorted-desc .sort-icon { opacity: 1; color: var(--accent-blue); }

/* ══════════════════════════════
   Pagination
   ══════════════════════════════ */
.accounts-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-top: 1px solid var(--border);
}
.pagination-info-left { flex: 1; }
.pagination-info { font-size: 13px; color: var(--text-muted); }

.pagination-nav { display: flex; align-items: center; gap: 4px; }

.page-nav-btn {
    width: 34px; height: 34px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--bg-card-alt);
    color: var(--text-secondary); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); font-family: inherit;
}
.page-nav-btn:hover { background: var(--border); color: var(--text-primary); }

.pagination-pages { display: flex; align-items: center; gap: 4px; }

.page-btn {
    min-width: 34px; height: 34px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--bg-card-alt);
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer; padding: 0 8px;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); font-family: inherit;
}
.page-btn:hover { background: var(--border); color: var(--text-primary); }
.page-btn.active {
    background: var(--accent-blue); color: #fff;
    border-color: var(--accent-blue);
}

.page-ellipsis {
    color: var(--text-muted); padding: 0 6px; font-size: 14px;
}

.pagination-size {
    display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end;
}
.pagination-size-label { font-size: 13px; color: var(--text-muted); }
.pagination-size select {
    padding: 6px 10px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 12px; font-family: inherit;
    outline: none; cursor: pointer;
}

/* ══════════════════════════════
   Status Badges
   ══════════════════════════════ */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: var(--radius);
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-badge.verified { background: rgba(40,167,69,0.12); color: var(--accent-green); }
.status-badge.submitted { background: rgba(74,158,255,0.12); color: var(--accent-blue); }
.status-badge.rejected { background: rgba(220,53,69,0.12); color: var(--accent-red); }
.status-badge.no-task { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.status-badge.ban { background: rgba(220,53,69,0.15); color: var(--accent-red); }
.status-badge.in-progress { background: rgba(255,193,7,0.12); color: #ffc107; }
.status-badge.problem { background: rgba(253,126,20,0.12); color: var(--accent-orange); }
.status-badge.none { background: transparent; color: var(--text-muted); }

.status-badge::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}
.status-badge.verified::before { background: var(--accent-green); }
.status-badge.submitted::before { background: var(--accent-blue); }
.status-badge.rejected::before { background: var(--accent-red); }
.status-badge.no-task::before { background: var(--text-muted); }
.status-badge.ban::before { background: var(--accent-red); }
.status-badge.in-progress::before { background: #ffc107; }
.status-badge.problem::before { background: var(--accent-orange); }
.status-badge.none::before { display: none; }

/* Profile Status badges */
.status-badge.ps-new { background: rgba(74,158,255,0.12); color: var(--accent-blue); }
.status-badge.ps-new::before { background: var(--accent-blue); }
.status-badge.ps-warmup { background: rgba(255,193,7,0.12); color: #ffc107; }
.status-badge.ps-warmup::before { background: #ffc107; }
.status-badge.ps-inwork { background: rgba(40,167,69,0.12); color: var(--accent-green); }
.status-badge.ps-inwork::before { background: var(--accent-green); }
.status-badge.ps-frozen { background: rgba(139,92,246,0.12); color: var(--accent-purple); }
.status-badge.ps-frozen::before { background: var(--accent-purple); }
.status-badge.ps-appeal { background: rgba(253,126,20,0.12); color: var(--accent-orange); }
.status-badge.ps-appeal::before { background: var(--accent-orange); }
.status-badge.ps-active { background: rgba(40,167,69,0.12); color: var(--accent-green); }
.status-badge.ps-active::before { background: var(--accent-green); }
.status-badge.ps-unbanned { background: rgba(40,167,69,0.18); color: #5ad47e; }
.status-badge.ps-unbanned::before { background: #5ad47e; }

/* Ads Health badges */
.status-badge.ah-ok { background: rgba(40,167,69,0.12); color: var(--accent-green); }
.status-badge.ah-ok::before { background: var(--accent-green); }
.status-badge.ah-review { background: rgba(255,193,7,0.12); color: #ffc107; }
.status-badge.ah-review::before { background: #ffc107; }
.status-badge.ah-limited { background: rgba(253,126,20,0.12); color: var(--accent-orange); }
.status-badge.ah-limited::before { background: var(--accent-orange); }
.status-badge.ah-disapproved { background: rgba(220,53,69,0.15); color: var(--accent-red); }
.status-badge.ah-disapproved::before { background: var(--accent-red); }
.status-badge.ah-suspended { background: rgba(220,53,69,0.2); color: #ff4d5e; }
.status-badge.ah-suspended::before { background: #ff4d5e; }
.status-badge.ah-budget { background: rgba(253,126,20,0.15); color: var(--accent-orange); }
.status-badge.ah-budget::before { background: var(--accent-orange); }
.status-badge.ah-nodata { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.status-badge.ah-nodata::before { background: var(--text-muted); }

/* Card-based sidebar design */
.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color var(--transition);
}
.detail-card:last-child {
    margin-bottom: 0;
}
.detail-card:hover {
    border-color: var(--border-hover);
}
.detail-card-danger {
    border-color: rgba(255, 77, 94, 0.25);
}
.detail-card-danger:hover {
    border-color: rgba(255, 77, 94, 0.4);
}
.detail-card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.detail-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.detail-card .detail-metrics {
    margin: 0;
}
.detail-card .detail-kv-grid {
    margin: 0;
}
.detail-card .detail-keyword-table {
    margin: 0;
}
.detail-card .detail-metric {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.05);
}

/* Ads Health sidebar styles */
.detail-subsection-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 12px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.detail-policy-list { display: flex; flex-direction: column; gap: 6px; }
.detail-policy-item { display: flex; align-items: center; gap: 8px; }
.detail-policy-meta { font-size: 11px; color: var(--text-muted); }
.detail-campaign-list { display: flex; flex-direction: column; gap: 4px; }
.detail-campaign-item { display: flex; align-items: center; gap: 8px; }
.detail-campaign-name { font-size: 12px; color: var(--text-primary); }
.detail-campaign-type { font-size: 11px; color: var(--text-muted); }
.detail-campaign-reasons { font-size: 11px; color: var(--accent-orange); margin-top: 4px; padding: 4px 8px; background: rgba(253,126,20,0.08); border-radius: 4px; }

/* Campaign pin button */
.campaign-pin-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.3;
    transition: all var(--transition);
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.campaign-pin-btn:hover {
    opacity: 0.7;
    color: #ffc107;
}
.campaign-pin-btn.pinned {
    opacity: 1;
    color: #ffc107;
}
.detail-card-pinned {
    border-color: rgba(255, 193, 7, 0.4);
    background: rgba(255, 193, 7, 0.04);
}
.detail-card-pinned:hover {
    border-color: rgba(255, 193, 7, 0.6);
}

/* Keyword cards */
.kw-card {
    padding: 10px 14px;
    margin-bottom: 6px;
}
.kw-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.kw-card-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kw-card-match {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 3px;
}
.kw-card-qs {
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 3px;
}
.kw-qs-good { color: var(--accent-green); background: rgba(81,207,102,0.1); }
.kw-qs-mid { color: #ffc107; background: rgba(255,193,7,0.1); }
.kw-qs-bad { color: var(--accent-red); background: rgba(255,77,94,0.1); }
.kw-qs-none { color: var(--text-muted); }
.kw-card-metrics {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.kw-card-stat {
    font-size: 12px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.kw-card-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-right: 4px;
}
.kw-card-stat .money {
    color: var(--accent-green);
}
.kw-card-campaign {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
}
.detail-keyword-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.detail-keyword-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.detail-keyword-table td { padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.kw-match { font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.detail-more-info { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.detail-no-data { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 8px 0; }

/* ══════════════════════════════
   Status Dropdown
   ══════════════════════════════ */
.status-dropdown-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.status-dropdown-wrap .sd-trigger {
    cursor: pointer;
    transition: opacity 0.15s;
}
.status-dropdown-wrap .sd-trigger:hover {
    opacity: 0.8;
}
.status-dropdown-wrap .sd-trigger::after {
    content: '▾';
    margin-left: 4px;
    font-size: 9px;
    opacity: 0.5;
}
.sd-menu {
    display: none;
    position: fixed;
    z-index: 9999;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    padding: 4px;
    min-width: 140px;
    max-height: 280px;
    overflow-y: auto;
}
.status-dropdown-wrap.open .sd-menu {
    display: block;
}
.sd-option {
    padding: 3px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.sd-option:hover {
    background: rgba(255,255,255,0.06);
}
.sd-option .status-badge {
    width: 100%;
    justify-content: flex-start;
    font-size: 11px;
    padding: 3px 10px;
}

/* ══════════════════════════════
   GEO Dropdown
   ══════════════════════════════ */
.geo-trigger {
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    cursor: pointer;
}
.geo-trigger::after {
    display: none !important;
}
.geo-menu {
    max-height: 260px;
    overflow-y: auto;
    min-width: 80px;
}
.geo-menu .sd-option {
    padding: 4px 8px;
    font-size: 13px;
}

/* ══════════════════════════════
   Creo Link
   ══════════════════════════════ */
.creo-link {
    text-decoration: none;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
.creo-edit {
    cursor: pointer;
    opacity: 0.4;
    font-size: 11px;
    margin-left: 2px;
    vertical-align: middle;
}
.creo-edit:hover {
    opacity: 1;
}

/* ══════════════════════════════
   Editable Cells
   ══════════════════════════════ */
.editable-cell {
    cursor: pointer;
    transition: opacity 0.15s;
}
.editable-cell:hover {
    opacity: 0.75;
}
.inline-edit-input {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    outline: none;
    font-family: inherit;
    box-shadow: 0 0 0 2px rgba(74,158,255,0.2);
}

/* ══════════════════════════════
   Cell Tags
   ══════════════════════════════ */
.cell-tag {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 8px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.tag-money {
    background: rgba(40, 167, 69, 0.10); color: var(--accent-green);
    font-weight: 600;
}
.tag-money.zero {
    background: rgba(255,255,255,0.04); color: var(--text-muted); font-weight: 400;
}
.tag-id {
    background: rgba(99, 102, 241, 0.10); color: var(--accent-blue);
    font-family: var(--font-mono, monospace); letter-spacing: 0.3px;
}
.tag-card {
    background: rgba(74, 158, 255, 0.10); color: var(--accent-blue);
}
.tag-domain {
    background: rgba(139, 92, 246, 0.10); color: var(--accent-purple);
    max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.tag-date {
    background: rgba(255,255,255,0.05); color: var(--text-secondary);
    font-size: 11px;
}

/* ══════════════════════════════
   Personal Tags
   ══════════════════════════════ */
.tags-cell {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    min-width: 80px;
}
.tag-personal {
    background: rgba(139, 92, 246, 0.12); color: var(--accent-purple);
    font-size: 11px; padding: 2px 8px; gap: 4px;
}
.tag-remove {
    background: none; border: none; color: inherit; cursor: pointer;
    font-size: 13px; line-height: 1; padding: 0 0 0 2px; opacity: 0.6;
}
.tag-remove:hover { opacity: 1; }
.tag-add-btn {
    background: rgba(255,255,255,0.06); border: 1px dashed var(--border);
    color: var(--text-muted); cursor: pointer; border-radius: 6px;
    width: 22px; height: 22px; font-size: 14px; display: flex;
    align-items: center; justify-content: center; padding: 0;
    transition: all 0.15s;
}
.tag-add-btn:hover {
    background: rgba(74,158,255,0.1); border-color: var(--accent-blue);
    color: var(--accent-blue);
}
.tag-input-wrap {
    position: relative; display: inline-block;
}
.tag-input {
    background: rgba(255,255,255,0.08); border: 1px solid var(--accent-blue);
    border-radius: 6px; color: var(--text-primary); font-size: 11px;
    padding: 2px 6px; width: 80px; outline: none; font-family: inherit;
    box-shadow: 0 0 0 2px rgba(74,158,255,0.15);
}
.tag-autocomplete {
    display: none; position: absolute; top: 100%; left: 0; z-index: 9999;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 100px; max-height: 150px; overflow-y: auto;
    margin-top: 2px; padding: 2px;
}
.tag-ac-item {
    padding: 4px 8px; cursor: pointer; font-size: 11px;
    border-radius: 4px; color: var(--text-primary);
}
.tag-ac-item:hover { background: rgba(74,158,255,0.12); }

/* ══════════════════════════════
   Autorule Toggle
   ══════════════════════════════ */
.autorule-check {
    position: relative; display: inline-block;
    width: 32px; height: 18px; cursor: pointer; margin: 0;
}
.autorule-check input { opacity: 0; width: 0; height: 0; }
.autorule-slider {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.1); border-radius: 9px;
    transition: background 0.2s;
}
.autorule-slider::before {
    content: ''; position: absolute; left: 2px; bottom: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--text-muted); transition: all 0.2s;
}
.autorule-check input:checked + .autorule-slider {
    background: rgba(40,167,69,0.3);
}
.autorule-check input:checked + .autorule-slider::before {
    transform: translateX(14px); background: var(--accent-green);
}

/* Inline date input */
.inline-date-input {
    width: 120px !important;
    font-size: 11px !important;
    padding: 2px 4px !important;
    color-scheme: dark;
}

/* UUID column */
.td-uuid {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* .text-muted helper */
.text-muted { color: var(--text-muted); }

/* ══════════════════════════════
   OctoBrowser Status
   ══════════════════════════════ */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: background 0.15s;
}
.connection-status:hover { background: var(--bg-hover); }
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.2s;
}
.status-dot.connected { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-text { color: var(--text-secondary); font-size: 11px; }

/* ══════════════════════════════
   OctoBrowser / Check Buttons
   ══════════════════════════════ */
.btn-octo {
    width: 32px; height: 32px;
    border: none; border-radius: 10px;
    cursor: pointer; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
.btn-octo.play {
    background: rgba(40, 167, 69, 0.12);
    color: var(--accent-green);
}
.btn-octo.play:hover { background: rgba(40, 167, 69, 0.25); transform: scale(1.1); }

.btn-octo.stop {
    background: rgba(220, 53, 69, 0.12);
    color: var(--accent-red);
}
.btn-octo.stop:hover { background: rgba(220, 53, 69, 0.25); transform: scale(1.1); }

.btn-octo.detect {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-blue);
}
.btn-octo.detect:hover { background: rgba(99, 102, 241, 0.25); transform: scale(1.1); }

.btn-octo.check {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
}
.btn-octo.check:hover { background: rgba(139, 92, 246, 0.25); transform: scale(1.1); }

.btn-octo.checking {
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-purple);
    animation: pulse-check 1.5s infinite;
}
@keyframes pulse-check {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

tr.row-checking { background: rgba(139, 92, 246, 0.05) !important; }

.btn-octo:disabled { opacity: 0.5; cursor: wait; transform: none; }

/* ══════════════════════════════
   Scrollbar Global
   ══════════════════════════════ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ══════════════════════════════
   Responsive
   ══════════════════════════════ */
@media (max-width: 900px) {
    .sidebar:not(.collapsed) { width: 60px; }
    .sidebar:not(.collapsed) .sidebar-item span:not(.sidebar-icon) { display: none; }
    .sidebar:not(.collapsed) ~ .main { margin-left: 60px; }
    .sidebar-section-label { display: none; }
}

/* ══════════════════════════════
   Profile Detail Panel
   ══════════════════════════════ */

/* Backdrop */
.detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.detail-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Panel slide-out */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(680px, 75vw);
    height: 100vh;
    background: var(--bg-body);
    border-left: 1px solid var(--border);
    z-index: 950;
    display: grid;
    grid-template-rows: auto 1fr;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-panel.open {
    transform: translateX(0);
}

/* Header (sticky) */
.detail-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
}
.detail-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.detail-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.detail-close-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.detail-close-btn:hover {
    background: var(--bg-card-alt);
    color: var(--text-primary);
    border-color: var(--border-hover);
}
.detail-header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.detail-header-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Body (scrollable) */
.detail-body {
    overflow-y: auto;
    padding: 20px 24px 32px;
}

/* Section */
.detail-section {
    margin-bottom: 24px;
}
.detail-section-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.detail-section-header:hover {
    color: var(--text-secondary);
}
.detail-section-chevron {
    font-size: 10px;
    transition: transform var(--transition);
}
.detail-section.collapsed .detail-section-chevron {
    transform: rotate(-90deg);
}
.detail-section.collapsed .detail-section-content {
    display: none;
}

/* Metric cards grid */
.detail-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.detail-metric {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    transition: border-color var(--transition);
}
.detail-metric:hover {
    border-color: var(--border-hover);
}
.detail-metric-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.detail-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.detail-metric-value.money {
    color: var(--accent-green);
}
.detail-metric-value.empty {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 13px;
}

/* Key-value rows */
.detail-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}
.detail-kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background var(--transition);
    gap: 8px;
}
.detail-kv:hover {
    background: rgba(255, 255, 255, 0.03);
}
.detail-kv-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.detail-kv-value {
    font-size: 13px;
    color: var(--text-primary);
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.detail-kv-value.mono {
    font-family: monospace;
    font-size: 12px;
}
.detail-kv-value.muted {
    color: var(--text-muted);
}
.detail-kv.full-width {
    grid-column: 1 / -1;
}

/* Editable field in detail panel */
.detail-kv-value.editable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all var(--transition);
}
.detail-kv-value.editable:hover {
    border-color: var(--border);
    background: var(--bg-input);
}
.detail-edit-input {
    background: var(--bg-input);
    border: 1px solid var(--accent-blue);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 2px 6px;
    outline: none;
    width: 100%;
    max-width: 180px;
    text-align: right;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.15);
}
.detail-edit-input[type="date"] {
    max-width: 160px;
}

/* Detail dropdown (reuse status-dropdown pattern) */
.detail-dd-wrap {
    position: relative;
    display: inline-flex;
}
.detail-dd-wrap .sd-menu {
    right: 0;
    left: auto;
    min-width: 160px;
}

/* Tags in detail */
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.detail-tag-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    margin-left: 2px;
    opacity: 0.6;
    line-height: 1;
}
.detail-tag-remove:hover {
    opacity: 1;
}
.detail-tag-add {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.detail-tag-add:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
}

/* Row clickable cursor */
.data-table tbody tr {
    cursor: pointer;
}
.data-table tbody tr:active {
    background: rgba(74, 158, 255, 0.06);
}

/* Detail panel responsive */
@media (max-width: 700px) {
    .detail-panel { width: 100vw; }
    .detail-metrics { grid-template-columns: repeat(2, 1fr); }
    .detail-kv-grid { grid-template-columns: 1fr; }
}
