/* ============================================================
   Odoo Channel Bridge — Dark Theme UI
   ============================================================ */

/* Variables */
:root {
    --bg:           #0a0a0a;
    --bg-card:      #141414;
    --bg-card-alt:  #111111;
    --bg-input:     #1a1a1a;
    --border:       #222222;
    --border-input: #333333;
    --text:         #e0e0e0;
    --text-muted:   #888888;
    --text-dim:     #555555;
    --accent:       #4f8cff;
    --accent-hover: #3a75e8;
    --accent-dim:   rgba(79, 140, 255, 0.12);
    --success:      #2ecc71;
    --success-dim:  rgba(46, 204, 113, 0.12);
    --warning:      #f39c12;
    --warning-dim:  rgba(243, 156, 18, 0.12);
    --error:        #e74c3c;
    --error-dim:    rgba(231, 76, 60, 0.12);
    --sidebar-w:    240px;
    --header-h:     60px;
    --radius:       12px;
    --radius-sm:    8px;
    --radius-xs:    6px;
    --shadow:       0 4px 24px rgba(0,0,0,0.5);
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
    --transition:   all 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* ============================================================
   Layout — App Shell
   ============================================================ */

.app {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

.logo {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    min-height: 72px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
    font-weight: 700;
}

.logo-text h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.logo-text .subtitle {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 18px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
}

.nav-links {
    list-style: none;
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-links li {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

.nav-link.active {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(79,140,255,0.2);
}

.nav-link .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.version-info {
    font-size: 11px;
    color: var(--text-dim);
}

/* ============================================================
   Main Content
   ============================================================ */

.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.page-header {
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    padding: 4px 8px;
    line-height: 1;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#page-content {
    padding: 28px;
    flex: 1;
    max-width: 1400px;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: #2a2a2a;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ============================================================
   Stat Cards (Dashboard)
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.accent::before  { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before    { background: #9b59b6; }

.stat-card:hover {
    border-color: #2a2a2a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================================
   Dashboard Grid
   ============================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

/* ============================================================
   Activity Feed
   ============================================================ */

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-dot.success { background: var(--success); }
.activity-dot.error   { background: var(--error); }
.activity-dot.partial { background: var(--warning); }
.activity-dot.info    { background: var(--accent); }

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.activity-time {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Quick Stats sidebar */
.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quick-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.quick-stat-item:last-child {
    border-bottom: none;
}

.quick-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.quick-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* ============================================================
   Tables
   ============================================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    background: var(--bg-card-alt);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s ease;
}

tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.015);
}

tbody tr:hover {
    background: rgba(79,140,255,0.04);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 12px 16px;
    color: var(--text);
    vertical-align: middle;
}

td.muted {
    color: var(--text-muted);
    font-size: 13px;
}

td.mono {
    font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
    font-size: 12px;
}

/* ============================================================
   Status Badges
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-success {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(46,204,113,0.25);
}

.badge-success::before { background: var(--success); }

.badge-warning {
    background: var(--warning-dim);
    color: var(--warning);
    border: 1px solid rgba(243,156,18,0.25);
}

.badge-warning::before { background: var(--warning); }

.badge-error {
    background: var(--error-dim);
    color: var(--error);
    border: 1px solid rgba(231,76,60,0.25);
}

.badge-error::before { background: var(--error); }

.badge-info {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(79,140,255,0.25);
}

.badge-info::before { background: var(--accent); }

.badge-neutral {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.08);
}

.badge-neutral::before { background: var(--text-dim); }

/* Direction badge */
.direction-badge {
    font-family: 'SF Mono', 'Fira Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(79,140,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-input);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-color: #444;
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border-color: rgba(231,76,60,0.3);
}

.btn-danger:hover:not(:disabled) {
    background: var(--error-dim);
    border-color: var(--error);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #27ae60;
    border-color: #27ae60;
}

.btn-sm {
    padding: 5px 11px;
    font-size: 12px;
}

.btn-icon {
    padding: 7px;
    font-size: 15px;
    border-radius: var(--radius-xs);
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================================
   Forms & Inputs
   ============================================================ */

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

.form-group:last-child {
    margin-bottom: 0;
}

label, .form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    padding: 9px 12px;
    transition: var(--transition);
    outline: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,140,255,0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

select option {
    background: #1e1e1e;
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ============================================================
   Toggle Switch
   ============================================================ */

.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-input);
    border-radius: 22px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: rgba(79,140,255,0.2);
    border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: var(--accent);
}

.toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(79,140,255,0.15);
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}

.modal.wide {
    max-width: 720px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Multi-step modal */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    flex: 1;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    transition: var(--transition);
}

.step.active .step-num {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.step.done .step-num {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
}

.step.active .step-label {
    color: var(--text);
}

.step-connector {
    flex: 0 0 20px;
    height: 1px;
    background: var(--border);
    margin: 0 4px;
}

.step-pane {
    display: none;
}

.step-pane.active {
    display: block;
}

/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    box-shadow: var(--shadow);
    pointer-events: auto;
    animation: toastIn 0.25s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hiding {
    opacity: 0;
    transform: translateX(20px);
}

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

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.toast-msg {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    flex-shrink: 0;
    transition: var(--transition);
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-muted);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ============================================================
   Filter Bar
   ============================================================ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-bar select,
.filter-bar input {
    width: auto;
    min-width: 160px;
}

.filter-bar label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
}

.filter-bar label input[type="checkbox"] {
    width: auto;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ============================================================
   Loading
   ============================================================ */

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255,255,255,0.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.spinner.large {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

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

.loading-row td {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================================
   Channel List (in modal)
   ============================================================ */

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-xs);
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    transition: var(--transition);
    font-size: 13.5px;
}

.channel-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
}

.channel-icon {
    font-size: 14px;
    opacity: 0.7;
}

.channel-name {
    flex: 1;
    color: var(--text);
}

.channel-id {
    font-size: 11px;
    color: var(--text-dim);
    font-family: monospace;
}

/* ============================================================
   Sync Result
   ============================================================ */

.sync-result {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 12px;
}

.sync-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.sync-result-row:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sync-result-label {
    color: var(--text-muted);
}

.sync-result-value {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-top: 1px solid var(--border);
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   Misc Utilities
   ============================================================ */

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

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error   { color: var(--error); }

.mono {
    font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
    font-size: 12px;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.gap-8  { gap: 8px; }
.mt-4   { margin-top: 4px; }
.mt-12  { margin-top: 12px; }
.mt-20  { margin-top: 20px; }
.mb-16  { margin-bottom: 16px; }

.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Info box */
.info-box {
    background: rgba(79,140,255,0.06);
    border: 1px solid rgba(79,140,255,0.2);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.info-box strong {
    color: var(--accent);
    font-weight: 600;
}

/* Error box */
.error-box {
    background: var(--error-dim);
    border: 1px solid rgba(231,76,60,0.25);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--error);
    line-height: 1.6;
}

/* ============================================================
   Logs — duration cell
   ============================================================ */

.duration {
    font-size: 12px;
    font-family: monospace;
    color: var(--text-muted);
}

.log-error-msg {
    font-size: 11.5px;
    color: var(--error);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,0.6);
    }

    .content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    #page-content {
        padding: 16px;
    }

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

    .page-header {
        padding: 0 16px;
    }

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

    .modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        align-self: flex-end;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-bar select,
    .filter-bar input {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
    }
}

/* Sidebar overlay for mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

.sidebar-backdrop.active {
    display: block;
}
