
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f7f5fb;
    --panel: #ffffff;
    --text: #21172a;
    --muted: #81758d;
    --line: #ece5f2;
    --primary: #8652e8;
    --primary-dark: #6940ce;
    --danger: #d83c56;
    --success: #15845d;
    --shadow: 0 10px 28px rgba(36, 16, 54, .055);

    --sidebar-bg: #1a0f25;
    --sidebar-text: #d9cde5;
    --gradient: linear-gradient(110deg, #5865ff 0%, #b36bff 100%);
    --sidebar-width: 248px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", "Inter", system-ui, -apple-system,
                 "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    transition: color .18s ease,
                background .18s ease,
                border-color .18s ease,
                box-shadow .18s ease;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* ==================== FIXED SIDEBAR ==================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;

    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;

    padding: 26px 17px;
    background: var(--sidebar-bg);
    color: #fff;

    display: flex;
    flex-direction: column;
    flex-shrink: 0;

    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color: #574365 var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar-thumb {
    background: #574365;
    border-radius: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 9px 30px;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--gradient);
    box-shadow: 0 5px 16px rgba(139, 53, 232, .24);
}

.brand small {
    display: block;
    color: #b9a5ca;
    font-size: 11px;
    margin-top: 3px;
    font-weight: 500;
}

.nav-label {
    padding: 8px 12px;
    color: #a18caf;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 11px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin: 3px 0;
    flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 5px 15px rgba(139, 53, 232, .18);
}

.nav-icon {
    width: 22px;
    flex-shrink: 0;
    text-align: center;
    font-size: 17px;
}

.nav-count {
    margin-left: auto;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: #ffb8c4;
    color: #451626;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Keep the bottom section at the sidebar's bottom */
.sidebar-bottom {
    margin-top: auto;
    padding: 16px 12px 0;
    border-top: 1px solid #3b2a48;
    color: #b9a9c6;
    font-size: 12px;
    line-height: 1.6;
    flex-shrink: 0;
}

.sidebar-bottom strong {
    color: #fff;
    display: block;
    font-weight: 600;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 11px 12px;
    border: 1px solid #454663;
    border-radius: 10px;
    color: #ffb9c2;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.logout-button:hover {
    background: #3b263f;
    color: #ffffff;
    border-color: #75516d;
}

.logout-button span {
    font-size: 18px;
}

/* ==================== MAIN CONTENT ==================== */

.main {
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 34px 42px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 27px;
}

.eyebrow {
    font-size: 11px;
    color: #9561d7;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.topbar h1 {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.65px;
    margin: 0;
}

.welcome {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.7;
}

.admin-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 9px 13px;
    flex-shrink: 0;
}

.avatar {
    display: grid;
    place-items: center;
    width: 37px;
    height: 37px;
    border-radius: 12px;
    background: #f0e5ff;
    color: var(--primary);
    font-weight: 700;
}

.admin-pill strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.admin-pill small {
    color: var(--muted);
    font-size: 11px;
}

/* ==================== NOTIFICATIONS ==================== */

.flash {
    padding: 13px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 500;
}

.flash.success {
    background: #e6f7ef;
    color: #126c4b;
    border: 1px solid #c8ead9;
}

.flash.error {
    background: #fff0f2;
    color: #a7233a;
    border: 1px solid #f2cbd3;
}

/* ==================== STATISTICS CARDS ==================== */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
    transition: box-shadow .18s ease, border-color .18s ease;
}

.stat:hover {
    border-color: #ded0f0;
    box-shadow: 0 12px 30px rgba(36, 16, 54, .08);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #f0e5ff;
    color: #8652e8;
    flex-shrink: 0;
}

.stat:nth-child(2) .stat-icon {
    background: #e5f8ef;
    color: #16845d;
}

.stat:nth-child(3) .stat-icon {
    background: #fff1e4;
    color: #b86a1c;
}

.stat:nth-child(4) .stat-icon {
    background: #e7f3ff;
    color: #3177bb;
}

.stat-number {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.6px;
    margin-top: 13px;
}

.stat-note {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
}

/* ==================== SECTION TABS ==================== */

.section-tabs {
    display: flex;
    gap: 7px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    padding: 13px 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* ==================== CONTENT CARDS ==================== */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 21px 22px;
    border-bottom: 1px solid var(--line);
}

.card-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.25px;
}

.card-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

/* ==================== FILTERS AND SEARCH ==================== */

.filters {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
}

.search {
    display: flex;
    min-width: 220px;
    flex: 1;
    max-width: 380px;
}

.search input,
.filters select,
.log-search input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    outline: none;
    font-size: 12px;
}

.search input::placeholder,
.log-search input::placeholder {
    color: #a59aaa;
}

.search input:focus,
.filters select:focus,
.log-search input:focus {
    border-color: #b36bff;
    box-shadow: 0 0 0 3px rgba(179, 107, 255, .13);
}

/* ==================== BUTTONS ==================== */

.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 13px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 53, 232, .16);
}

.btn-primary:hover {
    background: linear-gradient(110deg, #4b58ed 0%, #a456f4 100%);
    box-shadow: 0 6px 16px rgba(139, 53, 232, .23);
}

.btn-light {
    background: #f3edf9;
    color: #68458b;
}

.btn-light:hover {
    background: #eae0f5;
}

.btn-danger {
    background: #fff0f2;
    color: #bb2e45;
}

.btn-danger:hover {
    background: #ffe0e5;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ==================== TABLES ==================== */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th {
    text-align: left;
    background: #faf7fc;
    color: #8a7e91;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    padding: 13px 20px;
}

td {
    padding: 15px 20px;
    border-top: 1px solid #f0eaf3;
    font-size: 12px;
}

tbody tr:hover {
    background: #fcf9ff;
}

/* ==================== USER INFORMATION ==================== */

.person {
    display: flex;
    align-items: center;
    gap: 10px;
}

.person-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #f0e5ff;
    color: #8652e8;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.person strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.person small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

/* ==================== ROLE LABELS ==================== */

.role {
    display: inline-flex;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.role.admin {
    background: #f0e5ff;
    color: #7d2bc7;
}

.role.user {
    background: #e6f7ef;
    color: #14794f;
}

/* ==================== ACTION CONTROLS ==================== */

.actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.actions form {
    display: inline;
}

.actions select {
    max-width: 95px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 11px;
    background: white;
    color: var(--text);
}

/* ==================== EMPTY STATES ==================== */

.empty {
    text-align: center;
    color: var(--muted);
    padding: 34px 18px;
}

/* ==================== PAGINATION ==================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 21px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.page-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.page-links a,
.page-links span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.page-links a:hover {
    background: #f4edf9;
    border-color: #d9c5f0;
}

.page-links .current {
    background: var(--gradient);
    border-color: transparent;
    color: white;
}

/* ==================== ACTIVITY LOGS ==================== */

.log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
}

.log-search {
    display: flex;
    gap: 8px;
    max-width: 420px;
    flex: 1;
}

.log-count {
    font-size: 11px;
    color: var(--muted);
}

.action-label {
    font-weight: 600;
    color: #5c3b78;
}

.log-details {
    max-width: 380px;
    white-space: normal;
    line-height: 1.5;
    color: var(--muted);
}

.footnote {
    color: var(--muted);
    font-size: 11px;
    padding: 15px 22px;
    line-height: 1.6;
}

/* ==================== OVERVIEW CARDS ==================== */

.overview-grid {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 15px;
}

.overview-item {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fdfbff;
}

.overview-item h3 {
    font-weight: 600;
}

.overview-item p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* ==================== FEEDBACK TOOLBAR ==================== */

.feedback-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.feedback-search {
    flex: 1;
    min-width: 200px;
}

.feedback-search input,
.feedback-toolbar select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    outline: none;
}

.feedback-toolbar select {
    width: auto;
    min-width: 145px;
}

.feedback-search input:focus,
.feedback-toolbar select:focus,
.feedback-update-form select:focus,
.feedback-update-form textarea:focus {
    border-color: #b36bff;
    box-shadow: 0 0 0 3px rgba(179, 107, 255, .13);
}

/* ==================== FEEDBACK REPORT CARDS ==================== */

.feedback-list {
    padding: 20px;
}

.feedback-item {
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.feedback-item:last-child {
    margin-bottom: 0;
}

.feedback-item:hover {
    border-color: #dac8f2;
    box-shadow: 0 8px 22px rgba(36, 16, 54, .045);
}

.feedback-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 15px;
}

.feedback-item-title {
    min-width: 0;
}

.feedback-type {
    display: inline-flex;
    padding: 5px 9px;
    margin-bottom: 9px;
    border-radius: 7px;
    background: #f1e8ff;
    color: #7741c5;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.feedback-item h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.feedback-meta {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.feedback-meta strong {
    color: #5c3b78;
}

.feedback-message {
    padding: 15px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: #faf7fc;
    color: #62566e;
    font-size: 12px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ==================== FEEDBACK STATUS LABELS ==================== */

.feedback-status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pending {
    background: #fff2dc;
    color: #9b6414;
}

.status-in_progress {
    background: #e8efff;
    color: #365db2;
}

.status-resolved {
    background: #e2f7ec;
    color: #16754e;
}

.status-closed {
    background: #eeeaf2;
    color: #706579;
}

/* ==================== FEEDBACK UPDATE FORM ==================== */

.feedback-update-form {
    display: grid;
    grid-template-columns: minmax(140px, .7fr) minmax(220px, 1.8fr);
    gap: 14px;
    align-items: start;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.feedback-update-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #746580;
    font-size: 11px;
    font-weight: 600;
}

.feedback-update-form select,
.feedback-update-form textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    outline: none;
}

.feedback-update-form textarea {
    resize: vertical;
    line-height: 1.6;
}

.feedback-update-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.feedback-updated {
    color: var(--muted);
    font-size: 10px;
}

.feedback-empty {
    padding: 50px 20px;
    text-align: center;
}

.feedback-empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #f1e8ff;
    color: var(--primary);
    font-size: 24px;
}

.feedback-empty h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.feedback-empty p {
    max-width: 420px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

/* ==================== ACTION CONFIRMATION MODAL ==================== */

.action-modal-overlay,
.logout-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.action-modal-overlay {
    z-index: 10000;
    background: rgba(22, 10, 35, .68);
}

.action-modal-overlay.show,
.logout-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.action-modal {
    width: 100%;
    max-width: 430px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(20, 8, 35, .3);
    text-align: center;
    transform: translateY(15px) scale(.97);
    transition: transform .2s ease;
}

.action-modal-overlay.show .action-modal {
    transform: translateY(0) scale(1);
}

.action-modal-icon {
    width: 65px;
    height: 65px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: #f1e8ff;
    color: var(--primary);
    font-size: 25px;
}

.action-modal-icon.danger {
    background: #fff0f2;
    color: var(--danger);
}

.action-modal h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 21px;
    font-weight: 700;
}

.action-modal p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.action-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 27px;
}

.action-cancel-btn,
.action-confirm-btn {
    flex: 1;
    min-height: 45px;
    padding: 12px 15px;
    border: 0;
    border-radius: 11px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.action-cancel-btn {
    background: #f3edf9;
    color: #68458b;
}

.action-cancel-btn:hover {
    background: #e8def3;
}

.action-confirm-btn {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 5px 14px rgba(134, 82, 232, .2);
}

.action-confirm-btn:hover {
    transform: translateY(-1px);
}

.action-modal-icon.danger ~ .action-modal-actions .action-confirm-btn {
    background: linear-gradient(110deg, #c92f49, #ef526a);
    box-shadow: 0 5px 14px rgba(216, 60, 86, .18);
}

.action-cancel-btn:focus-visible,
.action-confirm-btn:focus-visible {
    outline: 3px solid #c8a7ff;
    outline-offset: 3px;
}

/* ==================== LOGOUT CONFIRMATION MODAL ==================== */

.logout-modal-overlay {
    z-index: 9999;
    background: rgba(22, 10, 35, .65);
}

.logout-modal {
    width: 100%;
    max-width: 420px;
    padding: 30px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(20, 8, 35, .28);
    text-align: center;
    transform: translateY(15px) scale(.97);
    transition: transform .2s ease;
}

.logout-modal-overlay.show .logout-modal {
    transform: translateY(0) scale(1);
}

.logout-modal-icon {
    width: 65px;
    height: 65px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: #f2e8ff;
    color: var(--primary);
    font-size: 25px;
}

.logout-modal h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
}

.logout-modal p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.logout-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 27px;
}

.logout-cancel-btn,
.logout-confirm-btn {
    flex: 1;
    min-height: 45px;
    padding: 12px 15px;
    border: 0;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.logout-cancel-btn {
    background: #f3edf9;
    color: #68458b;
}

.logout-cancel-btn:hover {
    background: #e8def3;
}

.logout-confirm-btn {
    background: linear-gradient(110deg, #8652e8, #b36bff);
    color: #fff;
    box-shadow: 0 5px 14px rgba(134, 82, 232, .2);
}

.logout-confirm-btn:hover {
    background: linear-gradient(110deg, #6940ce, #9850e8);
    transform: translateY(-1px);
}

.logout-cancel-btn:focus-visible,
.logout-confirm-btn:focus-visible {
    outline: 3px solid #c8a7ff;
    outline-offset: 3px;
}

/* ==================== TABLET ==================== */

@media (max-width: 1100px) and (min-width: 761px) {
    :root {
        --sidebar-width: 220px;
    }

    .main {
        padding: 24px;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        align-items: flex-start;
    }
}

/* ==================== MOBILE NAVIGATION ==================== */

.mobile-menu {
    display: none;
}

.overlay {
    display: none;
}

@media (max-width: 760px) {
    :root {
        --sidebar-width: 248px;
    }

    .sidebar {
        left: calc(-1 * var(--sidebar-width) - 12px);
        width: var(--sidebar-width);
        transition: left .2s ease;
        z-index: 1000;
    }

    .sidebar.open {
        left: 0;
    }

    .main {
        width: 100%;
        margin-left: 0;
        padding: 18px 14px 30px;
    }

    .overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(10, 12, 30, .45);
        z-index: 999;
    }

    .topbar {
        align-items: flex-start;
        gap: 10px;
    }

    .topbar h1 {
        font-size: 23px;
    }

    .mobile-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--line);
        background: #fff;
        color: var(--primary);
        border-radius: 10px;
        padding: 9px 11px;
        margin-right: 8px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mobile-menu:hover {
        background: #f5effc;
    }

    .heading-row {
        display: flex;
        align-items: center;
    }

    .admin-pill {
        padding: 7px;
    }

    .admin-pill > div:last-child {
        display: none;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat {
        padding: 14px;
    }

    .stat-number {
        font-size: 25px;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
    }

    .card-head {
        align-items: flex-start;
        flex-direction: column;
        padding: 17px;
    }

    .filters {
        width: 100%;
    }

    .search {
        max-width: none;
        min-width: 0;
    }

    .filters select {
        width: auto;
        flex: 1;
    }

    .log-toolbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px;
    }

    .log-search {
        max-width: none;
        width: 100%;
    }

    .pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    td,
    th {
        padding: 13px 14px;
    }

    .feedback-toolbar {
        padding: 15px;
    }

    .feedback-search {
        flex-basis: 100%;
    }

    .feedback-toolbar select {
        flex: 1;
    }

    .feedback-list {
        padding: 12px;
    }

    .feedback-item {
        padding: 15px;
    }

    .feedback-item-head {
        flex-direction: column;
    }

    .feedback-update-form {
        grid-template-columns: 1fr;
    }

    .feedback-update-actions {
        grid-column: auto;
        align-items: flex-start;
        flex-direction: column;
    }

    .action-modal,
    .logout-modal {
        padding: 24px 20px;
    }
}

/* ==================== SMALL MOBILE ==================== */

@media (max-width: 420px) {
    .stat-number {
        font-size: 22px;
    }

    .stat-note {
        font-size: 10px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .action-modal-actions,
    .logout-modal-actions {
        flex-direction: column-reverse;
    }
}
