:root {
    --bg: #f4f1ea;
    --bg-deep: #0d1a28;
    --panel: #ffffff;
    --panel-soft: #fbfaf7;
    --text: #14202e;
    --text-strong: #0a1320;
    --muted: #697486;
    --line: #ded7c8;
    --line-strong: #cbbfaa;
    --primary: #1e4f8f;
    --primary-dark: #12355f;
    --primary-soft: #e7eef8;
    --gold: #b8893b;
    --gold-soft: #fff2d4;
    --teal: #2d7c78;
    --success: #146344;
    --success-bg: #e7f6ed;
    --error: #9b2d2f;
    --error-bg: #fff0ee;
    --shadow: 0 24px 70px rgba(16, 28, 42, 0.13);
    --shadow-soft: 0 12px 34px rgba(16, 28, 42, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        linear-gradient(135deg, rgba(30, 79, 143, 0.08), transparent 34%),
        linear-gradient(225deg, rgba(184, 137, 59, 0.14), transparent 28%),
        repeating-linear-gradient(90deg, rgba(20, 32, 46, 0.025) 0, rgba(20, 32, 46, 0.025) 1px, transparent 1px, transparent 96px),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

body::before {
    background: linear-gradient(90deg, var(--bg-deep), #173a5f 46%, var(--gold));
    content: "";
    display: block;
    height: 4px;
    width: 100%;
}

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

.app-shell {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    min-height: calc(100vh - 4px);
}

.sidebar {
    background: linear-gradient(180deg, #0d1a28, #13283d);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 26px 20px;
    position: sticky;
    top: 0;
    height: calc(100vh - 4px);
}

.sidebar .brand {
    color: #fff;
}

.sidebar-company {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    display: grid;
    gap: 5px;
    padding: 16px;
}

.sidebar-company span {
    color: #fff4d8;
    font-weight: 800;
}

.sidebar-company strong,
.topbar-kicker {
    color: rgba(255, 255, 255, 0.64);
    font-size: 12px;
    text-transform: uppercase;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a {
    align-items: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    font-weight: 800;
    gap: 12px;
    padding: 12px;
    transition: background 150ms ease, color 150ms ease;
}

.side-nav a:hover,
.side-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.side-nav a.active {
    box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 7px;
    color: var(--gold-soft);
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 12px;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.logout-link {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffe3ad;
    font-weight: 800;
    margin-top: auto;
    padding: 18px 12px 0;
}

.content-shell {
    min-width: 0;
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(203, 191, 170, 0.75);
    box-shadow: 0 10px 32px rgba(13, 26, 40, 0.06);
    display: flex;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 38px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-shell .topbar {
    min-height: 72px;
}

.content-shell .topbar strong {
    color: var(--text-strong);
    display: block;
}

.content-shell .topbar-kicker {
    color: var(--muted);
    display: block;
    margin-bottom: 2px;
}

.guest-topbar {
    position: sticky;
}

.brand {
    align-items: center;
    color: var(--text-strong);
    display: inline-flex;
    font-size: 18px;
    font-weight: 800;
    gap: 12px;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--bg-deep), var(--primary));
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 12px 24px rgba(13, 26, 40, 0.16);
    color: #fff8e7;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.nav a,
.company-pill {
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
    padding: 9px 13px;
}

.nav a {
    transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.nav a:hover,
.nav a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav a.active {
    box-shadow: inset 0 0 0 1px rgba(30, 79, 143, 0.12);
}

.nav .nav-quiet {
    color: #8a5f28;
}

.company-pill {
    background: linear-gradient(135deg, #fff8e8, #f6ead1);
    border: 1px solid rgba(184, 137, 59, 0.25);
    color: #6f4d21;
}

.page {
    margin: 0 auto;
    max-width: 1200px;
    padding: 38px 32px 56px;
}

.hero,
.dashboard-head,
.page-head {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(13, 26, 40, 0.96), rgba(30, 79, 143, 0.91)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: #fff;
    display: flex;
    gap: 28px;
    justify-content: space-between;
    margin-bottom: 26px;
    min-height: 318px;
    overflow: hidden;
    padding: 44px;
    position: relative;
}

.hero::after,
.dashboard-head::after,
.page-head::after {
    background:
        linear-gradient(135deg, transparent 0 32%, rgba(255, 255, 255, 0.1) 32% 33%, transparent 33% 66%, rgba(184, 137, 59, 0.24) 66% 67%, transparent 67%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent);
    content: "";
    height: 180%;
    pointer-events: none;
    position: absolute;
    right: -16%;
    top: -40%;
    transform: rotate(8deg);
    width: 42%;
}

.hero > *,
.dashboard-head > *,
.page-head > * {
    position: relative;
    z-index: 1;
}

.hero h1,
.dashboard-head h1,
.page-head h1 {
    color: #fff;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.04;
    margin: 0 0 16px;
    max-width: 850px;
}

.eyebrow {
    color: var(--gold-soft);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.lead {
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
    margin: 0;
    max-width: 680px;
}

.page-head {
    min-height: 220px;
}

.panel .lead {
    color: var(--muted);
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.head-actions,
.directory-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.directory-tools span {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    padding: 8px 11px;
}

.button,
button {
    align-items: center;
    background: #f7f4ed;
    border: 1px solid rgba(203, 191, 170, 0.8);
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    padding: 10px 17px;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.button:hover,
button:hover {
    border-color: var(--line-strong);
    box-shadow: 0 10px 22px rgba(16, 28, 42, 0.08);
    transform: translateY(-1px);
}

.button.primary,
button.primary {
    background: linear-gradient(135deg, var(--gold), #d5ad68);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 14px 30px rgba(111, 77, 33, 0.22);
    color: #17110a;
}

.button.primary:hover,
button.primary:hover {
    background: linear-gradient(135deg, #c79b50, #efd08d);
}

.button.danger,
button.danger {
    background: #fff0ee;
    border-color: rgba(155, 45, 47, 0.24);
    color: var(--error);
}

.button.danger:hover,
button.danger:hover {
    background: #ffe4df;
}

.inline-action {
    display: inline-flex;
    margin: 0;
}

.hero .button:not(.primary),
.dashboard-head .button:not(.primary) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
}

.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-soft));
    border: 1px solid rgba(203, 191, 170, 0.86);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    padding: 26px;
}

.panel.narrow {
    margin: 56px auto;
    max-width: 480px;
}

.panel.compact {
    margin-bottom: 0;
}

.panel h1,
.panel h2 {
    color: var(--text-strong);
    line-height: 1.18;
    margin: 0 0 20px;
}

.panel p,
.directory-head p,
.org-card p,
.muted-text {
    color: var(--muted);
    margin: 0;
}

.panel-heading,
.directory-head,
.org-card-head,
.staff-card-top {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.modal {
    align-items: flex-start;
    display: none;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 32px;
    position: fixed;
    z-index: 100;
}

.modal:target {
    display: flex;
}

.modal-backdrop {
    background: rgba(6, 17, 29, 0.72);
    inset: 0;
    position: fixed;
}

.modal-card {
    background: linear-gradient(180deg, #ffffff, #fbfaf7);
    border: 1px solid rgba(203, 191, 170, 0.95);
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
    max-width: 560px;
    padding: 24px;
    position: relative;
    width: min(100%, 560px);
    z-index: 1;
}

.wide-modal .modal-card {
    max-width: 980px;
    width: min(100%, 980px);
}

.modal-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
}

.modal-head h2 {
    margin: 0;
}

.modal-head p {
    color: var(--muted);
    margin: 4px 0 0;
}

.modal-close {
    align-items: center;
    background: #f2eadc;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    display: inline-flex;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.warning-box {
    background: var(--error-bg);
    border: 1px solid rgba(155, 45, 47, 0.2);
    border-radius: 8px;
    color: var(--error);
    font-weight: 750;
    padding: 14px;
}

.panel-heading {
    margin-bottom: 22px;
}

.panel-heading h2,
.directory-head h2,
.org-card h2,
.staff-card h3 {
    margin: 0;
}

.panel h1 {
    font-size: 32px;
}

.panel h2 {
    font-size: 24px;
}

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

.stack {
    display: grid;
    gap: 18px;
}

.section-title {
    align-items: center;
    border-top: 1px solid var(--line);
    color: #7c571f;
    display: flex;
    font-size: 12px;
    font-weight: 850;
    gap: 10px;
    grid-column: 1 / -1;
    padding-top: 20px;
    text-transform: uppercase;
}

.section-title::before {
    background: var(--gold);
    border-radius: 999px;
    content: "";
    height: 7px;
    width: 7px;
}

.section-title:first-of-type {
    border-top: 0;
    padding-top: 0;
}

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

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
}

.checkbox-label {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.checkbox-label input {
    min-height: auto;
    width: auto;
}

input,
select,
textarea {
    background: #fffdf8;
    border: 1px solid rgba(203, 191, 170, 0.95);
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    min-height: 44px;
    outline: none;
    padding: 10px 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    background: #fff;
    border-color: rgba(30, 79, 143, 0.68);
    box-shadow: 0 0 0 4px rgba(30, 79, 143, 0.11);
}

textarea {
    resize: vertical;
}

.alert {
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 14px 16px;
}

.alert p {
    margin: 0 0 6px;
}

.alert p:last-child {
    margin-bottom: 0;
}

.alert.success {
    background: var(--success-bg);
    border-color: rgba(20, 99, 68, 0.18);
    color: var(--success);
}

.alert.error {
    background: var(--error-bg);
    border-color: rgba(155, 45, 47, 0.18);
    color: var(--error);
}

.stats,
.setup-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

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

.management-summary article {
    background: linear-gradient(145deg, #ffffff, #f8f4eb);
    border: 1px solid rgba(203, 191, 170, 0.86);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    padding: 20px;
}

.management-summary strong {
    color: var(--text-strong);
    display: block;
    font-size: 32px;
    line-height: 1;
}

.management-summary span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-top: 8px;
}

.approval-lane {
    margin-bottom: 20px;
}

.rank-flow {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.rank-node {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    position: relative;
}

.rank-node::before {
    background: linear-gradient(180deg, var(--gold), var(--teal));
    border-radius: 999px;
    content: "";
    height: calc(100% - 20px);
    left: 0;
    position: absolute;
    top: 10px;
    width: 4px;
}

.rank-node span,
.rank-node strong,
.rank-node em {
    display: block;
}

.rank-node span {
    color: #76531f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.rank-node strong {
    color: var(--text-strong);
    margin-top: 4px;
}

.rank-node em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    margin-top: 3px;
}

.org-board {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.org-card,
.staff-card {
    background: linear-gradient(180deg, #ffffff, #fbfaf7);
    border: 1px solid rgba(203, 191, 170, 0.86);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.org-card {
    padding: 22px;
}

.org-card-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.org-card-head span {
    background: var(--primary-soft);
    border-radius: 999px;
    color: var(--primary-dark);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 900;
    padding: 7px 10px;
}

.position-list {
    display: grid;
    gap: 10px;
}

.position-row {
    align-items: center;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 12px;
}

.position-row strong,
.position-row span {
    display: block;
}

.position-row span,
.position-row em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.muted-card {
    background: linear-gradient(180deg, #f8f4eb, #fffdf8);
}

.empty-state,
.empty-panel {
    color: var(--muted);
}

.staff-form-panel {
    overflow: hidden;
}

.staff-tabs > input[type="radio"] {
    height: 0;
    opacity: 0;
    position: absolute;
    width: 0;
}

.tab-list {
    background: #f2eadc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 22px;
    padding: 6px;
}

.tab-list label {
    align-items: center;
    border-radius: 7px;
    color: #74552a;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    justify-content: center;
    min-height: 38px;
    padding: 8px;
    text-align: center;
}

#tab-basic:checked ~ .tab-list label[for="tab-basic"],
#tab-personal:checked ~ .tab-list label[for="tab-personal"],
#tab-work:checked ~ .tab-list label[for="tab-work"],
#tab-family:checked ~ .tab-list label[for="tab-family"],
#tab-experience:checked ~ .tab-list label[for="tab-experience"],
#tab-education:checked ~ .tab-list label[for="tab-education"] {
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(16, 28, 42, 0.08);
    color: var(--primary-dark);
}

.tab-panel {
    display: none;
}

#tab-basic:checked ~ .basic-panel,
#tab-personal:checked ~ .personal-panel,
#tab-work:checked ~ .work-panel,
#tab-family:checked ~ .family-panel,
#tab-experience:checked ~ .experience-panel,
#tab-education:checked ~ .education-panel {
    display: block;
}

.profile-upload {
    align-items: center;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 18px;
    grid-template-columns: 92px minmax(0, 1fr);
    margin-bottom: 18px;
    padding: 16px;
}

.avatar-preview,
.staff-avatar,
.staff-card img {
    border-radius: 8px;
    height: 74px;
    width: 74px;
}

.avatar-preview,
.staff-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--bg-deep), var(--primary));
    color: var(--gold-soft);
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
}

.form-actions {
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 20px;
}

.directory-head {
    margin: 10px 0 18px;
}

.staff-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.department-directory {
    display: grid;
    gap: 22px;
}

.department-group {
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(203, 191, 170, 0.66);
    border-radius: 8px;
    padding: 18px;
}

.department-group-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.department-group-head h2 {
    color: var(--text-strong);
    margin: 0;
}

.department-group-head p {
    color: var(--muted);
    margin: 2px 0 0;
}

.staff-card {
    overflow: hidden;
    padding: 20px;
}

.staff-card-top {
    justify-content: flex-start;
}

.staff-card img {
    object-fit: cover;
}

.staff-card h3 {
    color: var(--text-strong);
    font-size: 20px;
}

.staff-card-top p {
    color: var(--muted);
    margin: 2px 0 0;
}

.staff-meta,
.profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.staff-meta span,
.profile-chips span {
    background: var(--primary-soft);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 850;
    padding: 7px 9px;
}

.profile-chips span {
    background: #fff2d4;
    color: #76531f;
}

.card-actions {
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
}

.card-actions .button {
    min-height: 38px;
    padding: 8px 12px;
}

.profile-facts {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding-top: 16px;
}

.profile-facts div {
    display: grid;
    gap: 3px;
}

.profile-facts dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-facts dd {
    color: var(--text);
    margin: 0;
    overflow-wrap: anywhere;
}

.profile-preview {
    display: grid;
    gap: 22px;
    grid-template-columns: 260px minmax(0, 1fr);
}

.preview-card {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 20px;
    text-align: center;
}

.preview-card img,
.large-avatar {
    height: 104px;
    width: 104px;
}

.preview-card img {
    border-radius: 8px;
    object-fit: cover;
}

.preview-card h3,
.preview-details h3 {
    color: var(--text-strong);
    margin: 0;
}

.preview-card p {
    color: var(--muted);
    margin: 0;
    overflow-wrap: anywhere;
}

.preview-details {
    display: grid;
    gap: 18px;
}

.preview-details section {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.staff-self-profile {
    align-items: start;
}

.record-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.record-list article {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.record-list strong,
.record-list span,
.record-list p {
    display: block;
}

.record-list span,
.record-list p {
    color: var(--muted);
    font-size: 13px;
    margin: 3px 0 0;
}

.task-board {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.task-column {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(203, 191, 170, 0.76);
    border-radius: 8px;
    min-width: 220px;
    padding: 14px;
}

.task-column-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.task-column-head h2 {
    color: var(--text-strong);
    font-size: 17px;
    margin: 0;
}

.task-column-head span {
    background: var(--primary-soft);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    padding: 6px 9px;
}

.task-list {
    display: grid;
    gap: 12px;
}

.task-card {
    background: linear-gradient(180deg, #ffffff, #fffdf8);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(16, 28, 42, 0.07);
    padding: 14px;
}

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

.task-card-head strong {
    color: var(--text-strong);
}

.task-card p {
    color: var(--muted);
    font-size: 13px;
    margin: 10px 0;
}

.task-tabs {
    margin-bottom: 24px;
}

.task-tab-input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.task-tab-list {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    overflow-x: auto;
    padding: 0 0 10px;
}

.task-tab {
    align-items: center;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
}

.task-tab span {
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.task-tab strong {
    background: var(--primary-soft);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 12px;
    line-height: 1;
    min-width: 26px;
    padding: 6px 8px;
    text-align: center;
}

#task-tab-blocked:checked ~ .task-tab-list label[for="task-tab-blocked"],
#task-tab-in_progress:checked ~ .task-tab-list label[for="task-tab-in_progress"],
#task-tab-not_started:checked ~ .task-tab-list label[for="task-tab-not_started"],
#task-tab-completed:checked ~ .task-tab-list label[for="task-tab-completed"],
#task-tab-cancelled:checked ~ .task-tab-list label[for="task-tab-cancelled"] {
    background: #ffffff;
    border-color: rgba(18, 53, 95, 0.28);
    box-shadow: 0 12px 26px rgba(16, 28, 42, 0.08);
    color: var(--text-strong);
}

.task-tab-panel {
    display: none;
}

#task-tab-blocked:checked ~ .task-panel-blocked,
#task-tab-in_progress:checked ~ .task-panel-in_progress,
#task-tab-not_started:checked ~ .task-panel-not_started,
#task-tab-completed:checked ~ .task-panel-completed,
#task-tab-cancelled:checked ~ .task-panel-cancelled {
    display: block;
}

.task-table-wrap {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(16, 28, 42, 0.07);
    overflow-x: auto;
}

.task-table {
    border-collapse: collapse;
    min-width: 1080px;
    width: 100%;
}

.task-table th {
    background: #f7f2e8;
    color: var(--text-strong);
    font-size: 12px;
    letter-spacing: 0;
    padding: 14px 16px;
    text-align: left;
    text-transform: uppercase;
}

.task-table td {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    padding: 16px;
    vertical-align: top;
}

.task-table td > strong,
.task-table-title strong,
.task-progress-line strong {
    color: var(--text-strong);
}

.task-table td > span,
.task-table td > small,
.task-table td > a {
    display: block;
    margin-top: 5px;
}

.task-table small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.task-title-cell {
    min-width: 280px;
}

.task-table-title {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.task-title-cell p {
    color: var(--muted);
    line-height: 1.45;
    margin: 8px 0 0;
}

.task-progress-line {
    display: grid;
    gap: 8px;
    min-width: 140px;
}

.task-table .progress-track {
    margin-top: 0;
}

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

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 150px;
}

.task-report-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.task-report-card,
.report-post {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(16, 28, 42, 0.07);
}

.task-report-card {
    padding: 18px;
    position: sticky;
    top: 92px;
}

.task-report-card h2 {
    color: var(--text-strong);
    font-size: 18px;
    margin: 0 0 12px;
}

.task-report-main {
    display: grid;
    gap: 18px;
}

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

.report-post {
    padding: 22px;
}

.report-post-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.report-post-head span,
.report-post-head time {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.report-post-head time {
    margin-top: 3px;
}

.report-post h2 {
    color: var(--text-strong);
    font-size: 22px;
    margin: 14px 0 8px;
}

.report-post p {
    color: var(--muted);
    line-height: 1.6;
}

.report-meta-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 16px 0 0;
}

.report-meta-grid div {
    background: #fbf8f0;
    border: 1px solid rgba(203, 191, 170, 0.72);
    border-radius: 8px;
    padding: 10px;
}

.report-meta-grid dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.report-meta-grid dd {
    color: var(--text-strong);
    font-size: 13px;
    margin: 4px 0 0;
}

.report-attachment {
    background: #f7fbfa;
    border: 1px solid rgba(48, 118, 113, 0.16);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
}

.report-attachment img {
    border-radius: 8px;
    max-height: 360px;
    object-fit: contain;
    width: 100%;
}

.review-note {
    background: #eef7f5;
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    margin-top: 16px;
    padding: 12px;
}

.review-note strong {
    color: var(--text-strong);
    display: block;
}

.review-note span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

.review-note p {
    margin: 8px 0 0;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.status-chip {
    background: #eef7f5;
    border: 1px solid rgba(48, 118, 113, 0.22);
    border-radius: 999px;
    color: #255f5a;
    font-size: 11px;
    font-weight: 900;
    padding: 5px 8px;
    text-transform: uppercase;
}

.status-chip.review-pending_review {
    background: #fff2d4;
    border-color: rgba(183, 128, 42, 0.28);
    color: #76531f;
}

.status-chip.review-approved {
    background: #e7f6ed;
    border-color: rgba(20, 99, 68, 0.2);
    color: #146344;
}

.status-chip.review-submitted,
.status-chip.review-reviewed {
    background: #eef7f5;
    border-color: rgba(48, 118, 113, 0.22);
    color: #255f5a;
}

.status-chip.review-rejected,
.status-chip.review-needs_adjustment {
    background: var(--error-bg);
    border-color: rgba(171, 60, 60, 0.22);
    color: var(--error);
}

.task-note {
    background: rgba(241, 248, 247, 0.86);
    border: 1px solid rgba(48, 118, 113, 0.16);
    border-radius: 8px;
    margin-top: 12px;
    padding: 10px;
}

.task-note strong {
    color: var(--text-strong);
    display: block;
    font-size: 12px;
}

.task-note p {
    margin: 4px 0;
}

.task-note a,
.record-list a {
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.priority {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    padding: 5px 8px;
    text-transform: uppercase;
}

.priority.low {
    background: #e7f6ed;
    color: #146344;
}

.priority.normal {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.priority.high {
    background: #fff2d4;
    color: #76531f;
}

.priority.urgent {
    background: var(--error-bg);
    color: var(--error);
}

.progress-track {
    background: #efe8d9;
    border-radius: 999px;
    height: 8px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-track span {
    background: linear-gradient(90deg, var(--teal), var(--gold));
    display: block;
    height: 100%;
}

.setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
    background: linear-gradient(145deg, #ffffff, #f8f4eb);
    border: 1px solid rgba(203, 191, 170, 0.86);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    padding: 24px;
    position: relative;
}

.stat::before {
    background: linear-gradient(180deg, var(--gold), var(--teal));
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 4px;
}

.stat strong {
    color: var(--text-strong);
    display: block;
    font-size: 38px;
    line-height: 1;
}

.stat span,
td span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-top: 5px;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-x: auto;
}

table {
    background: #fffdf8;
    border-collapse: collapse;
    min-width: 860px;
    width: 100%;
}

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

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

tbody tr:hover {
    background: #f8f1e4;
}

th {
    background: #f2eadc;
    color: #6f4d21;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

td strong {
    color: var(--text-strong);
}

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

    .sidebar {
        height: auto;
        position: static;
    }

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

    .topbar,
    .hero,
    .dashboard-head,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 18px;
        position: static;
    }

    .brand {
        font-size: 17px;
    }

    .nav {
        justify-content: flex-start;
        width: 100%;
    }

    .nav a,
    .company-pill {
        font-size: 13px;
    }

    .page {
        padding: 22px 16px 38px;
    }

    .hero,
    .dashboard-head,
    .page-head {
        min-height: auto;
        padding: 30px 22px;
    }

    .hero h1,
    .dashboard-head h1,
    .page-head h1 {
        font-size: 34px;
    }

    .form-grid,
    .stats,
    .setup-grid,
    .management-summary,
    .org-board,
    .staff-grid,
    .profile-preview,
    .two-column {
        grid-template-columns: 1fr;
    }

    .head-actions,
    .directory-tools {
        width: 100%;
    }

    .head-actions .button,
    .directory-tools span {
        width: 100%;
    }

    .task-tab-list {
        margin-left: -4px;
        padding-bottom: 8px;
    }

    .task-tab {
        min-height: 40px;
        padding: 9px 10px;
    }

    .task-table-wrap {
        overflow-x: visible;
    }

    .task-table {
        min-width: 0;
    }

    .task-table thead {
        display: none;
    }

    .task-table,
    .task-table tbody,
    .task-table tr,
    .task-table td {
        display: block;
        width: 100%;
    }

    .task-table tr {
        border-top: 1px solid var(--line);
        padding: 12px 0;
    }

    .task-table tr:first-child {
        border-top: 0;
    }

    .task-table td {
        border-top: 0;
        padding: 9px 14px;
    }

    .task-table td::before {
        color: var(--text-strong);
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 900;
        margin-bottom: 5px;
        text-transform: uppercase;
    }

    .task-table-title {
        display: grid;
        gap: 8px;
        justify-items: start;
    }

    .table-actions .button {
        flex: 1 1 120px;
    }

    .task-report-layout,
    .report-meta-grid {
        grid-template-columns: 1fr;
    }

    .task-report-card {
        position: static;
    }

    .report-post-head {
        display: grid;
    }

    .modal {
        padding: 16px;
    }

    .tab-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-upload {
        grid-template-columns: 1fr;
    }

    .task-board {
        grid-template-columns: 1fr;
        overflow-x: visible;
    }

    .panel {
        padding: 22px;
    }
}
