:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    margin: 0;
    background: #f6f7f9;
    color: #1f2933;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1f2933;
    color: #fff;
    padding: 24px 16px;
}

.brand {
    font-weight: 700;
    margin-bottom: 24px;
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar a {
    color: #e4e7eb;
    padding: 10px 12px;
    text-decoration: none;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #dde2e7;
    display: flex;
    justify-content: space-between;
    padding: 18px 24px;
}

.topbar h1 {
    font-size: 24px;
    margin: 0;
}

.language-switcher {
    align-items: center;
    display: flex;
    gap: 10px;
}

.content {
    padding: 24px;
}

.panel {
    background: #fff;
    border: 1px solid #dde2e7;
    border-radius: 8px;
    padding: 24px;
}

.calendar-placeholder {
    align-items: center;
    border: 2px dashed #9aa5b1;
    display: flex;
    min-height: 420px;
    justify-content: center;
}

.auth-form {
    display: grid;
    gap: 12px;
    max-width: 420px;
}

.auth-form input {
    border: 1px solid #cbd2d9;
    padding: 10px 12px;
}

.auth-form button,
.language-switcher button {
    cursor: pointer;
    padding: 9px 12px;
}

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.error-message {
    color: #b42318;
}

.meta-list {
    display: grid;
    gap: 8px 18px;
    grid-template-columns: max-content 1fr;
}

[dir="rtl"] .app-shell {
    direction: rtl;
}

@media (max-width: 800px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: auto;
    }

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

.login-page {
    align-items: center;
    background: #f8f9ff;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 32px;
}

.login-shell {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.05), 0 18px 40px rgba(15, 23, 42, 0.12);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
    max-width: 1200px;
    min-height: 700px;
    overflow: hidden;
    width: 100%;
}

.login-brand-panel {
    background: #dbe1ff;
    color: #0b1c30;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px;
    position: relative;
}

.login-brand-panel::before,
.login-brand-panel::after {
    background: rgba(0, 74, 198, 0.06);
    border-radius: 999px;
    content: "";
    position: absolute;
}

.login-brand-panel::before {
    height: 240px;
    inset-inline-end: -80px;
    top: -80px;
    width: 240px;
}

.login-brand-panel::after {
    background: rgba(0, 108, 73, 0.08);
    bottom: -140px;
    height: 360px;
    inset-inline-start: -130px;
    width: 360px;
}

.login-brand-content,
.login-visual,
.login-footer {
    position: relative;
    z-index: 1;
}

.login-brand,
.login-mobile-brand {
    align-items: center;
    color: #004ac6;
    display: flex;
    font-size: 22px;
    font-weight: 700;
    gap: 12px;
}

.login-brand-icon {
    align-items: center;
    background: #004ac6;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: 25px;
    font-weight: 700;
    height: 40px;
    justify-content: center;
    line-height: 1;
    width: 40px;
}

.login-brand-panel h1 {
    font-size: 48px;
    line-height: 1.15;
    margin: 56px 0 22px;
    max-width: 520px;
}

.login-brand-panel p {
    color: #434655;
    font-size: 18px;
    line-height: 1.55;
    max-width: 430px;
}

.login-visual {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(239, 244, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 74, 198, 0.16);
    margin: 40px auto 0;
    max-width: 430px;
    padding: 22px;
    width: 100%;
}

.login-visual-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.login-visual-toolbar span {
    background: #c3c6d7;
    border-radius: 999px;
    height: 10px;
    width: 10px;
}

.login-visual-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
}

.login-visual-grid div {
    background: #fff;
    border: 1px solid #d3e4fe;
    border-radius: 8px;
    padding: 14px;
}

.login-visual-grid strong {
    color: #004ac6;
    display: block;
    font-size: 22px;
}

.login-visual-grid span,
.login-footer,
.login-support p {
    color: #434655;
}

.login-visual-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.login-visual-list span {
    background: #e5eeff;
    border-radius: 999px;
    display: block;
    height: 14px;
}

.login-visual-list span:nth-child(2) {
    width: 78%;
}

.login-visual-list span:nth-child(3) {
    width: 58%;
}

.login-footer {
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 14px;
    padding-top: 28px;
}

.login-footer a {
    color: #004ac6;
}

.login-form-panel {
    align-items: center;
    background: #fff;
    display: flex;
    justify-content: center;
    padding: 80px 64px;
    position: relative;
}

.login-language-switcher {
    align-items: center;
    display: flex;
    gap: 10px;
    position: absolute;
    inset-inline-end: 32px;
    top: 32px;
}

.login-language-switcher > span {
    color: #737686;
    font-size: 14px;
}

.login-language-switcher div {
    background: #e5eeff;
    border-radius: 8px;
    display: flex;
    padding: 4px;
}

.login-language-switcher a {
    border-radius: 6px;
    color: #434655;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    text-decoration: none;
}

.login-language-switcher a.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
    color: #004ac6;
}

.login-form-wrap {
    max-width: 390px;
    width: 100%;
}

.login-mobile-brand {
    display: none;
    margin-bottom: 32px;
}

.login-heading {
    margin-bottom: 34px;
}

.login-heading h2 {
    font-size: 32px;
    line-height: 1.2;
    margin: 0 0 10px;
}

.login-heading p {
    color: #434655;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

.care-login-form {
    display: grid;
    gap: 14px;
}

.care-login-form label,
.care-label-row label {
    color: #0b1c30;
    font-size: 14px;
    font-weight: 600;
}

.care-label-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.care-label-row a,
.login-support a {
    color: #004ac6;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.care-input {
    align-items: center;
    background: #fff;
    border: 1px solid #c3c6d7;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    padding: 0 14px;
}

.care-input:focus-within {
    border-color: #004ac6;
    box-shadow: 0 0 0 3px rgba(0, 74, 198, 0.14);
}

.care-input > span {
    color: #737686;
    font-weight: 700;
}

.care-input input {
    border: 0;
    flex: 1;
    font-size: 16px;
    min-width: 0;
    outline: 0;
    padding: 14px 0;
}

.password-toggle {
    background: transparent;
    border: 0;
    color: #737686;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 0;
}

.care-checkbox {
    align-items: center;
    color: #434655;
    display: flex;
    gap: 10px;
    margin: 4px 0 10px;
}

.care-checkbox input {
    accent-color: #004ac6;
    height: 18px;
    width: 18px;
}

.care-login-button {
    background: #004ac6;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 18px rgba(0, 74, 198, 0.22);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    padding: 16px;
}

.care-login-button:hover {
    background: #2563eb;
}

.login-support {
    border-top: 1px solid #c3c6d7;
    margin-top: 44px;
    padding-top: 26px;
    text-align: center;
}

.login-support a {
    align-items: center;
    border: 1px solid #c3c6d7;
    border-radius: 12px;
    color: #0b1c30;
    display: flex;
    justify-content: center;
    margin-top: 14px;
    padding: 13px;
}

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

    .login-shell {
        display: block;
        min-height: 0;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: calc(100vh - 32px);
        padding: 96px 24px 40px;
    }

    .login-mobile-brand {
        display: flex;
    }
}

.admin-body {
    background: #f8f9ff;
    color: #0b1c30;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
}

.admin-sidebar {
    background: #f8f9ff;
    border-inline-end: 1px solid #c3c6d7;
    bottom: 0;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    inset-inline-start: 0;
    position: fixed;
    top: 0;
    width: 280px;
    z-index: 10;
}

.admin-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    padding: 32px 24px 24px;
}

.admin-brand-mark {
    align-items: center;
    background: #2563eb;
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    font-size: 28px;
    font-weight: 700;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.admin-brand strong {
    color: #004ac6;
    display: block;
    font-size: 24px;
    line-height: 1;
}

.admin-brand small,
.admin-user small {
    color: #434655;
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.admin-nav {
    display: grid;
    gap: 4px;
    overflow-y: auto;
    padding: 0 16px;
}

.admin-nav a,
.admin-sidebar-footer a,
.admin-sidebar-footer button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 12px;
    color: #434655;
    display: flex;
    font: inherit;
    gap: 12px;
    padding: 12px 16px;
    text-align: start;
    text-decoration: none;
    width: 100%;
}

.admin-nav a.active {
    background: rgba(0, 74, 198, 0.1);
    box-shadow: inset 4px 0 0 #004ac6;
    color: #004ac6;
}

[dir="rtl"] .admin-nav a.active {
    box-shadow: inset -4px 0 0 #004ac6;
}

.admin-nav a:hover,
.admin-sidebar-footer a:hover,
.admin-sidebar-footer button:hover {
    background: rgba(211, 228, 254, 0.55);
    color: #004ac6;
}

.admin-sidebar-footer {
    border-top: 1px solid #c3c6d7;
    margin-top: auto;
    padding: 16px;
}

.admin-sidebar-footer button {
    color: #ba1a1a;
    cursor: pointer;
}

.admin-topbar {
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(248, 249, 255, 0.86);
    border-bottom: 1px solid #c3c6d7;
    box-sizing: border-box;
    display: flex;
    height: 64px;
    inset-inline-end: 0;
    inset-inline-start: 280px;
    justify-content: space-between;
    padding: 0 40px;
    position: fixed;
    top: 0;
    z-index: 9;
}

.admin-search {
    align-items: center;
    background: #eff4ff;
    border-radius: 999px;
    display: flex;
    gap: 10px;
    max-width: 560px;
    padding: 0 14px;
    width: 42%;
}

.admin-search input {
    background: transparent;
    border: 0;
    flex: 1;
    font-size: 14px;
    min-width: 0;
    outline: 0;
    padding: 10px 0;
}

.admin-top-actions,
.admin-language-switcher,
.admin-user {
    align-items: center;
    display: flex;
    gap: 12px;
}

.admin-language-switcher {
    background: #e5eeff;
    border-radius: 999px;
    padding: 4px;
}

.admin-language-switcher a {
    border-radius: 999px;
    color: #434655;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 8px;
    text-decoration: none;
}

.admin-language-switcher a:hover,
.admin-language-switcher a.active {
    background: #fff;
    color: #004ac6;
}

.admin-language-switcher a.active {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.admin-top-actions button {
    background: transparent;
    border: 0;
    color: #434655;
    cursor: pointer;
    font-size: 16px;
}

.admin-user {
    border-inline-start: 1px solid #c3c6d7;
    padding-inline-start: 18px;
}

.admin-user strong {
    display: block;
    font-size: 14px;
}

.admin-user > span {
    align-items: center;
    background: #dbe1ff;
    border: 2px solid #2563eb;
    border-radius: 999px;
    color: #004ac6;
    display: inline-flex;
    font-weight: 700;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.admin-main {
    margin-inline-start: 280px;
    min-height: 100vh;
    padding: 104px 40px 40px;
}

.dashboard-hero {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 34px;
}

.dashboard-hero h1 {
    font-size: 32px;
    line-height: 1.2;
    margin: 0 0 8px;
}

.dashboard-hero p,
.dashboard-company span {
    color: #434655;
    margin: 0;
}

.dashboard-hero p span {
    color: #004ac6;
    font-weight: 700;
}

.dashboard-company {
    background: #fff;
    border: 1px solid #c3c6d7;
    border-radius: 12px;
    min-width: 220px;
    padding: 16px;
}

.dashboard-company strong {
    display: block;
    margin-top: 4px;
}

.dashboard-stats {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    margin-bottom: 34px;
}

.stat-card,
.dashboard-panel {
    background: #fff;
    border: 1px solid #c3c6d7;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.05);
}

.stat-card {
    display: grid;
    gap: 10px;
    min-height: 94px;
    padding: 18px;
}

.stat-card span {
    color: #434655;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-card strong {
    font-size: 30px;
}

.stat-card em {
    color: #434655;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.stat-card .positive,
.stat-card .success {
    color: #006c49;
}

.stat-card .danger {
    color: #ba1a1a;
}

.stat-card.featured {
    background: rgba(0, 74, 198, 0.06);
    border-color: rgba(0, 74, 198, 0.28);
}

.stat-card.featured span,
.stat-card.featured strong {
    color: #004ac6;
}

.dashboard-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    margin-bottom: 24px;
}

.dashboard-panel {
    padding: 24px;
}

.sms-panel {
    grid-column: 1 / 2;
}

.panel-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.panel-heading h2,
.quick-actions h2 {
    font-size: 20px;
    margin: 0;
}

.panel-heading div {
    display: flex;
    gap: 8px;
}

.panel-heading span,
.panel-heading b {
    border-radius: 999px;
    font-size: 12px;
    padding: 6px 10px;
}

.panel-heading span {
    background: #d3e4fe;
}

.panel-heading b,
.panel-heading strong {
    background: #004ac6;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
}

.line-chart {
    height: 250px;
    position: relative;
}

.line-chart svg {
    height: 210px;
    inset: 0;
    position: absolute;
    width: 100%;
}

.week-chart {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(7, minmax(42px, 1fr));
    min-height: 250px;
}

.week-chart div {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-rows: 1fr auto auto;
    height: 250px;
    text-align: center;
}

.week-chart span {
    align-self: end;
    background: #004ac6;
    border-radius: 8px 8px 0 0;
    display: block;
    min-height: 8px;
    width: 100%;
}

.week-chart strong {
    color: #0b1c30;
    font-size: 14px;
}

.week-chart small {
    color: #434655;
    font-size: 12px;
    min-height: 16px;
}

.chart-days {
    bottom: 0;
    color: #434655;
    display: grid;
    font-size: 12px;
    grid-template-columns: repeat(7, 1fr);
    position: absolute;
    text-align: center;
    width: 100%;
}

.activity-list {
    display: grid;
    gap: 22px;
}

.activity-list div {
    display: flex;
    gap: 14px;
}

.activity-list span {
    align-items: center;
    background: #6cf8bb;
    border-radius: 999px;
    color: #005236;
    display: inline-flex;
    flex: 0 0 40px;
    font-weight: 700;
    height: 40px;
    justify-content: center;
}

.activity-list p {
    margin: 0;
}

.activity-list small {
    color: #434655;
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.empty-state {
    background: #eff4ff;
    border: 1px dashed #c3c6d7;
    border-radius: 8px;
    color: #434655;
    margin: 0;
    padding: 16px;
}

.bar-chart {
    align-items: end;
    display: flex;
    gap: 20px;
    height: 170px;
    padding: 10px 8px 0;
}

.bar-chart span {
    background: rgba(0, 74, 198, 0.18);
    border-radius: 8px 8px 0 0;
    flex: 1;
}

.bar-chart span.active,
.bar-chart span:hover {
    background: #004ac6;
}

.status-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.status-summary div {
    background: #eff4ff;
    border: 1px solid #d3e4fe;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.status-summary span {
    color: #434655;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-summary strong {
    color: #004ac6;
    font-size: 26px;
}

.dashboard-bottom {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

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

.dashboard-table {
    border-collapse: collapse;
    min-width: 620px;
    width: 100%;
}

.dashboard-table th,
.dashboard-table td {
    border-bottom: 1px solid rgba(195, 198, 215, 0.55);
    padding: 14px 12px;
    text-align: start;
}

.dashboard-table th {
    background: #eff4ff;
    color: #434655;
    font-size: 12px;
    text-transform: uppercase;
}

.dashboard-table td span {
    background: rgba(0, 108, 73, 0.1);
    border-radius: 6px;
    color: #006c49;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 8px;
    text-transform: uppercase;
}

.quick-actions {
    display: grid;
    gap: 14px;
}

.quick-actions a {
    align-items: center;
    border: 2px solid #004ac6;
    border-radius: 12px;
    color: #004ac6;
    display: flex;
    font-weight: 700;
    justify-content: space-between;
    padding: 14px 18px;
    text-decoration: none;
}

.quick-actions a:first-of-type {
    background: #004ac6;
    color: #fff;
}

.quick-actions p {
    background: #e5eeff;
    border-radius: 12px;
    color: #434655;
    margin: 12px 0 0;
    padding: 16px;
}

@media (max-width: 1100px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .dashboard-bottom {
        grid-template-columns: 1fr;
    }

    .sms-panel {
        grid-column: auto;
    }
}

@media (max-width: 820px) {
    .admin-sidebar {
        position: static;
        width: auto;
    }

    .admin-topbar {
        inset-inline-start: 0;
        padding: 12px 16px;
        position: static;
    }

    .admin-main {
        margin-inline-start: 0;
        padding: 24px 16px;
    }

    .admin-search {
        display: none;
    }

    .dashboard-hero {
        display: block;
    }

    .dashboard-company {
        margin-top: 16px;
    }
}

/* ==========================================================================
   Shared admin component system (buttons, forms, tables, cards, badges,
   alerts, pagination, empty states, filter bars, calendar, reports, audit)
   ========================================================================== */

.page-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 6px;
}

.page-header p {
    color: #434655;
    margin: 0;
    max-width: 640px;
}

.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.work-grid {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
}

.panel {
    background: #fff;
    border: 1px solid #c3c6d7;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.05);
    padding: 24px;
}

.form-panel h2,
.list-panel h2 {
    font-size: 18px;
    margin: 0 0 18px;
}

.form-hint {
    color: #737686;
    font-size: 12px;
    margin: -8px 0 16px;
}

/* Forms ------------------------------------------------------------------ */

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
}

.form-grid label,
.filter-bar label {
    color: #0b1c30;
    display: grid;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
}

.form-grid label.wide {
    grid-column: 1 / -1;
}

.form-grid label.check,
label.check {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
    font-weight: 600;
}

.form-grid label.check input,
label.check input {
    accent-color: #004ac6;
    height: 17px;
    width: 17px;
}

.req {
    color: #ba1a1a;
    font-weight: 700;
    margin-inline-start: 2px;
}

.form-grid input:not([type="checkbox"]),
.form-grid select,
.form-grid textarea,
.filter-bar input,
.filter-bar select,
.inline-edit input,
.inline-edit select,
.inline-edit textarea {
    background: #fff;
    border: 1px solid #c3c6d7;
    border-radius: 10px;
    box-sizing: border-box;
    color: #0b1c30;
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.inline-edit input:focus,
.inline-edit select:focus,
.inline-edit textarea:focus {
    border-color: #004ac6;
    box-shadow: 0 0 0 3px rgba(0, 74, 198, 0.14);
    outline: 0;
}

.form-grid textarea {
    min-height: 80px;
    resize: vertical;
}

/* Buttons ---------------------------------------------------------------- */

.btn,
.primary-button,
.filter-bar button,
.inline-edit button,
.page-actions a.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    line-height: 1.1;
    padding: 11px 18px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary,
.primary-button,
.inline-edit button[type="submit"] {
    background: #004ac6;
    color: #fff;
}

.btn-primary:hover,
.primary-button:hover,
.inline-edit button[type="submit"]:hover {
    background: #2563eb;
}

.btn-secondary,
.filter-bar button {
    background: #eff4ff;
    border-color: #c3d5fb;
    color: #004ac6;
}

.btn-secondary:hover,
.filter-bar button:hover {
    background: #dbe6ff;
}

.btn-danger,
.delete-form button {
    background: #fbeaea;
    border-color: #f0c4c4;
    color: #ba1a1a;
}

.btn-danger:hover,
.delete-form button:hover {
    background: #f5d5d5;
}

.btn-sm {
    font-size: 13px;
    padding: 7px 12px;
}

.page-actions a:not(.btn) {
    background: #eff4ff;
    border: 1px solid #c3d5fb;
    border-radius: 10px;
    color: #004ac6;
    font-weight: 700;
    padding: 9px 14px;
    text-decoration: none;
}

.page-actions a:not(.btn):hover {
    background: #dbe6ff;
}

/* Filter bars ------------------------------------------------------------ */

.filter-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.filter-bar input,
.filter-bar select {
    max-width: 260px;
    width: auto;
}

.filter-bar input[type="search"] {
    flex: 1;
    min-width: 180px;
}

/* Tables ----------------------------------------------------------------- */

.table-wrap {
    border: 1px solid #e2e6f0;
    border-radius: 10px;
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    min-width: 620px;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #eceef4;
    padding: 12px 14px;
    text-align: start;
    vertical-align: top;
}

.data-table thead th {
    background: #eff4ff;
    color: #434655;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #f8fafe;
}

.data-table td strong {
    display: block;
}

.data-table td small {
    color: #737686;
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.message-cell {
    max-width: 320px;
}

.empty-cell {
    color: #737686;
    padding: 28px 14px !important;
    text-align: center !important;
}

/* Badges / pills --------------------------------------------------------- */

.badge,
.status-pill,
.pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-pill {
    background: #eef1f7;
    color: #434655;
}

/* Status colours (shared by tables and calendar) */
.status-pill.is-active, .status-pill.is-planned, .status-pill.is-confirmed {
    background: #d3e4fe;
    color: #004ac6;
}

.status-pill.is-completed, .status-pill.is-sent {
    background: rgba(0, 108, 73, 0.12);
    color: #006c49;
}

.status-pill.is-cancelled, .status-pill.is-failed,
.status-pill.is-no_show, .status-pill.is-inactive {
    background: #fbeaea;
    color: #ba1a1a;
}

.status-pill.is-paused, .status-pill.is-pending, .status-pill.is-queued {
    background: #fff2d8;
    color: #8a5a00;
}

/* Role badges */
.badge-role {
    background: #ece9fb;
    color: #5b3ecb;
}

/* Consent pills */
.pill {
    background: #eef1f7;
    color: #737686;
    margin-inline-end: 4px;
}

.pill.ok {
    background: rgba(0, 108, 73, 0.12);
    color: #006c49;
}

/* Row actions / inline edit --------------------------------------------- */

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row-details summary {
    color: #004ac6;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.row-details summary::-webkit-details-marker {
    display: none;
}

.row-details[open] summary {
    margin-bottom: 12px;
}

.inline-edit {
    background: #f8fafe;
    border: 1px solid #e2e6f0;
    border-radius: 10px;
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
    padding: 14px;
}

.inline-edit textarea {
    min-height: 70px;
    resize: vertical;
}

.delete-form {
    margin: 0;
}

/* Alerts / flash --------------------------------------------------------- */

.notice {
    border: 1px solid transparent;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 14px 16px;
}

.notice strong {
    display: block;
    margin-bottom: 4px;
}

.notice ul {
    margin: 4px 0 0;
    padding-inline-start: 18px;
}

.notice.success {
    background: rgba(0, 108, 73, 0.1);
    border-color: rgba(0, 108, 73, 0.3);
    color: #005236;
}

.notice.error {
    background: #fbeaea;
    border-color: #f0c4c4;
    color: #8f1414;
}

.notice.warning {
    background: #fff2d8;
    border-color: #f3d79a;
    color: #8a5a00;
}

/* Settings --------------------------------------------------------------- */

.settings-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
}

.settings-reminders {
    margin-top: 24px;
}

.settings-tests {
    margin-bottom: 24px;
}

.form-actions {
    margin-bottom: 24px;
}

.toggle-row {
    margin-bottom: 16px;
}

.provider-note {
    background: #fff2d8;
    border: 1px solid #f3d79a;
    border-radius: 10px;
    color: #8a5a00;
    margin: 0 0 24px;
    padding: 14px 16px;
}

.provider-note strong {
    display: block;
    margin-bottom: 4px;
}

/* Reports ---------------------------------------------------------------- */

.report-filter {
    margin-bottom: 24px;
}

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

.report-bars {
    display: grid;
    gap: 16px;
}

.report-bars > div {
    display: grid;
    gap: 4px 8px;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
}

.report-bars span {
    color: #434655;
    font-size: 13px;
    font-weight: 600;
}

.report-bars strong {
    color: #004ac6;
    justify-self: end;
}

.report-bars em {
    background: #004ac6;
    border-radius: 999px;
    display: block;
    grid-column: 1 / -1;
    height: 8px;
    min-width: 8px;
}

/* Audit ------------------------------------------------------------------ */

.json-box {
    background: #0b1c30;
    border-radius: 8px;
    color: #d8e6ff;
    font-size: 12px;
    margin: 0;
    max-height: 260px;
    overflow: auto;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.audit-diff {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 4px 0 0;
}

.audit-diff h4 {
    font-size: 12px;
    margin: 0 0 6px;
    text-transform: uppercase;
    color: #737686;
}

/* Calendar --------------------------------------------------------------- */

.calendar-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
    color: #737686;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 4px;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    background: #fbfcff;
    border: 1px solid #e2e6f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 116px;
    padding: 8px;
}

.calendar-day.muted {
    background: #f4f5f9;
    opacity: 0.65;
}

.calendar-day.today {
    border-color: #004ac6;
    box-shadow: inset 0 0 0 1px #004ac6;
}

.calendar-date {
    color: #434655;
    font-size: 13px;
    font-weight: 700;
}

.calendar-day.today .calendar-date {
    color: #004ac6;
}

.calendar-events {
    display: grid;
    gap: 4px;
}

.calendar-event {
    border-inline-start: 3px solid #004ac6;
    border-radius: 6px;
    background: #eff4ff;
    color: #0b1c30;
    display: block;
    font-size: 11px;
    padding: 4px 6px;
    text-decoration: none;
}

.calendar-event strong {
    display: block;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event span {
    color: #737686;
    display: block;
    font-size: 10px;
}

.calendar-event.planned, .calendar-event.confirmed { border-inline-start-color: #004ac6; background: #eff4ff; }
.calendar-event.completed { border-inline-start-color: #006c49; background: rgba(0, 108, 73, 0.1); }
.calendar-event.cancelled, .calendar-event.no_show { border-inline-start-color: #ba1a1a; background: #fbeaea; }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.calendar-legend span {
    align-items: center;
    color: #434655;
    display: inline-flex;
    font-size: 12px;
    gap: 6px;
}

.calendar-legend i {
    border-radius: 3px;
    height: 12px;
    width: 12px;
}

/* Pagination ------------------------------------------------------------- */

.pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
}

.pagination a,
.pagination span {
    background: #fff;
    border: 1px solid #c3c6d7;
    border-radius: 8px;
    color: #434655;
    display: inline-flex;
    font-size: 14px;
    min-width: 38px;
    justify-content: center;
    padding: 8px 12px;
    text-decoration: none;
}

.pagination a:hover {
    background: #eff4ff;
    color: #004ac6;
}

.pagination .active span {
    background: #004ac6;
    border-color: #004ac6;
    color: #fff;
}

.pagination .disabled span {
    color: #b7bcc9;
}

/* Mobile navigation toggle ---------------------------------------------- */

.admin-menu-toggle {
    background: #eff4ff;
    border: 1px solid #c3d5fb;
    border-radius: 10px;
    color: #004ac6;
    cursor: pointer;
    display: none;
    font-size: 20px;
    line-height: 1;
    padding: 8px 12px;
}

.communication-stack {
    border-top: 1px solid #dde2e7;
    margin-top: 14px;
    padding-top: 14px;
}

.communication-form textarea {
    min-height: 92px;
    resize: vertical;
}

.inline-edit-header {
    color: #0b1c30;
    font-size: 13px;
    font-weight: 700;
    grid-column: 1 / -1;
    margin-bottom: 4px;
}

.communication-history {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.communication-item {
    background: #f8f9ff;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    display: grid;
    gap: 6px;
    padding: 12px;
}

.communication-item p {
    margin: 0;
    white-space: pre-wrap;
}

.communication-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.communication-subject {
    color: #0b1c30;
    font-weight: 700;
}

.comm-error {
    color: #ba1a1a;
}

.empty-inline {
    color: #737686;
    margin: 0;
}

.appointment-response-box {
    margin-top: 14px;
}

.public-response-body {
    background: #f4f7fb;
    color: #0b1c30;
    margin: 0;
    min-height: 100vh;
}

.public-response-wrap {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

.public-response-card {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(11, 28, 48, 0.08);
    max-width: 720px;
    padding: 24px;
    width: 100%;
}

.public-response-header h1 {
    margin: 0 0 8px;
}

.public-response-header p {
    color: #5d6576;
    margin: 0 0 18px;
}

.public-response-details {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0 0 18px;
}

.public-response-details div {
    background: #f8f9ff;
    border: 1px solid #e1e6ee;
    border-radius: 10px;
    padding: 12px;
}

.public-response-details dt {
    color: #5d6576;
    font-size: 13px;
    margin-bottom: 4px;
}

.public-response-details dd {
    font-weight: 600;
    margin: 0;
}

.public-response-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.public-response-note {
    color: #5d6576;
    margin: 0 0 18px;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1024px) {
    .work-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

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

    .admin-menu-toggle {
        display: inline-flex;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-sidebar.open {
        display: flex;
        position: fixed;
        width: 260px;
        z-index: 30;
    }

    .filter-bar input,
    .filter-bar select {
        max-width: none;
        width: 100%;
    }

    .calendar-day {
        min-height: 84px;
    }

    .audit-diff {
        grid-template-columns: 1fr;
    }

    .public-response-card {
        padding: 18px;
    }
}
