/* ============================================================
   NO MORE HUB — Institutional Memory
   ============================================================ */

:root {
    --bg: #f8f7f4;
    --bg-warm: #f0ede8;
    --bg-low: #f4f2ee;
    --bg-high: #e8e5e0;
    --card: #ffffff;
    --card-hover: #f4f2ee;

    --sidebar-bg: #2c2c2c;
    --sidebar-text: #c8c4bc;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(255,255,255,0.10);

    --gold: #b8952f;
    --gold-fixed: #e8c468;
    --gold-fixed-dim: #c8a84c;
    --gold-light: #fdf3d7;
    --gold-dim: rgba(184, 149, 47, 0.10);

    --brown: #6b5344;
    --brown-dark: #3d3230;

    --text: #2a2a28;
    --text-secondary: #5a524c;
    --text-muted: #8c8278;

    --border: rgba(0,0,0,0.06);
    --border-light: rgba(0,0,0,0.04);

    --green: #3a8a52;
    --blue: #2d7ab5;
    --amber: #c08b20;
    --purple: #7c5caa;
    --red: #c0392b;
    --red-light: #fde8e6;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    letter-spacing: 0.3px;
}
a { color: var(--brown); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--gold); }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    background: linear-gradient(180deg, #252525 0%, #333 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}
.sidebar-brand { padding: 32px 28px 16px; }
.sidebar-brand h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--gold-fixed);
    margin-bottom: 4px;
}
.sidebar-subtitle {
    font-family: 'Raleway', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    color: var(--gold-fixed-dim);
    font-weight: 500;
}

.sidebar-search {
    padding: 0 20px 8px;
}
.sidebar-search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--sidebar-text);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: inherit;
}
.sidebar-search input::placeholder { color: rgba(200,196,188,0.5); }
.sidebar-search input:focus {
    outline: none;
    border-color: var(--gold-fixed-dim);
    background: rgba(255,255,255,0.08);
}

.sidebar-nav { list-style: none; padding: 12px 0; flex: 1; }
.nav-section-label {
    padding: 20px 28px 8px;
    font-size: 0.70rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    color: rgba(223, 195, 143, 0.5);
    font-weight: 600;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 28px;
    color: var(--sidebar-text);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}
.sidebar-nav li a svg { opacity: 0.5; flex-shrink: 0; transition: opacity 0.2s; }
.sidebar-nav li a:hover { background: var(--sidebar-hover); color: var(--gold-fixed); }
.sidebar-nav li a:hover svg { opacity: 1; }
.sidebar-nav li.active a {
    background: var(--sidebar-active);
    color: var(--gold-fixed);
    border-left-color: var(--gold-fixed);
}
.sidebar-nav li.active a svg { opacity: 1; color: var(--gold-fixed); }

.sidebar-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 11px;
}
.sidebar-footer-info { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.sidebar-footer-info .label {
    font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
    color: rgba(200,196,188,0.5);
}
.sidebar-footer-info .email { color: var(--sidebar-text); font-size: 11px; }
.sidebar-logout { color: rgba(200,196,188,0.7); font-size: 11px; }
.sidebar-logout:hover { color: var(--gold-fixed); }

/* Content */
.content {
    margin-left: 240px;
    padding: 32px 40px 60px;
    max-width: 1280px;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 32px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.2px;
}
.page-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}
.breadcrumb {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* Stat cards (home) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text);
}
.stat-card:hover {
    border-color: var(--gold-fixed-dim);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
}
.stat-value {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 44px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    margin: 6px 0 4px;
}
.stat-action { font-size: 11px; color: var(--gold); letter-spacing: 0.5px; }

/* Panel */
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}
.panel-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.panel-header h2 { font-size: 18px; color: var(--text); }
.panel-sub { font-size: 11px; color: var(--text-muted); }

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.data-table th {
    text-align: left;
    padding: 12px 24px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-low);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-low); }
.data-table td strong { font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* Pills */
.pill {
    display: inline-block;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 999px;
    background: var(--bg-high);
    color: var(--text-secondary);
}
.pill-status { background: var(--gold-dim); color: var(--gold); }
.pill-create { background: rgba(58,138,82,0.12); color: var(--green); }
.pill-update { background: rgba(45,122,181,0.12); color: var(--blue); }
.pill-delete { background: var(--red-light); color: var(--red); }
.pill-activity { background: rgba(124,92,170,0.12); color: var(--purple); }
.pill-editorial { background: rgba(45,122,181,0.12); color: var(--blue); }
.pill-press { background: rgba(124,92,170,0.12); color: var(--purple); }

.muted-inline { color: var(--text-muted); }

.btn-cta {
    background: var(--gold);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 9px 18px;
}
.btn-cta:hover { background: var(--brown-dark); color: #fff; }

/* Contact card */
.contact-card {
    padding: 16px 24px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.contact-row {
    display: grid;
    grid-template-columns: 22px 90px 1fr;
    gap: 12px;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--border-light);
}
.contact-row:last-child { border-bottom: none; }
.contact-icon {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
}
.contact-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}
.contact-value { color: var(--text); word-break: break-word; }
.contact-value a { color: var(--brown-dark); border-bottom: 1px dotted var(--tan-dark, #85746a); }
.contact-value a:hover { color: var(--gold); }

.panel-card {}
.meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 32px;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-low);
}
.meta-strip > div { display: flex; flex-direction: column; gap: 2px; }
.meta-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}
.meta-value { font-size: 13px; color: var(--text); }

.panel-tags {
    padding: 12px 24px 16px;
    border-top: 1px solid var(--border-light);
}

/* Markdown body */
.markdown-body {
    padding: 18px 24px 22px;
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.75;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--text);
    margin: 20px 0 8px;
    font-weight: 600;
}
.markdown-body h1:first-child,
.markdown-body h2:first-child { margin-top: 0; }
.markdown-body h1 { font-size: 22px; }
.markdown-body h2 { font-size: 18px; color: var(--brown-dark); border-bottom: 1px solid var(--border-light); padding-bottom: 4px; }
.markdown-body h3 { font-size: 15px; color: var(--brown); }
.markdown-body p { margin: 0 0 10px; }
.markdown-body ul, .markdown-body ol { margin: 4px 0 12px; padding-left: 20px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body li strong:first-child { color: var(--brown-dark); }
.markdown-body strong { color: var(--text); font-weight: 600; }
.markdown-body em { color: var(--text-secondary); }
.markdown-body a { color: var(--brown-dark); border-bottom: 1px dotted var(--outline, #a09488); }
.markdown-body a:hover { color: var(--gold); }
.markdown-body code {
    background: var(--bg-high);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11.5px;
}
.markdown-body blockquote {
    border-left: 3px solid var(--gold-fixed-dim);
    margin: 10px 0;
    padding: 6px 14px;
    color: var(--text-secondary);
    font-style: italic;
}
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Timeline */
.timeline {
    list-style: none;
    padding: 16px 24px 20px;
    margin: 0;
    border-left: none;
}
.timeline li {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-light);
    font-size: 13px;
}
.timeline li:last-child { border-bottom: none; }
.timeline-date {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gold);
    font-weight: 600;
    padding-top: 1px;
}
.timeline-body { color: var(--text); line-height: 1.6; }

/* Pull quote for press posts */
.pull-quote {
    margin: 0;
    padding: 28px 36px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    line-height: 1.4;
    color: var(--brown-dark);
    font-style: italic;
    position: relative;
}
.pull-quote::before {
    content: '"';
    position: absolute;
    top: 2px;
    left: 10px;
    font-size: 56px;
    color: var(--gold-fixed-dim);
    font-style: normal;
    line-height: 1;
}
.pull-quote p { margin: 0 0 10px; padding-left: 16px; }
.pull-quote footer {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-style: normal;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding-left: 16px;
}

.panel-wide { grid-column: 1 / -1; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 4px;
    font-size: 10px;
    background: var(--bg-high);
    color: var(--text-secondary);
    border-radius: 4px;
    letter-spacing: 0.3px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    min-width: 160px;
}
.filter-bar input:focus, .filter-bar select:focus {
    outline: none;
    border-color: var(--gold-fixed-dim);
}
.filter-bar input[type="search"] { flex: 1; min-width: 260px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.3px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--brown-dark); color: #fff; }
.btn-primary:hover { background: var(--gold); color: #fff; }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--card-hover); border-color: var(--gold-fixed-dim); color: var(--text); }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 980px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .detail-grid .panel:first-child { grid-column: 1 / -1; }
}

.detail-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 20px;
    padding: 18px 24px;
}
.detail-list dt {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    padding-top: 2px;
}
.detail-list dd { color: var(--text); font-size: 13px; word-break: break-word; }

.notes-body {
    padding: 16px 24px;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
}
.markdown-body {
    padding: 16px 24px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
}
.json-preview {
    background: var(--bg-low);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    white-space: pre-wrap;
    color: var(--text-secondary);
    max-height: 200px;
    overflow: auto;
}

/* Form */
.record-form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group-wide { grid-column: 1 / -1; }
.form-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.form-hint {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 10px;
    font-style: italic;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--card);
}
.form-group textarea {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--gold-fixed-dim);
    box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    margin-top: 8px;
}

.empty-state {
    padding: 32px 24px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Login */
.login-body {
    background: linear-gradient(135deg, #252525 0%, #3a3836 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container {
    background: var(--card);
    padding: 48px 56px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 360px;
    text-align: center;
}
.login-brand { margin-bottom: 32px; }
.login-brand h1 {
    font-size: 32px;
    letter-spacing: 6px;
    color: var(--brown-dark);
    margin-bottom: 4px;
}
.login-brand span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
}
.login-error {
    background: var(--red-light);
    color: var(--red);
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 12px;
}
.login-container input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    color: var(--text);
    background: var(--bg);
}
.login-container input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--card);
}
.login-container button {
    width: 100%;
    padding: 12px;
    background: var(--brown-dark);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.login-container button:hover { background: var(--gold); }
.login-tagline {
    margin-top: 20px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Mobile */
.mobile-menu-btn, .sidebar-overlay { display: none; }

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: flex;
        position: fixed;
        top: 14px; left: 14px;
        z-index: 101;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 8px;
        color: var(--text);
        cursor: pointer;
        box-shadow: var(--shadow-sm);
    }
    .sidebar { transform: translateX(-100%); transition: transform 0.25s; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }
    .content { margin-left: 0; padding: 60px 16px 40px; }
    .record-form { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; }
}
