:root {
    --navy: #0f172a;
    --navy-soft: #1e293b;
    --amber: #f59e0b;
    --amber-soft: #fef3c7;
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --line: #cbd5e1;
    --danger: #b91c1c;
    --success: #15803d;
    --sheet: #0b1220;
    --sheet-line: rgba(255, 255, 255, 0.08);
    --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.28);
}

:root[data-theme="dark"] {
    --bg: #020617;
    --panel: #0f172a;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #334155;
    --amber-soft: rgba(245, 158, 11, 0.16);
    --danger: #fca5a5;
    --success: #86efac;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: linear-gradient(180deg, #eff6ff 0%, var(--bg) 28%, #ffffff 100%);
    color: var(--text);
}

body.admin-body {
    background: #edf2f7;
}

body.wowdash-admin {
    background: #f5f7fb;
    color: #1f2937;
}

:root[data-theme="dark"] body {
    background: linear-gradient(180deg, #020617 0%, #08111f 30%, #020617 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

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

.sar-admin-main {
    min-height: 100vh;
    margin-left: 290px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.sar-admin-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 1.2rem 1.5rem 0;
    background: linear-gradient(180deg, rgba(245, 247, 251, 0.96) 0%, rgba(245, 247, 251, 0.9) 100%);
    backdrop-filter: blur(12px);
}

.sar-admin-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.07);
}

.sar-admin-header-title {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.sar-admin-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.75rem;
}

.sar-admin-header-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sar-admin-content {
    padding: 1.25rem 1.5rem 1.5rem;
}

.sidebar {
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.04);
}

.sidebar-logo {
    min-height: auto;
}

.sarcompass-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 72px;
}

.sarcompass-sidebar-logo-image {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.sarcompass-sidebar-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #fb7185);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.sarcompass-admin-body {
    display: grid;
    gap: 1rem;
}

.sarcompass-header-copy h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    color: #111827;
}

.sarcompass-header-copy p {
    margin: 0.2rem 0 0;
    color: #6b7280;
}

.sarcompass-toolbar-form {
    display: grid;
    gap: 0.35rem;
    min-width: 220px;
}

.sarcompass-toolbar-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    margin: 0;
}

.sarcompass-sidebar-logo {
    color: #0f172a;
}

.sarcompass-sidebar-wordmark {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.sarcompass-sidebar-footer {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    display: grid;
    gap: 0.25rem;
    border: 1px solid #e2e8f0;
}

.sarcompass-sidebar-footer small,
.sarcompass-sidebar-footer span {
    color: #64748b;
}

.sidebar-menu a.active-page {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-weight: 700;
}

.sidebar-menu a.active-page .menu-icon {
    color: #2563eb;
}

.sar-admin-content .hero.panel,
.sar-admin-content .panel,
.sar-admin-content .stat {
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.sar-admin-content .panel {
    border: 1px solid #e5e7eb;
}

.sar-admin-content .split {
    align-items: start;
}

.sar-admin-content table {
    width: 100%;
}

.sar-admin-content button,
.sar-admin-content .button {
    cursor: pointer;
}

.admin-hero {
    display: grid;
    gap: 1rem;
    padding: 1.35rem;
}

.admin-hero h1,
.admin-section-intro h2 {
    margin: 0.35rem 0 0;
}

.admin-hero-copy {
    display: grid;
    gap: 0.35rem;
}

body.sar-adminlte {
    background: #eef3f8;
    color: #0f172a;
}

.sar-adminlte .app-header {
    border-bottom: 1px solid #d8e1ea;
}

.sar-adminlte .app-sidebar {
    border-right: 1px solid #d8e1ea;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sar-adminlte .app-main {
    min-height: 100vh;
}

.sar-adminlte .app-content-header {
    padding: 1rem 1.25rem 0.25rem;
}

.sar-adminlte .app-content {
    padding: 0 1.25rem 1.5rem;
}

.sar-adminlte .sar-adminlte-content {
    display: grid;
    gap: 1rem;
}

.sar-adminlte .sidebar-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 0.75rem;
}

.sar-admin-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
}

.sar-admin-brand-image,
.sar-admin-brand-fallback {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.sar-admin-brand-image {
    object-fit: cover;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.sar-admin-brand-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #fb7185);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.sar-admin-page-title {
    font-weight: 700;
    color: #0f172a;
}

.sar-admin-toolbar-form {
    display: grid;
    gap: 0.25rem;
    min-width: 180px;
    margin: 0;
}

.sar-admin-toolbar-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sar-admin-sidebar-footer {
    margin: 0.9rem;
    margin-top: auto;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #d8e1ea;
}

.sar-adminlte .sidebar-menu .nav-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.sar-adminlte .sidebar-menu .nav-link {
    border-radius: 0.9rem;
    margin: 0.12rem 0.65rem;
    color: #334155;
}

.sar-adminlte .sidebar-menu .nav-link.active {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.sar-adminlte .sidebar-menu .nav-link.active .nav-icon {
    color: #f8fafc;
}

.sar-adminlte-content .panel,
.sar-adminlte-content .card,
.sar-adminlte-content .stat {
    border-radius: 1rem;
    border: 1px solid #d8e1ea;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.sar-adminlte-content .panel {
    padding: 1.15rem;
    background: #fff;
}

.sar-adminlte-content .hero.panel {
    padding: 1.35rem;
}

.sar-adminlte-content .admin-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.02;
}

.sar-adminlte-content .admin-shortcuts {
    margin-top: 0.35rem;
}

.sar-adminlte-content .card {
    background: #fff;
}

.sar-adminlte-content .stats {
    margin-top: 0;
}

.sar-adminlte-content .stat {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
}

.sar-adminlte-content .table-wrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: #fff;
}

.sar-adminlte-content table {
    border-collapse: collapse;
}

.sar-adminlte-content thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
}

.sar-adminlte-content th,
.sar-adminlte-content td {
    padding: 0.9rem 0.95rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
    text-align: left;
}

.sar-adminlte-content tr:last-child td {
    border-bottom: 0;
}

.sar-adminlte-content input,
.sar-adminlte-content select,
.sar-adminlte-content textarea {
    background: #fff;
    border-color: #cbd5e1;
    border-radius: 0.9rem;
}

.sar-adminlte-content .inline-form {
    align-items: end;
}

.sar-adminlte-content .button,
.sar-adminlte-content button,
.sar-adminlte-content input[type="submit"] {
    border-radius: 0.9rem;
}

.admin-hero-actions {
    display: flex;
    justify-content: flex-end;
}

.admin-shortcuts {
    margin-top: 0.35rem;
}

.admin-section-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
}

.admin-team-switch {
    display: grid;
    gap: 0.25rem;
    min-width: 220px;
}

.admin-team-switch label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.admin-sidebar-toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 12px;
}

.team-assignment-select {
    min-height: 148px;
}

.member-sections {
    display: grid;
    gap: 1rem;
}

.member-section {
    display: grid;
    gap: 0.75rem;
}

.member-section h3 {
    margin: 0;
}

.users-admin-overview {
    display: grid;
    gap: 1rem;
}

.users-admin-overview__copy {
    display: grid;
    gap: 0.45rem;
}

.users-admin-overview__copy h2 {
    margin: 0;
}

.users-admin-stats {
    margin-top: 0;
}

.users-admin-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    align-items: start;
}

.users-admin-stack {
    display: grid;
    gap: 1rem;
}

.users-admin-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.users-admin-panel-head h2 {
    margin: 0 0 0.35rem;
}

.users-admin-context {
    min-width: 240px;
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: #f8fafc;
}

.users-admin-context__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.users-admin-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.users-admin-checkbox input {
    width: auto;
}

.users-admin-context-card {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: #f8fafc;
    margin-bottom: 0.85rem;
}

.topbar {
    width: 100%;
    left: 0;
    right: 0;
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.98) 100%);
    color: #fff;
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    padding-right: 0.85rem;
    padding-bottom: 0.9rem;
    padding-left: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    box-sizing: border-box;
    --topbar-height: 82px;
    --topbar-subheader-height: 42px;
    padding-bottom: calc(0.9rem + var(--topbar-subheader-height));
}

@media (max-width: 1100px) {
    .users-admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .users-admin-panel-head {
        flex-direction: column;
    }

    .users-admin-context {
        min-width: 0;
        width: 100%;
    }
}

.topbar-row,
.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-row {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 64px;
    padding: 0.75rem 1rem;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar-search {
    flex: 1 1 440px;
    max-width: 560px;
    margin: 0 0.5rem;
}

.topbar-search input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar-search input::placeholder {
    color: #cbd5e1;
}

.brand {
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.brand-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.brand-title {
    display: block;
}

.brand small {
    display: block;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.topbar-icon-button {
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 16px rgba(2, 6, 23, 0.18);
}

.topbar-icon-button svg {
    width: 22px;
    height: 22px;
}

.topbar-team-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    max-width: min(44vw, 260px);
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.topbar-team-logo,
.topbar-team-fallback {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    flex: 0 0 34px;
}

.topbar-team-logo {
    object-fit: cover;
    background: #fff;
}

.topbar-team-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.topbar-team-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
}

.topbar-subheader {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    margin: 0 -0.85rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.topbar-subheader-row {
    min-height: var(--topbar-subheader-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.45rem 1.35rem;
}

.topbar-subheader-row-centered {
    justify-content: center;
}

.topbar-subheader-row-with-edit {
    position: relative;
    justify-content: center;
}

.topbar-subheader-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.topbar-subheader-row-centered .topbar-subheader-items {
    justify-content: center;
}

.topbar-subheader-row-with-edit .topbar-subheader-items {
    justify-content: center;
}

.topbar-subheader-label {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.topbar-subheader-label-primary {
    letter-spacing: 0.08em;
}

.topbar-subheader-edit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.82rem;
}

.topbar-subheader-row-with-edit .topbar-subheader-edit {
    position: absolute;
    right: 1.35rem;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.page {
    padding: 1.2rem 0 calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

.panel,
.card {
    background: var(--panel);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .card {
    border-color: rgba(71, 85, 105, 0.9);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.32);
}

.panel {
    padding: 1rem;
}

.hero {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.7rem, 5vw, 2.8rem);
    line-height: 1.05;
}

.hero p {
    margin: 0;
    color: var(--muted);
    max-width: 60ch;
}

.maintenance-body-shell {
    min-height: 100vh;
    background: radial-gradient(circle at top, #1e293b 0%, #0f172a 45%, #020617 100%);
    color: #e2e8f0;
}

.maintenance-shell {
    min-height: 100vh;
    width: min(760px, calc(100% - 2rem));
    margin: 0 auto;
    display: grid;
    align-content: center;
    gap: 1.5rem;
    padding: 2rem 0;
}

.maintenance-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 50px rgba(2, 6, 23, 0.22);
}

.maintenance-brand strong,
.maintenance-brand small {
    display: block;
}

.maintenance-brand small {
    color: #cbd5e1;
}

.maintenance-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
}

.maintenance-page {
    display: grid;
}

.maintenance-card {
    display: grid;
    gap: 1rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border: 1px solid rgba(203, 213, 225, 0.85);
    box-shadow: 0 32px 80px rgba(2, 6, 23, 0.28);
}

.maintenance-card h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 0.98;
}

.maintenance-body {
    color: #475569;
    font-size: 1.05rem;
}

.maintenance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.search-bar,
.grid,
.stats,
.admin-grid,
.detail-grid,
.checklist-grid,
.tool-grid,
.checklist-library,
.checklist-detail-items,
.tool-library {
    display: grid;
    gap: 1rem;
}

.search-bar {
    grid-template-columns: 1fr;
    margin-top: 1rem;
}

.grid,
.checklist-grid,
.tool-grid,
.admin-grid,
.checklist-library,
.tool-library {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-top: 1rem;
}

.stat {
    padding: 1rem;
    background: var(--navy);
    color: #fff;
    border-radius: 18px;
}

.admin-content .stat {
    min-height: 104px;
    display: grid;
    align-content: start;
    gap: 0.35rem;
}

.stat strong {
    font-size: 1.6rem;
    display: block;
}

.card {
    padding: 1rem;
}

.category-list,
.category-procedure-list {
    display: grid;
    gap: 1rem;
}

.category-list-card,
.category-procedure-card {
    display: grid;
    align-items: center;
    gap: 1rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    text-decoration: none;
    color: inherit;
}

.category-procedure-card-link {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.category-procedure-card-link:hover,
.category-procedure-card-link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.09);
    border-color: #94a3b8;
}

.category-list-card-solid {
    color: #fff;
    border-width: 0;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

.category-list-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.category-list-icon i {
    font-size: 1.4rem;
}

.category-list-copy,
.category-procedure-copy {
    min-width: 0;
}

.category-list-copy h2,
.category-procedure-copy h2 {
    margin: 0 0 0.35rem;
}

.category-list-card-solid .muted,
.category-list-card-solid .meta,
.category-list-card-solid .category-list-arrow {
    color: rgba(255, 255, 255, 0.88);
}

.category-list-arrow {
    font-size: 2rem;
    line-height: 1;
    color: #cbd5e1;
}

.category-procedure-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.card h3,
.card h2 {
    margin-top: 0;
}

.meta,
.muted {
    color: var(--muted);
    font-size: 0.95rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--navy);
}

.badge-warning {
    background: var(--amber-soft);
    color: #92400e;
}

.button,
button,
input[type="submit"] {
    border: 0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font: inherit;
    cursor: pointer;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.button-primary,
button,
input[type="submit"] {
    background: var(--navy);
    color: #fff;
}

.button-secondary {
    background: #e2e8f0;
    color: var(--navy);
}

.button-amber {
    background: var(--amber);
    color: #1f2937;
}

form {
    display: grid;
    gap: 0.85rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    font: inherit;
    background: #fff;
    color: var(--text);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
    background: #0b1220;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.wysiwyg {
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.wysiwyg-editor {
    min-height: 200px;
    padding: 1rem;
    outline: none;
}

.wysiwyg-source {
    min-height: 240px;
    padding: 1rem;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.95rem;
}

.alerts {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 14px;
}

.alert-success {
    background: #dcfce7;
    color: var(--success);
}

.alert-error {
    background: #fee2e2;
    color: var(--danger);
}

:root[data-theme="dark"] .alert-success {
    background: rgba(21, 128, 61, 0.16);
}

:root[data-theme="dark"] .alert-error {
    background: rgba(185, 28, 28, 0.18);
}

.detail-grid {
    grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
    align-items: start;
}

.detail-grid > * {
    min-width: 0;
}

.procedure-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.steps {
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding-left: 1.5rem;
}

.step {
    padding: 1rem;
    border-left: 5px solid var(--navy);
    background: #f8fafc;
    border-radius: 14px;
}

.steps-steps {
    list-style: decimal;
}

.steps-notes {
    list-style: disc;
}

.steps-notes .step {
    margin-left: 0.2rem;
}

.step-important {
    border-left-color: #dc2626;
    background: #fee2e2;
}

.step-warning {
    border-left-color: #f59e0b;
    background: #fef3c7;
}

.step-informational {
    border-left-color: #2563eb;
    background: #dbeafe;
}

.step-low {
    border-left-color: #16a34a;
    background: #dcfce7;
}

.step p {
    margin-bottom: 0;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.24);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav .container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.bottom-nav-link {
    position: relative;
    min-height: 78px;
    display: grid;
    place-items: center;
    gap: 0.28rem;
    padding: 0.8rem 0.4rem 0.95rem;
    font-weight: 700;
    color: #94a3b8;
    font-size: 0.85rem;
}

.bottom-nav-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 3px;
    border-radius: 999px;
    background: transparent;
}

.bottom-nav-icon {
    width: 1.45rem;
    height: 1.45rem;
    display: block;
}

.bottom-nav-icon-font {
    width: auto;
    height: auto;
    font-size: 1.35rem;
    line-height: 1;
}

.bottom-nav-link.active {
    color: var(--nav-accent, var(--amber));
}

.bottom-nav-link.contextual-active {
    color: var(--nav-accent, var(--amber));
}

.bottom-nav-link.active::before {
    background: var(--nav-accent, var(--amber));
}

.settings-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(2, 6, 23, 0.64);
    display: grid;
    align-items: end;
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.branding-preview-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: -0.35rem;
    margin-bottom: 0.75rem;
}

.branding-preview-image {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid #cbd5e1;
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.branding-remove-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}

.branding-remove-toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.admin-setting-toggle {
    display: grid;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
    border: 1px solid #d8e1ea;
    border-radius: 1rem;
    background: #f8fafc;
}

.admin-setting-toggle .muted {
    margin: 0;
}

.table-logo-thumb,
.table-logo-fallback {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.table-logo-thumb {
    object-fit: cover;
    display: block;
    background: #fff;
    border: 1px solid #cbd5e1;
}

.table-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.settings-sheet-backdrop[hidden] {
    display: none !important;
}

.settings-sheet {
    width: min(560px, 100%);
    margin: 0 auto;
    background: var(--sheet);
    color: #fff;
    border-radius: 24px 24px 18px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    max-height: min(88vh, 820px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.settings-sheet-header {
    background: var(--amber);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
}

.settings-sheet-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.settings-sheet-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.settings-sheet-close svg {
    width: 18px;
    height: 18px;
}

.settings-sheet-body {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    overflow: auto;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px) + 2rem);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.settings-team-switch {
    display: grid;
    gap: 0.35rem;
}

.settings-team-switch label {
    color: #fff;
}

.settings-team-switch select {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--sheet-line);
}

.settings-group {
    display: grid;
    gap: 0.5rem;
}

.settings-group-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--amber);
    padding: 0 0.25rem;
}

.settings-link-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.95rem 0.9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--sheet-line);
}

.settings-link-button {
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.settings-link-form {
    display: block;
}

.settings-static-row {
    margin-bottom: 0.35rem;
}

.settings-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--amber);
    color: #fff;
    flex: 0 0 40px;
}

.settings-link-icon svg {
    width: 20px;
    height: 20px;
}

.settings-link-content {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.settings-link-content strong {
    font-size: 1rem;
}

.settings-link-content small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
}

.theme-mode-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.theme-mode-button {
    min-height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid var(--sheet-line);
}

.theme-mode-button.active {
    background: var(--amber);
    color: #1f2937;
}

body.sheet-open {
    overflow: hidden;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

.rich-content {
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.rich-content > * {
    max-width: 100%;
}

.rich-content table {
    display: block;
    width: max-content;
    min-width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rich-content img,
.rich-content iframe {
    max-width: 100%;
    height: auto;
}

.rich-content th,
.rich-content td {
    word-break: normal;
}

th,
td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.split {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.checklist-items {
    display: grid;
    gap: 0.65rem;
}

.checklist-library {
    align-items: stretch;
}

.tool-library {
    align-items: stretch;
}

.contact-directory {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.contact-card {
    background: var(--panel);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    padding: 1.1rem;
    display: grid;
    gap: 0.75rem;
}

.contact-card-head,
.contact-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.contact-card h2 {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.contact-card p {
    margin: 0;
}

.checklist-tile {
    min-height: 220px;
    padding: 1.15rem;
    border-radius: 24px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.85rem;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.tool-tile {
    min-height: 220px;
    padding: 1.15rem;
    border-radius: 24px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.08), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.85rem;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.tool-tile:hover,
.tool-tile:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
    border-color: rgba(15, 23, 42, 0.25);
}

.tool-tile strong {
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    line-height: 1.05;
}

.tool-tile p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.tool-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tool-tile-cta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.7rem 0.95rem;
    border-radius: 999px;
    font-weight: 700;
    background: var(--navy);
    color: #fff;
}

.risk-result-card {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.8);
}

.risk-low {
    background: #86efac;
    color: #14532d;
}

.risk-medium {
    background: #fde047;
    color: #713f12;
}

.risk-high {
    background: #fb923c;
    color: #7c2d12;
}

.risk-very-high {
    background: #ef4444;
    color: #fff;
}

.risk-table th,
.risk-table td {
    text-align: center;
    font-weight: 700;
}

.risk-table th:first-child {
    background: #f8fafc;
    color: var(--navy);
}

.checklist-tile:hover,
.checklist-tile:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
}

.checklist-tile strong {
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    line-height: 1.05;
}

.checklist-tile p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.checklist-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.checklist-kicker,
.checklist-count,
.checklist-tile-cta {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 700;
}

.checklist-kicker {
    background: var(--amber-soft);
    color: #92400e;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.checklist-count {
    color: var(--muted);
    font-size: 0.9rem;
}

.checklist-tile-cta {
    padding: 0.7rem 0.95rem;
    background: var(--navy);
    color: #fff;
    width: fit-content;
}

.checklist-detail-panel {
    padding: 1.25rem;
}

.checklist-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.checklist-detail-items {
    grid-template-columns: 1fr;
}

.check-item {
    display: flex;
    gap: 0.75rem;
    align-items: start;
    padding: 0.8rem;
    border-radius: 14px;
    background: #f8fafc;
}

.check-item-detail {
    min-height: 92px;
    align-items: center;
    grid-template-columns: auto 1fr;
    display: grid;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(203, 213, 225, 0.7);
}

.check-item-detail input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
}

.check-item-copy {
    display: grid;
    gap: 0.25rem;
}

.check-item-copy strong {
    font-size: 1.15rem;
    line-height: 1.15;
}

.checklist-detail-copy {
    line-height: 1.45;
    white-space: normal;
}

.briefing-output {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 1rem;
    border-radius: 18px;
}

.briefing-script {
    display: grid;
    gap: 1rem;
}

.briefing-section h3 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
}

.briefing-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.35rem;
}

.briefing-list li {
    line-height: 1.4;
}

.briefing-mission-repeat {
    display: grid;
    gap: 0.8rem;
}

.briefing-mission-list li {
    font-size: 1.02rem;
}

.briefing-questions {
    margin: 0;
    padding-top: 0.4rem;
    border-top: 1px solid #fed7aa;
}

.gsmeac-shell {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.gsmeac-library,
.gsmeac-composer,
.gsmeac-preview-panel {
    display: grid;
    gap: 1rem;
}

.gsmeac-workspace {
    display: grid;
    gap: 1rem;
}

.gsmeac-library-header,
.gsmeac-section-header {
    display: grid;
    gap: 0.35rem;
}

.gsmeac-library-header h2,
.gsmeac-section-header h2 {
    margin: 0;
}

.gsmeac-status {
    min-height: 1.25rem;
    margin: 0;
}

.gsmeac-library-actions,
.gsmeac-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.gsmeac-brief-list {
    display: grid;
    gap: 0.75rem;
}

.gsmeac-brief-card {
    display: grid;
    gap: 0.2rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    text-align: left;
    color: var(--text);
}

.gsmeac-brief-card strong {
    font-size: 1rem;
}

.gsmeac-brief-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.gsmeac-brief-card.active {
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.14);
}

.gsmeac-empty-library {
    margin: 0;
}

.gsmeac-fields {
    display: grid;
    gap: 1rem;
}

.gsmeac-fields textarea {
    min-height: 104px;
}

@media (max-width: 900px) {
    .gsmeac-shell {
        grid-template-columns: 1fr;
    }
}

.content-page {
    display: grid;
    gap: 1rem;
}

.content-page-body {
    line-height: 1.7;
}

.content-page-body h2,
.content-page-body h3,
.content-page-body h4 {
    margin-top: 1.3rem;
}

.content-page-body table {
    width: 100%;
    border-collapse: collapse;
}

.content-page-body th,
.content-page-body td {
    border: 1px solid var(--line);
    padding: 0.75rem;
    text-align: left;
}

.content-page-body th {
    background: rgba(148, 163, 184, 0.16);
}

.offline-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.offline-card {
    max-width: 520px;
    padding: 1.5rem;
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.1);
}

@media (max-width: 760px) {
    .sar-admin-main {
        margin-left: 0;
    }

    .sar-admin-header {
        padding: 1rem 1rem 0;
    }

    .sar-admin-header-row,
    .admin-section-intro {
        flex-direction: column;
        align-items: stretch;
    }

    .sar-admin-header-actions {
        justify-content: stretch;
    }

    .sar-admin-header-links {
        width: 100%;
    }

    .sar-admin-header-links .btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .sar-admin-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sar-admin-content {
        padding: 1rem;
    }

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

    .topbar-row {
        min-height: 58px;
        padding: 0.65rem 0.8rem;
        border-radius: 20px;
        flex-wrap: wrap;
    }

    .topbar-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        margin: 0;
    }

    .topbar {
        --topbar-height: 74px;
        --topbar-subheader-height: 52px;
    }

    .topbar-subheader-row {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 0.45rem 0.85rem;
    }

    .checklist-tile {
        min-height: 180px;
    }

    .tool-tile {
        min-height: 180px;
    }

    .checklist-detail-head {
        flex-direction: column;
        align-items: stretch;
    }

    .check-item-detail {
        align-items: start;
    }

    .topbar-subheader-items {
        gap: 0.45rem 0.7rem;
    }

    .settings-sheet-backdrop {
        padding: 0.35rem;
    }

    .settings-sheet {
        border-radius: 22px 22px 0 0;
        max-height: calc(100vh - 0.35rem);
    }

    .theme-mode-control {
        grid-template-columns: 1fr;
    }

    .brand {
        font-size: 1.02rem;
    }

    .brand small {
        font-size: 0.73rem;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .topbar-team-chip {
        max-width: 42vw;
        padding-inline: 0.45rem;
    }

    .topbar-team-logo,
    .topbar-team-fallback {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .category-list-card,
    .category-procedure-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .category-list-arrow {
        display: none;
    }
}

@media (max-width: 960px) and (orientation: landscape) {
    .topbar {
        --topbar-height: 70px;
        --topbar-subheader-height: 38px;
    }

    .topbar-subheader-row {
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
}
