@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f7fb;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --surface-soft: #eef3fa;
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.15);
    --text: #0f172a;
    --muted: #64748b;
    --brand: #1A759F;
    --brand-2: #2F8FBC;
    --accent: #0F5C83;
    --danger: #dc2626;
    --warning: #f59e0b;
    --success: #16a34a;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --radius-xl: 14px;
    --radius-lg: 14px;
    --radius-md: 14px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(26, 117, 159, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(47, 143, 188, 0.14), transparent 25%),
        var(--bg);
    color: var(--text);
    font-family: 'Mulish', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: 'Mulish', sans-serif;
    font-weight: 500;
    line-height: 1.15;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 22px;
}

h4 {
    font-size: 20px;
}

h5 {
    font-size: 18px;
}

h6 {
    font-size: 16px;
}

.app-admin-body,
.app-admin-body *:not(.fa),
.app-auth-body,
.app-auth-body *:not(.fa) {
    letter-spacing: 0.6px !important;
}

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

button {
    border: 0;
    background: transparent;
}

a,
button,
.btn,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"],
.nav-group-toggle,
.sidebar-toggle,
.topbar-pill,
.pill,
.suggestion-item,
.clickable-row,
.icon-action,
.nav-link,
.yacht-option-button,
.photo-select,
.ghost-link,
.text-link {
    cursor: pointer;
}

.app-admin-body a,
.app-admin-body button,
.app-admin-body .btn,
.app-admin-body input,
.app-admin-body textarea,
.app-admin-body select,
.app-auth-body a,
.app-auth-body button,
.app-auth-body .btn,
.app-auth-body input,
.app-auth-body textarea,
.app-auth-body select {
    outline: none !important;
    box-shadow: none !important;
}

.app-admin-body a:hover,
.app-admin-body a:focus,
.app-admin-body a:active,
.app-auth-body a:hover,
.app-auth-body a:focus,
.app-auth-body a:active {
    color: inherit;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.app-admin-body button:hover,
.app-admin-body button:focus,
.app-admin-body button:active,
.app-admin-body .btn:hover,
.app-admin-body .btn:focus,
.app-admin-body .btn:active,
.app-admin-body input:focus,
.app-admin-body textarea:focus,
.app-admin-body select:focus,
.app-auth-body button:hover,
.app-auth-body button:focus,
.app-auth-body button:active,
.app-auth-body .btn:hover,
.app-auth-body .btn:focus,
.app-auth-body .btn:active,
.app-auth-body input:focus,
.app-auth-body textarea:focus,
.app-auth-body select:focus {
    outline: none !important;
    box-shadow: none !important;
}

.app-admin-body {
    overflow-x: hidden;
}

.admin-shell {
    display: grid;
    grid-template-columns: 310px 1fr;
    min-height: 100vh;
}

.admin-shell,
.admin-main,
.page-frame,
.admin-topbar,
.hero-panel,
.panel-card,
.stats-grid,
.summary-grid,
.content-grid,
.filter-grid,
.report-grid,
.toolbar-row,
.topbar-left,
.topbar-right,
.quick-link-list,
.yacht-list-grid,
.auth-shell,
.auth-card-wrap {
    min-width: 0;
}

.page-frame > *,
.admin-topbar > *,
.hero-panel > *,
.panel-head > *,
.stats-grid > *,
.summary-grid > *,
.content-grid > *,
.filter-grid > *,
.report-grid > * {
    min-width: 0;
}

.admin-main,
.admin-topbar,
.hero-panel,
.panel-card,
.app-alert,
.auth-card {
    width: 100%;
    max-width: 100%;
}

.sidebar-overlay {
    display: none;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 28px 22px;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(13, 20, 34, 0.92);
    color: #f8fafc;
    backdrop-filter: blur(18px);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
    z-index: 20;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.admin-sidebar::-webkit-scrollbar {
    width: 8px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.sidebar-brand img {
    width: 148px;
    filter: brightness(0) invert(1);
}

.sidebar-user {
    display: none;
    gap: 14px;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px;
    border-radius: 10px;
    color: #fff;
    text-align: left;
}

.sidebar-user-toggle:hover,
.sidebar-user.is-open .sidebar-user-toggle {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 800;
}

.sidebar-user-copy {
    min-width: 0;
}

.sidebar-user-copy strong {
    display: block;
    color: #fff;
    font-size: 14px;
}

.sidebar-user-copy span {
    display: block;
    margin-top: 2px;
    color: rgba(248, 250, 252, 0.68);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.sidebar-user-menu {
    display: none;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user.is-open .sidebar-user-menu {
    display: grid;
}

.sidebar-user-chevron {
    flex: 0 0 auto;
    color: rgba(248, 250, 252, 0.66);
    transition: transform 0.2s ease;
}

.sidebar-user.is-open .sidebar-user-chevron {
    transform: rotate(180deg);
}

.sidebar-user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    color: rgba(248, 250, 252, 0.78);
    background: rgba(255, 255, 255, 0.03);
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user-menu a:hover,
.sidebar-user-menu a.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.24), rgba(47, 143, 188, 0.22));
}

.sidebar-user-menu a.is-danger {
    color: #fecaca;
}

.sidebar-user-menu a.is-danger:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.18);
}

.sidebar-user-divider {
    height: 1px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.nav-group {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.nav-direct-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 18px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.03);
    color: #f8fafc;
    font-size: 15px;
    font-weight: 400;
    transition: 0.2s ease;
}

.nav-direct-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nav-direct-link:hover,
.nav-direct-link.is-active {
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.24), rgba(47, 143, 188, 0.22));
    color: #ffffff;
}

.nav-direct-link.is-disabled {
    cursor: default;
    opacity: 0.68;
}

.nav-direct-link.is-disabled:hover {
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.68;
}

.nav-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 10px;
    background: rgba(26, 117, 159, 0.22);
    color: #dff6ff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.nav-group-toggle {
    width: 100%;
    padding: 18px 18px;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 400;
}

.nav-group-toggle span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.nav-group-links {
    display: none;
    padding: 0 12px 14px;
}

.nav-group.is-open .nav-group-links {
    display: grid;
    gap: 6px;
}

.nav-subgroup {
    display: grid;
    gap: 6px;
}

.nav-subgroup-toggle {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(248, 250, 252, 0.78);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
}

.nav-subgroup.is-open .nav-subgroup-toggle {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-subgroup-links {
    display: none;
    gap: 6px;
    padding-left: 10px;
}

.nav-subgroup.is-open .nav-subgroup-links {
    display: grid;
}

.nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    color: rgba(248, 250, 252, 0.78);
    transition: 0.2s ease;
}

.nav-sublink {
    font-size: 13px;
    padding-left: 16px;
}

.nav-link:hover,
.nav-link.is-active {
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.24), rgba(47, 143, 188, 0.22));
    color: #ffffff;
}

.admin-main {
    padding: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 14;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 24px;
    border-radius: 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-top: 0;
    border-left: 0;
    border-right: 0;
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-left h1 {
    font-size: 18px;
}

.topbar-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-toggle,
.topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 18px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 600;
}

.topbar-yacht-pill {
    justify-content: flex-start;
}

.topbar-yacht-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(26, 117, 159, 0.12);
}

.topbar-yacht-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-yacht-avatar-fallback {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}

.topbar-pill span,
.topbar-user-copy,
.topbar-user-copy strong,
.topbar-user-copy span,
.quick-link-list strong,
.quick-link-list span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.sidebar-toggle {
    width: 50px;
    justify-content: center;
    display: none;
}

.topbar-user-menu {
    position: relative;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 50px;
    padding: 0 12px 0 8px;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
}

.topbar-user:hover,
.topbar-user-menu.is-open .topbar-user,
.topbar-user-menu.is-active .topbar-user {
    background: var(--surface-soft);
}

.topbar-avatar {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 800;
}

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

.topbar-user-copy span {
    color: var(--muted);
    font-size: 12px;
}

.user-menu-chevron {
    color: var(--muted);
    transition: transform 0.2s ease;
}

.topbar-user-menu.is-open .user-menu-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 30;
    display: none;
    min-width: 238px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff !important;
    background-image: none !important;
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: var(--shadow);
}

.topbar-user-menu.is-open .user-dropdown {
    display: grid;
    gap: 4px;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.user-dropdown a:hover,
.user-dropdown a.is-active {
    color: var(--brand);
    background: rgba(26, 117, 159, 0.09);
}

.user-dropdown a.is-danger {
    color: #b91c1c;
}

.user-dropdown a.is-danger:hover {
    color: #991b1b;
    background: rgba(239, 68, 68, 0.1);
}

.user-dropdown-divider {
    height: 1px;
    margin: 4px;
    background: var(--line);
}

.page-frame {
    padding: 24px;
    display: grid;
    gap: 24px;
}

.hero-panel,
.panel-card {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 26px;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(26, 117, 159, 0.96), rgba(15, 92, 131, 0.98)),
        var(--surface);
    color: #fff;
}

.hero-panel h2 {
    margin-top: 10px;
    font-size: 34px;
    max-width: 780px;
}

.hero-panel p {
    margin: 14px 0 0;
    max-width: 720px;
    color: rgba(255, 255, 255, 0.78);
}

.hero-panel .eyebrow {
    color: #fff;
}

.hero-chip-stack,
.stats-grid,
.summary-grid,
.content-grid,
.filter-grid,
.report-grid {
    display: grid;
    gap: 18px;
}

.hero-chip-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: end;
}

.hero-chip,
.stat-card,
.summary-item {
    padding: 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.hero-chip span,
.summary-item span,
.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-panel .hero-chip span {
    color: rgba(255, 255, 255, 0.72);
}

.hero-chip strong,
.summary-item strong,
.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 22px;
}

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
}

.tone-mint {
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.16), rgba(255, 255, 255, 0.95));
}

.tone-amber {
    background: linear-gradient(135deg, rgba(47, 143, 188, 0.16), rgba(255, 255, 255, 0.95));
}

.tone-cyan {
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.12), rgba(255, 255, 255, 0.95));
}

.tone-rose {
    background: linear-gradient(135deg, rgba(15, 92, 131, 0.16), rgba(255, 255, 255, 0.95));
}

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

.panel-card {
    padding: 24px;
}

.panel-card-tight {
    padding: 24px;
}

.panel-card.nested {
    box-shadow: none;
    background: var(--surface-strong);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.panel-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-head h3 {
    font-size: 24px;
}

.panel-head.mini {
    margin-bottom: 12px;
}

.panel-head.mini h3 {
    font-size: 18px;
}

.panel-kicker,
.eyebrow {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.text-link {
    color: var(--brand);
    font-weight: 700;
}

.quick-link-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.quick-link-list a {
    padding: 18px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid transparent;
}

.quick-link-list strong {
    display: block;
    font-size: 17px;
}

.quick-link-list span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

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

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--muted);
    font-weight: 700;
}

.pill.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
    color: #fff;
}

.search-inline {
    flex: 0 0 320px;
    position: relative;
}

.search-inline i {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--muted);
}

.search-inline input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.app-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: var(--surface-strong);
}

.app-table th,
.app-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.app-table thead th {
    position: sticky;
    top: 0;
    background: rgba(238, 243, 250, 0.96);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-table tbody tr:hover {
    background: rgba(26, 117, 159, 0.06);
}

.table-muted {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.clickable-row {
    cursor: pointer;
}

.receipt-thumb {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: cover;
}

.personnel-thumb {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    object-fit: cover;
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
}

.personnel-thumb-fallback {
    border: 1px solid var(--line);
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.actions-head {
    text-align: right;
}

.actions-cell .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-badge.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.document-title-cell {
    min-width: 220px;
    white-space: normal;
    line-height: 1.6;
}

.section-copy {
    margin: 10px 0 0;
    max-width: 72ch;
    color: var(--muted);
    line-height: 1.7;
}

.personnel-profile-shell {
    display: grid;
    grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
    gap: 24px;
}

.personnel-profile-card,
.personnel-profile-overview {
    min-width: 0;
}

.personnel-profile-card {
    padding: 0;
    overflow: hidden;
}

.personnel-profile-cover {
    height: 118px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(26, 117, 159, 1), rgba(15, 92, 131, 0.96));
}

.personnel-profile-body {
    position: relative;
    display: grid;
    gap: 20px;
    padding: 0 24px 24px;
    margin-top: -42px;
}

.personnel-profile-avatar {
    width: 108px;
    height: 108px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    border: 4px solid var(--surface);
    background: var(--surface-soft);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
}

.personnel-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.personnel-profile-avatar-fallback {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 34px;
    font-weight: 700;
}

.personnel-profile-header {
    display: grid;
    gap: 10px;
}

.personnel-profile-header h3 {
    margin: 0;
    font-size: 30px;
}

.personnel-profile-subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.personnel-profile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.personnel-profile-pills .pill {
    height: auto;
    min-height: 40px;
    padding: 10px 14px;
}

.personnel-profile-overview {
    display: grid;
    gap: 22px;
    align-content: start;
}

.personnel-profile-intro {
    display: grid;
    gap: 10px;
}

.personnel-profile-intro h3 {
    margin: 0;
}

.personnel-profile-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.personnel-profile-summary .summary-item {
    height: 100%;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.personnel-profile-summary .summary-item strong {
    font-size: 20px;
}

.personnel-profile-summary .summary-item.personnel-summary-date strong,
.personnel-profile-summary .personnel-summary-date strong {
    font-size: 17px;
    line-height: 1.5;
}

.personnel-profile-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.personnel-profile-meta-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.personnel-profile-meta-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.personnel-profile-meta-card strong {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-word;
}

.personnel-profile-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.personnel-profile-actions .btn {
    flex: 1 1 220px;
    justify-content: center;
}

.timesheet-panel {
    margin-top: 24px;
}

.timesheet-panel-head {
    gap: 18px;
    align-items: flex-start;
}

.timesheet-period-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.timesheet-period-form .input {
    width: 172px;
}

.timesheet-period-form .btn {
    min-height: 42px;
}

.timesheet-table-wrap {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.timesheet-smart-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.timesheet-inline-alert {
    flex: 1 1 420px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(186, 77, 77, 0.18);
    background: rgba(186, 77, 77, 0.08);
    color: #a43f3f;
    font-size: 13px;
    font-weight: 600;
}

.timesheet-autosave-state {
    flex: 0 1 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(80, 107, 122, 0.08);
    color: #58707d;
    font-size: 12px;
    font-weight: 700;
}

.timesheet-autosave-state.is-dirty,
.timesheet-autosave-state.is-saving {
    background: rgba(26, 117, 159, 0.1);
    color: var(--brand);
}

.timesheet-autosave-state.is-saved {
    background: rgba(43, 143, 91, 0.1);
    color: #257b50;
}

.timesheet-autosave-state.is-error {
    background: rgba(186, 77, 77, 0.12);
    color: #a43f3f;
}

.timesheet-table th,
.timesheet-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.timesheet-table tbody tr.is-weekend {
    background: rgba(26, 117, 159, 0.045);
}

.timesheet-table .timesheet-hour-head {
    min-width: 54px;
    font-size: 11px;
    text-align: center;
    letter-spacing: 0.04em;
}

.timesheet-day-number {
    display: block;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

.timesheet-port-select {
    min-width: 128px;
}

.timesheet-hour-cell {
    padding: 10px 6px;
    text-align: center;
}

.timesheet-hour-toggle {
    position: relative;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.timesheet-hour-toggle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.timesheet-hour-toggle span {
    width: 28px;
    height: 28px;
    display: inline-flex;
    border-radius: 8px;
    border: 1px solid rgba(26, 117, 159, 0.18);
    background: #fff;
    transition: all 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.timesheet-hour-toggle.is-checked span {
    border-color: rgba(26, 117, 159, 0.48);
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.18), rgba(26, 117, 159, 0.38));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.timesheet-hour-toggle input:disabled + span {
    cursor: default;
    opacity: 0.72;
}

.timesheet-total-pill {
    min-width: 74px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(26, 117, 159, 0.14);
    background: rgba(26, 117, 159, 0.08);
    color: var(--brand);
    font-weight: 600;
}

.timesheet-total-pill.is-rest {
    border-color: rgba(80, 107, 122, 0.14);
    background: rgba(80, 107, 122, 0.08);
    color: #4f6470;
}

.timesheet-total-pill.is-weekly.is-muted {
    background: rgba(80, 107, 122, 0.05);
    border-color: rgba(80, 107, 122, 0.08);
    color: #90a0a8;
}

.timesheet-table [data-range-label] {
    display: block;
    margin-top: 6px;
}

.timesheet-note-input {
    min-width: 220px;
}

.timesheet-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 18px;
}

.timesheet-actions .app-btn {
    min-width: 180px;
}

.filter-grid.work-hour-report-filter {
    grid-template-columns: minmax(220px, 300px) minmax(220px, 320px) max-content;
    align-items: end;
}

.work-hour-period-field {
    min-width: 0;
}

.period-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-stepper .btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
}

.period-stepper .input {
    min-width: 160px;
}

.summary-grid.compact.work-hour-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.summary-grid.compact.work-hour-summary-grid .summary-item {
    height: 100%;
}

.work-hour-personnel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.work-hour-personnel-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.work-hour-personnel-avatar {
    width: 42px;
    height: 42px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(26, 117, 159, 0.1);
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.work-hour-personnel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-hour-personnel-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.work-hour-personnel-copy strong,
.work-hour-personnel-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-hour-personnel-copy strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.work-hour-personnel-copy small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.work-hour-report-table td {
    vertical-align: middle;
}

.work-hour-export-links {
    margin: 0 0 18px;
}

.personnel-document-panel .panel-head {
    margin-bottom: 18px;
}

.document-file-stack {
    display: grid;
    gap: 4px;
}

.document-file-stack strong {
    font-size: 13px;
    font-weight: 600;
}

.document-file-stack span {
    color: var(--muted);
    font-size: 12px;
}

.field-note {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.conditional-field[hidden] {
    display: none !important;
}

.document-empty-state {
    align-items: start;
}

.document-switch-card {
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.document-switch-card .label {
    margin-bottom: 14px;
}

.form-switch {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.form-switch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.form-switch-track {
    position: relative;
    width: 58px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    transition: background 0.2s ease;
}

.form-switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease;
}

.form-switch-input:checked + .form-switch-track {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.form-switch-input:checked + .form-switch-track .form-switch-thumb {
    transform: translateX(26px);
}

.form-switch-copy {
    display: grid;
    gap: 4px;
}

.form-switch-copy strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.form-switch-copy span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 5px 10px;
    border-radius: 14px;
    background: rgba(26, 117, 159, 0.12);
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.inline-badge.info {
    background: rgba(26, 117, 159, 0.12);
    color: var(--brand);
}

.inline-badge.success {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.inline-badge.danger {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

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

.summary-grid.compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}

.summary-grid.compact.debt-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.debt-records-panel {
    order: 1;
}

.debt-accounts-panel {
    order: 2;
}

.summary-grid.compact.team-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.summary-grid.compact.team-summary-grid .summary-item {
    height: 100%;
}

.summary-grid.dashboard-period-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.summary-grid.dashboard-period-grid .summary-item {
    height: 100%;
}

.summary-grid.compact.report-export-totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.summary-grid.compact.report-export-totals .summary-item {
    height: 100%;
}

.summary-item {
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 24px;
}

.report-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.report-mode-field {
    grid-column: 1 / -1;
}

.report-mode-options {
    display: inline-grid;
    grid-template-columns: repeat(2, max-content);
    gap: 8px;
    max-width: 100%;
}

.report-mode-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.report-mode-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    opacity: 0;
    pointer-events: none;
}

.report-mode-card {
    display: grid;
    gap: 2px;
    min-width: 150px;
    min-height: 51px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--muted);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.report-mode-card strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.report-mode-card small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

.report-mode-option:hover .report-mode-card,
.report-mode-input:focus-visible + .report-mode-card {
    border-color: rgba(26, 117, 159, 0.35);
    background: rgba(26, 117, 159, 0.06);
    box-shadow: 0 0 0 3px rgba(26, 117, 159, 0.08);
}

.report-mode-input:checked + .report-mode-card {
    border-color: rgba(26, 117, 159, 0.42);
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.12), rgba(26, 117, 159, 0.05));
    box-shadow: inset 0 0 0 1px rgba(26, 117, 159, 0.12);
}

.report-mode-input:checked + .report-mode-card strong,
.report-mode-input:checked + .report-mode-card small {
    color: var(--brand);
}

.action-row {
    display: flex;
    align-items: flex-end;
}

.form-item {
    margin-bottom: 18px;
}

.personnel-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px 24px;
}

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

.form-span-full {
    grid-column: span 12;
}

.form-span-third {
    grid-column: span 4;
}

.form-span-half {
    grid-column: span 6;
}

.personnel-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 4px;
}

.personnel-form-actions .app-btn {
    min-width: 170px;
}

.label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.input,
.textarea,
.selectbox,
.input-group-text {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
}

.textarea {
    min-height: 120px;
}

.app-prefix-group .input-group-text {
    width: auto;
    display: inline-flex;
    align-items: center;
    background: var(--surface-soft);
}

.copy-field-group {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.copy-field-group .input {
    flex: 1 1 auto;
    min-width: 0;
}

.copy-field-button {
    min-width: 118px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.copy-field-button.is-copied {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.upload-dropzone {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    border: 1px dashed rgba(26, 117, 159, 0.24);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(26, 117, 159, 0.04), rgba(26, 117, 159, 0.08)),
        var(--surface-soft);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-within {
    border-color: rgba(26, 117, 159, 0.42);
    background:
        linear-gradient(135deg, rgba(26, 117, 159, 0.06), rgba(26, 117, 159, 0.12)),
        var(--surface);
    box-shadow: 0 0 0 3px rgba(26, 117, 159, 0.08);
}

.upload-dropzone.is-dragover {
    border-color: var(--brand);
    background:
        linear-gradient(135deg, rgba(26, 117, 159, 0.1), rgba(26, 117, 159, 0.16)),
        var(--surface);
    transform: translateY(-1px);
    box-shadow: 0 0 0 4px rgba(26, 117, 159, 0.12);
}

.upload-dropzone.has-file {
    border-style: solid;
}

.upload-dropzone-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);
    opacity: 0;
    white-space: nowrap;
}

.upload-dropzone-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.upload-dropzone-visual {
    width: 68px;
    height: 68px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(26, 117, 159, 0.12);
    color: var(--brand);
    font-size: 24px;
    font-weight: 700;
}

.upload-dropzone-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-dropzone-copy {
    display: grid;
    gap: 4px;
    flex: 1 1 240px;
    min-width: 0;
}

.upload-dropzone-copy strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.upload-dropzone-copy span {
    display: block;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.upload-dropzone-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.upload-dropzone-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

.upload-dropzone-filename {
    color: var(--text);
    font-weight: 600;
}

.app-btn,
.app-btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.01em;
}

.app-btn i,
.app-btn-light i,
.app-btn .btn-inline-count,
.app-btn-light .btn-inline-count {
    flex: 0 0 auto;
}

.app-btn:hover,
.app-btn:focus,
.app-btn:active,
.app-btn-light:hover,
.app-btn-light:focus,
.app-btn-light:active {
    opacity: 1 !important;
}

.app-btn {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}

.app-btn-light {
    background: var(--surface-soft);
    color: var(--text);
}

.app-btn-block {
    width: 100%;
}

.btn-outline-primary,
.btn-outline-danger {
    border-radius: 14px;
}

.mt-3 {
    margin-top: 18px;
}

.mt-4 {
    margin-top: 24px;
}

.app-alert {
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600;
}

.app-alert-success {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.18);
    color: #166534;
}

.app-alert-error,
.app-alert-danger {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.16);
    color: #991b1b;
}

.app-alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.16);
    color: #92400e;
}

.app-alert-info {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.16);
    color: #0c4a6e;
}

.empty-panel,
.empty-inline-state {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.empty-inline-state {
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed var(--line-strong);
    background: var(--surface-soft);
}

.empty-inline-state.slim {
    padding: 20px;
}

.auth-shell {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 100vh;
}

.auth-brand-panel,
.auth-content-panel {
    padding: 48px;
}

.auth-brand-panel {
    background:
        radial-gradient(circle at top left, rgba(47, 143, 188, 0.18), transparent 22%),
        radial-gradient(circle at bottom right, rgba(26, 117, 159, 0.2), transparent 28%),
        #09111f;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-logo img {
    width: 180px;
    filter: brightness(0) invert(1);
}

.auth-brand-copy h1 {
    margin: 16px 0 0;
    font-size: 28px;
    max-width: 620px;
}

.auth-brand-copy p {
    margin: 18px 0 0;
    max-width: 620px;
    color: rgba(255, 255, 255, 0.75);
}

.auth-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 14px;
}

.auth-chip {
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.auth-chip span {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-chip strong {
    display: block;
    margin-top: 0;
    font-size: 19px;
    line-height: 1.4;
}

.auth-content-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.auth-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    position: absolute;
    top: 48px;
    right: 48px;
    z-index: 3;
}

.ghost-link {
    color: var(--muted);
    font-weight: 700;
}

.auth-card-wrap {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.auth-card {
    padding: 30px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin-top: 0;
    font-size: 30px;
}

.auth-card p {
    margin-top: 14px;
    color: var(--muted);
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.auth-links-spaced {
    margin-top: 24px;
}

.auth-invitation-card {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    background: var(--surface-soft);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 18px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.radio-stack {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.radio-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.app-modal .modal-content,
.app-modal {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.app-modal .modal-header {
    border-bottom: 1px solid var(--line);
}

.modal-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.modal-helper-text {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.btn-inline-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 10px;
    background: rgba(26, 117, 159, 0.12);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.active-personnel-picker {
    display: grid;
    gap: 10px;
    max-height: 58vh;
    overflow: auto;
    padding-right: 4px;
}

.active-personnel-option {
    display: grid;
    grid-template-columns: auto 48px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    cursor: pointer;
    transition: 0.2s ease;
}

.active-personnel-option:hover {
    border-color: rgba(26, 117, 159, 0.3);
    background: #f7fbfd;
}

.active-personnel-check {
    position: relative;
    width: 22px;
    height: 22px;
}

.active-personnel-check input {
    position: absolute;
    inset: 0;
    width: 22px;
    height: 22px;
    opacity: 0;
    cursor: pointer;
}

.active-personnel-check span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.active-personnel-check input:checked + span {
    border-color: var(--brand);
    background: var(--brand);
}

.active-personnel-check input:checked + span::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

.active-personnel-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.active-personnel-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 117, 159, 0.12);
    color: var(--brand);
    font-weight: 700;
}

.active-personnel-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.active-personnel-copy strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.active-personnel-copy small {
    color: var(--muted);
    font-size: 12px;
}

.active-personnel-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.suggestion-box {
    display: none;
    margin-top: 10px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.suggestion-item {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.suggestion-item:last-child {
    border-bottom: 0;
}

.detail-stack {
    display: grid;
    gap: 20px;
}

.detail-media {
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.detail-media img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    border-radius: 14px;
}

.detail-media-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.detail-media-actions a {
    color: var(--brand);
    font-weight: 700;
}

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

.detail-item {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 14px;
    background: var(--surface-soft);
}

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

.detail-item strong {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chart-stack {
    display: grid;
    gap: 12px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr auto;
    gap: 12px;
    align-items: center;
}

.chart-bar {
    position: relative;
    height: 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.chart-bar div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.export-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.export-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--surface-soft);
    font-weight: 700;
}

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

.yacht-option {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 14px;
    background: var(--surface-soft);
}

.yacht-option.is-active {
    border: 1px solid rgba(26, 117, 159, 0.35);
}

.yacht-option-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.yacht-option-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(26, 117, 159, 0.12);
}

.yacht-option-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yacht-option-avatar-fallback {
    color: var(--brand);
    font-size: 18px;
    font-weight: 800;
}

.yacht-option-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.yacht-option-title {
    display: block;
    font-size: 16px;
    font-weight: 800;
}

.yacht-option-meta {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.icon-action {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
}

.icon-action.danger {
    color: var(--danger);
}

.text-content {
    max-height: 60vh;
    overflow: auto;
}

.task-command-center {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
    gap: 20px;
    align-items: center;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 251, 0.94));
    color: var(--text);
    box-shadow: var(--shadow);
}

.task-command-copy {
    display: grid;
    align-content: center;
    gap: 12px;
}

.task-command-copy .panel-kicker {
    color: var(--brand);
}

.task-command-copy h3 {
    font-size: 22px;
    color: var(--text);
}

.task-command-copy p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.task-command-actions {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.task-command-actions .app-btn {
    min-width: 150px;
}

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

.task-metric {
    min-height: 86px;
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.task-metric span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.task-metric strong {
    font-size: 24px;
    font-weight: 600;
}

.task-metric.is-urgent {
    border-color: rgba(220, 38, 38, 0.18);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.07), #ffffff);
}

.task-metric.is-done {
    border-color: rgba(22, 163, 74, 0.18);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.07), #ffffff);
}

.task-assignment-panel {
    background: #ffffff;
}

.task-assignment-panel .panel-head {
    margin-bottom: 18px;
}

.task-assignment-panel .panel-head h3 {
    font-size: 20px;
}

.task-assignment-form {
    display: grid;
    gap: 16px;
}

.task-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
    gap: 16px;
    align-items: start;
}

.task-user-field {
    grid-column: 1 / -1;
}

.task-priority-field {
    min-width: 0;
}

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

.task-priority-radios .radio-chip {
    min-height: 50px;
    padding: 0 14px;
    border-radius: 14px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    justify-content: center;
}

.task-priority-radios .radio-chip:has(input:checked) {
    border-color: rgba(26, 117, 159, 0.34);
    background: rgba(26, 117, 159, 0.1);
    color: var(--brand);
}

.task-priority-radios .radio-chip.is-urgent:has(input:checked) {
    border-color: rgba(220, 38, 38, 0.34);
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.task-description-field {
    grid-column: 1 / -1;
}

.task-description-field .textarea {
    min-height: 150px;
    resize: vertical;
}

.task-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.task-submit-button {
    min-width: 180px;
    min-height: 50px;
    margin-top: 2px;
}

.task-board-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.task-column {
    min-width: 0;
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.task-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 2px;
}

.task-column-head > div {
    min-width: 0;
    flex: 1 1 auto;
}

.task-column-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.task-column-head h4 {
    font-size: 17px;
}

.task-archive-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    margin-left: auto;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(26, 117, 159, 0.14);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.task-archive-link:hover,
.task-archive-link:focus {
    background: rgba(26, 117, 159, 0.2);
    color: var(--brand);
    text-decoration: none;
}

.task-archive-link i,
.task-archive-link span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.task-column-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.task-column-head strong {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--brand);
    font-size: 14px;
    font-weight: 800;
}

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

.task-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.task-card.is-urgent {
    border-color: rgba(220, 38, 38, 0.22);
}

.task-card.is-completed {
    opacity: 0.82;
}

.task-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.task-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.18), rgba(47, 143, 188, 0.18));
    color: var(--brand);
    font-weight: 800;
}

.task-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-card-top strong {
    display: block;
    font-size: 15px;
}

.task-card-top span:not(.task-avatar) {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.task-card p {
    margin: 0;
    color: var(--text);
    line-height: 1.65;
}

.task-card-meta,
.task-card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-card-meta .inline-badge {
    margin-left: 0;
}

.task-card-foot {
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.task-complete-button {
    width: auto;
    gap: 8px;
}

.task-source-button,
.task-archive-button,
.task-unarchive-button,
.task-delete-button {
    width: auto;
    gap: 8px;
}

.task-complete-button,
.task-source-button,
.task-archive-button,
.task-unarchive-button,
.task-delete-button,
.task-archive-back-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.task-archive-back-button {
    width: auto;
}

.task-archive-hero .panel-head {
    align-items: center;
}

.task-archive-hero .panel-head p {
    max-width: 680px;
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.task-archive-table td {
    vertical-align: middle;
}

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

.task-archive-table .task-unarchive-button {
    width: auto;
    min-width: 128px;
    white-space: nowrap;
}

.task-delete-button {
    min-width: 118px;
    color: var(--danger);
}

.task-delete-button:hover,
.task-delete-button:focus {
    color: var(--danger);
}

.task-archive-description {
    max-width: 420px;
    line-height: 1.55;
}

.lsa-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    background: linear-gradient(135deg, rgba(26, 117, 159, 0.1), rgba(255, 255, 255, 0.96));
}

.lsa-hero p {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.lsa-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
}

.lsa-hero-stats div {
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(26, 117, 159, 0.16);
    background: #ffffff;
}

.lsa-hero-stats span,
.lsa-assignment-strip span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.lsa-hero-stats strong {
    font-size: 22px;
    font-weight: 600;
}

.lsa-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.lsa-settings-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
    gap: 16px;
    align-items: end;
}

.lsa-settings-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.lsa-current-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}

.lsa-current-card {
    min-width: 0;
}

.lsa-assignment-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.lsa-assignment-strip > div {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    background: var(--surface-soft);
}

.lsa-assignment-strip strong {
    font-size: 16px;
    font-weight: 600;
}

.lsa-assignment-strip small {
    color: var(--muted);
}

.lsa-checklist-form {
    display: grid;
    gap: 16px;
}

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

.lsa-check-item {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
}

.lsa-check-item input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    cursor: pointer;
}

.lsa-check-item input:disabled,
.lsa-check-item input:disabled + span {
    cursor: default;
}

.lsa-check-item span {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.lsa-check-item strong {
    font-size: 14px;
    font-weight: 600;
}

.lsa-check-item small {
    color: var(--muted);
    font-size: 11px;
}

.lsa-check-item.is-checked {
    border-color: rgba(26, 117, 159, 0.3);
    background: rgba(26, 117, 159, 0.08);
}

.lsa-save-button {
    justify-self: start;
    min-height: 44px;
}

.lsa-save-note {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.lsa-add-card {
    display: grid;
    gap: 12px;
}

.lsa-add-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.lsa-add-form {
    display: grid;
    gap: 12px;
}

.lsa-add-form .app-btn-light {
    justify-self: start;
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
}

.lsa-history-table td {
    vertical-align: middle;
}

@media (max-width: 1280px) {
    .stats-grid,
    .summary-grid,
    .summary-grid.compact,
    .filter-grid,
    .hero-chip-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .summary-grid.compact.work-hour-summary-grid,
    .work-hour-personnel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .lsa-current-grid {
        grid-template-columns: 1fr;
    }

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

    .timesheet-period-form {
        width: 100%;
        justify-content: flex-start;
    }

    .hero-panel,
    .content-grid.two-up,
    .report-grid,
    .auth-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1199px) {
    .form-span-third,
    .form-span-half {
        grid-column: span 6;
    }
}

@media (max-width: 767px) {
    .personnel-form-grid {
        gap: 0 14px;
    }

    .personnel-profile-body,
    .personnel-profile-overview {
        padding: 18px;
    }

    .personnel-profile-body {
        margin-top: -30px;
    }

    .personnel-profile-cover {
        height: 88px;
    }

    .personnel-profile-avatar {
        width: 88px;
        height: 88px;
        font-size: 28px;
    }

    .personnel-profile-header h3 {
        font-size: 24px;
    }

    .personnel-profile-summary,
    .personnel-profile-meta-grid {
        grid-template-columns: 1fr;
    }

    .personnel-profile-actions .btn {
        width: 100%;
        flex: 1 1 100%;
    }

    .timesheet-panel-head,
    .timesheet-period-form {
        align-items: stretch;
        flex-direction: column;
    }

    .timesheet-period-form .input,
    .timesheet-period-form .btn,
    .timesheet-actions .app-btn {
        width: 100%;
    }

    .timesheet-port-select,
    .timesheet-note-input {
        min-width: 0;
        width: 100%;
    }

    .timesheet-smart-bar {
        align-items: stretch;
    }

    .timesheet-autosave-state {
        width: 100%;
        justify-content: center;
    }

    .filter-grid.work-hour-report-filter,
    .summary-grid.compact.work-hour-summary-grid,
    .work-hour-personnel-grid {
        grid-template-columns: 1fr;
    }

    .period-stepper {
        align-items: stretch;
    }

    .period-stepper .input {
        width: 100%;
        min-width: 0;
    }

    .work-hour-personnel-card {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .work-hour-personnel-card .timesheet-total-pill {
        grid-column: 1 / -1;
        width: 100%;
    }

    .form-span-third,
    .form-span-half {
        grid-column: span 12;
    }

    .upload-dropzone {
        padding: 16px;
    }

    .upload-dropzone-main {
        align-items: flex-start;
    }

    .upload-dropzone-button {
        width: 100%;
    }

    .personnel-form-actions .app-btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 980px) {
    .task-command-center,
    .task-modal-grid,
    .task-board-grid {
        grid-template-columns: 1fr;
    }

    .task-modal-actions {
        justify-content: stretch;
    }

    .task-submit-button {
        width: 100%;
        min-width: 0;
    }

    .lsa-hero,
    .lsa-settings-form,
    .lsa-assignment-strip,
    .lsa-checklist-grid {
        grid-template-columns: 1fr;
    }

    .lsa-hero-actions,
    .lsa-settings-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .lsa-hero-actions .btn,
    .lsa-settings-actions .btn {
        width: 100%;
    }

    .lsa-save-button,
    .lsa-add-form .app-btn-light {
        width: 100%;
    }

    .app-admin-body.sidebar-open {
        overflow: hidden;
    }

    .app-admin-body,
    .admin-shell,
    .admin-main,
    .page-frame {
        overflow-x: clip;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(88vw, 320px);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 18;
        border: 0;
        background: rgba(9, 17, 31, 0.42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .app-admin-body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .app-admin-body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar-close {
        display: inline-flex;
    }

    .admin-main {
        padding: 0;
    }

    .admin-topbar {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        padding: 20px 16px;
        gap: 12px;
    }

    .panel-card,
    .hero-panel {
        padding: 20px;
    }

    .topbar-left {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-start;
    }

    .topbar-left > div {
        display: none;
    }

    .topbar-right {
        width: auto;
        flex: 1 1 calc(100% - 62px);
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 10px;
    }

    .topbar-right > .topbar-pill:first-child {
        flex: 1 1 calc(100% - 86px);
        min-width: 0;
        justify-content: space-between;
    }

    .topbar-user-menu {
        display: none;
    }

    .topbar-user-copy {
        display: block;
    }

    .sidebar-user {
        display: grid;
    }

    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-inline {
        flex: 1 1 auto;
    }

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

    .panel-head .btn,
    .panel-head .text-link {
        width: 100%;
    }

    .hero-chip-stack,
    .yacht-option,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .actions-cell {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .detail-media-actions {
        flex-wrap: wrap;
    }

    .app-table th,
    .app-table td {
        padding: 14px 12px;
    }

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

@media (max-width: 640px) {
    .stats-grid,
    .summary-grid,
    .summary-grid.compact,
    .filter-grid,
    .hero-chip-stack {
        grid-template-columns: 1fr;
    }

    .summary-grid.compact.debt-summary-grid {
        grid-template-columns: 1fr;
    }

    .admin-main {
        padding: 0;
    }

    .page-frame {
        padding: 18px 16px 16px;
        gap: 18px;
    }

    .page-frame > *,
    .admin-topbar,
    .hero-panel,
    .panel-card,
    .app-alert {
        margin-left: 0;
        margin-right: 0;
    }

    .admin-topbar,
    .panel-card,
    .hero-panel {
        padding: 16px;
    }

    .topbar-right > .topbar-pill:first-child,
    .topbar-right > .topbar-pill {
        width: 100%;
        flex-basis: 100%;
    }

    .topbar-right > .topbar-pill:first-child {
        width: auto;
        flex: 1 1 calc(100% - 82px);
    }

    .topbar-right > .topbar-pill:not(:first-child) {
        width: auto;
        flex: 0 0 auto;
    }

    .topbar-pill {
        width: auto;
        justify-content: space-between;
        min-height: 46px;
        padding: 0 14px;
    }

    .topbar-user {
        padding: 12px 14px;
        border-radius: 14px;
        background: var(--surface-soft);
    }

    .topbar-user-copy span {
        word-break: break-word;
    }

    .summary-grid.compact.report-export-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-grid.compact.team-summary-grid {
        grid-template-columns: 1fr;
    }

    .task-command-center {
        padding: 18px;
    }

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

    .task-metric {
        min-height: 96px;
        padding: 14px;
    }

    .task-metric strong {
        font-size: 24px;
    }

    .task-column,
    .task-card {
        padding: 14px;
    }

    .auth-brand-panel,
    .auth-content-panel {
        padding: 28px 20px;
    }

    .auth-brand-copy h1 {
        font-size: 26px;
    }

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

    .hero-chip,
    .stat-card,
    .summary-item,
    .quick-link-list a,
    .export-links a,
    .yacht-option,
    .detail-item,
    .auth-card {
        padding: 16px;
    }

    .auth-toolbar {
        top: 28px;
        right: 20px;
        justify-content: flex-end;
        gap: 12px;
        flex-wrap: wrap;
    }

    .chart-row {
        gap: 8px;
    }

    .yacht-option-title {
        font-size: 15px;
    }

    .sidebar-brand img {
        width: 132px;
    }

    .sidebar-brand span {
        font-size: 10px;
        padding: 6px 10px;
    }

    .sidebar-close {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 640px) {
    .active-personnel-option {
        grid-template-columns: auto 40px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .active-personnel-avatar {
        width: 40px;
        height: 40px;
    }

    .active-personnel-modal-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .active-personnel-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}
