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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success-bg: #d1fae5; --success-text: #065f46; --success-border: #6ee7b7;
    --error-bg: #fee2e2;   --error-text: #991b1b;  --error-border: #fca5a5;
    --warn-bg: #fef3c7;    --warn-text: #92400e;   --warn-border: #fcd34d;
    --info-bg: #dbeafe;    --info-text: #1e40af;   --info-border: #93c5fd;
    --gray-border: #e5e7eb;
    --gray-light: #f3f4f6;
    --text: #111827;
    --text-muted: #6b7280;
    --nav-bg: #1e293b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #f9fafb;
    margin: 0;
    min-height: 100vh;
}

/* ── Nav ─────────────────────────────────────────── */
.navbar {
    background: var(--nav-bg);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    gap: 1rem;
}
/* ── Brand / Logo ────────────────────────────────── */
.brand-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: #f8fafc;
}
.nav-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.brand-logo-text {
    display: flex;
    align-items: baseline;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -.02em;
}
.brand-logo-text .sls { color: #2563eb; }
.brand-logo-text .tech { color: #94a3b8; }
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    border-left: 1px solid #334155;
    padding-left: .6rem;
}
.brand-app {
    color: #cbd5e1;
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .01em;
    white-space: nowrap;
}
.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    gap: .15rem;
}
.nav-links li { position: relative; }
.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    padding: .45rem .75rem;
    border-radius: 4px;
    display: block;
    font-size: .875rem;
    transition: background .15s, color .15s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.1); color: #f8fafc; }

.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    min-width: 160px;
    z-index: 200;
    list-style: none;
    padding: .25rem 0;
    margin: 0;
}
.dropdown-menu a {
    display: block;
    padding: .45rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: .875rem;
}
.dropdown-menu a:hover { background: rgba(255,255,255,.08); color: #f8fafc; }

.nav-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .8rem;
    color: #64748b;
    white-space: nowrap;
}
.nav-user a { color: #94a3b8; text-decoration: none; }
.nav-user a:hover { color: #f8fafc; }

/* ── Client chip ─────────────────────────────────── */
.client-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(37,99,235,.25);
    border: 1px solid rgba(37,99,235,.4);
    color: #93c5fd;
    border-radius: 12px;
    padding: .15em .7em;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.client-chip.super-admin {
    background: rgba(245,158,11,.15);
    border-color: rgba(245,158,11,.3);
    color: #fcd34d;
}

/* ── Layout ──────────────────────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.page-header h1 { margin: 0; font-size: 1.4rem; font-weight: 700; }

/* ── Flash ───────────────────────────────────────── */
.flash-messages { margin-bottom: 1rem; }
.flash {
    padding: .7rem 1rem;
    border-radius: 6px;
    margin-bottom: .4rem;
    font-size: .875rem;
    border: 1px solid transparent;
}
.flash-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.flash-error   { background: var(--error-bg);   color: var(--error-text);   border-color: var(--error-border); }
.flash-warning { background: var(--warn-bg);    color: var(--warn-text);    border-color: var(--warn-border); }
.flash-info, .flash-message { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); }

/* ── Cards ───────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 1.25rem;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
}
.stat-number { font-size: 2.25rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label  { color: var(--text-muted); font-size: .8rem; margin-top: .35rem; }
.stat-card.warn .stat-number { color: #d97706; }

/* ── Tables ──────────────────────────────────────── */
.table-container {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    overflow: hidden;
}
.table-wrapper { overflow-x: auto; }
.table-wrapper.scrollable { max-height: 520px; overflow-y: auto; }

table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead { position: sticky; top: 0; z-index: 1; }
th {
    background: #f8fafc;
    border-bottom: 2px solid var(--gray-border);
    padding: .6rem .75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
    white-space: nowrap;
}
td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--gray-border);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* ── Badges ──────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .2em .6em;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.badge-Active       { background: #d1fae5; color: #065f46; }
.badge-Draft        { background: #fef3c7; color: #92400e; }
.badge-Obsolete     { background: #f3f4f6; color: #4b5563; }
.badge-Under-Review { background: #dbeafe; color: #1e40af; }
.badge-Superseded   { background: #ede9fe; color: #5b21b6; }
.badge-admin  { background: #fee2e2; color: #991b1b; }
.badge-editor { background: #dbeafe; color: #1e40af; }
.badge-viewer { background: #f3f4f6; color: #4b5563; }
.badge-active-user  { background: #d1fae5; color: #065f46; }
.badge-inactive-user{ background: #f3f4f6; color: #9ca3af; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: .4rem .875rem;
    border-radius: 5px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--gray-border); }
.btn-secondary:hover { background: var(--gray-light); }
.btn-danger { background: #fff; color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #d97706; color: #fff; border-color: #d97706; }
.btn-sm { padding: .2rem .5rem; font-size: .78rem; }
.btn-group { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Forms ───────────────────────────────────────── */
.form-card {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 1.75rem;
    max-width: 920px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group.span-3 { grid-column: span 1; }

label { font-weight: 500; font-size: .875rem; }
label .req { color: #dc2626; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="datetime-local"], input[type="url"],
select, textarea {
    width: 100%;
    padding: .45rem .7rem;
    border: 1px solid var(--gray-border);
    border-radius: 5px;
    font-size: .875rem;
    color: var(--text);
    background: #fff;
    transition: border-color .15s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}
textarea { resize: vertical; min-height: 72px; }

.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-border);
    flex-wrap: wrap;
}

/* ── Filter bar ──────────────────────────────────── */
.filter-bar {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: .875rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: .25rem; min-width: 140px; }
.filter-group label { font-size: .78rem; font-weight: 500; color: var(--text-muted); }
.filter-group select, .filter-group input { font-size: .83rem; padding: .35rem .6rem; }

/* ── Pagination ──────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .7rem 1rem;
    border-top: 1px solid var(--gray-border);
    font-size: .83rem;
    color: var(--text-muted);
    background: #fff;
    flex-wrap: wrap;
    gap: .5rem;
}
.pagination-links { display: flex; gap: .2rem; }
.pagination-links a, .pagination-links span {
    display: inline-block;
    padding: .3rem .6rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--gray-border);
    font-size: .8rem;
}
.pagination-links a:hover { background: var(--gray-light); }
.pagination-links .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Timeline ────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: .55rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--gray-border);
}
.timeline-item {
    position: relative;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 1.1rem;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #f9fafb;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .4rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.timeline-rev { font-weight: 700; font-size: 1.05rem; }
.timeline-meta { font-size: .8rem; color: var(--text-muted); }
.timeline-reason { font-size: .8rem; color: var(--text-muted); font-style: italic; margin-top: .35rem; }
.timeline-comment { margin-top: .35rem; font-size: .875rem; }

/* ── Login ───────────────────────────────────────── */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 0px);
    background: #f1f5f9;
    padding: 2rem;
}
.login-card {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    padding: 2.25rem 2rem;
    width: 360px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.login-logo {
    max-height: 90px;
    max-width: 200px;
    object-fit: contain;
}
.login-logo-text-fallback {
    align-items: baseline;
    gap: .05em;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -.03em;
}
.login-logo-text-fallback .sls  { color: #2563eb; }
.login-logo-text-fallback .tech { color: #6b7280; }

.login-title {
    text-align: center;
    margin: 0 0 .25rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: .78rem;
    margin: 0 0 1.5rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.login-card .form-group { margin-bottom: 1rem; }
.login-card .btn { width: 100%; text-align: center; padding: .6rem; margin-top: .5rem; }

/* ── Detail meta grid ────────────────────────────── */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem 1.25rem;
    margin-bottom: 1.25rem;
}
.meta-item label {
    display: block;
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .2rem;
    font-weight: 600;
}
.meta-item .value { font-size: .9rem; font-weight: 500; word-break: break-all; }
.meta-item .value a { color: var(--primary); }

/* ── Tabs ────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-border);
    margin-bottom: 1.25rem;
    gap: 0;
    flex-wrap: wrap;
}
.tab-link {
    padding: .55rem 1.1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    font-size: .875rem;
    transition: all .15s;
}
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Category list (admin) ───────────────────────── */
.category-list { display: flex; flex-direction: column; gap: 1rem; }
.category-card {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    overflow: hidden;
}
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--gray-border);
    font-weight: 600;
    gap: .5rem;
}
.category-body { padding: .5rem 1rem; }
.subcategory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .4rem 0;
    border-bottom: 1px solid var(--gray-border);
    gap: .5rem;
}
.subcategory-item:last-child { border-bottom: none; }

.inactive-text { opacity: .5; text-decoration: line-through; }

/* ── Import preview ──────────────────────────────── */
.row-error td { background: #fff0f0 !important; }
.row-valid td { background: #f0fdf4 !important; }
.error-msg { color: #dc2626; font-size: .75rem; font-style: italic; display: block; }

/* ── Section title ───────────────────────────────── */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0 .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--gray-border);
    color: var(--text);
}

/* ── Due soon highlight ──────────────────────────── */
.due-soon { color: #d97706; font-weight: 600; }
.overdue  { color: #dc2626; font-weight: 600; }

/* ── Notes / code blocks ─────────────────────────── */
.notes-block {
    background: #f8fafc;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Column template ─────────────────────────────── */
.column-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: .5rem 0;
}
.col-tag {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: .2em .55em;
    font-size: .78rem;
    font-family: monospace;
}

/* ── Utilities ───────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.actions { white-space: nowrap; }
.w-full { width: 100%; }

/* ── Admin sub-navigation ────────────────────────── */
.admin-subnav {
    display: flex;
    gap: .25rem;
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: .5rem .75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}
.admin-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.admin-subnav-link:hover { background: var(--gray-light); color: var(--text); }
.admin-subnav-link.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}
.subnav-hint {
    font-size: .72rem;
    font-weight: 400;
    color: var(--text-muted);
    opacity: .8;
}

/* ── Edit-options admin link ─────────────────────── */
.edit-opts-link {
    font-size: .75rem;
    color: var(--primary);
    text-decoration: none;
    opacity: .75;
    transition: opacity .15s;
}
.edit-opts-link:hover { opacity: 1; text-decoration: underline; }

/* ── Revision count badge ────────────────────────── */
.rev-count-badge {
    display: inline-block;
    min-width: 2rem;
    padding: .2em .5em;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: .85rem;
    background: #f3f4f6;
    color: #374151;
}
.rev-count-badge.rev-mid  { background: #fef3c7; color: #92400e; }
.rev-count-badge.rev-high { background: #fee2e2; color: #991b1b; }

/* ── Error pages ─────────────────────────────────── */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}
.error-page h1 { font-size: 4rem; margin: 0; color: var(--text-muted); }
.error-page p { color: var(--text-muted); }

/* ── Bug tracker ─────────────────────────────────── */

/* Severity badges */
.badge-severity {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .15em .6em; border-radius: 4px; font-size: .75rem;
    font-weight: 700; letter-spacing: .03em; white-space: nowrap;
}
.sev-critical { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.sev-high     { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.sev-medium   { background: #fefce8; color: #a16207; border: 1px solid #fde047; }
.sev-low      { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }

/* Priority badges */
.badge-priority {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .15em .55em; border-radius: 4px; font-size: .75rem;
    font-weight: 700; white-space: nowrap;
}
.pri-p1 { background: #fdf2f8; color: #9d174d; border: 1px solid #f9a8d4; }
.pri-p2 { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.pri-p3 { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }
.pri-p4 { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }

/* Status badges */
.badge-status {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .15em .65em; border-radius: 12px; font-size: .75rem;
    font-weight: 600; white-space: nowrap;
}
.status-new             { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.status-assigned        { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.status-in-progress     { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.status-fixed           { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-in-verification { background: #cffafe; color: #155e75; border: 1px solid #67e8f9; }
.status-closed          { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-rejected        { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.status-wont-fix        { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }
.status-deferred        { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.status-duplicate       { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }
.status-reopened        { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }

/* Internal comment badge */
.badge-internal { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; font-size:.7rem; padding:.1em .5em; border-radius:4px; }

/* Detail two-column layout */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}
.detail-main  { display: flex; flex-direction: column; gap: 1rem; }
.detail-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* Comments */
.comment {
    padding: .75rem 1rem;
    border-radius: 6px;
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    margin-bottom: .6rem;
}
.comment-internal {
    background: #fefce8;
    border-color: #fde68a;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .25rem;
    font-size: .8rem;
}

/* Form sections */
.form-section {
    border-bottom: 1px solid var(--gray-border);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}
.form-section:last-of-type { border-bottom: none; }
.form-section-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin: 0 0 1rem;
}
.form-card {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 1.5rem;
}
.form-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin: .3rem 0 0;
}

/* mono link for IDs */
.mono-link { font-family: monospace; font-size: .85rem; }

/* ── Bug form — reporter strip ───────────────────── */
.reporter-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    padding: .5rem .85rem;
    font-size: .82rem;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}
.reporter-strip strong { color: var(--text); }

/* ── Bug form — severity pill picker ─────────────── */
.severity-picker {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.sev-option {
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid transparent;
    padding: .45rem 1rem;
    font-size: .82rem;
    font-weight: 700;
    transition: border-color .15s, box-shadow .15s;
    user-select: none;
}
.sev-option input[type="radio"] { display: none; }
.sev-opt-critical { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.sev-opt-high     { background: #fff7ed; color: #c2410c; border-color: #fdba74; }
.sev-opt-medium   { background: #fefce8; color: #a16207; border-color: #fde047; }
.sev-opt-low      { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.sev-option:has(input:checked) { border-width: 2px; box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.sev-opt-critical:has(input:checked) { border-color: #b91c1c; }
.sev-opt-high:has(input:checked)     { border-color: #c2410c; }
.sev-opt-medium:has(input:checked)   { border-color: #a16207; }
.sev-opt-low:has(input:checked)      { border-color: #15803d; }

/* ── Bug form — file drop ─────────────────────────── */
.file-drop-area {
    position: relative;
    border: 2px dashed var(--gray-border);
    border-radius: 8px;
    background: var(--gray-light);
    transition: border-color .15s, background .15s;
}
.file-drop-area:hover { border-color: var(--primary); background: #eff6ff; }
.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.file-drop-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: 1.5rem;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-muted);
    text-align: center;
}
.file-drop-icon { font-size: 1.6rem; }
.file-preview-list {
    list-style: none;
    margin: .4rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.file-preview-item {
    font-size: .8rem;
    color: var(--text-muted);
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    border-radius: 4px;
    padding: .2rem .6rem;
}

/* ── Bug form — admin collapsible ────────────────── */
.admin-details {
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: .6rem 1rem;
    margin-top: .25rem;
    background: var(--gray-light);
}
.admin-details summary {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.admin-details summary:hover { color: var(--text); }

/* ── Attachment list on detail page ──────────────── */
.attachment-list {
    list-style: none;
    margin: 0 0 .75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    padding: .35rem .6rem;
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: .83rem;
}
.attachment-link {
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    flex: 1;
}
.attachment-link:hover { text-decoration: underline; }

/* ── Glossary ────────────────────────────────────── */
.glossary-section {
    margin-bottom: 2.5rem;
}
.glossary-section-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-muted);
    margin: 0 0 .9rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--gray-border);
}
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: .75rem;
}
.glossary-card {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: .9rem 1rem;
    transition: box-shadow .15s;
}
.glossary-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.glossary-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}
.glossary-type-label {
    font-weight: 700;
    font-size: .85rem;
    color: var(--text);
}
.glossary-desc {
    font-size: .85rem;
    color: var(--text);
    line-height: 1.55;
    margin: 0 0 .35rem;
}
.glossary-meta {
    font-size: .72rem;
    color: var(--text-muted);
    margin: 0;
}
.glossary-textarea {
    font-size: .85rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: .5rem;
}
.glossary-edit-actions {
    display: flex;
    gap: .4rem;
}
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: .1rem .3rem;
    border-radius: 4px;
    font-size: .85rem;
    opacity: .45;
    transition: opacity .15s;
}
.btn-icon:hover { opacity: 1; background: var(--gray-light); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .meta-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; }
    .nav-links { display: none; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
}


/* ── Maintenance module ──────────────────────────────── */
.hours-gauge {
    width:100%; height:8px; background:#e5e7eb; border-radius:999px;
    overflow:hidden; position:relative;
}
.hours-gauge-fill {
    height:100%; background:#16a34a; transition:width .3s;
}
.hours-gauge-fill.warn   { background:#f59e0b; }
.hours-gauge-fill.danger { background:#dc2626; }

/* Approval status badges */
.badge-approval {
    display:inline-block; padding:.15rem .5rem; border-radius:999px;
    font-size:.72rem; font-weight:600; text-transform:uppercase;
    letter-spacing:.04em; line-height:1.4;
}
.approval-pending   { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }
.approval-approved  { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.approval-rejected  { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.approval-expired   { background:#f1f5f9; color:#475569; border:1px solid #cbd5e1; }

/* Renewal status badges */
.badge-active          { background:#d1fae5; color:#065f46; }
.badge-expired         { background:#fee2e2; color:#991b1b; }
.badge-pending-renewal { background:#fef3c7; color:#92400e; }
.badge-cancelled       { background:#f1f5f9; color:#475569; }

/* Time log table */
.time-log-table th { font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; }
.time-entry-internal { opacity:.7; font-style:italic; background:#f9fafb; }

/* Maintenance detail */
.pkg-stat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }
.pkg-stat { text-align:center; padding:1rem; background:#f9fafb; border:1px solid var(--gray-border); border-radius:6px; }
.pkg-stat .value { font-size:1.8rem; font-weight:700; line-height:1; }
.pkg-stat .label { font-size:.72rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; margin-top:.25rem; }

.low-balance-banner {
    background:#fef3c7; border:1px solid #fcd34d; color:#92400e;
    padding:.75rem 1rem; border-radius:6px; margin-bottom:1rem;
    font-size:.9rem;
}
