:root {
    --bg: #fff7ef;
    --bg-dark: #20130d;
    --text: #2f241d;
    --muted: #7b6b61;
    --card: rgba(255, 255, 255, 0.92);
    --card-strong: rgba(255, 255, 255, 0.98);
    --border: rgba(198, 124, 66, 0.18);
    --accent: #c96d23;
    --accent-soft: #fff0dd;
    --danger: #b63f2c;
    --danger-soft: #ffe5de;
    --success: #2f7d4f;
    --success-soft: #e4f7ea;
    --warning: #a65f1b;
    --warning-soft: #fff1d9;
    --info: #9c5d25;
    --info-soft: #ffefd9;
    --shadow-soft: 0 18px 44px rgba(15, 23, 42, 0.08);
    --shadow-panel: 0 24px 60px rgba(15, 23, 42, 0.09);
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Aptos", "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 30%),
        radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.14), transparent 28%),
        linear-gradient(180deg, #f8fafc, var(--bg));
}

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

button,
input,
textarea,
select {
    font: inherit;
}

.guest-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(251, 146, 60, 0.26), transparent 25%),
        radial-gradient(circle at bottom right, rgba(253, 186, 116, 0.18), transparent 24%),
        var(--bg-dark);
    color: #fff;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.login-hero,
.login-card {
    border-radius: 2rem;
    backdrop-filter: blur(10px);
}

.login-hero {
    padding: 2.5rem;
    border: 1px solid rgba(255, 231, 214, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 214, 170, 0.05));
}

.login-hero h1 {
    font-size: clamp(2.6rem, 5vw, 4rem);
    line-height: 1.05;
    margin: 1rem 0;
}

.login-hero p {
    color: rgba(226, 232, 240, 0.88);
    line-height: 1.8;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.feature-card,
.login-card,
.panel,
.metric-card,
.brand-card,
.sidebar-user {
    background: var(--card);
    color: var(--text);
}

.feature-card {
    border-radius: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 225, 195, 0.14);
}

.feature-card p {
    color: rgba(226, 232, 240, 0.82);
}

.login-card {
    padding: 2rem;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.35);
}

.demo-box,
.info-card,
.empty-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 1rem 1.2rem;
}

.guest-alert {
    max-width: 1000px;
    margin: 1rem auto 0;
}

.app-shell {
    max-width: 1420px;
    width: min(1420px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: clamp(248px, 17vw, 280px) minmax(0, 1fr);
    gap: clamp(0.9rem, 1.1vw, 1.25rem);
    padding: clamp(0.8rem, 0.95vw, 1rem);
}

.sidebar {
    background: linear-gradient(180deg, #2a1912, #1d120d);
    color: #fff;
    border-radius: 2rem;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: sticky;
    top: 0.85rem;
    max-height: calc(100vh - 1.7rem);
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

.brand-card {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border-radius: 1.5rem;
    padding: 1rem 1rem 1.05rem;
    overflow: hidden;
}

.brand-card h1,
.brand-title {
    margin: 0.55rem 0 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.brand-title-line {
    display: block;
    font-size: clamp(1.72rem, 1.28rem + 0.68vw, 2.18rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
    white-space: nowrap;
    text-wrap: balance;
}

.brand-card .eyebrow {
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.72rem;
    line-height: 1.42;
}

.brand-card > p:not(.eyebrow) {
    color: rgba(226, 232, 240, 0.84);
    line-height: 1.58;
    font-size: 0.92rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-links a {
    padding: 0.72rem 0.9rem;
    border-radius: 1rem;
    color: #cbd5e1;
    transition: 0.2s ease;
    font-size: 1rem;
    font-weight: 600;
}

.nav-links a.active,
.nav-links a:hover {
    background: #fff4ea;
    color: #8a4a16;
}

.sidebar-user {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-radius: 1.5rem;
    padding: 0.82rem;
    margin-top: auto;
}

.user-name {
    font-weight: 700;
    margin: 0;
    font-size: 1.15rem;
}

.user-email {
    color: #cbd5e1;
    margin: 0.26rem 0 0.58rem;
    line-height: 1.42;
    font-size: 0.88rem;
}

.logout-form {
    margin-top: 1rem;
}

.main-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    overflow: hidden;
}

.topbar,
.panel,
.metric-card {
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-panel);
}

.topbar {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 1.75rem;
    padding: 0.22rem 0.58rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.44rem;
    flex-wrap: wrap;
    min-width: 0;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 2rem;
    min-width: 0;
    overflow: hidden;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.74rem;
    color: #c96d23;
    margin: 0;
}

.hint-pill {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
}

.hint-pill.compact {
    padding: 0.48rem 0.78rem;
    font-size: 0.8rem;
}

.account-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 250px;
    max-width: 420px;
    padding: 0.36rem 0.78rem;
    border-radius: 0.95rem;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(13, 148, 136, 0.12);
    transition: 0.2s ease;
    white-space: nowrap;
}

.account-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.14);
}

.account-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
}

.account-inline-single-row {
    width: 100%;
}

.account-label,
.account-meta {
    font-size: 0.8rem;
}

.account-name {
    color: #134e4a;
    font-size: 0.94rem;
}

.account-divider {
    color: rgba(198, 124, 66, 0.58);
    font-size: 0.76rem;
}

.account-meta {
    padding-left: 0;
    border-left: none;
    white-space: nowrap;
}

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

.metric-card {
    border-radius: 1.75rem;
    padding: 0.95rem 1.05rem 1rem;
}

.metric-card .eyebrow {
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    line-height: 1.45;
}

.metric-card h3 {
    margin: 0.35rem 0 0.12rem;
    font-size: clamp(1.35rem, 1rem + 1vw, 1.72rem);
    line-height: 1.08;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.panel {
    border-radius: 1.75rem;
    padding: clamp(0.95rem, 1.2vw, 1.18rem);
    background: var(--card-strong);
}

.panel-subsection {
    border: 1px solid rgba(198, 124, 66, 0.18);
    background: linear-gradient(180deg, #fffdf9, #fff8f1);
}

.panel-subsection.is-collapsed {
    display: none;
}

.panel-head {
    margin-bottom: 0.6rem;
}

.panel-head.compact {
    margin-bottom: 0.25rem;
}

.panel-head h3,
.topbar h2,
.login-card h2 {
    margin: 0.1rem 0 0.28rem;
    font-size: clamp(1.08rem, 0.92rem + 0.58vw, 1.38rem);
    line-height: 1.14;
    letter-spacing: -0.03em;
}

.panel-head p,
.subtle,
.metric-card p,
.stat-block span,
.list-card p {
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
    font-size: 0.94rem;
}

.panel-tabs {
    padding-block: 0.8rem;
}

.panel-inline-note {
    width: fit-content;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 1.15rem;
    align-items: start;
    min-width: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
    min-width: 0;
}

.field,
.stack-sm,
.stack-md,
.stack-lg {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.field span,
.field small {
    color: var(--muted);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 1.1rem;
    border: 1px solid var(--border);
    background: #fffaf6;
}

.checkbox-row input[type="checkbox"] {
    margin-top: 0.25rem;
}

.checkbox-row span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-row strong {
    color: var(--text);
}

.machine-provision-toggle {
    gap: 0;
}

.field input,
.field textarea,
.field select,
.search-row input,
.search-row select,
.search-row-inline input,
.search-row-inline select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: #fff;
    color: var(--text);
    min-height: 54px;
}

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

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.68rem 0.95rem;
    border: none;
    cursor: pointer;
    transition: 0.2s ease;
    font-weight: 700;
    font-size: 0.9rem;
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.button-dark {
    background: #8a4a16;
    color: #fff;
}

.button-accent {
    background: var(--accent);
    color: #fff;
}

.button-light {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.button-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #fecdd3;
}

.button-full {
    width: 100%;
}

.button-small {
    padding: 0.42rem 0.72rem;
    font-size: 0.8rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.34rem 0.68rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: #f4e7da; color: #7a5f4d; }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-dark { background: #8a4a16; color: #fff; }

.data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.stat-block {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 0.82rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid rgba(198, 124, 66, 0.12);
}

.list-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 0.95rem 1rem;
}

.list-card-stretch,
.report-card {
    flex-wrap: wrap;
}

.profile-upload-guide {
    margin: 0.8rem 0 1rem;
}

.profile-upload-guide .info-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.profile-upload-guide strong {
    color: var(--text);
}

.profile-upload-guide small {
    color: var(--muted);
}

.profile-admin-action {
    margin-top: 1rem;
}

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

.profile-section-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-section-head .button {
    min-width: 132px;
}

.profile-management-table th,
.profile-management-table td {
    vertical-align: top;
}

.profile-management-table th:nth-child(1) {
    width: 22%;
}

.profile-management-table th:nth-child(6) {
    width: 13%;
}

.profile-mapping-inline-form {
    display: grid;
    grid-template-columns: minmax(104px, 1fr) auto;
    gap: 0.38rem;
    align-items: center;
}

.profile-mapping-inline-form input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.48rem 0.64rem;
}

.profile-upload-note {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    width: 100%;
}

.profile-upload-note div {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    border: 1px solid rgba(198, 124, 66, 0.14);
    border-radius: 1rem;
    background: #fffaf5;
    padding: 0.78rem 0.9rem;
}

.profile-upload-note span {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.profile-create-form input[type="file"] {
    min-height: 48px;
}

.profile-user-picker {
    position: relative;
}

.profile-user-picker-search {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: #fff;
    color: var(--text);
    min-height: 54px;
}

.profile-user-picker-search.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.profile-user-picker-list {
    position: absolute;
    z-index: 5;
    top: calc(100% + 0.42rem);
    left: 0;
    right: 0;
    max-height: min(330px, 44vh);
    overflow-y: auto;
    border: 1px solid rgba(198, 124, 66, 0.2);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 18px 42px rgba(46, 24, 9, 0.16);
    padding: 0.38rem;
}

.profile-user-picker-option {
    width: 100%;
    border: 0;
    border-radius: 0.72rem;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: block;
    padding: 0.72rem 0.82rem;
    text-align: left;
    line-height: 1.35;
}

.profile-user-picker-option:hover,
.profile-user-picker-option.is-selected {
    background: #fff4e6;
    color: var(--accent-strong);
}

.profile-user-picker-empty {
    color: var(--muted);
    padding: 0.8rem 0.9rem;
}

.profile-unmap-form {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(198, 124, 66, 0.14);
}

.profile-unmap-form .button {
    width: 100%;
}

.profile-detail-modal {
    width: min(1320px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #fff;
    padding: 1rem 1.05rem 0.95rem;
    font-size: 0.88rem;
}

.profile-detail-modal .modal-header {
    margin-bottom: 0.72rem;
}

.profile-detail-modal .modal-header h3 {
    font-size: 1rem;
    line-height: 1.2;
}

.profile-detail-modal .modal-header p {
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.profile-detail-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.48rem;
    margin-bottom: 0.62rem;
}

.profile-detail-summary div {
    border: 1px solid rgba(198, 124, 66, 0.14);
    border-radius: 0.72rem;
    background: #fffaf5;
    padding: 0.48rem 0.58rem;
    display: flex;
    flex-direction: row;
    gap: 0.45rem;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.profile-detail-summary span {
    color: var(--muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.profile-detail-summary strong {
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-detail-stack {
    display: flex;
    flex-direction: column;
    gap: 0.58rem;
}

.profile-modal-section {
    border: 1px solid rgba(198, 124, 66, 0.14);
    border-radius: 0.82rem;
    background: #fff;
    padding: 0.62rem;
}

.profile-modal-section-head {
    display: flex;
    justify-content: space-between;
    gap: 0.62rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.profile-modal-section-head h4 {
    margin: 0;
    font-size: 0.92rem;
}

.profile-modal-section-head p {
    margin: 0.1rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.profile-document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.42rem;
}

.profile-document-row {
    display: flex;
    justify-content: space-between;
    gap: 0.48rem;
    align-items: center;
    padding: 0.5rem 0.56rem;
    border: 1px solid rgba(198, 124, 66, 0.14);
    border-radius: 0.68rem;
    background: #f8fafc;
    min-width: 0;
}

.profile-document-row div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.profile-document-row strong {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-document-row span {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-document-row .button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0.34rem 0.58rem;
}

.profile-review-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.profile-review-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.28rem;
}

.profile-review-header {
    display: grid;
    grid-template-columns: minmax(112px, 0.72fr) minmax(150px, 0.95fr) minmax(190px, 1.15fr) minmax(230px, 1.35fr);
    gap: 0.42rem;
    align-items: center;
    padding: 0.14rem 0.44rem 0.28rem;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(198, 124, 66, 0.12);
}

.profile-review-card {
    border: 1px solid rgba(198, 124, 66, 0.14);
    border-radius: 0.68rem;
    background: #fffdf9;
    padding: 0.34rem 0.42rem;
    display: grid;
    grid-template-columns: minmax(112px, 0.72fr) minmax(150px, 0.95fr) minmax(190px, 1.15fr) minmax(230px, 1.35fr);
    gap: 0.42rem;
    align-items: center;
    min-width: 0;
}

.profile-review-card:hover,
.profile-review-card:focus-within {
    border-color: rgba(198, 124, 66, 0.28);
    background: #fffaf5;
}

.profile-review-card-head {
    display: contents;
}

.profile-review-card-head strong {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-review-card-head span {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: left;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-review-values {
    display: contents;
}

.profile-ocr-value,
.profile-confirm-value {
    min-width: 0;
    border-radius: 0.52rem;
    padding: 0.28rem 0.4rem;
    min-height: 34px;
}

.profile-ocr-value {
    background: #f8fafc;
    border: 1px solid rgba(198, 124, 66, 0.1);
}

.profile-confirm-value {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid rgba(198, 124, 66, 0.18);
}

.profile-ocr-value span,
.profile-confirm-value span {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.2;
    flex: 0 0 auto;
}

.profile-ocr-value p {
    margin: 0.06rem 0 0;
    line-height: 1.25;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-confirm-value input,
.profile-confirm-value textarea {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    min-height: 22px;
    color: var(--text);
    font-size: 0.8rem;
}

.profile-confirm-value textarea {
    resize: vertical;
    min-height: 24px;
}

.profile-save-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: end;
    padding: 0.55rem 0 0;
    background: #fff;
    border-top: 1px solid rgba(198, 124, 66, 0.12);
}

.profile-save-bar .field {
    gap: 0.35rem;
}

.profile-save-bar textarea {
    min-height: 42px;
}

.profile-save-bar .button {
    min-width: 112px;
    min-height: 42px;
}

.device-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 1.4rem;
    padding: 1rem;
}

.device-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.device-user-card {
    align-items: stretch;
}

.device-user-meta {
    min-width: 260px;
}

.mapping-actions {
    min-width: 320px;
    margin-left: auto;
}

.mapping-actions.compact {
    min-width: min(420px, 100%);
    align-items: stretch;
}

.machine-account-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: #fff;
}

.machine-account-inline-meta {
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.machine-account-inline-meta p {
    margin: 0;
}

.machine-account-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.provision-account-card {
    align-items: stretch;
}

.device-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.device-checkbox-card {
    display: flex;
    align-items: stretch;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 1.1rem;
    border: 1px solid var(--border);
    background: #fffaf5;
    cursor: pointer;
}

.device-checkbox-card input[type="checkbox"] {
    margin-top: 0.15rem;
}

.device-checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.device-checkbox-content small {
    color: var(--muted);
}

.mapping-actions form {
    width: 100%;
}

.mapping-actions input {
    flex: 1 1 220px;
}

.plain-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding-left: 1.2rem;
}

.alert {
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #bbf7d0;
}

.alert-error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecdd3;
}

.search-row,
.search-row-inline,
.action-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.leave-note-input {
    width: min(240px, 100%);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 0.52rem 0.72rem;
    background: #fff;
    color: var(--text);
}

.attendance-report-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow: hidden;
    min-width: 0;
}

.attendance-primary-panel {
    padding-top: 0.72rem;
}

.attendance-summary-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.36rem;
    align-items: center;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.32rem 0.58rem;
    border-radius: 999px;
    background: #fff7ef;
    border: 1px solid rgba(198, 124, 66, 0.16);
    color: #8a4a16;
    white-space: nowrap;
}

.summary-chip strong {
    font-size: 0.82rem;
    line-height: 1;
}

.summary-chip small {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.attendance-report-actions {
    justify-content: flex-start;
    gap: 0.56rem;
}

.attendance-report-actions .hint-pill {
    flex: 1 1 320px;
}

.attendance-filter-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1.45fr) repeat(3, minmax(145px, 0.7fr));
    gap: 0.46rem;
    align-items: end;
}

.attendance-filter-grid-inline {
    grid-template-columns: minmax(280px, 1.25fr) repeat(3, minmax(160px, 0.62fr)) auto;
}

.attendance-filter-field {
    min-width: 0;
}

.attendance-filter-grid-inline .field {
    gap: 0.22rem;
}

.attendance-filter-grid-inline .field span {
    font-size: 0.78rem;
    line-height: 1.28;
}

.attendance-filter-grid-inline .field input,
.attendance-filter-grid-inline .field select {
    min-height: 46px;
    padding: 0.66rem 0.9rem;
}

.attendance-filter-actions-inline {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.46rem;
    flex-wrap: nowrap;
    justify-self: end;
}

.attendance-filter-actions-inline .button {
    min-height: 46px;
}

.attendance-inline-hint {
    align-self: flex-start;
}

.attendance-filter-compact .field span {
    font-size: 0.7rem;
}

.attendance-filter-compact .field input,
.attendance-filter-compact .field select {
    min-height: 40px;
    padding: 0.56rem 0.78rem;
}

.attendance-report-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.account-subnav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.72rem;
}

.account-subnav-link {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.88rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(198, 124, 66, 0.14);
    background: #fffaf5;
    color: var(--text);
    min-width: 0;
}

.account-subnav-link strong {
    font-size: 0.98rem;
}

.account-subnav-link small {
    color: var(--muted);
    line-height: 1.5;
}

.account-subnav-link.is-active {
    border-color: rgba(198, 124, 66, 0.28);
    background: linear-gradient(180deg, #fff6ee 0%, #fffdf9 100%);
    box-shadow: 0 12px 28px rgba(107, 59, 30, 0.08);
}

.account-filter-row {
    align-items: end;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    background: #fff;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    table-layout: auto;
}

.report-table th,
.report-table td {
    padding: 0.6rem 0.68rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(198, 124, 66, 0.14);
}

.report-table th {
    background: #fff5e8;
    color: #8a4a16;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
}

.report-table tbody tr:hover {
    background: rgba(255, 244, 234, 0.7);
}

.ocr-review-table input,
.ocr-review-table textarea {
    width: 100%;
    min-width: 180px;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.62rem 0.72rem;
    background: #fff;
    color: var(--text);
}

.ocr-review-table textarea {
    resize: vertical;
}

.ocr-review-table small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
}

.user-admin-table td,
.machine-account-table td {
    vertical-align: top;
}

.user-admin-table {
    table-layout: fixed;
}

.user-admin-table td {
    font-size: 0.92rem;
}

.attendance-summary-table th:nth-child(1) {
    width: 46%;
}

.attendance-summary-table th:nth-child(2) {
    width: 8%;
}

.attendance-summary-table th:nth-child(3) {
    width: 24%;
}

.attendance-summary-table th:nth-child(4) {
    width: 10%;
}

.attendance-summary-table th:nth-child(5) {
    width: 6%;
}

.attendance-summary-table th:nth-child(6) {
    width: 6%;
}

.table-identity-cell {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    min-width: 0;
}

.table-inline-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.38;
}

.table-inline-primary {
    font-size: 0.76rem;
    line-height: 1.32;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 24ch;
}

.attendance-email-full {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.34;
}

.table-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.table-meta-cell strong {
    line-height: 1.4;
}

.table-email {
    display: block;
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-meta-cell span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.32;
}

.table-identity-head {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.table-identity-name {
    font-size: 0.9rem;
    line-height: 1.32;
}

.table-identity-meta {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.36;
}

.table-device-cell {
    min-width: 0;
}

.table-status-stack {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-start;
}

.table-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.34rem;
    align-items: center;
}

.table-action-group form {
    margin: 0;
}

.inline-action-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(31, 18, 10, 0.34);
    backdrop-filter: blur(3px);
    overflow-y: auto;
}

.modal-dialog {
    width: min(760px, calc(100vw - 2rem));
    max-height: calc(100dvh - 3rem);
    overflow: auto;
    background: #fffdfa;
    border: 1px solid rgba(198, 124, 66, 0.22);
    border-radius: 1.4rem;
    box-shadow: 0 26px 60px rgba(46, 24, 9, 0.2);
    padding: 1.25rem 1.25rem 1.1rem;
}

.modal-dialog-wide {
    width: min(920px, calc(100vw - 2rem));
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.18rem;
}

.modal-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.25rem;
    padding: 0.62rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(198, 124, 66, 0.22);
    background: #fff;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-close:hover {
    transform: translateY(-1px);
    border-color: rgba(198, 124, 66, 0.34);
    box-shadow: 0 10px 24px rgba(198, 124, 66, 0.14);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(198, 124, 66, 0.14);
}

.table-identity-cell p {
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

.user-admin-table th:nth-child(1) {
    width: 23%;
}

.user-admin-table th:nth-child(2) {
    width: 12%;
}

.user-admin-table th:nth-child(3) {
    width: 8%;
}

.user-admin-table th:nth-child(4) {
    width: 10%;
}

.user-admin-table th:nth-child(5) {
    width: 10%;
}

.user-admin-table th:nth-child(6) {
    width: 11%;
}

.user-admin-table th:nth-child(7) {
    width: 9%;
}

.user-admin-table th:nth-child(8) {
    width: 17%;
}

.user-admin-table .badge {
    font-size: 0.76rem;
    padding: 0.34rem 0.58rem;
}

.user-admin-table .button-small {
    padding: 0.46rem 0.68rem;
    font-size: 0.78rem;
}

.machine-account-table th:nth-child(1) {
    width: 18%;
}

.machine-account-table th:nth-child(2) {
    width: 18%;
}

.machine-account-table th:nth-child(3) {
    width: 14%;
}

.machine-account-table th:nth-child(4) {
    width: 14%;
}

.machine-account-table th:nth-child(5) {
    width: 18%;
}

.machine-account-table th:nth-child(6) {
    width: 18%;
}

.report-table-compact th,
.report-table-compact td {
    white-space: normal;
}

.device-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.device-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.56rem;
    border-radius: 999px;
    background: #fff4ea;
    color: #8a4a16;
    border: 1px solid rgba(198, 124, 66, 0.14);
    font-size: 0.72rem;
    font-weight: 700;
}

.time-pill,
.time-range-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    padding: 0.32rem 0.58rem;
    border-radius: 0.8rem;
    background: #27b39b;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1.2;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.attendance-detail-page-panel {
    gap: 0.72rem;
}

.attendance-detail-header-main {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(420px, 1.08fr);
    gap: 0.92rem;
    align-items: start;
}

.attendance-detail-header-compact {
    grid-template-columns: minmax(360px, 1fr) minmax(380px, 0.95fr);
}

.attendance-detail-toolbar-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.72rem;
    flex-wrap: wrap;
    padding-bottom: 0.2rem;
}

.attendance-detail-page-actions {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.attendance-detail-summary {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.attendance-detail-summary-card,
.attendance-detail-toolbar-card {
    border: 1px solid rgba(198, 124, 66, 0.14);
    border-radius: 1rem;
    background: #fffdf9;
    padding: 0.9rem 1rem;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.68rem;
    padding: 0.82rem 0.92rem;
    border: 1px solid rgba(198, 124, 66, 0.14);
    border-radius: 1rem;
    background: #fffaf5;
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    min-width: 0;
}

.detail-meta-item span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-meta-item strong {
    font-size: 0.9rem;
    line-height: 1.32;
}

.detail-meta-grid-compact {
    width: min(820px, 100%);
    background: #fffdf9;
}

.detail-meta-grid-single-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attendance-detail-toolbar-panel {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
    min-width: 0;
    padding: 0.82rem 0.92rem;
}

.attendance-detail-toolbar-heading {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.attendance-detail-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.56rem;
    flex-wrap: wrap;
}

.attendance-detail-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.56rem;
    flex-wrap: wrap;
}

.attendance-detail-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.attendance-detail-toolbar .field {
    min-width: 0;
}

.attendance-detail-month-field {
    min-width: 180px;
}

.attendance-detail-month-field input {
    min-height: 46px;
    padding: 0.66rem 0.88rem;
}

.attendance-detail-month-form {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.attendance-detail-month-form .button {
    margin-bottom: 0.08rem;
}

.attendance-detail-stats-compact .stat-block {
    padding: 0.72rem 0.82rem;
}

.attendance-detail-stats-compact .stat-block strong {
    font-size: 0.94rem;
}

.time-separator {
    opacity: 0.82;
}

.attendance-summary-table td:nth-child(2),
.attendance-summary-table td:nth-child(5),
.attendance-summary-table td:nth-child(6) {
    white-space: nowrap;
}

.attendance-summary-table td:nth-child(5),
.attendance-summary-table td:nth-child(6) {
    text-align: center;
}

.attendance-summary-table td:nth-child(5) .badge-info {
    justify-content: center;
    min-width: 82px;
    white-space: nowrap;
    padding-inline: 0.8rem;
}

.attendance-summary-table td:nth-child(6) .button-small {
    min-width: 88px;
    white-space: nowrap;
    padding-inline: 0.82rem;
}

.attendance-date-cell {
    display: inline-block;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
}

.attendance-time-stack {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.attendance-time-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.attendance-time-label {
    min-width: 60px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.time-range-pill-muted {
    background: #e8f6f2;
    color: #237e72;
}

.attendance-detail-table th:nth-child(1) {
    width: 10%;
}

.attendance-detail-table th:nth-child(2) {
    width: 18%;
}

.attendance-detail-table th:nth-child(3) {
    width: 18%;
}

.attendance-detail-table th:nth-child(4) {
    width: 10%;
}

.attendance-detail-table th:nth-child(5) {
    width: 8%;
}

.attendance-detail-table th:nth-child(6) {
    width: 18%;
}

.attendance-detail-table th:nth-child(7) {
    width: 18%;
}

.pagination-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.pagination-link.is-active,
.pagination-link:hover {
    background: #fff4ea;
    color: #8a4a16;
}

.attendance-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.attendance-detail-page-panel {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.attendance-detail-page-head {
    margin-bottom: 0.15rem;
}

.attendance-detail-banner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #dff4ff, #f6fbff);
    border: 1px solid #bfe3f3;
    border-radius: 1.5rem;
    padding: 1.25rem;
}

.attendance-detail-banner h3 {
    margin: 0.2rem 0 0.6rem;
    font-size: clamp(1.55rem, 1.1rem + 1vw, 1.95rem);
}

.attendance-detail-banner p {
    color: #2e5d78;
    margin: 0.3rem 0;
    line-height: 1.7;
}

.attendance-detail-tools {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 300px;
}

.attendance-detail-tools .field {
    min-width: 180px;
}

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

@media (max-width: 1400px) {
    .app-shell {
        grid-template-columns: 236px minmax(0, 1fr);
    }

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

    .attendance-filter-grid {
        grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(130px, 0.68fr));
    }
}

@media (max-width: 1280px) {
    .app-shell {
        max-width: 1220px;
        width: min(1220px, 100%);
        grid-template-columns: 224px minmax(0, 1fr);
    }

    .brand-title-line {
        font-size: 1.9rem;
    }

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

    .data-grid,
    .attendance-detail-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 1100px) {
    .login-screen,
    .app-shell,
    .metrics-grid,
    .two-col,
    .data-grid,
    .attendance-detail-stats {
        grid-template-columns: 1fr;
    }

    .feature-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
        position: static;
        max-height: none;
        overflow: visible;
    }

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

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

    .attendance-detail-banner {
        flex-direction: column;
    }

    .attendance-detail-tools {
        min-width: 100%;
    }

    .attendance-filter-grid-inline {
        grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(160px, 0.72fr));
    }

    .attendance-filter-actions-inline {
        grid-column: 1 / -1;
        justify-self: start;
        flex-wrap: wrap;
    }

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

    .detail-meta-grid-single-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .attendance-detail-actions-row {
        justify-content: flex-start;
    }

    .attendance-detail-toolbar-row {
        justify-content: flex-start;
    }

    .attendance-detail-toolbar {
        flex-wrap: wrap;
    }

    .account-subnav {
        grid-template-columns: 1fr;
    }

    .profile-upload-note,
    .profile-detail-summary,
    .profile-document-grid,
    .profile-review-grid,
    .profile-save-bar {
        grid-template-columns: 1fr;
    }

    .profile-review-header {
        display: none;
    }

    .profile-review-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .profile-review-card-head {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .profile-review-values {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .profile-confirm-value {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-section-head {
        align-items: stretch;
    }

    .profile-section-head .button {
        width: 100%;
    }
}

@media (max-width: 900px) {
    body {
        font-size: 15px;
    }

    .attendance-filter-grid {
        grid-template-columns: 1fr;
    }

    .attendance-filter-actions-inline {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .attendance-report-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .attendance-report-actions .button,
    .attendance-report-actions .hint-pill {
        width: 100%;
    }

    .pagination-row {
        justify-content: flex-start;
    }

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

    .attendance-detail-month-form {
        width: 100%;
        align-items: stretch;
    }

    .attendance-detail-month-form .button {
        width: 100%;
        margin-bottom: 0;
    }

    .attendance-detail-toolbar-row,
    .attendance-detail-toolbar {
        width: 100%;
    }

    .attendance-detail-toolbar {
        flex-wrap: wrap;
    }

    .attendance-detail-month-field {
        min-width: 0;
        flex: 1 1 220px;
    }

    .attendance-summary-table,
    .attendance-summary-table thead,
    .attendance-summary-table tbody,
    .attendance-summary-table tr,
    .attendance-summary-table th,
    .attendance-summary-table td {
        display: block;
        width: 100%;
    }

    .attendance-summary-table thead {
        display: none;
    }

    .attendance-summary-table tbody {
        display: grid;
        gap: 0.9rem;
        padding: 0.9rem;
    }

    .attendance-summary-table tr {
        border: 1px solid rgba(198, 124, 66, 0.14);
        border-radius: 1.2rem;
        padding: 0.2rem 0.95rem;
        background: #fffaf5;
    }

    .attendance-summary-table td {
        display: grid;
        grid-template-columns: minmax(112px, 126px) minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
        padding: 0.72rem 0;
        border-bottom: 1px solid rgba(198, 124, 66, 0.12);
    }

    .attendance-summary-table td:last-child {
        border-bottom: none;
    }

    .attendance-summary-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        line-height: 1.4;
    }

    .attendance-summary-table td[data-label="Chi tiết"] {
        align-items: center;
    }

    .attendance-summary-table td[data-label="Chi tiết"] .button {
        justify-self: flex-start;
    }

    .table-device-cell,
    .table-identity-cell {
        min-width: 0;
    }

    .user-admin-table,
    .user-admin-table thead,
    .user-admin-table tbody,
    .user-admin-table tr,
    .user-admin-table th,
    .user-admin-table td,
    .machine-account-table,
    .machine-account-table thead,
    .machine-account-table tbody,
    .machine-account-table tr,
    .machine-account-table th,
    .machine-account-table td,
    .profile-management-table,
    .profile-management-table thead,
    .profile-management-table tbody,
    .profile-management-table tr,
    .profile-management-table th,
    .profile-management-table td,
    .profile-review-table,
    .profile-review-table thead,
    .profile-review-table tbody,
    .profile-review-table tr,
    .profile-review-table th,
    .profile-review-table td {
        display: block;
        width: 100%;
    }

    .user-admin-table thead,
    .machine-account-table thead,
    .profile-management-table thead,
    .profile-review-table thead {
        display: none;
    }

    .user-admin-table tbody,
    .machine-account-table tbody,
    .profile-management-table tbody,
    .profile-review-table tbody {
        display: grid;
        gap: 0.9rem;
        padding: 0.9rem;
    }

    .user-admin-table tr,
    .machine-account-table tr,
    .profile-management-table tr,
    .profile-review-table tr {
        border: 1px solid rgba(198, 124, 66, 0.14);
        border-radius: 1.2rem;
        padding: 0.25rem 0.95rem;
        background: #fffaf5;
    }

    .user-admin-table td,
    .machine-account-table td,
    .profile-management-table td,
    .profile-review-table td {
        display: grid;
        grid-template-columns: minmax(112px, 126px) minmax(0, 1fr);
        gap: 0.72rem;
        align-items: start;
        padding: 0.72rem 0;
        border-bottom: 1px solid rgba(198, 124, 66, 0.12);
    }

    .user-admin-table td:last-child,
    .machine-account-table td:last-child,
    .profile-management-table td:last-child,
    .profile-review-table td:last-child {
        border-bottom: none;
    }

    .user-admin-table td::before,
    .machine-account-table td::before,
    .profile-management-table td::before,
    .profile-review-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        line-height: 1.4;
    }

    .table-action-group {
        justify-content: flex-start;
    }

    .modal-backdrop {
        padding: 0.9rem;
        align-items: flex-start;
        height: 100dvh;
        min-height: 100dvh;
        overflow-y: auto;
    }

    .modal-dialog,
    .modal-dialog-wide,
    .profile-detail-modal {
        width: 100%;
        max-height: calc(100dvh - 1.8rem);
        overflow: auto;
        margin-top: 0.4rem;
        padding: 1rem;
    }

    .modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-close {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .profile-mapping-inline-form {
        grid-template-columns: 1fr;
    }
}

/* App-wide premium baseline for the rest of the system.
   Profile OCR and Attendance keep their approved scoped rules below. */
body.app-body:not(.profile-shell) {
    --bg: #f5f8fb;
    --text: #0f1f33;
    --muted: #64748b;
    --card: #ffffff;
    --card-strong: #ffffff;
    --border: #dbe6ef;
    --accent: #073760;
    --accent-soft: #eef6fc;
    --danger: #b63f2c;
    --danger-soft: #fff1ee;
    --success: #2f7d4f;
    --success-soft: #e8f6ef;
    --warning: #9a5b14;
    --warning-soft: #fff7e7;
    --info: #237e72;
    --info-soft: #e8f6f2;
    --shadow-soft: 0 16px 36px rgba(15, 31, 51, 0.08);
    --shadow-panel: 0 22px 58px rgba(15, 31, 51, 0.08);
    background:
        linear-gradient(180deg, rgba(7, 55, 96, 0.08), rgba(246, 249, 252, 0.96) 34%),
        #f5f8fb;
    color: var(--text);
}

.guest-body {
    --text: #0f1f33;
    --muted: #64748b;
    --border: #dbe6ef;
    --accent: #073760;
    --accent-soft: #eef6fc;
    background:
        radial-gradient(circle at 12% 10%, rgba(24, 85, 128, 0.38), transparent 26%),
        linear-gradient(180deg, #052946, #071f35 56%, #061727);
}

.login-screen {
    max-width: 1280px;
    gap: clamp(1rem, 3vw, 2rem);
}

.login-hero,
.login-card {
    border-radius: 1.35rem;
}

.login-hero {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.login-hero h1 {
    letter-spacing: 0;
}

.login-card {
    background: #ffffff;
    color: #0f1f33;
    border: 1px solid rgba(219, 230, 239, 0.9);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.login-card .subtle,
.login-card .field span,
.login-card .field small {
    color: #64748b;
}

.login-card .demo-box,
.feature-card {
    border-color: rgba(219, 230, 239, 0.18);
}

.guest-body .button-dark,
.guest-body .button-accent {
    background: #073760;
    color: #ffffff;
}

.guest-body .button-dark:not(:disabled):hover,
.guest-body .button-accent:not(:disabled):hover {
    background: #052946;
}

.feature-card {
    border-radius: 1rem;
}

body.app-body:not(.profile-shell) .app-shell {
    max-width: 1480px;
    width: min(1480px, 100%);
    grid-template-columns: clamp(236px, 16vw, 272px) minmax(0, 1fr);
    gap: 1rem;
}

body.app-body:not(.profile-shell) .sidebar {
    background: linear-gradient(180deg, #073760, #052946);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.55rem;
    box-shadow: 0 24px 70px rgba(5, 41, 70, 0.28);
}

body.app-body:not(.profile-shell) .brand-card,
body.app-body:not(.profile-shell) .sidebar-user {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.18rem;
}

body.app-body:not(.profile-shell) .brand-title-line {
    letter-spacing: 0;
}

body.app-body:not(.profile-shell) .brand-card .eyebrow {
    color: rgba(255, 255, 255, 0.68);
}

body.app-body:not(.profile-shell) .nav-links a {
    color: rgba(255, 255, 255, 0.76);
}

body.app-body:not(.profile-shell) .nav-links a.active,
body.app-body:not(.profile-shell) .nav-links a:hover {
    background: #ffffff;
    color: #073760;
}

body.app-body:not(.profile-shell) .topbar {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 230, 239, 0.86);
    border-radius: 1.2rem;
    box-shadow: 0 18px 40px rgba(15, 31, 51, 0.06);
}

body.app-body:not(.profile-shell) .topbar h2 {
    color: #0f1f33;
    letter-spacing: 0;
}

body.app-body:not(.profile-shell) .account-link {
    background: #eef6fc;
    color: #073760;
    border-color: #dbe6ef;
}

body.app-body:not(.profile-shell) .account-name {
    color: #073760;
}

body.app-body:not(.profile-shell) .account-divider {
    color: rgba(7, 55, 96, 0.35);
}

body.app-body:not(.profile-shell) .sidebar-user .badge {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.app-body:not(.profile-shell) .panel,
body.app-body:not(.profile-shell) .metric-card {
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: var(--shadow-panel);
}

body.app-body:not(.profile-shell) .metric-card {
    padding: 1rem 1.05rem;
}

body.app-body:not(.profile-shell) .metric-card h3,
body.app-body:not(.profile-shell) .panel-head h3 {
    color: var(--text);
    letter-spacing: 0;
}

body.app-body:not(.profile-shell) .eyebrow,
body.app-body:not(.profile-shell) .report-table th,
body.app-body:not(.profile-shell) .attendance-time-label {
    color: #073760;
}

body.app-body:not(.profile-shell) .hint-pill,
body.app-body:not(.profile-shell) .device-chip {
    background: var(--accent-soft);
    color: #073760;
    border: 1px solid var(--border);
}

body.app-body:not(.profile-shell) .info-card,
body.app-body:not(.profile-shell) .empty-card,
body.app-body:not(.profile-shell) .demo-box,
body.app-body:not(.profile-shell) .stat-block,
body.app-body:not(.profile-shell) .device-card,
body.app-body:not(.profile-shell) .list-card,
body.app-body:not(.profile-shell) .attendance-detail-summary-card,
body.app-body:not(.profile-shell) .attendance-detail-toolbar-card,
body.app-body:not(.profile-shell) .detail-meta-grid,
body.app-body:not(.profile-shell) .checkbox-row,
body.app-body:not(.profile-shell) .device-checkbox-card {
    border-color: var(--border);
    background: #f6f9fc;
}

body.app-body:not(.profile-shell) .field input,
body.app-body:not(.profile-shell) .field textarea,
body.app-body:not(.profile-shell) .field select,
body.app-body:not(.profile-shell) .search-row input,
body.app-body:not(.profile-shell) .search-row select,
body.app-body:not(.profile-shell) .search-row-inline input,
body.app-body:not(.profile-shell) .search-row-inline select,
body.app-body:not(.profile-shell) .leave-note-input {
    border-color: var(--border);
    border-radius: 0.86rem;
    background: #ffffff;
    color: var(--text);
}

body.app-body:not(.profile-shell) .field input:focus-visible,
body.app-body:not(.profile-shell) .field textarea:focus-visible,
body.app-body:not(.profile-shell) .field select:focus-visible,
body.app-body:not(.profile-shell) .search-row input:focus-visible,
body.app-body:not(.profile-shell) .search-row select:focus-visible,
body.app-body:not(.profile-shell) .search-row-inline input:focus-visible,
body.app-body:not(.profile-shell) .search-row-inline select:focus-visible,
body.app-body:not(.profile-shell) .button:focus-visible,
body.app-body:not(.profile-shell) .modal-close:focus-visible {
    outline: 3px solid rgba(7, 55, 96, 0.22);
    outline-offset: 2px;
}

body.app-body:not(.profile-shell) .button {
    border-radius: 999px;
    min-height: 42px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

body.app-body:not(.profile-shell) .button:not(:disabled):hover {
    transform: translateY(-1px);
}

body.app-body:not(.profile-shell) .button-dark,
body.app-body:not(.profile-shell) .button-accent {
    background: #073760;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(7, 55, 96, 0.18);
}

body.app-body:not(.profile-shell) .button-dark:not(:disabled):hover,
body.app-body:not(.profile-shell) .button-accent:not(:disabled):hover {
    background: #052946;
    box-shadow: 0 16px 34px rgba(7, 55, 96, 0.24);
}

body.app-body:not(.profile-shell) .button-light {
    background: #ffffff;
    color: #073760;
    border-color: var(--border);
}

body.app-body:not(.profile-shell) .button-light:not(:disabled):hover {
    border-color: #c5d4e2;
    box-shadow: 0 10px 22px rgba(15, 31, 51, 0.08);
}

body.app-body:not(.profile-shell) .button-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecdd3;
}

body.app-body:not(.profile-shell) .badge-muted {
    background: #f1f6fa;
    color: #64748b;
}

body.app-body:not(.profile-shell) .badge-dark {
    background: #073760;
    color: #ffffff;
}

body.app-body:not(.profile-shell) .badge-info {
    background: #e8f6f2;
    color: #237e72;
}

body.app-body:not(.profile-shell) .table-wrap {
    border-color: var(--border);
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: none;
}

body.app-body:not(.profile-shell) .report-table th,
body.app-body:not(.profile-shell) .report-table td {
    border-bottom-color: var(--border);
}

body.app-body:not(.profile-shell) .report-table th {
    background: #f1f6fa;
    color: #073760;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.app-body:not(.profile-shell) .report-table tbody tr:hover {
    background: #f8fbfd;
}

body.app-body:not(.profile-shell) .account-subnav-link {
    border-color: var(--border);
    background: #f6f9fc;
    border-radius: 1rem;
}

body.app-body:not(.profile-shell) .account-subnav-link:hover,
body.app-body:not(.profile-shell) .account-subnav-link.is-active {
    border-color: #c5d4e2;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(7, 55, 96, 0.08);
}

body.app-body:not(.profile-shell) .pagination-link {
    border-color: var(--border);
    color: #073760;
    background: #ffffff;
}

body.app-body:not(.profile-shell) .pagination-link.is-active,
body.app-body:not(.profile-shell) .pagination-link:hover {
    background: #073760;
    color: #ffffff;
}

body.app-body:not(.profile-shell) .time-range-pill {
    background: #e8f6f2;
    color: #237e72;
    border: 1px solid #cceee7;
}

body.app-body:not(.profile-shell) .modal-backdrop {
    background: rgba(5, 41, 70, 0.45);
}

body.app-body:not(.profile-shell) .modal-dialog {
    background: #ffffff;
    border-color: var(--border);
    border-radius: 1.15rem;
    box-shadow: 0 28px 80px rgba(5, 41, 70, 0.26);
}

body.app-body:not(.profile-shell) .modal-close {
    border-color: var(--border);
    background: #ffffff;
    color: #073760;
}

body.app-body:not(.profile-shell) .modal-actions {
    border-top-color: var(--border);
}

@media (max-width: 1100px) {
    body.app-body:not(.profile-shell) .app-shell {
        grid-template-columns: 1fr;
        max-width: 920px;
    }

    body.app-body:not(.profile-shell) .sidebar {
        order: 0;
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: minmax(210px, 0.74fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 0.75rem;
        overflow: visible;
    }

    body.app-body:not(.profile-shell) .brand-card {
        min-height: 100%;
    }

    body.app-body:not(.profile-shell) .brand-card h1,
    body.app-body:not(.profile-shell) .brand-title {
        margin-bottom: 0;
    }

    body.app-body:not(.profile-shell) .brand-card > p:not(.eyebrow) {
        display: none;
    }

    body.app-body:not(.profile-shell) .nav-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        align-self: start;
    }

    body.app-body:not(.profile-shell) .nav-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.55rem 0.65rem;
        text-align: center;
        font-size: 0.88rem;
        line-height: 1.25;
    }

    body.app-body:not(.profile-shell) .sidebar-user {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: center;
        margin-top: 0;
    }

    body.app-body:not(.profile-shell) .sidebar-user .badge {
        justify-self: start;
        width: fit-content;
    }

    body.app-body:not(.profile-shell) .sidebar-user .button-full {
        width: auto;
        min-width: 150px;
    }
}

@media (max-width: 720px) {
    .login-screen {
        display: flex;
        flex-direction: column;
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .login-hero,
    .login-card {
        border-radius: 1rem;
        padding: 1rem;
    }

    .login-card {
        order: -1;
    }

    .login-hero h1 {
        font-size: 1.55rem;
        line-height: 1.08;
    }

    .login-hero p {
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .login-hero .feature-grid {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        margin-top: 0.9rem;
    }

    .login-hero .feature-card {
        padding: 0.78rem 0.9rem;
    }

    .login-hero .feature-card p {
        margin: 0.25rem 0 0;
        font-size: 0.86rem;
        line-height: 1.45;
    }

    body.app-body:not(.profile-shell) .app-shell {
        padding: 0.65rem;
    }

    body.app-body:not(.profile-shell) .sidebar {
        grid-template-columns: 1fr;
        border-radius: 1.2rem;
        gap: 0.55rem;
        padding: 0.72rem;
    }

    body.app-body:not(.profile-shell) .brand-card {
        padding: 0.72rem 0.82rem;
    }

    body.app-body:not(.profile-shell) .brand-card .eyebrow {
        font-size: 0.62rem;
        margin: 0 0 0.18rem;
    }

    body.app-body:not(.profile-shell) .brand-card h1,
    body.app-body:not(.profile-shell) .brand-title {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.12rem 0.36rem;
    }

    body.app-body:not(.profile-shell) .brand-title-line {
        font-size: 1.12rem;
        line-height: 1.02;
    }

    body.app-body:not(.profile-shell) .nav-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    body.app-body:not(.profile-shell) .nav-links a {
        min-height: 38px;
        padding: 0.42rem 0.52rem;
        font-size: 0.82rem;
    }

    body.app-body:not(.profile-shell) .sidebar-user {
        grid-template-columns: 1fr;
        gap: 0.38rem;
        padding: 0.72rem;
    }

    body.app-body:not(.profile-shell) .sidebar-user .user-name {
        font-size: 0.98rem;
    }

    body.app-body:not(.profile-shell) .sidebar-user .user-email {
        margin: 0;
        font-size: 0.8rem;
    }

    body.app-body:not(.profile-shell) .sidebar-user .button-full {
        width: 100%;
        min-height: 38px;
    }

    body.app-body:not(.profile-shell) .panel,
    body.app-body:not(.profile-shell) .metric-card {
        border-radius: 1rem;
    }
}

@media (max-width: 900px) {
    body.app-body:not(.profile-shell) .search-row,
    body.app-body:not(.profile-shell) .search-row-inline {
        align-items: stretch;
        flex-direction: column;
    }

    body.app-body:not(.profile-shell) .search-row .button,
    body.app-body:not(.profile-shell) .search-row-inline .button,
    body.app-body:not(.profile-shell) .search-row input,
    body.app-body:not(.profile-shell) .search-row select,
    body.app-body:not(.profile-shell) .search-row-inline input,
    body.app-body:not(.profile-shell) .search-row-inline select {
        width: 100%;
    }

    body.app-body:not(.profile-shell) .report-table,
    body.app-body:not(.profile-shell) .report-table thead,
    body.app-body:not(.profile-shell) .report-table tbody,
    body.app-body:not(.profile-shell) .report-table tr,
    body.app-body:not(.profile-shell) .report-table th,
    body.app-body:not(.profile-shell) .report-table td {
        display: block;
        width: 100%;
    }

    body.app-body:not(.profile-shell) .report-table thead {
        display: none;
    }

    body.app-body:not(.profile-shell) .report-table tbody {
        display: grid;
        gap: 0.9rem;
        padding: 0.9rem;
    }

    body.app-body:not(.profile-shell) .report-table tr {
        border: 1px solid var(--border);
        border-radius: 1rem;
        padding: 0.25rem 0.95rem;
        background: #ffffff;
    }

    body.app-body:not(.profile-shell) .report-table td {
        display: grid;
        grid-template-columns: minmax(112px, 126px) minmax(0, 1fr);
        gap: 0.72rem;
        align-items: start;
        padding: 0.72rem 0;
        border-bottom: 1px solid var(--border);
    }

    body.app-body:not(.profile-shell) .report-table td:last-child {
        border-bottom: none;
    }

    body.app-body:not(.profile-shell) .report-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        line-height: 1.4;
        text-transform: uppercase;
    }
}

@media (max-width: 520px) {
    body.app-body:not(.profile-shell) .report-table td {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    body.app-body:not(.profile-shell) .report-table td::before {
        margin-bottom: 0.04rem;
    }

    body.app-body:not(.profile-shell) .table-action-group,
    body.app-body:not(.profile-shell) .action-row,
    body.app-body:not(.profile-shell) .modal-actions {
        align-items: stretch;
    }

    body.app-body:not(.profile-shell) .table-action-group .button,
    body.app-body:not(.profile-shell) .table-action-group form {
        width: 100%;
    }

    body.app-body:not(.profile-shell) .table-action-group .button {
        min-height: 38px;
    }
}

body.app-body:not(.profile-shell) .dashboard-home-page,
body.app-body:not(.profile-shell) .devices-admin-page,
body.app-body:not(.profile-shell) .reports-admin-page {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

body.app-body:not(.profile-shell) .dashboard-hero-panel,
body.app-body:not(.profile-shell) .devices-admin-hero,
body.app-body:not(.profile-shell) .reports-hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(460px, 1fr);
    gap: 1rem;
    align-items: stretch;
    padding: clamp(1rem, 1.5vw, 1.3rem);
}

body.app-body:not(.profile-shell) .dashboard-hero-panel {
    background: #073760;
    color: #ffffff;
}

body.app-body:not(.profile-shell) .dashboard-hero-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.72rem;
}

body.app-body:not(.profile-shell) .dashboard-hero-main .eyebrow,
body.app-body:not(.profile-shell) .dashboard-hero-main h3,
body.app-body:not(.profile-shell) .dashboard-hero-main p {
    color: #ffffff;
}

body.app-body:not(.profile-shell) .dashboard-hero-main .eyebrow {
    color: rgba(255, 255, 255, 0.68);
}

body.app-body:not(.profile-shell) .dashboard-hero-main h3 {
    margin: 0;
    font-size: clamp(2rem, 1.35rem + 1.8vw, 3.1rem);
    line-height: 1.02;
}

body.app-body:not(.profile-shell) .dashboard-hero-main p {
    max-width: 640px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
}

body.app-body:not(.profile-shell) .dashboard-hero-main .button-light {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.app-body:not(.profile-shell) .dashboard-hero-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card {
    min-height: 130px;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card .eyebrow,
body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card h3,
body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card p {
    color: #ffffff;
}

body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card .eyebrow,
body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card p {
    color: rgba(255, 255, 255, 0.74);
}

body.app-body:not(.profile-shell) .dashboard-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.72fr);
    gap: 0.85rem;
    align-items: start;
}

body.app-body:not(.profile-shell) .dashboard-empty-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

body.app-body:not(.profile-shell) .dashboard-step-list {
    display: grid;
    gap: 0.62rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.app-body:not(.profile-shell) .dashboard-step-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.14rem 0.72rem;
    align-items: start;
    padding: 0.72rem;
    border: 1px solid var(--border);
    border-radius: 0.88rem;
    background: #f6f9fc;
}

body.app-body:not(.profile-shell) .dashboard-step-list span {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #073760;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
}

body.app-body:not(.profile-shell) .dashboard-step-list strong {
    color: var(--text);
}

body.app-body:not(.profile-shell) .dashboard-step-list p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

body.app-body:not(.profile-shell) .devices-admin-hero,
body.app-body:not(.profile-shell) .reports-hero-panel {
    grid-template-columns: minmax(0, 1fr) auto;
}

body.app-body:not(.profile-shell) .devices-admin-hero h3,
body.app-body:not(.profile-shell) .reports-hero-panel h3 {
    margin: 0.12rem 0 0.3rem;
    font-size: clamp(1.35rem, 1rem + 0.8vw, 2rem);
}

body.app-body:not(.profile-shell) .devices-admin-hero p,
body.app-body:not(.profile-shell) .reports-hero-panel p {
    margin: 0;
    color: var(--muted);
}

body.app-body:not(.profile-shell) .devices-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(112px, 1fr));
    gap: 0.55rem;
    min-width: min(560px, 100%);
}

body.app-body:not(.profile-shell) .devices-summary-strip .metric-card {
    min-height: 92px;
    padding: 0.78rem 0.86rem;
    box-shadow: none;
}

body.app-body:not(.profile-shell) .devices-create-panel,
body.app-body:not(.profile-shell) .devices-list-panel,
body.app-body:not(.profile-shell) .reports-result-panel {
    padding: 1rem;
}

body.app-body:not(.profile-shell) .device-create-form {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
}

body.app-body:not(.profile-shell) .device-create-form .field-full,
body.app-body:not(.profile-shell) .device-create-form .button.field-full {
    grid-column: 1 / -1;
}

body.app-body:not(.profile-shell) .device-card-compact {
    gap: 0.72rem;
    padding: 0.85rem;
    border-radius: 1rem;
}

body.app-body:not(.profile-shell) .device-card-head p {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

body.app-body:not(.profile-shell) .device-card-ops-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(280px, 1.12fr);
    gap: 0.65rem;
    align-items: stretch;
}

body.app-body:not(.profile-shell) .device-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

body.app-body:not(.profile-shell) .device-stats-grid .stat-block {
    padding: 0.72rem 0.78rem;
}

body.app-body:not(.profile-shell) .device-sync-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.65rem;
    padding: 0.72rem 0.82rem;
}

body.app-body:not(.profile-shell) .device-sync-meta p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.36;
}

body.app-body:not(.profile-shell) .device-config-details {
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: #ffffff;
}

body.app-body:not(.profile-shell) .device-config-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0 0.9rem;
    color: #073760;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

body.app-body:not(.profile-shell) .device-config-details summary::-webkit-details-marker {
    display: none;
}

body.app-body:not(.profile-shell) .device-config-details summary::after {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: #eef6fc;
    color: #073760;
    font-size: 1rem;
    line-height: 1;
}

body.app-body:not(.profile-shell) .device-config-details[open] {
    padding-bottom: 0.85rem;
}

body.app-body:not(.profile-shell) .device-config-details[open] summary {
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.78rem;
}

body.app-body:not(.profile-shell) .device-config-details[open] summary::after {
    content: "-";
}

body.app-body:not(.profile-shell) .device-config-details .device-edit-grid,
body.app-body:not(.profile-shell) .device-config-details .device-save-button {
    margin-inline: 0.85rem;
}

body.app-body:not(.profile-shell) .device-edit-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.58rem;
}

body.app-body:not(.profile-shell) .device-edit-grid .field-full {
    grid-column: 1 / -1;
}

body.app-body:not(.profile-shell) .device-create-form .field,
body.app-body:not(.profile-shell) .device-edit-grid .field {
    gap: 0.28rem;
}

body.app-body:not(.profile-shell) .device-create-form input,
body.app-body:not(.profile-shell) .device-create-form select,
body.app-body:not(.profile-shell) .device-edit-grid input,
body.app-body:not(.profile-shell) .device-edit-grid select {
    min-height: 42px;
    padding: 0.56rem 0.74rem;
}

body.app-body:not(.profile-shell) .device-create-form textarea,
body.app-body:not(.profile-shell) .device-edit-grid textarea {
    min-height: 74px;
    padding: 0.62rem 0.74rem;
}

body.app-body:not(.profile-shell) .device-save-button {
    justify-self: end;
    min-width: 190px;
}

body.app-body:not(.profile-shell) .reports-hero-panel {
    align-items: end;
}

body.app-body:not(.profile-shell) .reports-toolbar {
    justify-content: flex-end;
    min-width: min(620px, 100%);
}

body.app-body:not(.profile-shell) .reports-toolbar form {
    flex: 1 1 360px;
}

body.app-body:not(.profile-shell) .reports-toolbar input {
    min-width: 280px;
}

body.app-body:not(.profile-shell) .reports-result-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

body.app-body:not(.profile-shell) .report-card-compact {
    display: grid;
    grid-template-columns: minmax(250px, 0.85fr) minmax(180px, 0.5fr) minmax(360px, 1fr);
    align-items: stretch;
    padding: 0.85rem;
}

body.app-body:not(.profile-shell) .report-card-identity p {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

body.app-body:not(.profile-shell) .report-card-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

body.app-body:not(.profile-shell) .report-card-stats .stat-block {
    padding: 0.7rem 0.76rem;
}

@media (max-width: 1280px) {
    body.app-body:not(.profile-shell) .dashboard-hero-panel,
    body.app-body:not(.profile-shell) .devices-admin-hero,
    body.app-body:not(.profile-shell) .reports-hero-panel,
    body.app-body:not(.profile-shell) .dashboard-workspace-grid,
    body.app-body:not(.profile-shell) .device-card-ops-grid,
    body.app-body:not(.profile-shell) .report-card-compact {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .devices-summary-strip {
        min-width: 0;
    }

    body.app-body:not(.profile-shell) .device-create-form,
    body.app-body:not(.profile-shell) .device-edit-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.app-body:not(.profile-shell) .dashboard-hero-kpis,
    body.app-body:not(.profile-shell) .devices-summary-strip,
    body.app-body:not(.profile-shell) .device-stats-grid,
    body.app-body:not(.profile-shell) .device-sync-meta,
    body.app-body:not(.profile-shell) .report-card-stats,
    body.app-body:not(.profile-shell) .device-create-form,
    body.app-body:not(.profile-shell) .device-edit-grid {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .dashboard-empty-profile,
    body.app-body:not(.profile-shell) .reports-hero-panel {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .dashboard-empty-profile .button,
    body.app-body:not(.profile-shell) .device-save-button,
    body.app-body:not(.profile-shell) .reports-toolbar,
    body.app-body:not(.profile-shell) .reports-toolbar form,
    body.app-body:not(.profile-shell) .reports-toolbar input,
    body.app-body:not(.profile-shell) .reports-toolbar .button {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    body.app-body:not(.profile-shell) .dashboard-hero-panel {
        padding: 0.95rem;
    }

    body.app-body:not(.profile-shell) .dashboard-hero-main h3 {
        font-size: 1.75rem;
    }

    body.app-body:not(.profile-shell) .dashboard-hero-main .action-row .button {
        width: 100%;
    }

    body.app-body:not(.profile-shell) .devices-create-panel,
    body.app-body:not(.profile-shell) .devices-list-panel,
    body.app-body:not(.profile-shell) .reports-result-panel {
        padding: 0.82rem;
    }
}

/* UI pass: compact app chrome, dashboard, reports and account creation. */
body.app-body:not(.profile-shell) .app-shell {
    max-width: 1540px;
    grid-template-columns: clamp(218px, 14vw, 250px) minmax(0, 1fr);
    gap: 0.85rem;
    padding: 0.7rem;
}

body.app-body:not(.profile-shell) .sidebar {
    border-radius: 1.35rem;
    padding: 0.75rem;
    gap: 0.62rem;
}

body.app-body:not(.profile-shell) .brand-card {
    padding: 0.86rem 0.9rem 0.92rem;
    overflow: visible;
}

body.app-body:not(.profile-shell) .brand-card h1,
body.app-body:not(.profile-shell) .brand-title {
    margin: 0.5rem 0 0;
    gap: 0.08rem;
}

body.app-body:not(.profile-shell) .brand-title-line {
    font-size: clamp(1.42rem, 1.05rem + 0.62vw, 1.78rem);
    line-height: 1.04;
    white-space: normal;
}

body.app-body:not(.profile-shell) .nav-links {
    gap: 0.26rem;
}

body.app-body:not(.profile-shell) .nav-links a {
    min-height: 40px;
    padding: 0.52rem 0.72rem;
    border-radius: 0.82rem;
    font-size: 0.92rem;
    line-height: 1.22;
}

body.app-body:not(.profile-shell) .sidebar-user {
    padding: 0.72rem;
    border-radius: 1rem;
}

body.app-body:not(.profile-shell) .sidebar-user .user-name {
    font-size: 1rem;
    line-height: 1.18;
}

body.app-body:not(.profile-shell) .sidebar-user .user-email {
    font-size: 0.78rem;
    word-break: break-word;
}

body.app-body:not(.profile-shell) .sidebar-user .button-full {
    min-height: 40px;
}

body.app-body:not(.profile-shell) .dashboard-hero-panel {
    grid-template-columns: minmax(0, 0.72fr) minmax(420px, 0.92fr);
    padding: clamp(1rem, 1.25vw, 1.18rem);
    gap: 0.86rem;
}

body.app-body:not(.profile-shell) .dashboard-hero-main {
    gap: 0.58rem;
}

body.app-body:not(.profile-shell) .dashboard-hero-main h3 {
    font-size: clamp(1.9rem, 1.3rem + 1.45vw, 2.55rem);
}

body.app-body:not(.profile-shell) .dashboard-hero-main p {
    font-size: 0.94rem;
    line-height: 1.52;
}

body.app-body:not(.profile-shell) .dashboard-hero-kpis {
    gap: 0.56rem;
}

body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card {
    min-height: 104px;
    padding: 0.82rem 0.92rem;
    border-radius: 1rem;
}

body.app-body:not(.profile-shell) .dashboard-hero-kpis .metric-card h3 {
    font-size: clamp(1.35rem, 1rem + 0.72vw, 1.85rem);
    line-height: 1.08;
}

body.app-body:not(.profile-shell) .dashboard-workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
    gap: 0.78rem;
}

body.app-body:not(.profile-shell) .dashboard-step-list li {
    padding: 0.62rem 0.68rem;
}

body.app-body:not(.profile-shell) .reports-hero-panel {
    grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 0.78fr);
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
}

body.app-body:not(.profile-shell) .reports-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    min-width: 0;
    align-items: end;
}

body.app-body:not(.profile-shell) .reports-toolbar form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.58rem;
    flex: unset;
    min-width: 0;
}

body.app-body:not(.profile-shell) .reports-toolbar input {
    min-width: 0;
}

body.app-body:not(.profile-shell) .reports-toolbar .button {
    min-width: 132px;
    white-space: nowrap;
}

body.app-body:not(.profile-shell) .reports-result-panel {
    padding: 0.92rem;
}

body.app-body:not(.profile-shell) .report-card-compact {
    grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.58fr) minmax(320px, 0.9fr);
    gap: 0.72rem;
}

body.app-body:not(.profile-shell) .account-create-panel {
    padding: 1rem;
}

body.app-body:not(.profile-shell) .account-create-head {
    margin-bottom: 0.72rem;
}

body.app-body:not(.profile-shell) .account-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

body.app-body:not(.profile-shell) .account-create-section {
    display: grid;
    grid-template-columns: minmax(160px, 0.2fr) minmax(0, 1fr);
    gap: 0.74rem;
    align-items: start;
    padding: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: #f6f9fc;
}

body.app-body:not(.profile-shell) .account-create-section-compact {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

body.app-body:not(.profile-shell) .account-create-section-title {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    min-width: 0;
}

body.app-body:not(.profile-shell) .account-create-section-title strong {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.18;
}

body.app-body:not(.profile-shell) .account-create-section-title span {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

body.app-body:not(.profile-shell) .account-create-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.62rem;
    min-width: 0;
}

body.app-body:not(.profile-shell) .account-create-wide {
    grid-column: 1 / -1;
}

body.app-body:not(.profile-shell) .account-create-form .field {
    gap: 0.28rem;
    min-width: 0;
}

body.app-body:not(.profile-shell) .account-create-form .field span {
    font-size: 0.78rem;
    font-weight: 750;
    color: #4c6179;
}

body.app-body:not(.profile-shell) .account-create-form input,
body.app-body:not(.profile-shell) .account-create-form select {
    min-height: 42px;
    padding: 0.56rem 0.72rem;
    border-radius: 0.72rem;
    font-size: 0.88rem;
}

body.app-body:not(.profile-shell) .account-create-form .checkbox-row {
    padding: 0.76rem 0.86rem;
    border-radius: 0.88rem;
}

body.app-body:not(.profile-shell) .account-create-form .checkbox-row strong {
    font-size: 0.9rem;
}

body.app-body:not(.profile-shell) .account-create-form .checkbox-row small {
    font-size: 0.78rem;
}

body.app-body:not(.profile-shell) .account-create-form .panel-subsection {
    margin: 0;
    box-shadow: none;
}

body.app-body:not(.profile-shell) .account-create-form .device-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

body.app-body:not(.profile-shell) .account-create-form .device-checkbox-card {
    padding: 0.58rem 0.68rem;
    border-radius: 0.76rem;
}

body.app-body:not(.profile-shell) .account-create-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.1rem;
}

body.app-body:not(.profile-shell) .account-create-actions .button {
    min-width: 190px;
}

@media (max-width: 1280px) {
    body.app-body:not(.profile-shell) .dashboard-hero-panel,
    body.app-body:not(.profile-shell) .dashboard-workspace-grid,
    body.app-body:not(.profile-shell) .reports-hero-panel,
    body.app-body:not(.profile-shell) .report-card-compact {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .account-create-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    body.app-body:not(.profile-shell) .account-create-section {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .account-create-grid,
    body.app-body:not(.profile-shell) .account-create-form .device-checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.app-body:not(.profile-shell) .reports-toolbar,
    body.app-body:not(.profile-shell) .reports-toolbar form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    body.app-body:not(.profile-shell) .brand-title-line {
        font-size: 1.06rem;
    }

    body.app-body:not(.profile-shell) .dashboard-hero-kpis,
    body.app-body:not(.profile-shell) .account-create-grid,
    body.app-body:not(.profile-shell) .account-create-form .device-checkbox-grid {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .account-create-actions,
    body.app-body:not(.profile-shell) .account-create-actions .button {
        width: 100%;
    }
}

@media (max-width: 1100px) {
    body.app-body:not(.profile-shell) .app-shell {
        grid-template-columns: 1fr;
        max-width: 920px;
        padding: 0.75rem;
    }

    body.app-body:not(.profile-shell) .sidebar {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: minmax(190px, 0.58fr) minmax(0, 1fr);
        gap: 0.65rem;
        overflow: visible;
    }

    body.app-body:not(.profile-shell) .brand-card {
        min-height: 100%;
    }

    body.app-body:not(.profile-shell) .brand-card h1,
    body.app-body:not(.profile-shell) .brand-title {
        margin-bottom: 0;
    }

    body.app-body:not(.profile-shell) .nav-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
        align-self: start;
    }

    body.app-body:not(.profile-shell) .nav-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 0.48rem 0.58rem;
        text-align: center;
        font-size: 0.84rem;
    }

    body.app-body:not(.profile-shell) .sidebar-user {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.65rem;
        align-items: center;
        margin-top: 0;
    }

    body.app-body:not(.profile-shell) .sidebar-user .button-full {
        width: auto;
        min-width: 140px;
    }
}

@media (max-width: 720px) {
    body.app-body:not(.profile-shell) .app-shell {
        max-width: 100%;
        padding: 0.55rem;
        gap: 0.62rem;
    }

    body.app-body:not(.profile-shell) .sidebar {
        grid-template-columns: 1fr;
        border-radius: 1rem;
        padding: 0.62rem;
        gap: 0.48rem;
    }

    body.app-body:not(.profile-shell) .brand-card {
        padding: 0.68rem 0.76rem;
        border-radius: 0.9rem;
    }

    body.app-body:not(.profile-shell) .brand-card .eyebrow {
        margin: 0 0 0.16rem;
        font-size: 0.58rem;
    }

    body.app-body:not(.profile-shell) .brand-card h1,
    body.app-body:not(.profile-shell) .brand-title {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.12rem 0.32rem;
    }

    body.app-body:not(.profile-shell) .brand-title-line {
        font-size: 1.04rem;
        line-height: 1.04;
    }

    body.app-body:not(.profile-shell) .nav-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.32rem;
    }

    body.app-body:not(.profile-shell) .nav-links a {
        min-height: 36px;
        padding: 0.4rem 0.48rem;
        border-radius: 0.72rem;
        font-size: 0.78rem;
    }

    body.app-body:not(.profile-shell) .sidebar-user {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0.58rem;
        gap: 0.5rem;
        align-items: center;
    }

    body.app-body:not(.profile-shell) .sidebar-user .user-name {
        font-size: 0.95rem;
    }

    body.app-body:not(.profile-shell) .sidebar-user .user-email {
        display: none;
    }

    body.app-body:not(.profile-shell) .sidebar-user .badge {
        display: none;
    }

    body.app-body:not(.profile-shell) .sidebar-user .logout-form {
        margin: 0;
    }

    body.app-body:not(.profile-shell) .sidebar-user .button-full {
        width: auto;
        min-width: 104px;
        min-height: 36px;
        padding-inline: 1rem;
    }

    body.app-body:not(.profile-shell) .account-link {
        width: 100%;
    }

    body.app-body:not(.profile-shell) .topbar {
        border-radius: 0.95rem;
        padding: 0.36rem 0.5rem;
    }
}

/* Profile OCR premium redesign, scoped to avoid changing other modules. */
.profile-page-premium {
    --profile-navy: #073760;
    --profile-navy-strong: #052946;
    --profile-ink: #0f1f33;
    --profile-muted: #64748b;
    --profile-panel: #ffffff;
    --profile-surface: #f6f9fc;
    --profile-line: #dbe6ef;
    --profile-line-strong: #c5d4e2;
    --profile-accent: #c26f32;
    --profile-accent-soft: #fff3e8;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--profile-ink);
}

body.profile-shell {
    --profile-navy: #073760;
    --profile-navy-strong: #052946;
    --profile-ink: #0f1f33;
    --profile-muted: #64748b;
    --profile-panel: #ffffff;
    --profile-surface: #f6f9fc;
    --profile-line: #dbe6ef;
    --profile-line-strong: #c5d4e2;
    --profile-accent: #c26f32;
    --profile-accent-soft: #fff3e8;
    background:
        linear-gradient(180deg, rgba(7, 55, 96, 0.08), rgba(246, 249, 252, 0.96) 34%),
        #f5f8fb;
}

body.profile-shell .app-shell {
    max-width: 1480px;
    grid-template-columns: clamp(236px, 16vw, 272px) minmax(0, 1fr);
    gap: 1rem;
}

body.profile-shell .sidebar {
    background: linear-gradient(180deg, var(--profile-navy), var(--profile-navy-strong));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.55rem;
    box-shadow: 0 24px 70px rgba(5, 41, 70, 0.28);
}

body.profile-shell .brand-card,
body.profile-shell .sidebar-user {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.18rem;
}

body.profile-shell .nav-links a.active,
body.profile-shell .nav-links a:hover {
    background: #ffffff;
    color: var(--profile-navy);
}

body.profile-shell .nav-links a {
    color: rgba(255, 255, 255, 0.76);
}

body.profile-shell .brand-title-line {
    letter-spacing: 0;
}

body.profile-shell .topbar {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 230, 239, 0.86);
    box-shadow: 0 18px 40px rgba(15, 31, 51, 0.06);
}

.profile-page-premium .profile-subnav {
    gap: 0.55rem;
    padding: 0.35rem;
    border: 1px solid var(--profile-line);
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 16px 35px rgba(15, 31, 51, 0.05);
}

.profile-page-premium .account-subnav-link {
    justify-content: center;
    min-height: 58px;
    padding: 0.78rem 1rem;
    border-color: transparent;
    border-radius: 0.86rem;
    background: transparent;
    color: var(--profile-muted);
    font-weight: 800;
}

.profile-page-premium .account-subnav-link:hover,
.profile-page-premium .account-subnav-link.is-active {
    background: var(--profile-navy);
    color: #ffffff;
    border-color: var(--profile-navy);
    box-shadow: 0 14px 28px rgba(7, 55, 96, 0.18);
}

.profile-page-premium .panel {
    border: 1px solid var(--profile-line);
    border-radius: 1.28rem;
    background: var(--profile-panel);
    box-shadow: 0 22px 58px rgba(15, 31, 51, 0.08);
}

.profile-page-premium .profile-ocr-panel {
    gap: 0.9rem;
    padding: clamp(1rem, 1.6vw, 1.55rem);
}

.profile-ocr-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    padding: clamp(1rem, 1.5vw, 1.35rem);
    border-radius: 1.1rem;
    background: var(--profile-navy);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(7, 55, 96, 0.18);
}

.profile-ocr-hero .eyebrow {
    margin: 0 0 0.45rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.profile-ocr-hero h3 {
    margin: 0;
    font-size: clamp(1.85rem, 1.2rem + 1.5vw, 2.7rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.profile-ocr-hero p {
    max-width: 680px;
    margin: 0.55rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.98rem;
    line-height: 1.6;
}

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

.profile-page-premium .button {
    min-height: 42px;
    border-radius: 999px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.profile-page-premium .button:not(:disabled):hover {
    transform: translateY(-1px);
}

.profile-page-premium .button:focus-visible,
.profile-page-premium input:focus-visible,
.profile-page-premium textarea:focus-visible,
.profile-page-premium select:focus-visible {
    outline: 3px solid rgba(7, 55, 96, 0.22);
    outline-offset: 2px;
}

.profile-page-premium .button-dark,
.profile-page-premium .button-accent {
    background: var(--profile-navy);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(7, 55, 96, 0.18);
}

.profile-page-premium .button-dark:not(:disabled):hover,
.profile-page-premium .button-accent:not(:disabled):hover {
    background: var(--profile-navy-strong);
    box-shadow: 0 16px 34px rgba(7, 55, 96, 0.24);
}

.profile-page-premium .profile-ocr-hero .button-dark {
    background: #ffffff;
    color: var(--profile-navy);
    box-shadow: none;
}

.profile-page-premium .button-light {
    background: #ffffff;
    color: var(--profile-navy);
    border-color: var(--profile-line);
}

.profile-page-premium .button-light:not(:disabled):hover {
    border-color: var(--profile-line-strong);
    box-shadow: 0 10px 22px rgba(15, 31, 51, 0.08);
}

.profile-page-premium .button-danger {
    background: #fff1f1;
    color: #b42318;
    border-color: #ffd0d0;
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.profile-stat-card {
    min-height: 92px;
    padding: 0.92rem 1rem;
    border: 1px solid var(--profile-line);
    border-radius: 1rem;
    background: var(--profile-surface);
}

.profile-stat-card span {
    display: block;
    color: var(--profile-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
}

.profile-stat-card strong {
    display: block;
    margin-top: 0.45rem;
    color: var(--profile-ink);
    font-size: clamp(1.35rem, 1rem + 1vw, 2rem);
    line-height: 1;
}

.profile-page-premium .search-row.profile-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding: 0.35rem;
    border: 1px solid var(--profile-line);
    border-radius: 1rem;
    background: var(--profile-surface);
}

.profile-page-premium .search-row.profile-toolbar input {
    min-height: 48px;
    border-color: transparent;
    border-radius: 0.78rem;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(219, 230, 239, 0.75);
}

.profile-page-premium .search-row.profile-toolbar .button {
    min-width: 112px;
}

.profile-page-premium .table-wrap {
    border-color: var(--profile-line);
    border-radius: 1rem;
    box-shadow: none;
}

.profile-page-premium .report-table th,
.profile-page-premium .report-table td {
    padding: 0.78rem 0.82rem;
    border-bottom-color: var(--profile-line);
}

.profile-page-premium .report-table th {
    background: #f1f6fa;
    color: var(--profile-navy);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-page-premium .report-table tbody tr:hover {
    background: #f8fbfd;
}

.profile-page-premium .table-identity-cell strong,
.profile-page-premium .table-meta-cell strong {
    color: var(--profile-ink);
    font-size: 0.93rem;
    line-height: 1.35;
}

.profile-page-premium .table-inline-meta,
.profile-page-premium .table-meta-cell span {
    color: var(--profile-muted);
    font-size: 0.82rem;
}

.profile-page-premium .table-action-group {
    justify-content: flex-start;
    gap: 0.45rem;
}

.profile-page-premium .badge {
    font-size: 0.68rem;
    padding: 0.28rem 0.54rem;
}

.profile-page-premium .empty-card,
.profile-page-premium .demo-box,
.profile-page-premium .info-card {
    border-color: var(--profile-line);
    background: var(--profile-surface);
    border-radius: 1rem;
}

.profile-page-premium .field input,
.profile-page-premium .field textarea,
.profile-page-premium .field select,
.profile-page-premium .search-row input,
.profile-page-premium .search-row select,
.profile-page-premium .profile-user-picker-search {
    border-color: var(--profile-line);
    border-radius: 0.86rem;
    background: #ffffff;
}

.profile-page-premium .profile-upload-note div {
    border-color: var(--profile-line);
    border-radius: 0.92rem;
    background: #f6f9fc;
}

body.profile-shell .modal-backdrop {
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding-block: clamp(0.75rem, 3vh, 1.5rem);
    background: rgba(5, 22, 38, 0.54);
    backdrop-filter: blur(5px);
}

.profile-page-premium .modal-dialog,
.profile-page-premium .profile-detail-modal {
    margin: 0 auto;
    border-color: var(--profile-line);
    border-radius: 1.1rem;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(5, 22, 38, 0.28);
}

.profile-page-premium .modal-header {
    align-items: center;
    padding-bottom: 0.72rem;
    border-bottom: 1px solid var(--profile-line);
}

.profile-page-premium .modal-header h3 {
    color: var(--profile-ink);
    font-size: 1.1rem;
    letter-spacing: 0;
}

.profile-page-premium .modal-header p {
    color: var(--profile-muted);
}

.profile-page-premium .modal-close {
    border-color: var(--profile-line);
    color: var(--profile-navy);
    border-radius: 999px;
}

.profile-page-premium .profile-detail-modal {
    width: min(1240px, calc(100vw - 2rem));
    padding: 0.95rem;
}

.profile-page-premium .profile-detail-summary {
    gap: 0.5rem;
}

.profile-page-premium .profile-detail-summary div {
    border-color: var(--profile-line);
    border-radius: 0.78rem;
    background: #fbfdff;
}

.profile-page-premium .profile-detail-summary span {
    color: var(--profile-muted);
}

.profile-page-premium .profile-modal-section {
    border-color: var(--profile-line);
    border-radius: 0.92rem;
    background: #ffffff;
}

.profile-page-premium .profile-modal-section-head h4 {
    color: var(--profile-ink);
}

.profile-page-premium .profile-modal-section-head p {
    color: var(--profile-muted);
}

.profile-page-premium .profile-document-row {
    border-color: var(--profile-line);
    background: #fbfdff;
}

.profile-page-premium .profile-document-row span {
    color: var(--profile-muted);
}

.profile-page-premium .profile-review-header {
    grid-template-columns: minmax(110px, 0.72fr) minmax(150px, 0.95fr) minmax(180px, 1.1fr) minmax(230px, 1.35fr);
    color: var(--profile-muted);
    border-bottom-color: var(--profile-line);
}

.profile-page-premium .profile-review-card {
    grid-template-columns: minmax(110px, 0.72fr) minmax(150px, 0.95fr) minmax(180px, 1.1fr) minmax(230px, 1.35fr);
    border-color: var(--profile-line);
    background: #ffffff;
}

.profile-page-premium .profile-review-card:hover,
.profile-page-premium .profile-review-card:focus-within {
    border-color: var(--profile-line-strong);
    background: #f8fbfd;
}

.profile-page-premium .profile-review-card-head span,
.profile-page-premium .profile-ocr-value span,
.profile-page-premium .profile-confirm-value span {
    color: var(--profile-muted);
}

.profile-page-premium .profile-ocr-value {
    background: #f6f9fc;
    border-color: var(--profile-line);
}

.profile-page-premium .profile-confirm-value {
    border-color: var(--profile-line);
    background: #ffffff;
}

.profile-page-premium .profile-save-bar {
    border-top-color: var(--profile-line);
}

@media (max-width: 1280px) {
    .profile-page-premium .profile-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    body.profile-shell .app-shell {
        grid-template-columns: 1fr;
        max-width: 920px;
    }

    body.profile-shell .sidebar {
        order: 0;
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: minmax(210px, 0.74fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 0.75rem;
    }

    body.profile-shell .brand-card {
        min-height: 100%;
    }

    body.profile-shell .brand-card h1,
    body.profile-shell .brand-title {
        margin-bottom: 0;
    }

    body.profile-shell .brand-card > p:not(.eyebrow) {
        display: none;
    }

    body.profile-shell .nav-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        align-self: start;
    }

    body.profile-shell .nav-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.55rem 0.65rem;
        text-align: center;
        font-size: 0.88rem;
        line-height: 1.25;
    }

    body.profile-shell .sidebar-user {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: center;
        margin-top: 0;
    }

body.profile-shell .sidebar-user .badge {
    justify-self: start;
    width: fit-content;
}

    body.profile-shell .sidebar-user .button-full {
        width: auto;
        min-width: 150px;
    }

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

    .profile-ocr-hero-actions {
        justify-content: flex-start;
    }

    .profile-page-premium .profile-ocr-hero .button {
        width: auto;
        min-width: 150px;
    }
}

@media (max-width: 900px) {
    .profile-page-premium .profile-subnav,
    .profile-page-premium .profile-stat-grid,
    .profile-page-premium .search-row.profile-toolbar,
    .profile-page-premium .profile-detail-summary,
    .profile-page-premium .profile-document-grid,
    .profile-page-premium .profile-save-bar {
        grid-template-columns: 1fr;
    }

    .profile-page-premium .search-row.profile-toolbar .button,
    .profile-page-premium .profile-ocr-hero .button {
        width: 100%;
    }

    .profile-page-premium .profile-management-table tr {
        border-color: var(--profile-line);
        border-radius: 1rem;
        background: #ffffff;
    }

    .profile-page-premium .profile-management-table td {
        border-bottom-color: var(--profile-line);
    }

    .profile-page-premium .profile-management-table td::before {
        color: var(--profile-muted);
    }

    .profile-page-premium .table-action-group .button {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .profile-page-premium {
        gap: 0.75rem;
    }

    body.profile-shell .app-shell {
        padding: 0.65rem;
    }

    body.profile-shell .sidebar {
        grid-template-columns: 1fr;
        border-radius: 1.2rem;
        gap: 0.55rem;
        padding: 0.72rem;
    }

    body.profile-shell .brand-card {
        padding: 0.72rem 0.82rem;
    }

    body.profile-shell .brand-card .eyebrow {
        font-size: 0.62rem;
        margin: 0 0 0.18rem;
    }

    body.profile-shell .brand-card h1,
    body.profile-shell .brand-title {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.12rem 0.36rem;
    }

    body.profile-shell .brand-title-line {
        font-size: 1.12rem;
        line-height: 1.02;
    }

    body.profile-shell .nav-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    body.profile-shell .nav-links a {
        min-height: 38px;
        padding: 0.42rem 0.52rem;
        font-size: 0.82rem;
    }

    body.profile-shell .sidebar-user {
        grid-template-columns: 1fr;
        gap: 0.38rem;
        padding: 0.72rem;
    }

    body.profile-shell .sidebar-user .user-name {
        font-size: 0.98rem;
    }

    body.profile-shell .sidebar-user .user-email {
        margin: 0;
        font-size: 0.8rem;
    }

    body.profile-shell .sidebar-user .button-full {
        width: 100%;
        min-height: 38px;
    }

    .profile-page-premium .panel,
    .profile-page-premium .profile-ocr-panel {
        border-radius: 1rem;
        padding: 0.82rem;
    }

    .profile-ocr-hero {
        padding: 1rem;
        border-radius: 0.9rem;
    }

    .profile-ocr-hero h3 {
        font-size: 1.72rem;
    }

    .profile-ocr-hero p {
        font-size: 0.9rem;
    }

    .profile-stat-card {
        min-height: auto;
        padding: 0.78rem 0.86rem;
    }

    .profile-page-premium .modal-dialog,
    .profile-page-premium .modal-dialog-wide,
    .profile-page-premium .profile-detail-modal {
        border-radius: 1rem;
        padding: 0.82rem;
    }

    .profile-page-premium .modal-header {
        align-items: stretch;
    }
}

/* OCR create modal and account admin polish. */
body.app-body:not(.profile-shell) .account-admin-tabs-panel {
    padding: 0.55rem;
}

body.app-body:not(.profile-shell) .account-subnav-admin {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
}

body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link {
    min-height: 92px;
    justify-content: flex-start;
    gap: 0.28rem;
    padding: 0.82rem 0.9rem;
    border-color: #dbe6ef;
    background: #f6f9fc;
    color: #0f1f33;
}

body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link strong {
    color: #073760;
    font-size: 0.92rem;
    line-height: 1.2;
}

body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link small {
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.35;
}

body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link:hover,
body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link.is-active {
    border-color: #073760;
    background: #073760;
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(7, 55, 96, 0.16);
}

body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link:hover strong,
body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link:hover small,
body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link.is-active strong,
body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link.is-active small {
    color: #ffffff;
}

body.app-body:not(.profile-shell) .account-inline-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid #dbe6ef;
    border-radius: 1rem;
    background: #f6f9fc;
}

body.app-body:not(.profile-shell) .account-inline-form input {
    min-height: 42px;
    border-color: transparent;
    border-radius: 0.78rem;
    box-shadow: inset 0 0 0 1px rgba(219, 230, 239, 0.85);
}

body.app-body:not(.profile-shell) .organization-position-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.62rem;
}

body.app-body:not(.profile-shell) .organization-position-grid .stat-block {
    min-height: 92px;
    padding: 0.78rem 0.88rem;
}

body.app-body:not(.profile-shell) .device-user-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.72fr) minmax(300px, 0.95fr);
    gap: 0.72rem;
    align-items: stretch;
}

body.app-body:not(.profile-shell) .device-user-card .info-card {
    padding: 0.72rem 0.82rem;
}

body.app-body:not(.profile-shell) .device-user-card .mapping-actions {
    min-width: 0;
    margin-left: 0;
}

body.app-body:not(.profile-shell) .device-user-card .mapping-actions .search-row-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.48rem;
}

body.app-body:not(.profile-shell) .account-section-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.58fr);
    gap: 0.9rem;
    align-items: stretch;
    padding: 1rem;
    border: 1px solid #dbe6ef;
    border-radius: 1.15rem;
    background: linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
}

body.app-body:not(.profile-shell) .account-section-hero h3 {
    margin: 0.12rem 0 0.3rem;
    color: #0f1f33;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.08;
}

body.app-body:not(.profile-shell) .account-section-hero p:not(.eyebrow) {
    max-width: 760px;
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
}

body.app-body:not(.profile-shell) .account-section-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.58rem;
}

body.app-body:not(.profile-shell) .account-section-kpis span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.78rem;
    border: 1px solid #dbe6ef;
    border-radius: 0.95rem;
    background: #ffffff;
}

body.app-body:not(.profile-shell) .account-section-kpis strong {
    overflow: hidden;
    color: #073760;
    font-size: 1.08rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body:not(.profile-shell) .account-section-kpis small {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 750;
}

body.app-body:not(.profile-shell) .account-create-inline-card,
body.app-body:not(.profile-shell) .position-filter-panel,
body.app-body:not(.profile-shell) .alias-filter-bar {
    display: grid;
    gap: 0.62rem;
    align-items: end;
    padding: 0.76rem;
    border: 1px solid #dbe6ef;
    border-radius: 1rem;
    background: #f6f9fc;
}

body.app-body:not(.profile-shell) .account-create-inline-card {
    grid-template-columns: minmax(220px, 0.7fr) minmax(240px, 1fr) auto;
}

body.app-body:not(.profile-shell) .account-create-inline-card div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.14rem;
}

body.app-body:not(.profile-shell) .account-create-inline-card strong {
    color: #0f1f33;
    font-size: 0.95rem;
}

body.app-body:not(.profile-shell) .account-create-inline-card span {
    color: #64748b;
    font-size: 0.78rem;
}

body.app-body:not(.profile-shell) .account-create-inline-card input,
body.app-body:not(.profile-shell) .account-row-edit-form input,
body.app-body:not(.profile-shell) .position-filter-panel input,
body.app-body:not(.profile-shell) .position-filter-panel select,
body.app-body:not(.profile-shell) .alias-filter-bar input,
body.app-body:not(.profile-shell) .alias-filter-bar select,
body.app-body:not(.profile-shell) .alias-map-form input {
    min-height: 42px;
    border-radius: 0.78rem;
    font-size: 0.86rem;
}

body.app-body:not(.profile-shell) .account-table-shell {
    border: 1px solid #dbe6ef;
    border-radius: 1rem;
}

body.app-body:not(.profile-shell) .account-row-edit-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 0.48rem;
    align-items: center;
}

body.app-body:not(.profile-shell) .account-department-table td,
body.app-body:not(.profile-shell) .account-position-table td {
    vertical-align: middle;
}

body.app-body:not(.profile-shell) .position-filter-panel {
    grid-template-columns: minmax(320px, 1fr) minmax(180px, 0.38fr) minmax(220px, 0.46fr);
}

body.app-body:not(.profile-shell) .position-filter-panel .field,
body.app-body:not(.profile-shell) .alias-filter-bar .field {
    gap: 0.28rem;
}

body.app-body:not(.profile-shell) .position-filter-panel .field span,
body.app-body:not(.profile-shell) .alias-filter-bar .field span {
    color: #4c6179;
    font-size: 0.76rem;
    font-weight: 800;
}

body.app-body:not(.profile-shell) .position-summary-grid .position-summary-card {
    background: #ffffff;
}

body.app-body:not(.profile-shell) .position-summary-card strong {
    color: #073760;
}

body.app-body:not(.profile-shell) .alias-filter-bar {
    grid-template-columns: minmax(320px, 1fr) minmax(180px, 0.32fr) auto;
}

body.app-body:not(.profile-shell) .alias-review-list {
    display: grid;
    gap: 0.58rem;
}

body.app-body:not(.profile-shell) .alias-review-row {
    display: grid;
    grid-template-columns: minmax(210px, 0.68fr) minmax(320px, 1fr) minmax(260px, 0.85fr) minmax(280px, 0.86fr);
    gap: 0.62rem;
    align-items: stretch;
    padding: 0.72rem;
    border: 1px solid #dbe6ef;
    border-radius: 1rem;
    background: #ffffff;
}

body.app-body:not(.profile-shell) .alias-main,
body.app-body:not(.profile-shell) .alias-suggestion,
body.app-body:not(.profile-shell) .alias-actions {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 0.34rem;
}

body.app-body:not(.profile-shell) .alias-main strong,
body.app-body:not(.profile-shell) .alias-suggestion strong {
    overflow: hidden;
    color: #0f1f33;
    font-size: 0.92rem;
    line-height: 1.24;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body:not(.profile-shell) .alias-main p,
body.app-body:not(.profile-shell) .alias-suggestion span {
    overflow: hidden;
    margin: 0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.35;
    text-overflow: ellipsis;
}

body.app-body:not(.profile-shell) .alias-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

body.app-body:not(.profile-shell) .alias-metrics span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 0.16rem;
    padding: 0.56rem;
    border: 1px solid #dbe6ef;
    border-radius: 0.78rem;
    background: #f6f9fc;
}

body.app-body:not(.profile-shell) .alias-metrics small {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 750;
}

body.app-body:not(.profile-shell) .alias-metrics strong {
    overflow: hidden;
    color: #073760;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-body:not(.profile-shell) .alias-map-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto;
    gap: 0.45rem;
}

@media (max-width: 1280px) {
    body.app-body:not(.profile-shell) .account-section-hero,
    body.app-body:not(.profile-shell) .alias-review-row {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .alias-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    body.app-body:not(.profile-shell) .account-create-inline-card,
    body.app-body:not(.profile-shell) .position-filter-panel,
    body.app-body:not(.profile-shell) .alias-filter-bar {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .account-section-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body.app-body:not(.profile-shell) .account-section-hero {
        padding: 0.76rem;
        border-radius: 0.95rem;
    }

    body.app-body:not(.profile-shell) .account-section-kpis,
    body.app-body:not(.profile-shell) .alias-metrics,
    body.app-body:not(.profile-shell) .account-row-edit-form,
    body.app-body:not(.profile-shell) .alias-map-form {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .account-create-inline-card .button,
    body.app-body:not(.profile-shell) .alias-filter-bar .button,
    body.app-body:not(.profile-shell) .alias-actions .button {
        width: 100%;
    }

    body.app-body:not(.profile-shell) .alias-main strong,
    body.app-body:not(.profile-shell) .alias-suggestion strong {
        white-space: normal;
    }
}

body.profile-shell .brand-title-line {
    white-space: normal;
}

body.profile-shell #profile-create-modal .modal-dialog-wide {
    width: min(1120px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

body.profile-shell #profile-create-modal .modal-header {
    flex: 0 0 auto;
    padding: 1rem 1.1rem 0.86rem;
    margin: 0;
}

.profile-create-flow {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    flex-direction: column;
    gap: 0.78rem;
    padding: 0.95rem 1.1rem 1rem;
}

.profile-create-section {
    display: grid;
    grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
    padding: 0.88rem;
    border: 1px solid var(--profile-line);
    border-radius: 1rem;
    background: var(--profile-surface);
}

.profile-create-section-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.58rem;
    align-items: start;
}

.profile-create-section-head > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--profile-navy);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 850;
}

.profile-create-section-head strong {
    display: block;
    color: var(--profile-ink);
    font-size: 0.96rem;
    line-height: 1.22;
}

.profile-create-section-head small {
    display: block;
    margin-top: 0.15rem;
    color: var(--profile-muted);
    font-size: 0.78rem;
    line-height: 1.36;
}

.profile-create-user-section .profile-user-picker-field {
    min-width: 0;
}

.profile-create-user-section .profile-user-picker-search {
    min-height: 46px;
    padding: 0.62rem 0.78rem;
    border-radius: 0.78rem;
    font-size: 0.9rem;
}

.profile-create-user-section .profile-user-picker-list {
    max-height: min(270px, 42vh);
    border-color: var(--profile-line);
    box-shadow: 0 20px 45px rgba(5, 22, 38, 0.16);
}

.profile-create-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
    grid-column: 2;
}

.profile-create-meta-grid .field {
    gap: 0.3rem;
}

.profile-create-meta-grid input {
    min-height: 42px;
    padding: 0.56rem 0.72rem;
    border-radius: 0.72rem;
    font-size: 0.88rem;
}

.profile-create-doc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.62rem;
}

.profile-create-doc-card {
    display: flex;
    min-width: 0;
    min-height: 172px;
    flex-direction: column;
    gap: 0.34rem;
    padding: 0.8rem;
    border: 1px solid var(--profile-line);
    border-radius: 0.92rem;
    background: #ffffff;
}

.profile-create-doc-card strong {
    color: var(--profile-ink);
    font-size: 0.92rem;
    line-height: 1.28;
}

.profile-create-doc-card small {
    min-height: 2.6em;
    color: var(--profile-muted);
    font-size: 0.76rem;
    line-height: 1.32;
}

.profile-create-doc-index {
    display: inline-flex;
    width: fit-content;
    padding: 0.24rem 0.52rem;
    border-radius: 999px;
    background: #eef6fc;
    color: var(--profile-navy);
    font-size: 0.7rem;
    font-weight: 850;
}

.profile-create-doc-card input[type="file"] {
    margin-top: auto;
    width: 100%;
    min-height: 40px;
    padding: 0.35rem;
    border: 1px dashed var(--profile-line-strong);
    border-radius: 0.7rem;
    background: #f8fbfd;
    color: var(--profile-muted);
    font-size: 0.78rem;
}

.profile-create-doc-card input[type="file"]::file-selector-button {
    margin-right: 0.55rem;
    border: 0;
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
    background: var(--profile-navy);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
}

.profile-create-actions {
    position: sticky;
    bottom: -1rem;
    display: flex;
    justify-content: flex-end;
    margin-inline: -1.1rem;
    margin-bottom: -1rem;
    padding: 0.82rem 1.1rem 1rem;
    border-top: 1px solid var(--profile-line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
}

.profile-create-actions .button {
    min-width: 180px;
}

@media (max-width: 1280px) {
    body.app-body:not(.profile-shell) .account-subnav-admin {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.app-body:not(.profile-shell) .device-user-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .profile-create-section,
    .profile-create-meta-grid,
    .profile-create-doc-grid {
        grid-template-columns: 1fr;
    }

    .profile-create-meta-grid {
        grid-column: auto;
    }

    body.app-body:not(.profile-shell) .account-subnav-admin,
    body.app-body:not(.profile-shell) .organization-position-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body.profile-shell .app-shell {
        max-width: 100%;
        padding: 0.55rem;
        gap: 0.62rem;
    }

    body.profile-shell .sidebar {
        border-radius: 1rem;
        padding: 0.62rem;
        gap: 0.48rem;
    }

    body.profile-shell .brand-card {
        padding: 0.68rem 0.76rem;
        border-radius: 0.9rem;
    }

    body.profile-shell .brand-card .eyebrow {
        font-size: 0.58rem;
    }

    body.profile-shell .brand-title-line {
        font-size: 1.04rem;
    }

    body.profile-shell .nav-links {
        gap: 0.32rem;
    }

    body.profile-shell .nav-links a {
        min-height: 36px;
        padding: 0.4rem 0.48rem;
        border-radius: 0.72rem;
        font-size: 0.78rem;
    }

    body.profile-shell .sidebar-user {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0.58rem;
        gap: 0.5rem;
        align-items: center;
    }

    body.profile-shell .sidebar-user .user-email,
    body.profile-shell .sidebar-user .badge {
        display: none;
    }

    body.profile-shell .sidebar-user .logout-form {
        margin: 0;
    }

    body.profile-shell .sidebar-user .button-full {
        width: auto;
        min-width: 104px;
        min-height: 36px;
        padding-inline: 1rem;
    }

    body.profile-shell #profile-create-modal .modal-dialog-wide {
        width: calc(100vw - 1rem);
        max-height: calc(100dvh - 1.35rem);
        border-radius: 0.95rem;
    }

    body.profile-shell #profile-create-modal .modal-header {
        padding: 0.82rem 0.86rem 0.72rem;
    }

    .profile-create-flow {
        padding: 0.78rem 0.86rem 0.9rem;
    }

    .profile-create-section {
        padding: 0.72rem;
    }

    .profile-create-doc-card {
        min-height: auto;
    }

    .profile-create-doc-card small {
        min-height: 0;
    }

    .profile-create-actions {
        align-items: stretch;
        bottom: 0;
        margin-inline: -0.86rem;
        margin-bottom: 0;
        padding: 0.72rem 0.86rem 0.78rem;
    }

    .profile-create-actions .button,
    body.app-body:not(.profile-shell) .account-inline-form .button {
        width: 100%;
    }

    body.app-body:not(.profile-shell) .account-subnav-admin,
    body.app-body:not(.profile-shell) .organization-position-grid,
    body.app-body:not(.profile-shell) .account-inline-form {
        grid-template-columns: 1fr;
    }

    body.app-body:not(.profile-shell) .account-subnav-admin {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.12rem;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    body.app-body:not(.profile-shell) .account-subnav-admin .account-subnav-link {
        flex: 0 0 min(220px, 78vw);
        min-height: 78px;
        padding: 0.68rem 0.74rem;
        scroll-snap-align: start;
    }
}

/* Attendance premium baseline, aligned with the approved Profile OCR direction. */
.attendance-page-premium {
    --attendance-navy: #073760;
    --attendance-navy-strong: #052946;
    --attendance-ink: #0f1f33;
    --attendance-muted: #64748b;
    --attendance-panel: #ffffff;
    --attendance-surface: #f6f9fc;
    --attendance-line: #dbe6ef;
    --attendance-line-strong: #c5d4e2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--attendance-ink);
}

body.attendance-shell {
    --attendance-navy: #073760;
    --attendance-navy-strong: #052946;
    --attendance-ink: #0f1f33;
    --attendance-muted: #64748b;
    --attendance-panel: #ffffff;
    --attendance-surface: #f6f9fc;
    --attendance-line: #dbe6ef;
    --attendance-line-strong: #c5d4e2;
    background:
        linear-gradient(180deg, rgba(7, 55, 96, 0.08), rgba(246, 249, 252, 0.96) 34%),
        #f5f8fb;
}

body.attendance-shell .app-shell {
    max-width: 1480px;
    grid-template-columns: clamp(236px, 16vw, 272px) minmax(0, 1fr);
    gap: 1rem;
}

body.attendance-shell .sidebar {
    background: linear-gradient(180deg, var(--attendance-navy), var(--attendance-navy-strong));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.55rem;
    box-shadow: 0 24px 70px rgba(5, 41, 70, 0.28);
}

body.attendance-shell .brand-card,
body.attendance-shell .sidebar-user {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.18rem;
}

body.attendance-shell .nav-links a {
    color: rgba(255, 255, 255, 0.76);
}

body.attendance-shell .nav-links a.active,
body.attendance-shell .nav-links a:hover {
    background: #ffffff;
    color: var(--attendance-navy);
}

body.attendance-shell .brand-title-line {
    letter-spacing: 0;
}

body.attendance-shell .topbar {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 230, 239, 0.86);
    box-shadow: 0 18px 40px rgba(15, 31, 51, 0.06);
}

.attendance-page-premium .panel {
    border: 1px solid var(--attendance-line);
    border-radius: 1.28rem;
    background: var(--attendance-panel);
    box-shadow: 0 22px 58px rgba(15, 31, 51, 0.08);
}

.attendance-page-premium .attendance-primary-panel {
    gap: 0.9rem;
    padding: clamp(1rem, 1.6vw, 1.55rem);
}

.attendance-page-premium .attendance-report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    margin: 0;
    padding: clamp(1rem, 1.5vw, 1.35rem);
    border-radius: 1.1rem;
    background: var(--attendance-navy);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(7, 55, 96, 0.18);
}

.attendance-page-premium .attendance-report-hero .eyebrow {
    margin: 0 0 0.45rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.attendance-page-premium .attendance-report-hero h3 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.85rem, 1.2rem + 1.5vw, 2.7rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.attendance-page-premium .attendance-report-hero p {
    max-width: 720px;
    margin: 0.55rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.98rem;
    line-height: 1.6;
}

.attendance-page-premium .attendance-summary-inline {
    max-width: 520px;
    justify-content: flex-end;
    gap: 0.46rem;
}

.attendance-page-premium .summary-chip,
.attendance-page-premium .attendance-report-hero .badge-dark {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-radius: 999px;
}

.attendance-page-premium .summary-chip strong {
    color: #ffffff;
    font-size: 0.88rem;
}

.attendance-page-premium .summary-chip small {
    color: rgba(255, 255, 255, 0.72);
}

.attendance-page-premium .attendance-filter-toolbar {
    padding: 0.35rem;
    border: 1px solid var(--attendance-line);
    border-radius: 1rem;
    background: var(--attendance-surface);
}

.attendance-page-premium .attendance-filter-grid-inline {
    grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(142px, 0.62fr)) auto;
    gap: 0.65rem;
}

.attendance-page-premium .field span,
.attendance-page-premium .hint-pill {
    color: var(--attendance-muted);
}

.attendance-page-premium .field input,
.attendance-page-premium .field textarea,
.attendance-page-premium .field select {
    border-color: var(--attendance-line);
    border-radius: 0.86rem;
    background: #ffffff;
}

.attendance-page-premium .attendance-filter-grid-inline .field input,
.attendance-page-premium .attendance-filter-grid-inline .field select {
    min-height: 48px;
}

.attendance-page-premium .attendance-filter-actions-inline {
    gap: 0.45rem;
}

.attendance-page-premium .button {
    min-height: 42px;
    border-radius: 999px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.attendance-page-premium .button:not(:disabled):hover {
    transform: translateY(-1px);
}

.attendance-page-premium .button:focus-visible,
.attendance-page-premium input:focus-visible,
.attendance-page-premium textarea:focus-visible,
.attendance-page-premium select:focus-visible {
    outline: 3px solid rgba(7, 55, 96, 0.22);
    outline-offset: 2px;
}

.attendance-page-premium .button-dark,
.attendance-page-premium .button-accent {
    background: var(--attendance-navy);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(7, 55, 96, 0.18);
}

.attendance-page-premium .button-dark:not(:disabled):hover,
.attendance-page-premium .button-accent:not(:disabled):hover {
    background: var(--attendance-navy-strong);
    box-shadow: 0 16px 34px rgba(7, 55, 96, 0.24);
}

.attendance-page-premium .button-light {
    background: #ffffff;
    color: var(--attendance-navy);
    border-color: var(--attendance-line);
}

.attendance-page-premium .button-light:not(:disabled):hover {
    border-color: var(--attendance-line-strong);
    box-shadow: 0 10px 22px rgba(15, 31, 51, 0.08);
}

.attendance-page-premium .hint-pill.compact {
    display: inline-flex;
    width: fit-content;
    margin-top: 0.5rem;
    border-color: var(--attendance-line);
    background: #ffffff;
}

.attendance-page-premium .table-wrap {
    border-color: var(--attendance-line);
    border-radius: 1rem;
    box-shadow: none;
}

.attendance-page-premium .report-table th,
.attendance-page-premium .report-table td {
    padding: 0.78rem 0.82rem;
    border-bottom-color: var(--attendance-line);
}

.attendance-page-premium .report-table th {
    background: #f1f6fa;
    color: var(--attendance-navy);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.attendance-page-premium .report-table tbody tr:hover {
    background: #f8fbfd;
}

.attendance-page-premium .table-identity-name,
.attendance-page-premium .table-identity-cell strong,
.attendance-page-premium .attendance-date-cell {
    color: var(--attendance-ink);
}

.attendance-page-premium .table-inline-meta,
.attendance-page-premium .table-identity-meta,
.attendance-page-premium .attendance-email-full,
.attendance-page-premium .attendance-time-label {
    color: var(--attendance-muted);
}

.attendance-page-premium .time-range-pill {
    background: #e8f6f2;
    color: #237e72;
    border: 1px solid #cceee7;
}

.attendance-page-premium .badge-dark {
    background: var(--attendance-navy);
    color: #ffffff;
}

.attendance-page-premium .badge-info {
    background: #e8f6f2;
    color: #237e72;
}

.attendance-page-premium .badge-muted {
    background: #f1f6fa;
    color: var(--attendance-muted);
}

.attendance-page-premium .pagination-link {
    border-color: var(--attendance-line);
    color: var(--attendance-navy);
    background: #ffffff;
}

.attendance-page-premium .pagination-link.is-active,
.attendance-page-premium .pagination-link:hover {
    background: var(--attendance-navy);
    color: #ffffff;
}

.attendance-page-premium .empty-card,
.attendance-page-premium .alert {
    border-radius: 1rem;
}

@media (max-width: 1280px) {
    .attendance-page-premium .attendance-report-hero {
        grid-template-columns: 1fr;
    }

    .attendance-page-premium .attendance-summary-inline {
        justify-content: flex-start;
    }
}

@media (max-width: 1100px) {
    body.attendance-shell .app-shell {
        grid-template-columns: 1fr;
        max-width: 920px;
    }

    body.attendance-shell .sidebar {
        order: 0;
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: minmax(210px, 0.74fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 0.75rem;
    }

    body.attendance-shell .brand-card {
        min-height: 100%;
    }

    body.attendance-shell .brand-card h1,
    body.attendance-shell .brand-title {
        margin-bottom: 0;
    }

    body.attendance-shell .brand-card > p:not(.eyebrow) {
        display: none;
    }

    body.attendance-shell .nav-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        align-self: start;
    }

    body.attendance-shell .nav-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.55rem 0.65rem;
        text-align: center;
        font-size: 0.88rem;
        line-height: 1.25;
    }

    body.attendance-shell .sidebar-user {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: center;
        margin-top: 0;
    }

    body.attendance-shell .sidebar-user .badge {
        justify-self: start;
        width: fit-content;
    }

    body.attendance-shell .sidebar-user .button-full {
        width: auto;
        min-width: 150px;
    }

    .attendance-page-premium .attendance-filter-grid-inline {
        grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(160px, 0.72fr));
    }

    .attendance-page-premium .attendance-filter-actions-inline {
        grid-column: 1 / -1;
        justify-self: start;
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    .attendance-page-premium .attendance-filter-grid-inline {
        grid-template-columns: 1fr;
    }

    .attendance-page-premium .attendance-filter-actions-inline,
    .attendance-page-premium .attendance-filter-actions-inline .button {
        width: 100%;
    }

    .attendance-page-premium .attendance-summary-inline {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .attendance-page-premium .summary-chip,
    .attendance-page-premium .attendance-report-hero .badge-dark {
        justify-content: center;
    }

    .attendance-page-premium .attendance-summary-table tr {
        border-color: var(--attendance-line);
        border-radius: 1rem;
        background: #ffffff;
    }

    .attendance-page-premium .attendance-summary-table td {
        border-bottom-color: var(--attendance-line);
        grid-template-columns: minmax(118px, 32%) minmax(0, 1fr);
    }

    .attendance-page-premium .attendance-summary-table td::before {
        color: var(--attendance-muted);
    }
}

@media (max-width: 720px) {
    body.attendance-shell .app-shell {
        padding: 0.65rem;
    }

    body.attendance-shell .sidebar {
        grid-template-columns: 1fr;
        border-radius: 1.2rem;
        gap: 0.55rem;
        padding: 0.72rem;
    }

    body.attendance-shell .brand-card {
        padding: 0.72rem 0.82rem;
    }

    body.attendance-shell .brand-card .eyebrow {
        font-size: 0.62rem;
        margin: 0 0 0.18rem;
    }

    body.attendance-shell .brand-card h1,
    body.attendance-shell .brand-title {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.12rem 0.36rem;
    }

    body.attendance-shell .brand-title-line {
        font-size: 1.12rem;
        line-height: 1.02;
    }

    body.attendance-shell .nav-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    body.attendance-shell .nav-links a {
        min-height: 38px;
        padding: 0.42rem 0.52rem;
        font-size: 0.82rem;
    }

    body.attendance-shell .sidebar-user {
        grid-template-columns: 1fr;
        gap: 0.38rem;
        padding: 0.72rem;
    }

    body.attendance-shell .sidebar-user .user-name {
        font-size: 0.98rem;
    }

    body.attendance-shell .sidebar-user .user-email {
        margin: 0;
        font-size: 0.8rem;
    }

    body.attendance-shell .sidebar-user .button-full {
        width: 100%;
        min-height: 38px;
    }

    .attendance-page-premium .attendance-primary-panel {
        border-radius: 1rem;
        padding: 0.82rem;
    }

    .attendance-page-premium .attendance-report-hero {
        padding: 1rem;
        border-radius: 0.9rem;
    }

    .attendance-page-premium .attendance-report-hero h3 {
        font-size: 1.72rem;
    }

    .attendance-page-premium .attendance-report-hero p {
        font-size: 0.9rem;
    }

    .attendance-page-premium .attendance-summary-inline {
        grid-template-columns: 1fr;
    }

    .attendance-page-premium .attendance-summary-table td {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .attendance-page-premium .attendance-summary-table td::before {
        margin-bottom: 0.05rem;
    }

    .attendance-page-premium .attendance-email-full {
        overflow-wrap: anywhere;
        word-break: normal;
    }
}
