/* Domain Hub — app.css */

:root {
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --bg: #f5f6fa;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #eef0f8;
    --border: #e2e5f0;
    --text-primary: #1a1d2e;
    --text-secondary: #4a5070;
    --text-muted: #9197b3;
    --accent: #4f7cff;
    --accent-hover: #3d6be8;
    --accent-soft: rgba(79, 124, 255, 0.10);
    --green: #10b981;
    --green-soft: rgba(16, 185, 129, 0.10);
    --orange: #f59e0b;
    --orange-soft: rgba(245, 158, 11, 0.10);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.10);
    --yellow: #d97706;
    --yellow-soft: rgba(217, 119, 6, 0.10);
    --purple: #7c3aed;
    --purple-soft: rgba(124, 58, 237, 0.10);
    --font: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #fff;
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item i { font-size: 16px; width: 18px; text-align: center; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff;
    flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.btn-logout {
    color: var(--text-muted);
    font-size: 16px;
    text-decoration: none;
    transition: color 0.15s;
}
.btn-logout:hover { color: var(--red); }

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

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

.topbar-actions { display: flex; gap: 8px; }

.content-area { padding: 24px; flex: 1; }

/* ── CARDS ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 14px 18px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
}

.card-body { padding: 18px; }
.card-footer { background: transparent; border-top: 1px solid var(--border); padding: 12px 18px; }

/* ── STAT CARDS ── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}
.stat-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue  { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.orange{ background: var(--orange-soft); color: var(--orange); }
.stat-icon.purple{ background: var(--purple-soft); color: var(--purple); }

.stat-value { font-size: 26px; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── TABLES ── */
.table {
    color: var(--text-primary);
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: var(--bg-hover);
    --bs-table-striped-bg: transparent;
    font-size: 13.5px;
}

.table thead th {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-color: var(--border);
    padding: 10px 14px;
    background: var(--bg-hover);
}

.table td {
    padding: 11px 14px;
    border-color: var(--border);
    vertical-align: middle;
}

.table-hover tbody tr:hover td { background: var(--bg-hover); }

/* ── FORMS ── */
.form-control, .form-select {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    transition: border-color 0.15s;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus, .form-select:focus {
    background: var(--bg-surface);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(79,124,255,0.15);
}
.form-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; }
.form-select option { background: var(--bg-card); color: var(--text-primary); }

/* ── BUTTONS ── */
.btn { font-family: var(--font); font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline-secondary { border-color: var(--border); color: var(--text-secondary); background: transparent; }
.btn-outline-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }

/* ── BADGES ── */
.badge { font-family: var(--font); font-size: 11px; font-weight: 500; padding: 4px 8px; border-radius: 4px; }

/* ── MODALS ── */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}
.modal-header { border-bottom-color: var(--border); padding: 16px 20px; }
.modal-footer { border-top-color: var(--border); padding: 12px 20px; }
.modal-title { font-size: 15px; font-weight: 600; }
.btn-close { filter: none; }

/* ── ALERTS ── */
.alert {
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    border: none;
}
.alert-success { background: var(--green-soft); color: #065f46; }
.alert-danger  { background: var(--red-soft);   color: #991b1b; }
.alert-warning { background: var(--yellow-soft); color: #78350f; }
.alert-info    { background: var(--accent-soft); color: #1e40af; }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 6px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
}
.timeline-item.source-tracker::before { background: var(--orange); }
.timeline-item.source-ai::before { background: var(--purple); }

.timeline-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.timeline-date { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.timeline-title { font-size: 13.5px; font-weight: 600; margin: 2px 0 4px; }
.timeline-desc { font-size: 13px; color: var(--text-secondary); }
.timeline-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── CREDENTIAL ITEM ── */
.credential-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.credential-icon {
    width: 36px; height: 36px;
    background: var(--accent-soft);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}
.credential-info { flex: 1; min-width: 0; }
.credential-platform { font-size: 13px; font-weight: 600; }
.credential-username { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── PASSWORD REVEAL ── */
.password-field { display: flex; align-items: center; gap: 6px; }
.password-dots { font-family: var(--font-mono); letter-spacing: 2px; color: var(--text-muted); }

/* ── AI SUGGESTION CARD ── */
.suggestion-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--purple);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.suggestion-card.unread { border-left-color: var(--accent); }

/* ── PROJECT STATUS ── */
.project-row td:first-child { font-weight: 500; }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 13.5px; margin: 0; }

/* ── TRACKER CODE BLOCK ── */
.code-block {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-primary);
    word-break: break-all;
}

/* ── TABS ── */
.nav-tabs {
    border-color: var(--border);
}
.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13.5px;
    padding: 8px 14px;
}
.nav-tabs .nav-link:hover { color: var(--text-primary); }
.nav-tabs .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); background: transparent; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .content-area { padding: 16px; }
}

/* ── LOGIN PAGE ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.login-box {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
}
.login-logo {
    width: 48px; height: 48px;
    background: var(--accent);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    margin: 0 auto 16px;
}

/* ── STICKY NOTES ── */
.sticky-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.sticky-note {
    border-radius: var(--radius);
    padding: 16px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
    transition: box-shadow 0.15s, transform 0.15s;
}
.sticky-note:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.sticky-note.color-yellow { background: #fef9c3; border-color: #fde047; }
.sticky-note.color-green  { background: #dcfce7; border-color: #86efac; }
.sticky-note.color-blue   { background: #dbeafe; border-color: #93c5fd; }
.sticky-note.color-pink   { background: #fce7f3; border-color: #f9a8d4; }
.sticky-note.color-purple { background: #ede9fe; border-color: #c4b5fd; }
.sticky-note.color-orange { background: #ffedd5; border-color: #fdba74; }

.sticky-note-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1d2e;
}

.sticky-note-content {
    font-size: 13px;
    color: #4a5070;
    white-space: pre-wrap;
    flex: 1;
    line-height: 1.55;
}

.sticky-note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11px;
    color: #9197b3;
}

.sticky-note-footer .note-actions { display: flex; gap: 4px; }

.color-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.color-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}
.color-dot:hover, .color-dot.selected { border-color: #333; transform: scale(1.1); }
.color-dot.c-yellow { background: #fde047; }
.color-dot.c-green  { background: #86efac; }
.color-dot.c-blue   { background: #93c5fd; }
.color-dot.c-pink   { background: #f9a8d4; }
.color-dot.c-purple { background: #c4b5fd; }
.color-dot.c-orange { background: #fdba74; }

/* ── FILE ITEMS ── */
.file-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    width: 36px; height: 36px;
    background: var(--accent-soft);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}
.file-icon.img  { background: var(--green-soft);  color: var(--green); }
.file-icon.doc  { background: var(--accent-soft);  color: var(--accent); }
.file-icon.zip  { background: var(--orange-soft);  color: var(--orange); }
.file-icon.code { background: var(--purple-soft);  color: var(--purple); }

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── COOKIE BANNER ── */
.cookie-access-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.cookie-access-box.protected { border-color: var(--orange); background: var(--orange-soft); }
.cookie-access-box.open      { border-color: var(--green);  background: var(--green-soft); }
