/* ==============================================
   WorkSafety Core – Unified Stylesheet
   Consolidated from backup: colors, design, fonts,
   dashboard, files, login, settings CSS
   ============================================== */

/* === Local Fonts === */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 100; font-display: swap; src: url('../fonts/poppins-100.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 200; font-display: swap; src: url('../fonts/poppins-200.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/poppins-300.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-600.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-700.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/poppins-800.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 900; font-display: swap; src: url('../fonts/poppins-900.woff2') format('woff2'); }

/* === Material Symbols Sharp (local) === */
@font-face {
    font-family: 'Material Symbols Sharp';
    font-style: normal;
    font-weight: 100 700;
    src: url('../fonts/material-symbols-sharp.woff2') format('woff2');
}
.material-symbols-sharp {
    font-family: 'Material Symbols Sharp';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* === CSS Variables (colors.css) === */
:root {
    --color-primary: #1B80C6;
    --color-secondary: #8CC751;
    --color-success: #5CB33E;
    --color-warning: #10A0DD;
    --color-white: #fff;
    --color-info-dark: #7d8da1;
    --color-info-light: #dce1eb;
    --color-dark: #1e1e1e;
    --color-light: rgba(132, 139, 200, 0.18);
    --color-primary-variant: #677483;
    --color-dark-variant: #677483;
    --color-background: #f6f6f9;

    --card-border-radius: 2rem;
    --border-radius-1: 0.4rem;
    --border-radius-2: 0.8rem;
    --border-radius-3: 1.2rem;

    --card-padding: 1.8rem;
    --padding-1: 1.2rem;

    --box-shadow: 0 2rem 3rem var(--color-light);
}

/* === Reset & Base (design.css + fonts.css) === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    outline: 0;
    appearance: none;
    border: 0;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
}

html { font-size: 14px; }

body {
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    user-select: none;
    overflow-x: hidden;
    background: var(--color-background);
    color: var(--color-dark);
}

h1 { font-weight: 800; font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 0.87rem; }
h4 { font-size: 0.8rem; }
h5 { font-size: 0.77rem; }
small { font-size: 0.75rem; }

a { color: var(--color-dark); }
img { display: block; width: 100%; }

.text-muted { color: var(--color-info-dark); }
p { color: var(--color-dark-variant); }
b { color: var(--color-dark); }
.primary { color: var(--color-primary); }
.secondary { color: var(--color-secondary); }
.success { color: var(--color-success); }
.warning { color: var(--color-warning); }

/* === Container Grid Layout (design.css) === */
.container {
    display: grid;
    width: 96%;
    margin: 0 auto;
    gap: 1.8rem;
    grid-template-columns: 14rem 1fr;
    height: 100vh;
}

/* === Profile Photo (design.css) === */
.profile-photo {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    overflow: hidden;
    border: 0.15rem solid var(--color-dark-variant);
    box-shadow: 0 0.125rem 0.25rem var(--color-dark-variant);
}

/* ==============================================
   SIDEBAR (design.css + colors.css)
   ============================================== */
aside { height: 100%; }

aside .top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.4rem;
}

aside .icon {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
aside .icon img { width: 2rem; height: 2rem; }

aside .close { display: none; }

aside .sidebar {
    display: flex;
    flex-direction: column;
    height: 92vh;
    position: relative;
    top: 2rem;
    bottom: 1.4rem;
    background: var(--color-white);
}

aside .sidebar a {
    display: flex;
    margin-left: 2rem;
    gap: 1rem;
    align-items: center;
    position: relative;
    height: 3.7rem;
    transition: all 300ms ease;
    color: var(--color-info-dark);
}

aside .sidebar a span { transition: all 300ms ease; font-size: 1.6rem; }
aside h3 { font-weight: 500; }

aside .sidebar a:last-child {
    position: absolute;
    bottom: 2rem;
    width: 100%;
}

aside .sidebar a.active {
    margin-left: 0;
    background-color: var(--color-light);
    color: var(--color-primary);
}

aside .sidebar a.active:before {
    content: '';
    width: 6px;
    height: 100%;
    background: var(--color-primary);
}

aside .sidebar a.active span { color: var(--color-primary); margin-left: calc(1rem - 3px); }

aside .sidebar a:hover { color: var(--color-primary); }
aside .sidebar a:hover span { margin-left: 1rem; }

/* ==============================================
   MAIN AREA (design.css)
   ============================================== */
main {
    margin-top: 1.4rem;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: 96%;
    overflow: auto;
    background: var(--color-white);
}

/* === Profile / Top Bar (design.css) === */
.right .top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.right .top button { display: none; }

.right .top .profile {
    display: flex;
    gap: 2rem;
    align-items: center;
    text-align: right;
}

/* ==============================================
   DASHBOARD (dashboard.css)
   ============================================== */

/* Insights grid */
main .insights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.6rem;
    justify-content: space-between;
}

main .insights > div {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    margin-top: 1rem;
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
    flex: 1;
}

main .insights > div:hover { box-shadow: none; }

/* Donut chart analytics card */
.analytics {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.analytics-icon {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--color-primary);
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.analytics-icon .material-symbols-sharp {
    font-size: 1.5rem;
}

.open-count-value {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.1em;
}

.symbol-top-right {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2.5rem;
    background: var(--color-primary);
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--color-white);
}

.content-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.info-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.chart-container {
    flex: 1;
    height: 300px;
    width: 300px;
    margin-top: 1rem;
}

/* Calendar analytics card */
.analytics2 {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: var(--color-white);
    box-shadow: var(--box-shadow);
    border-radius: var(--card-border-radius);
}

.analytics2 > span {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2.5rem;
    background: var(--color-primary);
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--color-white);
}

.analytics2 .chart-container { width: 400px; height: 300px; margin-top: 1rem; }

main .insights small { margin-top: 1.6rem; display: block; }

/* Clickable analytics link */
.analytics-link {
    text-decoration: none;
    display: block;
    color: inherit;
}

.analytics-link .analytics {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    margin-top: 1rem;
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

.analytics-link .analytics:hover { box-shadow: none; cursor: pointer; }

/* ==============================================
   CALENDAR (dashboard.css)
   ============================================== */
.calendar-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem;
}

.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    gap: 20px;
}

.calendar-title {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    min-width: 140px;
}

.calendar-month, .calendar-year { font-size: 14px; white-space: nowrap; }

.prev-month, .next-month {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 300ms ease;
}

.prev-month span, .next-month span {
    font-size: 18px;
    position: static;
    background: none;
    padding: 0;
    color: var(--color-white);
}

.prev-month:hover, .next-month:hover { transform: scale(1.1); }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
    width: 100%;
    max-width: 320px;
}

.calendar-weekdays div {
    padding: 4px 0;
    font-size: 0.8rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 320px;
}

.calendar-day {
    aspect-ratio: 1;
    max-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    margin: 0 auto;
}

.calendar-day:hover { background-color: #f0f0f0; }
.calendar-day.empty { cursor: default; }
.calendar-day.current-day { background-color: var(--color-primary); color: var(--color-white); }

/* ==============================================
   TABLES – Recent / All Documents (dashboard.css + files.css)
   ============================================== */
main .recent-documents { margin-top: 2rem; }
main .recent-documents h2 { margin-bottom: 0.8rem; }

main .recent-documents table,
main .documents table {
    background-color: var(--color-white);
    width: 100%;
    border-radius: var(--card-border-radius);
    padding: var(--card-padding);
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: all 300ms ease;
}

main .recent-documents table:hover,
main .documents table:hover { box-shadow: none; }

main table tbody td {
    height: 2.8rem;
    border-bottom: 1px solid var(--color-light);
    color: var(--color-dark-variant);
}

main table tbody tr:last-child { border: none; }

main .recent-documents a,
main .documents a {
    text-align: center;
    display: block;
    margin: 1rem auto;
    color: var(--color-primary);
}

main .documents { margin-top: 2rem; }
main .documents h2 { margin-bottom: 0.8rem; }

/* ==============================================
   SEARCH & FILTER BAR (files.css)
   ============================================== */
.search-bar {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 1rem 0;
    padding: 0.5rem;
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-1);
    background-color: var(--color-white);
    box-shadow: var(--box-shadow);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem;
    font-size: 1rem;
    color: var(--color-dark);
    background: transparent;
}

.search-bar button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    font-size: 1.5rem;
    padding: 0.5rem;
}

.search-bar button:hover { color: var(--color-dark); }

.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
}

.filter-bar label { font-weight: bold; }

.filter-bar select {
    padding: 0.5rem;
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-1);
    background-color: var(--color-white);
    font-size: 1rem;
    color: var(--color-dark);
}

.filter-bar select:focus { outline: none; border-color: #5A9BD5; }

/* Button bar */
.button-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

.button-bar .right-buttons { display: flex; gap: 1rem; }

#resetFilters, #upload {
    background-color: #5A9BD5;
    color: white;
    font-size: 14px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#delete {
    background-color: #d65a5a;
    color: white;
    font-size: 14px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#resetFilters:hover, #upload:hover { background-color: #4A8BC2; }
#delete:hover { background-color: #b85050; }

/* ==============================================
   LOGIN PAGE (login.css)
   ============================================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    background-color: var(--color-background);
    color: #333;
    text-align: center;
}

.login-page img {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
    text-align: center;
}

.login-container h1 { font-size: 1.8rem; margin-bottom: 1.5rem; }

.login-container form { display: flex; flex-direction: column; }

.login-container input[type="email"],
.login-container input[type="password"],
.login-container input[type="text"] {
    padding: 0.8rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.login-container input[type="submit"],
.login-container button[type="submit"] {
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background-color: #1b80c6;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.login-container input[type="submit"]:hover,
.login-container button[type="submit"]:hover { background-color: #155a8e; }

.login-links { text-align: center; margin-top: 1.2rem; font-size: 0.85rem; color: #888; }
.login-links a { color: var(--color-primary); font-weight: 500; }
.login-links a:hover { text-decoration: underline; }

/* ==============================================
   SETTINGS (settings.css)
   ============================================== */
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.settings-category {
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.settings-category h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #333;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.5rem;
}

/* ==============================================
   ALERTS
   ============================================== */
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ==============================================
   BUTTONS (general)
   ============================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-white);
    background-color: var(--color-primary);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.btn:hover { background-color: #155a8e; }
.btn-primary { background-color: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background-color: #155a8e; }
.btn-secondary { background-color: #5A9BD5; color: var(--color-white); }
.btn-secondary:hover { background-color: #4A8BC2; }
.btn-danger { background-color: #d65a5a; color: var(--color-white); }
.btn-danger:hover { background-color: #b85050; }
.btn-block { display: block; width: 100%; }

/* ==============================================
   FORM ELEMENTS
   ============================================== */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-dark-variant);
    font-size: 0.88rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    background: var(--color-white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-primary); }
.form-group small { display: block; margin-top: 0.3rem; color: var(--color-info-dark); font-size: 0.8rem; }

/* ==============================================
   LANDING PAGE
   ============================================== */
.landing-page { min-height: 100vh; background: var(--color-background); }

.landing-hero {
    background: linear-gradient(135deg, var(--color-primary), #3a78b5);
    color: var(--color-white);
    padding: 4rem 2rem;
    text-align: center;
}
.landing-hero h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
.landing-hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; color: var(--color-white); }

.action-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: -2rem auto 3rem;
    padding: 0 2rem;
}

.feature-card {
    background: var(--color-white);
    padding: 1.8rem;
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: all 300ms ease;
}
.feature-card:hover { box-shadow: none; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.6rem; color: var(--color-dark); }
.feature-card p { color: var(--color-info-dark); font-size: 0.9rem; }

.landing-footer { text-align: center; padding: 2rem; color: var(--color-info-dark); font-size: 0.85rem; }

/* ==============================================
   DARK MODE (colors.css)
   ============================================== */
body.dark-mode { background-color: #121212; color: var(--color-white); }
body.dark-mode aside .sidebar { background: var(--color-dark); color: var(--color-white); }
body.dark-mode aside .sidebar a { color: var(--color-info-dark); }
body.dark-mode aside .sidebar a.active { background-color: var(--color-light); color: var(--color-primary); }
body.dark-mode aside .sidebar a.active:before { background: var(--color-primary); }
body.dark-mode aside .sidebar a.active span { color: var(--color-primary); }
body.dark-mode aside .sidebar a:hover { color: var(--color-primary); }

body.dark-mode .recent-documents table,
body.dark-mode .documents table {
    background-color: #2e2e2e;
    color: #f1f1f1;
    border: 1px solid #444444;
    box-shadow: none;
}

body.dark-mode .search-bar,
body.dark-mode .filter-bar select {
    background-color: #2e2e2e;
    border: 1px solid #444444;
    color: #f1f1f1;
    box-shadow: none;
}

body.dark-mode a { color: #66b3ff; box-shadow: none; }
body.dark-mode a:hover { color: #cfcfcf; box-shadow: none; }

body.dark-mode .calendar-day { color: #f1f1f1; }
body.dark-mode .calendar-day:hover { background-color: #444444; }
body.dark-mode .calendar-day.current-day { background-color: var(--color-primary); color: var(--color-white); }
body.dark-mode .calendar-weekdays { color: #ffffff; }
body.dark-mode .calendar-title { color: #f1f1f1; }
body.dark-mode .prev-month,
body.dark-mode .next-month { background: var(--color-primary); color: var(--color-white); }

body.dark-mode .settings-category {
    background-color: #2e2e2e;
    color: #fff;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}
body.dark-mode .settings-category h2 { color: #fff; border-color: #555; }

/* ==============================================
   UTILITIES
   ============================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ==============================================
   UPLOAD CARD
   ============================================== */
.upload-card {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    max-width: 600px;
    margin-top: 1rem;
}

.upload-card input[type="file"] {
    padding: 0.6rem;
    font-family: 'Poppins', sans-serif;
}

/* ==============================================
   BUTTON BAR – STYLED BUTTONS
   ============================================== */
.btn-reset,
.btn-filter,
.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 10px 15px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}

.btn-reset {
    background-color: #6c757d;
    color: white;
}
.btn-reset:hover { background-color: #5a6268; }

.btn-filter {
    background-color: var(--color-primary);
    color: white;
}
.btn-filter:hover { background-color: #155a8e; }

.btn-upload {
    background-color: var(--color-secondary);
    color: white;
}
.btn-upload:hover { background-color: #79b245; }

/* ==============================================
   STATUS BADGES
   ============================================== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}
.status-badge.status-active { background: #d4edda; color: #155724; }
.status-badge.status-pending-review { background: #fff3cd; color: #856404; }
.status-badge.status-archived { background: #e2e3e5; color: #383d41; }
.status-badge.status-expired { background: #f8d7da; color: #721c24; }

/* ==============================================
   SHOW ALL LINK
   ============================================== */
.show-all {
    float: right;
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 500;
}
.show-all:hover { text-decoration: underline; }

/* ==============================================
   DONUT CHART CONTAINER
   ============================================== */
.donut-chart {
    width: 100%;
    max-width: 280px;
    margin: 1rem auto 0;
}

.item.online {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.item.online .icon {
    background: var(--color-primary);
    padding: 0.6rem;
    border-radius: 50%;
    color: var(--color-white);
    display: flex;
}

/* ==============================================
   DARK MODE – ADDITIONAL
   ============================================== */
body.dark-mode main {
    background: #1e1e1e;
    box-shadow: none;
}
body.dark-mode .upload-card {
    background: #2e2e2e;
    box-shadow: none;
}
body.dark-mode .login-container {
    background: #2e2e2e;
    color: #f1f1f1;
}
body.dark-mode .login-container input {
    background: #3a3a3a;
    color: #f1f1f1;
    border-color: #555;
}

/* ==============================================
   ADMIN PANEL
   ============================================== */

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-light);
    margin-bottom: 2rem;
}
.admin-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.4rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-info-dark);
    border-bottom: 3px solid transparent;
    transition: all 200ms ease;
    background: none;
    font-family: 'Poppins', sans-serif;
}
.admin-tab:hover { color: var(--color-primary); }
.admin-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}
.admin-tab .material-symbols-sharp { font-size: 1.2rem; }

/* Tab panels */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* Stat cards row */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.admin-stat-card {
    background: var(--color-white);
    padding: 1.4rem;
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: all 300ms ease;
}
.admin-stat-card:hover { box-shadow: none; }
.admin-stat-card .stat-icon {
    background: var(--color-primary);
    color: var(--color-white);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
}
.admin-stat-card .stat-icon .material-symbols-sharp { font-size: 1.3rem; }
.admin-stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-dark);
}
.admin-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--color-info-dark);
    margin-top: 0.2rem;
}

/* Admin table */
.admin-table {
    width: 100%;
    border-radius: var(--border-radius-3);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    background: var(--color-white);
}
.admin-table th {
    background: var(--color-background);
    padding: 0.9rem 1rem;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-dark);
}
.admin-table td {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-light);
    color: var(--color-dark-variant);
}
.admin-table tr:last-child td { border-bottom: none; }

.admin-actions { display: flex; gap: 0.5rem; }
.admin-actions .btn { padding: 5px 12px; font-size: 0.78rem; }

/* Section card */
.admin-section {
    background: var(--color-white);
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    padding: 1.6rem;
    margin-bottom: 1.6rem;
}
.admin-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.admin-section p.desc {
    color: var(--color-info-dark);
    font-size: 0.83rem;
    margin-bottom: 1.2rem;
}

/* Monitoring cards */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.6rem;
}
.monitoring-card {
    background: var(--color-white);
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    padding: 1.4rem;
}
.monitoring-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.monitoring-card .material-symbols-sharp { font-size: 1.2rem; color: var(--color-primary); }

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.green { background: var(--color-success); }
.status-dot.red { background: #d65a5a; }

/* Storage bar */
.storage-bar {
    background: var(--color-background);
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
    margin: 0.6rem 0;
}
.storage-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 8px;
    transition: width 400ms ease;
}
.storage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--color-info-dark);
}

/* Auth provider cards */
.auth-providers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
}
.auth-provider-card {
    background: var(--color-white);
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-3);
    padding: 1.4rem;
    transition: all 200ms ease;
}
.auth-provider-card:hover { box-shadow: var(--box-shadow); }
.auth-provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}
.auth-provider-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.auth-provider-card p.desc {
    color: var(--color-info-dark);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.auth-provider-card .form-group { margin-bottom: 0.8rem; }
.auth-provider-card .form-group label { font-size: 0.8rem; margin-bottom: 0.3rem; }
.auth-provider-card .form-group input { padding: 8px; font-size: 0.85rem; }

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-success); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Admin section header with button */
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

/* Form grid (2-col) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-grid .full-width { grid-column: 1 / -1; }

/* Dark mode admin */
body.dark-mode .admin-tab { color: var(--color-info-dark); }
body.dark-mode .admin-tab.active { color: var(--color-primary); }
body.dark-mode .admin-stat-card,
body.dark-mode .admin-table,
body.dark-mode .admin-section,
body.dark-mode .monitoring-card,
body.dark-mode .auth-provider-card {
    background: #2e2e2e;
    color: #f1f1f1;
    box-shadow: none;
}
body.dark-mode .admin-table th { background: #1e1e1e; color: #f1f1f1; }
body.dark-mode .admin-table td { color: #ccc; border-color: #444; }
body.dark-mode .auth-provider-card { border-color: #444; }

/* ==============================================
   KNOWLEDGE BASE
   ============================================== */
.kb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.kb-search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 500px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-light);
    border-radius: var(--border-radius-2);
    background: var(--color-white);
    box-shadow: var(--box-shadow);
}
.kb-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.4rem;
    font-size: 0.9rem;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    color: var(--color-dark);
}
.kb-search .material-symbols-sharp {
    color: var(--color-info-dark);
    font-size: 1.3rem;
}

/* Category pills */
.kb-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}
.kb-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 200ms ease;
    border: 1px solid var(--color-light);
    background: var(--color-white);
    color: var(--color-dark-variant);
    font-family: 'Poppins', sans-serif;
}
.kb-cat-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.kb-cat-pill.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.kb-cat-pill .material-symbols-sharp { font-size: 1rem; }

/* Stats row */
.kb-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.8rem;
}
.kb-stat-card {
    background: var(--color-white);
    padding: 1.2rem;
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.kb-stat-card .stat-icon {
    background: var(--color-primary);
    color: var(--color-white);
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kb-stat-card .stat-icon .material-symbols-sharp { font-size: 1.2rem; }
.kb-stat-card .stat-info .stat-value { font-size: 1.3rem; font-weight: 700; }
.kb-stat-card .stat-info .stat-label { font-size: 0.75rem; color: var(--color-info-dark); }

/* Article grid */
.kb-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.4rem;
}
.kb-article-card {
    background: var(--color-white);
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    padding: 1.4rem;
    transition: all 300ms ease;
    display: flex;
    flex-direction: column;
}
.kb-article-card:hover { box-shadow: none; transform: translateY(-2px); }

.kb-article-card .kb-card-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}
.kb-article-card .kb-card-cat .material-symbols-sharp { font-size: 0.9rem; }

.kb-article-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-dark);
}
.kb-article-card .kb-card-excerpt {
    font-size: 0.82rem;
    color: var(--color-dark-variant);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 1rem;
}
.kb-article-card .kb-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-info-dark);
    border-top: 1px solid var(--color-light);
    padding-top: 0.8rem;
}
.kb-card-meta span { display: flex; align-items: center; gap: 0.25rem; }
.kb-card-meta .material-symbols-sharp { font-size: 0.95rem; }

/* ===== Modal Overlay ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--color-white);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.8rem;
}
.modal-content.modal-large {
    width: 680px;
}
.modal-content.modal-small {
    width: 400px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-dark);
}
.modal-close {
    background: none !important;
    border: none !important;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-dark-variant);
    padding: 0.2rem 0.5rem;
    line-height: 1;
}
.modal-close:hover {
    color: var(--color-danger);
}
.modal-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ===== KB Modal Body ===== */
.kb-modal-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--color-info-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--color-light);
}
.kb-modal-meta .material-symbols-sharp { font-size: 1rem; }
.kb-modal-body { line-height: 1.7; color: var(--color-dark); }
.kb-modal-body h4 { margin: 1rem 0 0.5rem; color: var(--color-dark); }
.kb-modal-body ul, .kb-modal-body ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.kb-modal-body li { margin-bottom: 0.3rem; }

/* ===== Document Actions ===== */
.doc-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.action-icon {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--border-radius-1);
    color: var(--color-dark-variant);
    display: flex;
    align-items: center;
}
.action-icon:hover {
    background: var(--color-light) !important;
    color: var(--color-primary);
}
.action-icon.action-danger:hover {
    color: var(--color-danger);
}

/* ===== Modal Form ===== */
.modal-content .form-group {
    margin-bottom: 1rem;
}
.modal-content .form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--color-dark);
}
.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-light) !important;
    border-radius: var(--border-radius-1);
    font-size: 0.9rem;
    background: var(--color-background);
    color: var(--color-dark);
    appearance: auto !important;
}

/* ==============================================
   Profile Overlay (slide-in panel)
   ============================================== */
.profile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}
.profile-overlay.active { display: block; }
.profile-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35);
}
.profile-overlay-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 92vw;
    height: 100%;
    background: var(--color-white);
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    animation: slideInRight .25s ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.profile-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--color-info-light);
}
.profile-overlay-header h3 { margin: 0; font-size: 1.1rem; }
.profile-overlay-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-dark);
    font-size: 1.4rem;
    padding: 0.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-overlay-close:hover { background: var(--color-background); }
.profile-overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.4rem;
}
.profile-overlay-body hr {
    border: none;
    border-top: 1px solid var(--color-info-light);
    margin: 1rem 0;
}
.profile-field {
    margin-bottom: 1rem;
}
.profile-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--color-dark);
}
.profile-field input[type="text"],
.profile-field input[type="email"],
.profile-field input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-1);
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--color-white);
    transition: border-color .15s;
}
.profile-field input:focus {
    outline: none;
    border-color: var(--color-primary);
}
.profile-field input:disabled {
    background: var(--color-background);
    cursor: not-allowed;
}
.profile-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 1.2rem;
}
.profile-actions .btn-cancel {
    padding: 0.55rem 1.2rem;
    border: 1px solid var(--color-info-light);
    background: var(--color-white);
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-size: 0.85rem;
}
.profile-actions .btn-save {
    padding: 0.55rem 1.4rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.profile-actions .btn-save:hover { opacity: 0.9; }
.profile-overlay-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--color-info-light);
}
.profile-logout-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-danger);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
}
.profile-logout-link:hover { opacity: 0.8; }

/* Supervisor key in profile overlay */
.supervisor-key-display {
    background: #fff8f0;
    padding: 0.8rem;
    border-radius: var(--border-radius-1);
    border: 1px solid #fde8d0;
}
.supervisor-key-value {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-dark);
    background: transparent;
    padding: 0;
}
.copy-key-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-info-dark);
    padding: 0.3rem;
    border-radius: 4px;
    transition: color .15s;
}
.copy-key-btn:hover { color: var(--color-primary); }

/* === MFA / Two-Factor Authentication === */
.mfa-section {
    margin-bottom: 1rem;
}
.mfa-section > label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}
.mfa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--border-radius-1);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}
.mfa-badge-on {
    background: #e8f5e9;
    color: #2e7d32;
}
.mfa-badge-off {
    background: #fff3e0;
    color: #e65100;
}
.btn-mfa-enable,
.btn-mfa-confirm {
    padding: 0.45rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
}
.btn-mfa-enable:hover,
.btn-mfa-confirm:hover { opacity: 0.9; }
.btn-mfa-disable {
    padding: 0.45rem 1rem;
    background: none;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: var(--border-radius-1);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
}
.btn-mfa-disable:hover { background: #ffebee; }
.mfa-qr-wrap {
    display: flex;
    justify-content: center;
    padding: 0.8rem;
    background: #fff;
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-1);
    margin-bottom: 0.6rem;
}
.mfa-qr-wrap svg {
    width: 200px;
    height: 200px;
}
.mfa-manual-key {
    font-size: 0.8rem;
    background: var(--color-background);
    padding: 0.5rem 0.7rem;
    border-radius: var(--border-radius-1);
    margin-bottom: 0.5rem;
    word-break: break-all;
}
.mfa-manual-key code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-dark);
    font-size: 0.85rem;
}
.mfa-confirm-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.4rem;
}
.mfa-code-input {
    width: 120px;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-1);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    text-align: center;
}
.mfa-code-input:focus {
    outline: none;
    border-color: var(--color-primary);
}
.mfa-recovery-box {
    background: #fffde7;
    border: 1px solid #fff9c4;
    border-radius: var(--border-radius-1);
    padding: 1rem;
}
.mfa-recovery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 1rem;
}
.mfa-recovery-grid code {
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 0.2rem 0;
}

/* ==============================================
   Supervisor Mode – Blurred content overlay
   ============================================== */

/* Supervisor banner at top of page */
.supervisor-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.supervisor-banner .material-symbols-sharp {
    font-size: 20px;
}
body.supervisor-mode {
    padding-top: 2.5rem;
}
body.supervisor-mode .container {
    margin-top: 0;
}

/* Blur sensitive content – everything inside main except h1 and profile bar */
body.supervisor-mode .blur-content {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
    position: relative;
}
body.supervisor-mode .blur-content::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    border-radius: var(--border-radius-2);
    z-index: 1;
}

/* Blur entire tables, charts, form data */
body.supervisor-mode .insights,
body.supervisor-mode .recent-documents table tbody,
body.supervisor-mode .kb-articles,
body.supervisor-mode .kb-stats,
body.supervisor-mode .admin-panel,
body.supervisor-mode .upload-form-content {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

/* Keep navigation, headers, structure visible */
body.supervisor-mode aside,
body.supervisor-mode .right,
body.supervisor-mode main > h1,
body.supervisor-mode .admin-tabs,
body.supervisor-mode .recent-documents h2,
body.supervisor-mode .recent-documents .show-all,
body.supervisor-mode .recent-documents table thead {
    filter: none !important;
    pointer-events: auto;
    user-select: auto;
}

/* Supervisor badge in sidebar */
.supervisor-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius-1);
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.supervisor-badge .material-symbols-sharp {
    font-size: 16px;
}

/* Login page – supervisor divider & form */
.supervisor-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 0.8rem;
}
.supervisor-divider::before,
.supervisor-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-info-light);
}
.supervisor-divider span {
    font-size: 0.75rem;
    color: var(--color-info-dark);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.supervisor-login-form input {
    text-align: center;
    letter-spacing: 4px;
    font-size: 1.1rem;
    font-weight: 600;
}
.btn-supervisor {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-supervisor:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
}
.modal-content .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.kb-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    transition: gap 200ms ease;
}
.kb-read-more:hover { gap: 0.6rem; }
.kb-read-more .material-symbols-sharp { font-size: 1rem; }

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}
.role-badge.role-admin   { background: #dbeafe; color: #1e40af; }
.role-badge.role-manager { background: #fef3c7; color: #92400e; }
.role-badge.role-editor  { background: #d1fae5; color: #065f46; }
.role-badge.role-reader  { background: #f3e8ff; color: #6b21a8; }

/* Dark mode KB */
body.dark-mode .kb-search { background: #2e2e2e; border-color: #444; }
body.dark-mode .kb-search input { color: #f1f1f1; }
body.dark-mode .kb-cat-pill { background: #2e2e2e; border-color: #444; color: #ccc; }
body.dark-mode .kb-cat-pill.active { background: var(--color-primary); color: #fff; }
body.dark-mode .kb-stat-card,
body.dark-mode .kb-article-card { background: #2e2e2e; box-shadow: none; color: #f1f1f1; }
body.dark-mode .kb-article-card h3 { color: #f1f1f1; }
body.dark-mode .kb-article-card .kb-card-meta { border-color: #444; }

/* ==============================================
   PERMISSIONS MATRIX
   ============================================== */
.perm-section { margin-bottom: 2rem; }
.perm-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-dark);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    margin-bottom: 0;
}
.perm-section-title .material-symbols-sharp { font-size: 1.2rem; color: var(--color-primary); }

.perm-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.perm-matrix thead th {
    padding: 0.7rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    background: var(--color-background);
    color: var(--color-dark-variant);
    border-bottom: 1px solid var(--color-light);
}
.perm-matrix thead th:first-child { text-align: left; width: 40%; }
.perm-matrix tbody td {
    padding: 0.55rem 0.6rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    color: var(--color-dark);
}
.perm-matrix tbody td:first-child {
    text-align: left;
    font-weight: 500;
}
.perm-matrix tbody tr:hover { background: #f8fafc; }

/* Styled checkboxes */
.perm-check {
    width: 1.3rem;
    height: 1.3rem;
    accent-color: var(--color-primary);
    cursor: pointer;
    transform: scale(1.15);
    appearance: auto;
    -webkit-appearance: checkbox;
}
.perm-check:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* User overrides panel */
.perm-user-panel {
    background: var(--color-white);
    border-radius: var(--border-radius-3);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-top: 2rem;
}
.perm-user-select {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}
.perm-user-select select {
    flex: 1;
    max-width: 350px;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--color-info-light);
    border-radius: var(--border-radius-1);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: var(--color-dark);
    background: var(--color-white);
}
.perm-override-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
}

/* Save bar */
.perm-save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-light);
}

/* Dark mode permissions */
body.dark-mode .perm-section-title { color: #f1f1f1; border-color: var(--color-primary); }
body.dark-mode .perm-matrix thead th { background: #1e1e1e; color: #ccc; border-color: #444; }
body.dark-mode .perm-matrix tbody td { color: #eee; border-color: #333; }
body.dark-mode .perm-matrix tbody tr:hover { background: #353535; }
body.dark-mode .perm-user-panel { background: #2e2e2e; box-shadow: none; }
body.dark-mode .perm-user-select select { background: #1e1e1e; color: #f1f1f1; border-color: #444; }