.admin-ui {
    --navy: #001b2d;
    --cyan: #00b3e4;
    --cyan-text: #006987;
    --admin-canvas: #f2f6fa;
    --admin-ink: #162b3c;
    --admin-muted: #536b80;
    --admin-line: #dce6ee;
    --admin-tint: #e4f5fa;
    --sidebar-width: 222px;
    --tblr-primary: #006987;
    --tblr-primary-rgb: 0, 105, 135;
    --tblr-body-color: var(--admin-ink);
    --tblr-body-bg: var(--admin-canvas);
    --tblr-border-color: var(--admin-line);
    --tblr-link-color-rgb: var(--tblr-primary-rgb);
    --tblr-secondary-color: var(--admin-muted);
    min-height: 100vh;
    margin: 0;
    background: var(--admin-canvas);
    color: var(--admin-ink);
    font: 400 14px/1.5 var(--tblr-font-sans-serif, system-ui, sans-serif);
}

.admin-ui a { color: var(--cyan-text); }
.admin-ui .btn-primary {
    --tblr-btn-bg: #006987;
    --tblr-btn-border-color: #006987;
    --tblr-btn-hover-bg: #00546f;
    --tblr-btn-hover-border-color: #00546f;
    --tblr-btn-active-bg: #004862;
    --tblr-btn-active-border-color: #004862;
}

.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    height: 100dvh;
    overflow-y: auto;
    padding: 23px 13px 16px;
    background: var(--navy);
    color: #c7d9e5;
}

.sidebar-top { margin: 0 5px 26px; }
.app-sidebar .sidebar-brand, .admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: .035em;
    text-decoration: none;
}

.app-brand-mark {
    position: relative;
    flex: none;
    width: 29px;
    height: 29px;
    border-radius: 8px;
    background: var(--cyan);
}

.app-brand-mark::before {
    position: absolute;
    inset: 7px;
    border: 3px solid var(--navy);
    border-top-color: #ffad93;
    border-radius: 4px;
    content: "";
    transform: rotate(-20deg);
}

.sidebar-toggle { display: none; }
.app-navigation { flex: 1; flex-direction: column; gap: 18px; }
.sidebar-nav { display: grid; gap: 4px; }
.app-sidebar .sidebar-nav-item, .app-sidebar .sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 41px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #c7d9e5;
    text-decoration: none;
}
.app-sidebar .sidebar-nav-item:hover, .app-sidebar .sidebar-footer-link:hover {
    background: #0c3045;
    color: white;
}
.app-sidebar .sidebar-nav-item.active {
    background: #123e56;
    color: #a9efff;
    font-weight: 650;
}
.sidebar-nav-item i.icon, .sidebar-footer-link i.icon { margin: 0; }
.sidebar-divider { height: 1px; margin: 8px 0; background: #264455; }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid #264455; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 2px 8px 10px; }
.sidebar-user-avatar { color: var(--cyan-text); background: var(--admin-tint); }
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { overflow: hidden; color: white; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { color: #a9bfce; font-size: 12px; }

.app-content { flex: 1; min-width: 0; }
.app-topbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 56px;
    padding: 12px clamp(14px, 3vw, 34px);
    border-bottom: 1px solid var(--admin-line);
    background: white;
    color: var(--admin-muted);
    font-size: 13px;
}
.app-main { max-width: 1440px; padding: 24px clamp(14px, 3vw, 34px) 44px; }
.app-main > .page-header { margin: 0 0 20px; }
.app-main .page-title { margin: 0; color: var(--admin-ink); font-size: 28px; font-weight: 700; letter-spacing: -.035em; }
.app-main .app-panel { margin-bottom: 14px; }
.app-main .card-title { font-weight: 650; }
.app-main .table { margin-bottom: 0; }
.app-main .table th { white-space: nowrap; }
.app-main .table th, .app-main .table td { vertical-align: middle; }
.admin-ui .table .collapsing { width: 1%; white-space: nowrap; }
.admin-ui .table .center.aligned { text-align: center; }
.admin-ui .table .right.aligned { text-align: right; }
.admin-ui .table td .ui.buttons:has(.icon.button) {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    vertical-align: middle;
}
.admin-ui .table td .ui.buttons:has(.icon.button) > form {
    margin: 0;
}
.admin-ui .table td .ui.icon.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 7px;
    font-size: 14px;
    vertical-align: middle;
}
.admin-ui .table td .ui.icon.button > i.icon {
    display: block;
    width: 1em;
    height: 1em;
    line-height: 1;
    text-align: center;
}
@media (pointer: coarse) {
    .admin-ui .table td .ui.icon.button {
        width: 44px;
        height: 44px;
    }
}
.admin-ui .table-responsive:focus-visible { outline: 2px solid var(--cyan-text); outline-offset: -2px; }
.app-main .table .app-open { font-weight: 650; }
.app-list-meta { color: var(--admin-muted); font-size: 13px; }
.app-toast { position: fixed; z-index: 9999; top: 14px; right: 14px; max-width: min(360px, calc(100vw - 28px)); }

.guest-shell { display: grid; justify-items: center; align-content: center; gap: 14px; min-height: 100dvh; padding: 18px; }
.guest-body { background: #001b2d; }
.guest-message { width: min(100%, 420px); margin-bottom: 0; }
.admin-auth-card { width: min(100%, 420px); }
.admin-auth-card .admin-brand { color: var(--admin-ink); margin-bottom: 22px; }
.admin-auth-card .card-body { padding: clamp(18px, 5vw, 32px); }
.admin-password-card { max-width: 500px; }

.admin-ui .status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 30px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.admin-ui .status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.admin-ui .status-pending { background: #fff1cf; color: #775000; }
.admin-ui .status-approved { background: #e4f5ec; color: #176243; }
.admin-ui .status-rejected { background: #fcebea; color: #993b38; }

/* Existing Fomantic calendar, dropdown and dialog controls share the Tabler palette. */
.admin-ui :is(.ui.header, .ui.button, .ui.input input, .ui.form input, .ui.form textarea,
              .ui.menu, .ui.label, .ui.modal > .header, .ui.statistic > .value, .ui.statistic > .label) {
    font-family: inherit;
}
.admin-ui .ui.header { color: var(--admin-ink); font-weight: 700; }
.admin-ui .ui.header .sub.header { color: var(--admin-muted); }
.app-main h2.ui.header { font-size: 27px; letter-spacing: -.025em; }
.admin-ui .ui.segment { border-color: var(--admin-line); border-radius: 9px; box-shadow: none; background: #fff; }
.admin-ui .ui.raised.segment, .admin-ui .ui.stacked.segment { box-shadow: none; }
.admin-ui .ui.table { border-color: var(--admin-line); border-radius: 8px; color: var(--admin-ink); }
.admin-ui .ui.table thead th { background: var(--admin-canvas); color: var(--admin-muted); font-weight: 650; }
.admin-ui .ui.celled.table tr :is(th, td) { border-left: 0; }
.admin-ui .ui.table tr :is(th, td) { border-top-color: var(--admin-line); }
.admin-ui .ui.striped.table tbody tr:nth-child(2n) { background: #f8fafc; }
.admin-ui .ui.form .field > label { color: var(--admin-ink); }
.admin-ui .ui.form input:not([type="checkbox"]):not([type="radio"]),
.admin-ui .ui.form textarea,
.admin-ui .ui.form select,
.admin-ui .ui.selection.dropdown { min-height: 40px; border-color: var(--admin-line); border-radius: 7px; }
.admin-ui .ui.form input:focus, .admin-ui .ui.form textarea:focus, .admin-ui .ui.selection.dropdown:focus {
    border-color: var(--cyan-text);
    box-shadow: 0 0 0 2px var(--admin-tint);
}
.admin-ui .ui.button { border-radius: 7px; }
.admin-ui :is(.ui.primary.button, .ui.blue.button) { background: var(--cyan-text); color: #fff; }
.admin-ui :is(.ui.primary.button, .ui.blue.button):hover { background: #00546f; color: #fff; }
.admin-ui .ui.dropdown .menu { border-color: var(--admin-line); }
.admin-ui .ui.dropdown .menu .item.active { color: var(--cyan-text); }
.admin-ui .ui.modal { height: auto; overflow: visible; border-radius: 11px; }
.admin-ui .ui.modal > .header { color: var(--admin-ink); }
.admin-ui .ui.modal > .actions { background: var(--admin-canvas); }
.admin-ui .ui.modal .scrolling.content { overflow: auto; }

@media (min-width: 801px) {
    .app-navigation.collapse:not(.show), .app-navigation.collapse.show { display: flex; }
}

@media (max-width: 800px) {
    .app-shell { display: block; }
    .app-sidebar { position: static; width: 100%; height: auto; overflow: visible; padding: 10px 14px; }
    .sidebar-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 0; }
    .sidebar-toggle { display: inline-flex; padding-inline: 12px; min-height: 44px; }
    .app-navigation.show { display: flex; padding-top: 12px; }
    .app-topbar { display: none; }
    .app-main { padding-top: 18px; }
    .app-main .ui.two.column.grid > .column:not(.row) { width: 100%; }
    .app-main .ui.menu { flex-wrap: wrap; }
    .app-main .ui.buttons { flex-wrap: wrap; }
}

