/* Ubersmith Viewer — styles.css
 *
 * Dark theme matching the SafeShare/GIP NOC design system.
 * Tokens: --bg #0d0f14, --accent #e63946, IBM Plex Sans/Mono fonts.
 *
 * Phase 1: minimal layout for login + landing pages. Phase 3 expands this
 * with the search UI components.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
    --bg:           #0d0f14;
    --bg-elev:      #14171f;
    --bg-elev-2:    #1c2029;
    --border:       #2a2f3a;
    --border-soft:  #1d212a;
    --text:         #e9ecf2;
    --text-muted:   #8e95a4;
    --accent:       #e63946;
    --accent-soft:  #e6394620;
    --success:      #2dd4bf;
    --warning:      #f59e0b;
    --link:         #93c5fd;

    --font-sans: 'IBM Plex Sans', -apple-system, system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;

    --radius:    8px;
    --shadow:    0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
code, pre { font-family: var(--font-mono); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.brand {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.topbar-nav { display: flex; gap: 20px; flex: 1; }
.topbar-nav a { color: var(--text-muted); font-size: 0.95rem; }
.topbar-nav a:hover { color: var(--text); text-decoration: none; }
.user-block { display: flex; align-items: center; gap: 16px; }
.user-name { color: var(--text-muted); font-size: 0.9rem; }
.logout { font-size: 0.85rem; color: var(--text-muted); }
.logout:hover { color: var(--accent); }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 24px;
}
.footer {
    border-top: 1px solid var(--border-soft);
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── Hero (landing page) ──────────────────────────────────────────────── */
.hero {
    max-width: 640px;
    margin: 60px auto;
    text-align: center;
}
.hero h1 {
    font-size: 2.25rem;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.hero .subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0 0 32px;
}
.hero .hint {
    color: var(--text-muted);
    margin-top: 20px;
}

/* ─── Search form ──────────────────────────────────────────────────────── */
.search-form {
    display: flex;
    gap: 8px;
    margin: 0 auto;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s;
}
.search-form input[type="search"]:focus {
    border-color: var(--accent);
}
.search-form button {
    padding: 14px 24px;
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.15s;
}
.search-form button:hover { opacity: 0.9; }

/* ─── Login card ───────────────────────────────────────────────────────── */
.login-card {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.login-card h1 {
    font-size: 1.5rem;
    margin: 0 0 12px;
}
.login-card .lead {
    color: var(--text-muted);
    margin: 0 0 28px;
}

.google-signin {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
}
.google-signin:hover { opacity: 0.9; text-decoration: none; }

.dev-warning {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    text-align: left;
}
.dev-warning strong {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}
.dev-warning p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 4px 0 12px;
}
.dev-warning form { display: flex; flex-direction: column; gap: 8px; }
.dev-warning label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.dev-warning input[type="email"] {
    padding: 8px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
}
.dev-warning button {
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-sans);
}

/* ─── Misc ─────────────────────────────────────────────────────────────── */
code {
    background: var(--bg-elev-2);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85em;
    color: var(--text);
}

@media (max-width: 640px) {
    .topbar-inner { flex-wrap: wrap; gap: 16px; }
    .hero h1 { font-size: 1.6rem; }
    .content { padding: 24px 16px; }
    .search-form { flex-direction: column; }
}

/* ─── Topbar additions (search + active state) ─────────────────────────── */
.topbar-nav a.active {
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}
.topbar-search {
    flex: 1;
    max-width: 480px;
}
.topbar-search input {
    width: 100%;
    padding: 8px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.9rem;
}
.topbar-search input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ─── Search page layout ──────────────────────────────────────────────── */
.search-page {
    max-width: 1100px;
    margin: 0 auto;
}

.search-hero {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.search-hero-input {
    flex: 1;
    padding: 16px 22px;
    font-size: 1.1rem;
    font-family: var(--font-sans);
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s;
}
.search-hero-input:focus { border-color: var(--accent); }
.search-hero-button {
    padding: 16px 28px;
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}
.search-hero-button:hover { opacity: 0.9; }

/* ─── Entity tabs ─────────────────────────────────────────────────────── */
.entity-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0 0 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}
.entity-tabs-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 8px;
}
.entity-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: transparent;
    text-decoration: none;
    transition: all 0.15s;
}
.entity-tab:hover {
    color: var(--text);
    border-color: var(--border);
    text-decoration: none;
}
.entity-tab.active {
    color: var(--text);
    background: var(--accent-soft);
    border-color: var(--accent);
}
.entity-tab-count {
    background: var(--bg-elev-2);
    color: var(--text-muted);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.hero-tabs {
    border-bottom: none;
    justify-content: center;
    margin-top: 24px;
}

/* ─── Scoped layout (sidebar + main) ──────────────────────────────────── */
.scoped-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
}

.filters {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px;
    align-self: start;
    position: sticky;
    top: 80px;
}
.filters h3 {
    margin: 0 0 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}
.filters-form { display: flex; flex-direction: column; gap: 12px; }
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text);
}
.filter-row > span {
    flex: 1;
}
.filter-row > select,
.filter-row > input[type="text"] {
    padding: 6px 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    min-width: 90px;
}
.filter-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.apply-filters {
    padding: 8px 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: 8px;
}
.apply-filters:hover { opacity: 0.9; }
.clear-filters {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}
.clear-filters:hover { color: var(--accent); text-decoration: none; }

/* ─── Results & cards ─────────────────────────────────────────────────── */
.results-header {
    margin-bottom: 16px;
}
.results-header h2 {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.entity-section {
    margin-bottom: 32px;
}
.entity-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-soft);
}
.entity-section-header h2 {
    margin: 0;
    font-size: 1.1rem;
}
.see-all {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.see-all:hover { color: var(--accent); text-decoration: none; }

.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color 0.15s;
}
.card:hover { border-color: var(--border); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.card-title {
    color: var(--text);
    font-weight: 500;
    font-size: 1rem;
}
.card-title:hover { color: var(--accent); text-decoration: none; }
.card-title em {
    background: var(--accent-soft);
    font-style: normal;
    padding: 0 2px;
    border-radius: 2px;
    color: var(--text);
}
.card-subtitle {
    margin: 0 0 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.card-subtitle em { background: var(--accent-soft); font-style: normal; padding: 0 2px; border-radius: 2px; }
.card-snippet {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
    background: var(--bg);
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--border);
}
.card-snippet em {
    background: var(--accent-soft);
    font-style: normal;
    padding: 0 2px;
    border-radius: 2px;
    color: var(--text);
    font-weight: 500;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 6px 0 0;
    font-size: 0.82rem;
}
.card-meta > div {
    display: flex;
    gap: 4px;
}
.card-meta dt {
    color: var(--text-muted);
    margin: 0;
}
.card-meta dt::after { content: ":"; }
.card-meta dd {
    margin: 0;
    color: var(--text);
}

/* ─── Badges ──────────────────────────────────────────────────────────── */
.card-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    font-family: var(--font-mono);
}
.badge-success {
    background: rgba(45, 212, 191, 0.15);
    color: var(--success);
    border-color: rgba(45, 212, 191, 0.3);
}
.badge-danger {
    background: rgba(230, 57, 70, 0.15);
    color: var(--accent);
    border-color: rgba(230, 57, 70, 0.3);
}
.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}
.badge-info {
    background: rgba(147, 197, 253, 0.15);
    color: var(--link);
    border-color: rgba(147, 197, 253, 0.3);
}
.badge-muted {
    background: var(--bg-elev-2);
    color: var(--text-muted);
    border-color: var(--border-soft);
}

/* ─── Pagination ──────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}
.page-link {
    padding: 6px 14px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.page-link:hover { background: var(--bg-elev); text-decoration: none; }
.page-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

/* ─── Misc state pages ────────────────────────────────────────────────── */
.search-empty {
    padding: 40px 20px;
    text-align: center;
}
.search-empty h2 { margin: 0 0 8px; font-size: 1.4rem; }
.search-tips {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    text-align: left;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.search-tips li {
    padding: 6px 0 6px 24px;
    position: relative;
}
.search-tips li::before {
    content: "→";
    color: var(--accent);
    position: absolute;
    left: 0;
}
.search-footer { margin: 24px 0 0; text-align: center; font-size: 0.85rem; }
.muted { color: var(--text-muted); }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px 0;
}
.alert-error {
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid var(--accent);
    color: var(--text);
}
.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid var(--warning);
    color: var(--text);
}

/* ─── Detail placeholder ──────────────────────────────────────────────── */
.detail-page { max-width: 900px; margin: 0 auto; }
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.back-link:hover { color: var(--accent); text-decoration: none; }
.detail-header { margin-bottom: 24px; }
.detail-header h1 { margin: 0 0 8px; font-size: 1.6rem; }
.detail-stub {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}
.raw-doc { margin-top: 24px; text-align: left; }
.raw-doc summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 0;
}
.raw-doc pre {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto;
    font-size: 0.8rem;
    color: var(--text);
    max-height: 400px;
    overflow-y: auto;
}

/* ─── Keyboard hint ───────────────────────────────────────────────────── */
kbd {
    display: inline-block;
    padding: 1px 6px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.75em;
}

/* ─── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
    .scoped-layout {
        grid-template-columns: 1fr;
    }
    .filters {
        position: static;
    }
}
@media (max-width: 640px) {
    .topbar-inner {
        flex-wrap: wrap;
        gap: 12px;
    }
    .topbar-search {
        order: 99;
        flex-basis: 100%;
        max-width: 100%;
    }
    .search-hero {
        flex-direction: column;
    }
    .search-hero-button {
        width: 100%;
    }
    .entity-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── Detail page (v0.4) ──────────────────────────────────────────────── */
.detail-page {
    max-width: 1100px;
    margin: 0 auto;
}

.detail-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.detail-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.detail-header h1 {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.3;
}
.detail-header h1 .muted {
    font-family: var(--font-mono);
    font-size: 0.85em;
    margin-right: 8px;
}
.external-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.external-link:hover {
    color: var(--text);
    border-color: var(--accent);
    text-decoration: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
}
.detail-main { min-width: 0; }

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.meta-section {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.meta-section h3 {
    margin: 0 0 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.meta-list {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 12px;
    font-size: 0.88rem;
}
.meta-list dt {
    margin: 0;
    color: var(--text-muted);
    align-self: start;
}
.meta-list dd {
    margin: 0;
    color: var(--text);
    word-break: break-word;
}
.meta-list dd a { color: var(--link); }
.meta-list dd a:hover { color: var(--accent); }

/* Tickets — posts */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.post {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-left: 4px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
}
.post-staff {
    border-left-color: var(--accent);
    background: var(--bg-elev);
}
.post-customer {
    border-left-color: var(--text-muted);
    background: var(--bg);
}
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}
.post-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}
.post-time {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}
.post-body {
    margin: 0;
    padding: 8px 0 0;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Attachment list (sidebar) */
.attach-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.85rem;
}
.attach-list li {
    padding: 8px 10px;
    background: var(--bg);
    border-radius: 4px;
    border: 1px solid var(--border-soft);
}
.attach-list strong {
    color: var(--text);
    font-weight: 500;
    word-break: break-all;
}

/* Child devices */
.child-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.child-list li {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.child-list li:last-child { border-bottom: none; }

/* Related sections (clients, people detail pages) */
.related-section { margin-bottom: 32px; }
.related-section h2 {
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 1.05rem;
}
.see-all-row { text-align: right; margin: 8px 0 0; }

/* Invoice amounts */
.invoice-amounts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.amount-card {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.amount-card.amount-danger {
    border-color: var(--accent);
    background: rgba(230, 57, 70, 0.08);
}
.amount-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.amount-value {
    margin-top: 6px;
    font-size: 1.6rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text);
}

/* ─── Settings page ──────────────────────────────────────────────────── */
.settings-page {
    max-width: 640px;
    margin: 0 auto;
}
.settings-page h1 {
    margin: 0 0 24px;
    font-size: 1.5rem;
}
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.settings-section {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 20px;
}
.settings-section h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}
.settings-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    margin-top: 12px;
}
.alert-success {
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid var(--success);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

/* Top-bar user name — clickable to settings */
.user-name {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
}
.user-name:hover { color: var(--text); text-decoration: none; }
.user-name.active { color: var(--text); border-bottom: 2px solid var(--accent); }

/* ─── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .detail-titlebar {
        flex-direction: column;
        align-items: flex-start;
    }
    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── Attachment download links ────────────────────────────────────────── */
.attach-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    display: inline-block;
}
.attach-link::before {
    content: "📎 ";
    margin-right: 4px;
}
.attach-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ─── Not-found page ─────────────────────────────────────────────────────── */
.not-found {
    text-align: center;
    padding: 64px 24px;
    max-width: 640px;
    margin: 0 auto;
}
.not-found h1 {
    margin-bottom: 12px;
    color: var(--text);
}
.not-found .subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}
.not-found .button-primary {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s;
}
.not-found .button-primary:hover {
    opacity: 0.9;
    text-decoration: none;
}
.not-found .hint {
    margin-top: 32px;
}

/* ─── Client hub (detail page redesign) ───────────────────────────────── */
.client-hub .hub-section {
    margin-top: 32px;
    padding: 20px;
    background: var(--card-bg, #161821);
    border-radius: 8px;
    border: 1px solid var(--border, #2a2d3a);
}
.client-hub .hub-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}
.client-hub .hub-section-header h2 {
    margin: 0;
    font-size: 1.1em;
}
.client-hub .hub-section-header h2 small {
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 8px;
}
.client-hub .see-all-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9em;
}
.client-hub .see-all-link:hover {
    text-decoration: underline;
}
.client-hub .hub-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.client-hub .hub-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #2a2d3a);
}
.client-hub .hub-row:last-child {
    border-bottom: none;
}
.client-hub .hub-row-main {
    flex: 1;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.client-hub .hub-row-main:hover {
    color: var(--accent);
}
.client-hub .hub-row-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.client-hub .hub-row-sub {
    font-size: 0.85em;
}
.client-hub .hub-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 0.85em;
}

/* ─── Topbar Find Client widget ────────────────────────────────────────── */
.topbar-find-client {
    margin: 0 8px;
}
.topbar-find-client input {
    width: 180px;
    padding: 6px 10px;
    background: var(--input-bg, #1a1d28);
    border: 1px solid var(--border, #2a2d3a);
    color: var(--text);
    border-radius: 6px;
    font-size: 0.9em;
}
.topbar-find-client input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ─── Client filter chip on search results ─────────────────────────────── */
.client-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--card-bg, #161821);
    border: 1px solid var(--accent);
    border-radius: 20px;
    margin-bottom: 16px;
    font-size: 0.9em;
}
.client-filter-chip .chip-name {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}
.client-filter-chip .chip-name:hover {
    text-decoration: underline;
}
.client-filter-chip .chip-clear {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 4px;
    font-size: 1.2em;
    line-height: 1;
}
.client-filter-chip .chip-clear:hover {
    color: var(--accent);
}

/* ─── Admin users page ────────────────────────────────────────────────── */
.admin-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}
.admin-page h1 {
    margin-top: 0;
}
.admin-flash {
    padding: 10px 16px;
    margin: 16px 0;
    border-radius: 6px;
    font-size: 0.95em;
}
.admin-flash.success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}
.admin-flash.error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}
.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.admin-users-table th,
.admin-users-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border, #2a2d3a);
}
.admin-users-table th {
    background: var(--card-bg, #161821);
    font-weight: 600;
    font-size: 0.9em;
}
.admin-users-table tr.row-inactive {
    opacity: 0.55;
}
.admin-users-table .inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-right: 6px;
}
.admin-users-table .inline-form select {
    padding: 4px 8px;
    background: var(--input-bg, #1a1d28);
    color: var(--text);
    border: 1px solid var(--border, #2a2d3a);
    border-radius: 4px;
}
.admin-users-table .inline-form button {
    padding: 4px 10px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}
.admin-users-table .inline-form button.btn-danger {
    background: transparent;
    color: #e74c3c;
    border-color: #e74c3c;
}
.admin-users-table .inline-form button.btn-danger:hover {
    background: rgba(231, 76, 60, 0.15);
}
.admin-notes {
    margin-top: 32px;
    padding: 16px;
    background: var(--card-bg, #161821);
    border-radius: 6px;
}
.admin-notes summary {
    cursor: pointer;
    font-weight: 500;
}
.admin-notes ul {
    margin: 12px 0;
}

/* ─── Closed-tickets hint banner ──────────────────────────────────────── */
.closed-hint-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin: 16px 0;
    background: rgba(241, 196, 15, 0.10);
    border: 1px solid rgba(241, 196, 15, 0.5);
    border-radius: 8px;
}
.closed-hint-banner p {
    margin: 0;
    flex: 1;
    color: var(--text);
    font-size: 0.95em;
}
.closed-hint-banner code {
    background: rgba(0, 0, 0, 0.2);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}
.closed-hint-banner .closed-hint-cta {
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}
.closed-hint-banner .closed-hint-cta:hover {
    opacity: 0.9;
}
