:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #202124;
    --muted: #6b6f76;
    --line: #dbe2ea;
    --accent: #0f8f83;
    --accent-dark: #0d6f67;
    --warm: #d45d2f;
    --soft: #e7f5f2;
    --nav: #1f2933;
    --nav-soft: #2e3b47;
    --shadow: 0 18px 45px rgba(31, 41, 51, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15, 143, 131, 0.08), transparent 36%),
        linear-gradient(315deg, rgba(212, 93, 47, 0.08), transparent 34%),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(110deg, rgba(15, 118, 110, 0.16), transparent 42%),
        linear-gradient(250deg, rgba(194, 65, 12, 0.13), transparent 40%),
        var(--bg);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 430px);
    gap: 28px;
    width: min(1040px, 100%);
    align-items: center;
}

.login-copy h1,
.panel-intro h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 5vw, 4.7rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.login-copy p,
.panel-intro p {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.7;
}

.eyebrow {
    margin: 0;
    color: var(--warm);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-card,
.panel,
.stats-grid article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-card {
    padding: 28px;
}

.login-card h2,
.panel h2 {
    margin: 0;
    font-size: 1.25rem;
}

label {
    display: block;
    margin: 18px 0 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

textarea {
    min-height: 96px;
    padding: 12px 14px;
    resize: vertical;
}

select {
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(15, 118, 110, 0.16);
}

button {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

.danger-button {
    min-height: 36px;
    padding: 0 12px;
    background: #b42318;
}

.danger-button:hover {
    background: #8f1f17;
}

.login-card button {
    width: 100%;
    margin-top: 22px;
}

.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff1f0;
    color: #a32d20;
    border: 1px solid #ffc9c2;
}

.inline-alert,
.success {
    margin: 14px 18px 0;
}

.standalone {
    margin: 0 0 16px;
}

.success {
    padding: 12px 14px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
    font-weight: 700;
}

.demo-logins {
    display: grid;
    gap: 7px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.demo-logins strong {
    color: var(--ink);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 14px clamp(18px, 5vw, 54px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.topbar > div,
.topbar nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    font-weight: 900;
}

.role-pill,
.mini-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    background: var(--soft);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.mini-pill {
    min-height: 24px;
}

.topbar a {
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
}

.app-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    padding: 22px;
    background: linear-gradient(180deg, var(--nav), #18212b);
    color: #f8fafc;
}

.sidebar-brand,
.sidebar-profile {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand-mark,
.avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 900;
}

.brand-mark {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, #0f8f83, #23b6a7 52%, #d45d2f);
    box-shadow: 0 14px 28px rgba(15, 143, 131, 0.28);
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 6px;
}

.brand-mark span {
    position: relative;
    z-index: 1;
    font-size: 1.25rem;
    letter-spacing: 0;
}

.sidebar-brand strong,
.sidebar-profile strong {
    display: block;
    line-height: 1.2;
}

.sidebar-brand span,
.sidebar-profile span {
    display: block;
    margin-top: 4px;
    color: #b9c4cf;
    font-size: 0.84rem;
}

.sidebar-nav {
    display: grid;
    align-content: start;
    gap: 8px;
    margin-top: 34px;
}

.sidebar-nav a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    border-radius: 8px;
    padding: 0 14px;
    color: #d8e0e8;
    font-weight: 800;
    text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--nav-soft);
    color: #fff;
}

.sidebar-nav a.active {
    box-shadow: inset 4px 0 0 var(--accent);
}

.sidebar-nav a.has-unread {
    background: rgba(212, 93, 47, 0.18);
    color: #fff;
    box-shadow: inset 4px 0 0 var(--warm);
}

.nav-badge,
.chat-badge {
    display: none;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    padding: 0 7px;
    background: var(--warm);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1;
}

.sidebar-profile {
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar {
    width: 40px;
    height: 40px;
    background: #fff;
    color: var(--nav);
}

.content-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 28px;
}

.content-topbar > div {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.content-topbar strong {
    color: var(--muted);
    font-size: 0.92rem;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    color: var(--nav);
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.dashboard {
    width: min(1220px, calc(100% - 44px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.panel-intro {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 20px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(15, 143, 131, 0.13), transparent 48%),
        linear-gradient(270deg, rgba(212, 93, 47, 0.12), transparent 38%),
        #fff;
    box-shadow: var(--shadow);
}

.panel-intro h1 {
    font-size: clamp(2rem, 4vw, 3.75rem);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stats-grid article {
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.stats-grid article::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 18px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--soft);
}

.stats-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.stats-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--nav);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.quick-actions a {
    display: flex;
    align-items: center;
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 18px;
    background: #fff;
    color: var(--nav);
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 14px 36px rgba(31, 41, 51, 0.08);
}

.quick-actions a:hover {
    border-color: rgba(15, 143, 131, 0.35);
    color: var(--accent-dark);
}

.dashboard-entry-panel {
    margin-bottom: 16px;
}

.dashboard-entry-table {
    min-width: 860px;
}

.entry-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.detail-table-wrap {
    overflow-x: auto;
}

.detail-table th {
    width: 180px;
    color: var(--muted);
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.detail-table td {
    min-width: 240px;
}

.entry-view-update {
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    background: #fbfcfd;
}

.entry-view-update label {
    margin-top: 0;
}

.entry-chat-panel {
    grid-column: 2;
    grid-row: 1;
}

.entry-admin-update-panel {
    grid-column: 1;
    grid-row: 2;
}

.entry-chat-messages {
    height: 310px;
    overflow-y: auto;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(15, 143, 131, 0.05), transparent 30%),
        #f8fafc;
}

.entry-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
    gap: 16px;
    align-items: start;
}

.entries-section {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.wallet-section {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.wallet-request-form {
    display: grid;
    grid-template-columns: 140px 220px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.qr-payment-box {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.qr-frame {
    display: grid;
    place-items: center;
    width: 148px;
    height: 148px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
}

.qr-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-frame span {
    display: none;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-weight: 900;
    line-height: 1.45;
    text-align: center;
}

.qr-payment-box p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.qr-admin-box {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.qr-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.qr-upload-form label {
    margin-top: 0;
}

.wallet-request-form label {
    margin-top: 0;
}

.wallet-request-table {
    min-width: 920px;
}

.wallet-review-form {
    display: grid;
    gap: 8px;
    min-width: 230px;
}

.review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.review-actions button {
    min-height: 36px;
    padding: 0 10px;
}

.entry-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
    background: #fbfcfd;
}

.entry-form label,
.entry-update-form label {
    margin-top: 0;
}

.full-field {
    grid-column: 1 / -1;
}

.entry-form button {
    width: max-content;
    min-width: 150px;
}

.form-cancel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 900;
    text-decoration: none;
    background: #fff;
}

.entry-actions-stack {
    display: grid;
    gap: 10px;
    min-width: 220px;
}

.entry-list {
    display: grid;
    gap: 14px;
    padding: 18px;
    background: #f8fafc;
}

.entry-table-wrap {
    background: #fff;
}

.entry-table {
    min-width: 1180px;
}

.entry-table th,
.entry-table td {
    vertical-align: top;
}

.table-link {
    color: var(--accent-dark);
    font-weight: 900;
    text-decoration: none;
}

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

.table-update-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.table-update-form select,
.table-update-form textarea {
    min-height: 38px;
    font-size: 0.9rem;
}

.table-update-form textarea {
    min-height: 64px;
}

.table-update-form button {
    min-height: 38px;
}

.entry-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(31, 41, 51, 0.05);
}

.entry-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}

.entry-card h3,
.entry-card p {
    margin: 0;
}

.entry-card h3 {
    font-size: 1.02rem;
}

.entry-card-head p,
.entry-detail,
.entry-meta {
    color: var(--muted);
}

.entry-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.entry-detail-grid span {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    color: var(--muted);
    line-height: 1.45;
}

.entry-detail-grid strong {
    color: var(--nav);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.entry-detail-grid .wide {
    grid-column: 1 / -1;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.86rem;
}

.entry-meta a {
    color: var(--accent-dark);
    font-weight: 900;
    text-decoration: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-pending {
    background: #fff7ed;
    color: #c2410c;
}

.status-in_review {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-approved {
    background: #ecfdf5;
    color: #047857;
}

.status-rejected {
    background: #fff1f0;
    color: #b42318;
}

.admin-note {
    padding: 12px 14px;
    border-radius: 8px;
    background: #f5f7fa;
    border: 1px solid var(--line);
}

.admin-note strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.84rem;
}

.entry-update-form {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.entry-update-form textarea {
    min-height: 74px;
}

.empty-state {
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.panel {
    overflow: hidden;
    box-shadow: 0 14px 36px rgba(31, 41, 51, 0.08);
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    min-height: 68px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.panel-heading span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

.operator-form,
.wallet-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
    padding: 4px 20px 20px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.wallet-form {
    grid-template-columns: minmax(0, 1fr) 140px auto;
}

.operator-form label,
.wallet-form label {
    margin-top: 16px;
}

.operator-form button,
.wallet-form button {
    white-space: nowrap;
}

.rate-form {
    display: grid;
    grid-template-columns: 110px auto;
    gap: 8px;
    align-items: center;
    min-width: 190px;
}

.rate-form input,
.rate-form button {
    min-height: 36px;
}

.rate-form button {
    padding: 0 12px;
}

.rate-grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr)) auto;
    gap: 8px;
    align-items: end;
    min-width: 540px;
}

.rate-grid-form label {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.rate-grid-form input,
.rate-grid-form button {
    min-height: 36px;
}

.rate-grid-form button {
    padding: 0 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    background: #f8fafc;
    letter-spacing: 0.04em;
}

tbody tr:hover {
    background: #f8fbfb;
}

.chat-panel {
    min-height: 560px;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.chat-messages {
    height: 410px;
    overflow-y: auto;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(15, 143, 131, 0.05), transparent 30%),
        #f8fafc;
}

.chat-message {
    width: min(82%, 420px);
    margin-bottom: 12px;
    padding: 13px 15px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 41, 51, 0.06);
}

.chat-message.mine {
    margin-left: auto;
    background: #dcf7f2;
    border-color: rgba(15, 143, 131, 0.24);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
}

.message-meta strong {
    color: var(--ink);
}

.chat-message p {
    margin: 8px 0 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.entry-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1200;
    display: grid;
    gap: 12px;
    place-items: center;
    width: min(460px, calc(100vw - 32px));
    min-height: 220px;
    padding: 34px 30px 28px;
    border: 1px solid rgba(15, 143, 131, 0.3);
    border-top: 6px solid var(--accent);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(31, 41, 51, 0.22);
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -46%) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.entry-notification.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    animation: entryNotifyBlink 1s ease-in-out infinite;
}

.entry-notification strong {
    color: var(--ink);
    font-size: 1.45rem;
    letter-spacing: 0.04em;
}

.entry-notification span {
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 900;
}

.entry-notification a {
    width: max-content;
    color: var(--accent);
    font-weight: 900;
    text-decoration: none;
}

.entry-notification-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    border-radius: 999px;
    background: #eef6f5;
    color: var(--ink);
    box-shadow: none;
}

@keyframes entryNotifyBlink {
    0%,
    100% {
        border-color: rgba(15, 143, 131, 0.3);
        box-shadow: 0 24px 70px rgba(31, 41, 51, 0.22);
    }
    50% {
        border-color: rgba(212, 93, 47, 0.74);
        box-shadow: 0 24px 70px rgba(212, 93, 47, 0.34);
    }
}

.floating-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
}

.chat-launcher {
    position: relative;
    display: none;
    min-width: 92px;
    min-height: 48px;
    box-shadow: 0 16px 32px rgba(15, 143, 131, 0.28);
}

.chat-launcher.has-unread {
    background: var(--warm);
    box-shadow: 0 18px 38px rgba(212, 93, 47, 0.34);
}

.chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    border: 2px solid #fff;
}

.floating-chat.is-minimized .chat-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.floating-chat-box {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: min(390px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(31, 41, 51, 0.24);
}

.floating-chat.is-minimized .floating-chat-box {
    display: none;
}

.floating-chat-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: var(--nav);
    color: #fff;
}

.floating-chat-header strong,
.floating-chat-header span {
    display: block;
}

.floating-chat-header span {
    margin-top: 3px;
    color: #b9c4cf;
    font-size: 0.82rem;
}

.floating-chat-header button {
    min-width: 36px;
    min-height: 34px;
    padding: 0;
    background: rgba(255, 255, 255, 0.14);
}

.floating-chat-header button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.floating-chat-operator {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.floating-chat-operator label {
    margin: 0;
    font-size: 0.78rem;
}

.floating-chat-operator select {
    min-height: 40px;
}

.floating-chat-messages {
    overflow-y: auto;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(15, 143, 131, 0.05), transparent 30%),
        #f8fafc;
}

.floating-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}

.floating-chat-form button {
    padding: 0 14px;
}

.chat-empty {
    padding: 14px;
}

@media (max-width: 1100px) {
    .app-layout {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        grid-template-rows: auto auto auto;
        gap: 18px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 0;
    }

    .dashboard {
        width: min(100% - 28px, 760px);
        padding-top: 20px;
    }

    .login-shell,
    .workspace-grid,
    .entry-view-grid,
    .stats-grid,
    .entry-form,
    .entry-detail-grid,
    .entry-update-form,
    .operator-form,
    .wallet-form,
    .wallet-request-form {
        grid-template-columns: 1fr;
    }

    .rate-grid-form {
        grid-template-columns: 1fr 1fr;
        min-width: 0;
    }

    .qr-payment-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .qr-admin-box,
    .qr-upload-form {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .chat-panel {
        min-height: 520px;
    }
}

@media (max-width: 540px) {
    .auth-page {
        padding: 16px;
    }

    .login-card {
        padding: 20px;
    }

    .sidebar {
        padding: 18px;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .content-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-intro {
        padding: 20px;
    }

    .chat-form {
        grid-template-columns: 1fr;
    }

    .floating-chat {
        right: 12px;
        bottom: 12px;
    }

    .entry-notification {
        width: calc(100vw - 24px);
        min-height: 190px;
        padding: 30px 22px 24px;
    }

    .floating-chat-box {
        width: calc(100vw - 24px);
        height: min(540px, calc(100vh - 24px));
    }

    .entry-chat-panel {
        grid-column: auto;
    }

    .entry-chat-form {
        grid-template-columns: 1fr;
    }

    .rate-grid-form {
        grid-template-columns: 1fr;
    }

    .chat-message {
        width: 100%;
    }
}
