/* =========================================================================
   Digital Lab Notebook — Design System (portal restyle)
   -------------------------------------------------------------------------
   Dense, early-2000s "research portal" aesthetic: a full-height flex shell
   (header, ticker, sidebar, scrolling content, status bar) with a dark blue
   palette and the Inter typeface. Containers and buttons use subtle
   rounding; status badges are pills.
   ========================================================================= */

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


/* -------------------------------------------------------------------------
   Design tokens — blue palette with layered backgrounds, borders and text
   ------------------------------------------------------------------------- */
:root {
    /* Backgrounds, darkest (app) to lightest (raised) */
    --bg: #0d1117;
    --bg2: #161b22;
    --bg3: #1f2630;
    --bg4: #2a3340;

    /* Borders — subtle white alpha for depth on dark surfaces */
    --border: rgba(255, 255, 255, 0.07);
    --border2: rgba(255, 255, 255, 0.13);
    --border3: rgba(255, 255, 255, 0.22);

    /* Text — primary, secondary, subtle */
    --text: #e6edf3;
    --text2: #9aa7b4;
    --text3: #5b6675;

    /* Accent (blue) */
    --accent: #2f81f7;
    --accent2: #6ba5f9;
    --accent3: rgba(47, 129, 247, 0.15);
    --accent-press: #2670e0;

    /* Status colors with translucent backgrounds */
    --green: #3fb950;
    --green2: #56d364;
    --green-bg: rgba(63, 185, 80, 0.12);
    --amber: #d29922;
    --amber2: #e3b341;
    --amber-bg: rgba(210, 153, 34, 0.12);
    --red: #f85149;
    --red-bg: rgba(248, 81, 73, 0.10);

    /* Shape */
    --radius: 6px;
    --radius-sm: 4px;
    --radius-pill: 999px;

    /* Layout */
    --app-max-width: 1280px;

    /* Typography */
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}


/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */
body {
    font-family: var(--font);
    font-size: 12px;
    line-height: 1.6;
    background: #090b10;
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 8px;
}

h1 { font-size: 18px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
h4 { font-size: 12px; }

p {
    margin-bottom: 10px;
}

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

a:hover {
    text-decoration: underline;
}

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

code {
    font-family: var(--mono);
    font-size: 11px;
    background: var(--bg3);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    color: var(--text2);
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}


/* -------------------------------------------------------------------------
   Portal shell — fixed chrome, only .content scrolls
   ------------------------------------------------------------------------- */
.portal-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--app-max-width);
    height: 100vh;
    height: 100dvh;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    overflow: hidden;
}


/* -------------------------------------------------------------------------
   Header — logo block | nav | user
   ------------------------------------------------------------------------- */
.portal-header {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border2);
}

.header-logo-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 170px;
    padding: 10px 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.header-sub {
    margin-top: 2px;
    padding-left: 29px;
    font-size: 10px;
    color: var(--text3);
}

.header-nav-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 10px;
}

/* Hamburger toggle — revealed on small screens only */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    margin-right: 6px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}


/* -------------------------------------------------------------------------
   Ticker bar
   ------------------------------------------------------------------------- */
.ticker-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    padding: 5px 12px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    color: var(--text3);
    overflow: hidden;
}

.ticker-greeting {
    color: var(--text2);
}

.ticker-greeting strong {
    color: var(--text);
    font-weight: 600;
}

.ticker-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    font-size: 10px;
    color: var(--text3);
}

.ticker-logout {
    color: var(--text3);
}

.ticker-logout:hover {
    color: var(--accent2);
}


/* -------------------------------------------------------------------------
   Body + sidebar
   ------------------------------------------------------------------------- */
.portal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 180px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.sb-section {
    border-bottom: 1px solid var(--border);
}

.sb-head {
    padding: 10px 12px 5px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text3);
}

.sb-link {
    display: block;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text2);
    border-left: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s;
}

.sb-link:hover {
    background: var(--bg3);
    color: var(--text);
    text-decoration: none;
}

.sb-link.active {
    background: var(--accent3);
    color: var(--accent2);
    border-left-color: var(--accent);
    font-weight: 500;
}

.sb-link-muted {
    font-size: 11px;
    color: var(--text3);
}

.sb-empty {
    padding: 4px 12px 6px;
    font-size: 11px;
    font-style: italic;
    color: var(--text3);
}

.sb-proj {
    display: block;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--text2);
    border-left: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.12s;
}

.sb-proj:hover {
    background: var(--bg3);
    color: var(--text);
    text-decoration: none;
}

.sb-proj.active {
    background: var(--accent3);
    color: var(--accent2);
    border-left-color: var(--accent);
}

.sb-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    vertical-align: middle;
}

.sb-stat {
    display: flex;
    justify-content: space-between;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--text3);
}

.sb-stat strong {
    color: var(--accent2);
}


/* -------------------------------------------------------------------------
   Content + status bar
   ------------------------------------------------------------------------- */
.content {
    flex: 1;
    min-width: 0;
    padding: 16px;
    background: var(--bg);
    overflow-y: auto;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 5px 12px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--text3);
}

.status-pane {
    padding: 2px 8px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.status-spacer {
    margin-left: auto;
}

/* Sidebar overlay backdrop (shown on mobile only) */
.sidebar-backdrop {
    display: none;
}


/* -------------------------------------------------------------------------
   Page title bar
   ------------------------------------------------------------------------- */
.page-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
}

.ptb-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.ptb-breadcrumb {
    font-size: 11px;
    color: var(--text3);
}


/* -------------------------------------------------------------------------
   Section box
   ------------------------------------------------------------------------- */
.section-box {
    margin-bottom: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
}

.section-body {
    padding: 12px;
}


/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.12s;
}

.btn:hover {
    background: var(--bg4);
    color: var(--text);
    border-color: var(--border3);
    text-decoration: none;
}

.btn:active {
    opacity: 0.85;
}

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

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

.btn-ghost {
    background: transparent;
    border-color: transparent;
}

.btn-danger {
    color: var(--red);
    border-color: rgba(248, 81, 73, 0.3);
}

.btn-danger:hover {
    background: var(--red-bg);
    color: var(--red);
}


/* -------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.portal-table th {
    padding: 6px 10px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border2);
    text-align: left;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text3);
}

.portal-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text2);
}

.portal-table tr:last-child td {
    border-bottom: none;
}

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

/* Stat table — label / value pairs */
.stat-table {
    width: 100%;
    border-collapse: collapse;
}

.stat-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.stat-table tr:last-child td {
    border-bottom: none;
}

.stat-table td:first-child {
    width: 60%;
    color: var(--text3);
}

.stat-table td:last-child {
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent2);
}


/* -------------------------------------------------------------------------
   Badges (status) — pills
   ------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 500;
}

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge-active {
    background: var(--green-bg);
    color: var(--green2);
}

.badge-completed {
    background: var(--accent3);
    color: var(--accent2);
}

.badge-paused {
    background: var(--amber-bg);
    color: var(--amber2);
}

.badge-low {
    background: var(--red-bg);
    color: var(--red);
}

.badge-muted {
    background: var(--bg4);
    color: var(--text3);
}


/* -------------------------------------------------------------------------
   Tags
   ------------------------------------------------------------------------- */
.tag-pill {
    display: inline-block;
    margin: 1px;
    padding: 1px 8px;
    background: var(--bg4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--text2);
}

.tag-cat {
    background: var(--accent3);
    border-color: transparent;
    color: var(--accent2);
}


/* -------------------------------------------------------------------------
   Progress
   ------------------------------------------------------------------------- */
.progress-outer {
    width: 100%;
    height: 5px;
    background: var(--bg4);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
    transition: width 0.3s;
}


/* -------------------------------------------------------------------------
   Project card
   ------------------------------------------------------------------------- */
.proj-card {
    display: block;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.proj-card:hover {
    border-color: var(--border2);
    background: var(--bg3);
    text-decoration: none;
}

.proj-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.proj-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.proj-card__desc {
    margin: 6px 0;
    color: var(--text2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.proj-card__meta {
    margin-top: 6px;
    font-size: 10px;
    color: var(--text3);
}

.proj-card__tags {
    margin-top: 6px;
}

.proj-card__progress {
    margin-top: 8px;
}

.card-star {
    color: var(--amber2);
}

.star-form {
    display: inline-flex;
    margin: 0;
}

.star-btn {
    padding: 0 2px;
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    color: var(--text3);
    cursor: pointer;
}

.star-btn:hover,
.star-btn.is-starred {
    color: var(--amber2);
}

/* Responsive grid for project cards — up to ~4 per row, stacks when narrow */
.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.proj-grid .proj-card {
    margin-bottom: 0;
}


/* -------------------------------------------------------------------------
   Tabs
   ------------------------------------------------------------------------- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.tab {
    margin-bottom: -1px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text2);
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.tab:hover {
    color: var(--text);
    text-decoration: none;
}

.tab.active {
    color: var(--accent2);
    border-bottom-color: var(--accent);
    font-weight: 600;
}


/* -------------------------------------------------------------------------
   Entry timeline
   ------------------------------------------------------------------------- */
.entry {
    margin-bottom: 8px;
    padding: 10px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}

.entry-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

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

.entry-date {
    font-size: 10px;
    color: var(--text3);
    white-space: nowrap;
}

.entry-notes {
    margin: 6px 0 0;
    color: var(--text2);
    white-space: pre-wrap;
}

.entry-tags {
    margin-top: 6px;
}

.entry-media {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.entry-media-item {
    display: block;
    width: 120px;
    height: 90px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.entry-media-item img,
.entry-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entry-media-doc {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--text2);
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.entry-media-edit {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}


/* -------------------------------------------------------------------------
   Entry data tables
   ------------------------------------------------------------------------- */
.entry-table {
    margin-top: 8px;
}

.entry-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.entry-table-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
}

.entry-table-edit {
    margin-top: 8px;
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.entry-edit-toggle {
    padding: 0;
    background: none;
    border: none;
    font-size: 11px;
    color: var(--accent2);
    cursor: pointer;
}

.entry-edit-toggle:hover {
    text-decoration: underline;
}

.entry-edit-form {
    margin-top: 8px;
}

.dt-add {
    margin-top: 8px;
}

.dt-add summary {
    cursor: pointer;
    padding: 4px 0;
    font-size: 11px;
    color: var(--accent2);
}

.dt-add > form {
    margin-top: 8px;
}

.dt-grid {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.dt-grid th,
.dt-grid td {
    padding: 2px;
    border: 1px solid var(--border);
}

.dt-col,
.dt-cell {
    width: 100%;
    min-width: 90px;
    padding: 4px 6px;
    font-family: var(--font);
    font-size: 11px;
    color: var(--text);
    background: var(--bg3);
    border: 1px solid transparent;
    outline: none;
}

.dt-col {
    font-weight: 600;
}

.dt-col:focus,
.dt-cell:focus {
    border-color: var(--accent);
}

.dt-x {
    padding: 0 4px;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text3);
    cursor: pointer;
}

.dt-x:hover {
    color: var(--red);
}

.dt-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}


/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text2);
}

.form-input {
    width: 100%;
    padding: 7px 9px;
    font-family: var(--font);
    font-size: 12px;
    color: var(--text);
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-error {
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--red-bg);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--red);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.form-select,
.form-textarea {
    width: 100%;
    padding: 7px 9px;
    font-family: var(--font);
    font-size: 12px;
    color: var(--text);
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s;
}

.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
}

.form-textarea {
    min-height: 70px;
    resize: vertical;
}

.form-success {
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--green-bg);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--green2);
}

/* Color swatch picker (radio-based, no JS) */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-swatch span {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-swatch input:checked + span {
    border-color: var(--bg2);
    box-shadow: 0 0 0 2px var(--text2);
}

.color-swatch input:focus-visible + span {
    box-shadow: 0 0 0 2px var(--accent);
}


/* -------------------------------------------------------------------------
   Login page (standalone — no portal shell)
   ------------------------------------------------------------------------- */
.login-body {
    justify-content: center;
    padding: 24px;
    overflow: auto;
}

.login-card {
    width: 100%;
    max-width: 340px;
    padding: 24px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
}

.login-head {
    margin-bottom: 20px;
    text-align: center;
}

.login-head .logo-icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    font-size: 16px;
}

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


/* -------------------------------------------------------------------------
   Milestones
   ------------------------------------------------------------------------- */
.milestone {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ms-check-form {
    flex-shrink: 0;
}

.ms-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: var(--bg3);
    border: 1px solid var(--border3);
    border-radius: var(--radius-sm);
    font-size: 11px;
    line-height: 1;
    color: transparent;
    cursor: pointer;
}

.ms-check.done {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

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

.ms-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

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

.ms-title.ms-done {
    color: var(--text3);
    text-decoration: line-through;
}

.ms-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.ms-meta {
    font-size: 10px;
    color: var(--text3);
}

.ms-desc {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text2);
    white-space: pre-wrap;
}

.conclusion-body {
    margin: 0 0 4px;
    color: var(--text2);
    white-space: pre-wrap;
}

.test-field {
    margin-bottom: 8px;
}

.test-field-label {
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text3);
}

.test-field-text {
    color: var(--text2);
    white-space: pre-wrap;
}


/* -------------------------------------------------------------------------
   Media gallery
   ------------------------------------------------------------------------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.media-item {
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.media-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 130px;
    background: var(--bg3);
    overflow: hidden;
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-doc {
    padding: 10px;
    text-align: center;
    font-size: 11px;
    color: var(--text2);
    text-decoration: none;
    word-break: break-word;
}

.media-doc-icon {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent2);
}

.media-info {
    padding: 8px;
    font-size: 10px;
    color: var(--text3);
}

.media-name {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    color: var(--text2);
    word-break: break-word;
}

.media-actions {
    margin-top: auto;
    padding: 0 8px 8px;
}


/* -------------------------------------------------------------------------
   Helpers
   ------------------------------------------------------------------------- */
.two-col {
    display: flex;
    gap: 10px;
}

.two-col > * {
    flex: 1;
    min-width: 0;
}

.empty-msg {
    padding: 24px;
    text-align: center;
    font-size: 12px;
    font-style: italic;
    color: var(--text3);
}


/* -------------------------------------------------------------------------
   Scrollbar
   ------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg4);
    border-radius: var(--radius-pill);
}


/* -------------------------------------------------------------------------
   Responsive — sidebar collapses to an overlay drawer
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
        margin-right: 0;
        font-size: 18px;
    }

    /* Taller header so the hamburger is comfortable to tap */
    .portal-header {
        min-height: 56px;
    }

    /* Logo takes ~80%, nav bar (hamburger) ~20%, aligned right */
    .header-logo-block {
        flex: 4;
        min-width: 0;
    }

    .header-nav-bar {
        flex: 1;
        justify-content: flex-end;
    }

    /* Hide the date on small screens to keep greeting + logout uncrowded */
    .ticker-date {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 220px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(0, 0, 0, 0.5);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .two-col {
        flex-direction: column;
    }
}
