@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Light.ttf") format("truetype");
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-LightItalic.ttf") format("truetype");
    font-style: italic;
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Semibold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-BoldItalic.ttf") format("truetype");
    font-style: italic;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Gilroy";
    src: url("../fonts/Gilroy-Black.ttf") format("truetype");
    font-style: normal;
    font-weight: 900;
    font-display: swap;
}

:root {
    --bg: #eef2f7;
    --panel: #ffffff;
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #e1e6ee;
    --accent: #4b5563;
    --green: #1f9d62;
    --red: #c93c37;
    --sidebar: #f8fafc;
    --soft-shadow: 0 18px 45px rgba(31, 41, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Gilroy", "Segoe UI", Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

.auth-body {
    display: grid;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.16), transparent 32%),
        radial-gradient(circle at 80% 15%, rgba(51, 65, 85, 0.12), transparent 28%),
        linear-gradient(135deg, #f8fafc 0%, #e8eef6 100%);
}

.auth-shell {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    min-height: 100vh;
    padding: 28px;
}

.auth-card {
    width: min(440px, 100%);
    padding: 34px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(14px);
}

.auth-logo {
    display: block;
    max-width: 230px;
    height: auto;
    margin: 0 auto 28px;
}

.auth-card .eyebrow {
    text-align: center;
    margin-bottom: 20px;
}

.auth-card h1 {
    margin-bottom: 20px;
    font-size: 30px;
}

.portal-login-card {
    text-align: center;
}

.portal-login-card h1 {
    margin-bottom: 24px;
    text-align: center;
}

.portal-login-card .auth-form {
    text-align: left;
}

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

.auth-form .g-recaptcha {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 78px;
}

.auth-form .g-recaptcha > div {
    margin-inline: auto;
}

.auth-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.auth-form .btn {
    margin-top: 4px;
    padding: 11px 16px;
}

.auth-link {
    display: inline-block;
    margin-top: 18px;
    color: #475569;
    text-decoration: none;
}

.auth-link-secondary {
    display: block;
    margin-top: 10px;
}

.auth-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.auth-link:hover {
    color: #0f172a;
    text-decoration: underline;
}

@media (max-width: 380px) {
    .auth-form .g-recaptcha {
        transform: scale(0.92);
        transform-origin: center top;
        margin-bottom: -6px;
    }
}

.install-app-button {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 10px 14px;
    color: #1f2933;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
}

.install-app-button:hover {
    background: #eef2f7;
}

.install-app-button[hidden] {
    display: none;
}

.install-help {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.install-help[hidden] {
    display: none;
}

.auth-footer {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.auth-footer a {
    color: var(--muted);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.denied-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 25% 18%, rgba(14, 165, 233, 0.18), transparent 28%),
        radial-gradient(circle at 78% 8%, rgba(148, 163, 184, 0.28), transparent 30%),
        linear-gradient(135deg, #f8fafc 0%, #e7edf4 100%);
}

.denied-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 28px;
}

.denied-modal {
    position: relative;
    width: min(420px, 100%);
    padding: 34px 34px 28px;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 22px;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.18);
    animation: denied-pop 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
    overflow: hidden;
}

.denied-modal::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #475569, #0ea5e9, #94a3b8);
}

.denied-logo {
    display: block;
    width: min(250px, 82%);
    height: auto;
    margin: 0 auto 22px;
}

.denied-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #f1f5f9;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.denied-icon span {
    position: relative;
    display: block;
    width: 28px;
    height: 20px;
    border-radius: 6px;
    background: #475569;
}

.denied-icon span::before {
    content: "";
    position: absolute;
    left: 5px;
    top: -15px;
    width: 18px;
    height: 20px;
    border: 4px solid #475569;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
}

.denied-modal h1 {
    margin: 4px 0 12px;
    color: #18283a;
    font-size: 30px;
    font-weight: 800;
}

.denied-modal p:not(.eyebrow) {
    max-width: 310px;
    margin: 0 auto 22px;
    color: #667085;
    line-height: 1.55;
}

.denied-action {
    width: 100%;
    padding: 12px 18px;
}

.denied-modal .auth-footer {
    margin-top: 22px;
}

@keyframes denied-pop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.portal-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(14, 165, 233, 0.15), transparent 30%),
        linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.portal-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.portal-topbar img {
    width: 170px;
    max-width: 58vw;
    height: auto;
}

.portal-topbar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.portal-topbar nav .btn {
    white-space: nowrap;
}

.portal-hero {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.portal-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    overflow: hidden;
    color: #475569;
    background: #eef2f7;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 900;
}

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

.portal-sheet {
    margin-top: 18px;
}

.portal-hero h1 {
    margin-bottom: 6px;
    font-size: 24px;
}

.portal-hero .eyebrow {
    margin-bottom: 4px;
}

.portal-hero .timecard-meta {
    margin-top: 8px;
}

.portal-hero .timecard-meta span {
    padding: 5px 8px;
    font-size: 13px;
}

.portal-sheet {
    padding: 22px;
}

.portal-sheet .timecard-header img {
    width: 180px;
}

.portal-sheet .timecard-punch {
    padding: 9px 12px;
}

.virtual-clock-shell {
    max-width: 780px;
}

.virtual-clock-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
        #ffffff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
}

.virtual-clock-person {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.virtual-clock-person h1 {
    margin: 0;
    font-size: 24px;
}

.virtual-clock-time {
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 34px 18px;
    color: #16324c;
    background:
        radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.12), transparent 42%),
        linear-gradient(135deg, #f8fafc, #eaf2f8);
    border: 1px solid #dbe4ee;
    border-radius: 20px;
}

.virtual-clock-time span {
    color: #667085;
    font-size: 15px;
    font-weight: 700;
}

.virtual-clock-time strong {
    font-size: clamp(52px, 15vw, 92px);
    line-height: 1;
    letter-spacing: 0;
}

.virtual-clock-time small {
    color: #4b5563;
    font-size: 15px;
}

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

.virtual-info-card {
    min-height: 112px;
    padding: 16px;
    color: #1f2937;
    background: #f8fafc;
    border: 1px solid #e3e9f0;
    border-radius: 16px;
}

.virtual-info-card span,
.virtual-info-card small {
    display: block;
}

.virtual-info-card span {
    margin-bottom: 8px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.virtual-info-card strong {
    display: block;
    margin-bottom: 4px;
    color: #16324c;
    font-size: 20px;
    line-height: 1.2;
}

.virtual-info-card small {
    color: #667085;
    line-height: 1.4;
}

.virtual-geo-card.is-ok {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.virtual-geo-card.is-ok strong {
    color: #047857;
}

.virtual-geo-card.is-warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.virtual-geo-card.is-warning strong {
    color: #b45309;
}

.virtual-geo-card.is-loading {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.virtual-geo-card.is-loading strong {
    color: #1d4ed8;
}

.virtual-geo-coords {
    margin-top: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.virtual-location-button {
    appearance: none;
    margin-top: 12px;
    padding: 10px 13px;
    color: #16324c;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.virtual-location-button:hover:not(:disabled) {
    border-color: #94a3b8;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
    transform: translateY(-1px);
}

.virtual-location-button:disabled {
    opacity: 0.72;
}

.virtual-map-panel {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    background: #e5e7eb;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
}

.virtual-map-panel iframe {
    display: block;
    width: 100%;
    height: 240px;
    border: 0;
}

.virtual-map-panel a {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 8px 12px;
    color: #16324c;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.virtual-last-punch {
    padding: 12px 14px;
    color: #4b5563;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
}

.virtual-clock-card .virtual-punch-button,
.virtual-punch-button {
    appearance: none;
    display: inline-grid;
    place-items: center;
    width: 100%;
    min-height: 76px;
    color: #ffffff !important;
    background: linear-gradient(135deg, #16324c, #0f253a) !important;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: 0 14px 28px rgba(22, 50, 76, 0.22);
    font-size: 25px;
    font-weight: 800;
    text-align: center;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.virtual-clock-card .virtual-punch-button:hover:not(:disabled),
.virtual-punch-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #10263a, #071827) !important;
    box-shadow: 0 18px 34px rgba(22, 50, 76, 0.28);
    transform: translateY(-2px);
}

.virtual-clock-card .virtual-punch-button:disabled,
.virtual-punch-button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.virtual-clock-note {
    margin: 12px 0 0;
    color: #667085;
    text-align: center;
}

.portal-report-employee table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.portal-report-employee th,
.portal-report-employee td {
    padding: 8px 9px;
    border: 1px solid #cbd5e1;
    font-size: 12px;
}

.portal-report-employee th {
    width: 130px;
    color: #475569;
    background: #f8fafc;
    font-size: 10px;
    text-align: left;
    text-transform: uppercase;
}

.portal-terms-shell {
    width: min(900px, calc(100% - 32px));
}

.portal-terms-card {
    padding: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.portal-terms-header {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.portal-terms-header h1 {
    margin: 0 0 10px;
    font-size: 30px;
}

.portal-terms-header p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
}

.portal-terms-person {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 18px 0;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.portal-terms-person strong {
    width: 100%;
    color: #1f2933;
    font-size: 18px;
}

.portal-terms-person span {
    color: var(--muted);
}

.portal-terms-content {
    display: grid;
    gap: 14px;
}

.portal-terms-content h2 {
    margin: 0 0 -6px;
    color: #1f2933;
    font-size: 17px;
}

.portal-terms-content p {
    margin: 0;
    color: #4b5563;
    line-height: 1.65;
}

.portal-terms-form {
    display: grid;
    gap: 18px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.portal-terms-form .btn {
    justify-self: start;
}

.portal-terms-accepted {
    margin-top: 22px;
    padding: 12px 14px;
    color: #047857;
    background: #dff8ed;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-weight: 700;
}

.portal-email-panel .panel-header {
    align-items: flex-start;
}

.portal-email-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
}

.portal-email-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.portal-email-toggle {
    margin: 0;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.portal-email-toggle span {
    color: #1f2933;
}

.portal-email-status .status-badge {
    margin-bottom: 0;
}

.portal-push-box {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.portal-push-box p {
    margin: 0;
    color: #4b5563;
}

.portal-push-box small {
    color: var(--muted);
}

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

.portal-push-actions .btn[hidden] {
    display: none;
}

.status-badge.online {
    color: #047857;
    background: #dff8ed;
    border: 1px solid #bbf7d0;
}

.status-badge.pending {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.status-badge.offline {
    color: #475569;
    background: #eef2f7;
    border: 1px solid #dbe3ef;
}

.sidebar {
    background: var(--sidebar);
    color: var(--ink);
    padding: 24px;
    border-right: 1px solid var(--line);
}

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

.brand-logo {
    display: block;
    width: 100%;
    max-width: 210px;
    height: auto;
    object-fit: contain;
}

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

.nav-menu a {
    color: #4b5563;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #e9eef5;
    color: #111827;
}

.btn-primary {
    --bs-btn-bg: #4b5563;
    --bs-btn-border-color: #4b5563;
    --bs-btn-hover-bg: #374151;
    --bs-btn-hover-border-color: #374151;
    --bs-btn-active-bg: #1f2937;
    --bs-btn-active-border-color: #1f2937;
}

.btn-outline-secondary {
    --bs-btn-color: #4b5563;
    --bs-btn-border-color: #9ca3af;
    --bs-btn-hover-bg: #4b5563;
    --bs-btn-hover-border-color: #4b5563;
}

.content {
    display: flex;
    flex-direction: column;
    padding: 28px;
}

.topbar,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar {
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    color: #16324c;
    font-family: "Gilroy", "Segoe UI", Arial, Helvetica, sans-serif;
    font-weight: 900;
    letter-spacing: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 20px;
}

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

.alert-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.alert-panel strong,
.alert-panel span {
    display: block;
}

.alert-panel span {
    margin-top: 2px;
    color: var(--muted);
}

.danger-zone-alert {
    margin-bottom: 18px;
    padding: 16px 18px;
    background: #fff1f1;
    border: 1px solid #f1a7a3;
    border-left: 6px solid #c93c37;
    border-radius: 10px;
    color: #7f1d1d;
    box-shadow: 0 12px 28px rgba(201, 60, 55, 0.08);
}

.danger-zone-alert strong,
.danger-zone-alert span {
    display: block;
}

.danger-zone-alert strong {
    font-size: 18px;
    font-weight: 900;
}

.danger-zone-alert span {
    margin-top: 4px;
    color: #991b1b;
}

.table-main-link {
    color: #16324c;
    font-weight: 800;
    text-decoration: none;
}

.table-main-link:hover {
    color: #0ea5e9;
    text-decoration: underline;
}

.muted-link {
    color: #475569;
    font-weight: 600;
}

.access-list-table {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.access-row {
    display: grid;
    grid-template-columns: 54px minmax(220px, 1fr) 110px 150px;
    gap: 14px;
    align-items: center;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.access-row:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 32px rgba(31, 41, 51, 0.08);
}

.access-row-avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 14px;
    background: #eef2f7;
    color: #475569;
    font-weight: 900;
}

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

.access-row-person strong,
.access-row-person span,
.access-row time strong,
.access-row time span {
    display: block;
}

.access-row-person strong {
    color: #18283a;
    font-size: 17px;
}

.access-row-person span,
.access-row time span {
    color: var(--muted);
    font-size: 13px;
}

.access-row time {
    text-align: right;
}

.access-row time strong {
    color: #18283a;
}

.access-row-status {
    justify-self: end;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.access-row.is-authorized .access-row-status {
    color: #047857;
    background: #dff8ed;
}

.access-row.is-denied .access-row-status {
    color: #b42318;
    background: #fde8e7;
}

.grouped-access-list {
    gap: 12px;
}

.access-person-group {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.access-person-group:hover,
.access-person-group[open] {
    border-color: #cbd5e1;
    box-shadow: 0 14px 32px rgba(31, 41, 51, 0.08);
}

.access-person-group summary {
    display: grid;
    grid-template-columns: 54px minmax(220px, 1fr) 92px 170px 170px;
    gap: 14px;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    list-style: none;
}

.access-person-group summary::-webkit-details-marker {
    display: none;
}

.access-person-group summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    font-weight: 900;
}

.access-person-group[open] summary::after {
    content: "-";
}

.access-group-count strong,
.access-group-count span {
    display: block;
}

.access-group-count strong {
    color: #18283a;
    font-size: 24px;
    line-height: 1;
}

.access-group-count span {
    color: var(--muted);
    font-size: 12px;
}

.access-person-punches {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px 80px;
}

.access-day-group {
    display: grid;
    gap: 7px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 10px;
}

.access-day-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #475569;
}

.access-day-title strong {
    color: #18283a;
}

.access-day-title span {
    color: var(--muted);
    font-size: 12px;
}

.access-row.compact {
    grid-template-columns: 130px 170px;
    justify-content: start;
    padding: 9px 12px;
    background: #f8fafc;
    box-shadow: none;
}

.access-row.compact:hover {
    transform: none;
    box-shadow: none;
}

.access-row-status.status-authorized {
    color: #047857;
    background: #dff8ed;
}

.access-row-status.status-denied {
    color: #b42318;
    background: #fde8e7;
}

.empty-state {
    padding: 22px;
    color: var(--muted);
    text-align: center;
}

.print-only {
    display: none;
}

.employee-lookup {
    position: relative;
}

.employee-suggestions {
    position: absolute;
    z-index: 20;
    inset: calc(100% + 6px) 0 auto 0;
    overflow: hidden;
    max-height: 330px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.employee-suggestions button,
.employee-suggestion-empty {
    display: block;
    width: 100%;
    padding: 11px 13px;
    text-align: left;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #eef2f7;
}

.employee-suggestions button:hover,
.employee-suggestions button:focus {
    background: #f8fafc;
}

.employee-suggestions strong,
.employee-suggestions span {
    display: block;
}

.employee-suggestions strong {
    color: #18283a;
    font-size: 14px;
}

.employee-suggestions span,
.employee-suggestion-empty {
    color: var(--muted);
    font-size: 12px;
}

.timecard-sheet {
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--soft-shadow);
}

.timecard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.timecard-header img {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
}

.timecard-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.timecard-period {
    min-width: 230px;
    padding: 14px 16px;
    text-align: right;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.timecard-period span,
.timecard-period strong {
    display: block;
}

.timecard-period span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.timecard-period strong {
    margin-top: 4px;
    color: #16324c;
    font-size: 18px;
}

.timecard-employee {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 22px 0;
}

.timecard-photo {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    overflow: hidden;
    border-radius: 18px;
    background: #eef2f7;
    color: #475569;
    font-size: 28px;
    font-weight: 900;
}

.timecard-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timecard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
    color: var(--muted);
}

.timecard-meta span {
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.timecard-meta strong {
    color: #1f2933;
}

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

.timecard-list {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.timecard-day {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.timecard-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.timecard-day-head strong,
.timecard-day-head span,
.timecard-day-head small {
    display: block;
}

.timecard-day-head span,
.timecard-day-head small {
    color: var(--muted);
}

.timecard-punches {
    display: grid;
}

.timecard-punch {
    display: grid;
    grid-template-columns: 110px minmax(160px, 1fr) minmax(150px, 1fr) 130px;
    gap: 12px;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid #eef2f7;
}

.timecard-punch-head {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.timecard-punch-head time,
.timecard-punch-head span,
.timecard-punch-head small,
.timecard-punch-head em {
    color: #64748b;
    font-size: 12px;
}

.timecard-report-summary table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 16px;
}

.timecard-report-summary th,
.timecard-report-summary td {
    padding: 8px;
    border: 1px solid #cbd5e1;
    text-align: center;
}

.timecard-report-summary th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
}

.timecard-punch:last-child {
    border-bottom: 0;
}

.timecard-punch time {
    color: #16324c;
    font-size: 18px;
    font-weight: 900;
}

.timecard-punch span,
.timecard-punch small {
    color: #475569;
}

.timecard-punch em {
    justify-self: end;
    padding: 6px 10px;
    border-radius: 999px;
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
}

.timecard-punch.is-authorized em {
    color: #047857;
    background: #dff8ed;
}

.timecard-punch.is-denied em {
    color: #b42318;
    background: #fde8e7;
}

.timecard-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 58px;
}

.timecard-signatures span {
    display: block;
    border-top: 1px solid #94a3b8;
}

.timecard-signatures strong {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.timecard-print-footer {
    margin: 28px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.metric,
.panel,
.quick-actions a {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric {
    padding: 18px;
}

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

.metric strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 34px;
    line-height: 1;
}

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

.dashboard-main {
    min-width: 0;
}

.dashboard-topbar {
    margin-bottom: 18px;
}

.dashboard-topbar h1 {
    font-size: 32px;
}

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

.dashboard-summary .metric {
    min-height: 158px;
    padding: 24px;
    border: 0;
    border-radius: 14px;
    box-shadow: var(--soft-shadow);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
    will-change: transform;
}

.dashboard-summary .metric:hover,
.dashboard-actions a:hover,
.recent-access-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 55px rgba(31, 41, 51, 0.14);
    filter: saturate(1.04);
}

.dashboard-summary .metric span {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.dashboard-summary .metric strong {
    margin-top: 22px;
    text-align: right;
    font-size: 38px;
}

.dashboard-summary .metric small {
    font-size: 14px;
}

.metric-blue {
    background: #e8f1ff;
}

.metric-green {
    background: #e8f8f2;
}

.metric-slate {
    background: #eef1f5;
}

.metric-cyan {
    background: #e7f8fb;
}

.metric-blue strong,
.metric-blue span {
    color: #2563eb;
}

.metric-green strong,
.metric-green span {
    color: #178458;
}

.metric-slate strong,
.metric-slate span {
    color: #334155;
}

.metric-cyan strong,
.metric-cyan span {
    color: #078aa4;
}

.dashboard-alert {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--soft-shadow);
}

.dashboard-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-actions a {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--soft-shadow);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.recent-access-card {
    position: sticky;
    top: 24px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--soft-shadow);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.recent-access-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 24px 24px 10px;
}

.recent-access-header h2 {
    font-size: 24px;
}

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #178458;
    font-size: 12px;
    font-weight: 700;
}

.live-dot::before {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    content: "";
}

.access-timeline {
    max-height: 620px;
    overflow-y: auto;
    padding: 12px 24px 24px;
}

.access-item {
    display: grid;
    grid-template-columns: 58px 22px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 78px;
}

.access-item time {
    text-align: right;
}

.access-item time strong,
.access-item time span {
    display: block;
}

.access-item time strong {
    color: #111827;
    font-size: 14px;
}

.access-item time span {
    color: var(--muted);
    font-size: 12px;
}

.access-line {
    position: relative;
    width: 2px;
    height: 100%;
    margin: 0 auto;
    background: #dbe4ee;
}

.access-line::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 3px solid #16b8c7;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    content: "";
}

.access-authorized .access-line::before {
    border-color: #16b8c7;
}

.access-denied .access-line::before {
    border-color: #dc2626;
    background: #fee2e2;
}

.access-denied .access-avatar {
    border-color: #fee2e2;
}

.access-person {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.access-avatar {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    overflow: hidden;
    background: #eef2f7;
    border: 3px solid #f1f5f9;
    border-radius: 50%;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
}

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

.access-person strong,
.access-person span,
.access-empty strong,
.access-empty span {
    display: block;
}

.access-person strong {
    overflow: hidden;
    color: #1f2937;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-person span {
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-status {
    display: inline-flex;
    width: fit-content;
    margin-top: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.access-authorized .access-status {
    color: #0f766e;
    background: #ccfbf1;
}

.access-denied .access-status {
    color: #991b1b;
    background: #fee2e2;
}

.access-empty {
    padding: 32px 12px;
    color: var(--muted);
    text-align: center;
}

.access-empty strong {
    color: var(--ink);
}

.metric.success strong {
    color: var(--green);
}

.metric.danger strong {
    color: var(--red);
}

.panel {
    overflow: hidden;
}

.panel-header {
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.table {
    margin: 0;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.table td,
.table th {
    padding: 14px 18px;
}

.table td strong,
.table td small {
    display: block;
}

.table td small {
    color: var(--muted);
}

.status {
    display: inline-flex;
    align-items: center;
    min-width: 78px;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.status.online {
    background: var(--green);
}

.status.offline {
    background: var(--red);
}

.actions {
    white-space: nowrap;
}

.empty-state {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.pending-list {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.pending-device {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(420px, 1.8fr);
    gap: 18px;
    align-items: end;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pending-device-info strong,
.pending-device-info span,
.pending-device-info small {
    display: block;
}

.pending-device-info span {
    margin-top: 6px;
}

.pending-device-info .device-serial {
    color: var(--ink);
    font-weight: 700;
}

.pending-device-info small {
    margin-top: 6px;
    color: var(--muted);
}

.pending-device-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.pending-device-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.quick-actions a {
    display: block;
    padding: 18px;
    color: var(--ink);
    text-decoration: none;
}

.quick-actions a:hover {
    border-color: var(--accent);
}

.quick-actions strong,
.quick-actions span {
    display: block;
}

.quick-actions span {
    margin-top: 6px;
    color: var(--muted);
}

.equipment-tools {
    min-width: min(420px, 100%);
}

.equipment-overview {
    display: grid;
    grid-template-columns: 180px 180px minmax(260px, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.equipment-stat,
.equipment-search {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(31, 41, 51, 0.06);
}

.equipment-stat {
    padding: 18px;
}

.equipment-stat span,
.equipment-stat small {
    display: block;
    color: var(--muted);
}

.equipment-stat span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.equipment-stat strong {
    display: block;
    margin: 8px 0 2px;
    color: #111827;
    font-size: 32px;
    line-height: 1;
}

.equipment-search {
    padding: 16px 18px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 18px;
}

.equipment-card,
.settings-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.equipment-card {
    position: relative;
    display: grid;
    gap: 16px;
    overflow: hidden;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(31, 41, 51, 0.07);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.equipment-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #94a3b8, #38bdf8);
    opacity: 0.9;
}

.equipment-card.equipment-online::before {
    background: linear-gradient(90deg, #22c55e, #38bdf8);
}

.equipment-card.equipment-offline::before {
    background: linear-gradient(90deg, #ef4444, #94a3b8);
}

.equipment-card:hover {
    transform: translateY(-6px);
    border-color: #cbd5e1;
    box-shadow: 0 24px 58px rgba(31, 41, 51, 0.14);
}

.equipment-card[hidden] {
    display: none;
}

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

.equipment-card h3 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 21px;
    font-weight: 700;
}

.equipment-card-head span:not(.status) {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

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

.equipment-details div,
.readonly-grid div {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.equipment-details small,
.equipment-details strong,
.readonly-grid small,
.readonly-grid strong {
    display: block;
}

.equipment-details small,
.readonly-grid small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.equipment-details strong,
.readonly-grid strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.equipment-card-actions,
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.employee-grid {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.employee-card {
    display: grid;
    grid-template-columns: 86px minmax(220px, 1fr) minmax(180px, 260px);
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.employee-card[hidden] {
    display: none;
}

.employee-photo {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    overflow: hidden;
    background: #f6f7f9;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.employee-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.employee-check {
    align-items: flex-start;
    gap: 10px;
}

.employee-check small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-weight: 400;
}

.status-badge {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-blocked {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.audit-table details summary {
    cursor: pointer;
    color: #4b5563;
    font-weight: 700;
}

.audit-details {
    max-width: 420px;
    max-height: 220px;
    overflow: auto;
    margin: 8px 0 0;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #334155;
    font-size: 12px;
    white-space: pre-wrap;
}

.employee-info span,
.employee-sync span,
.employee-sync small,
.employee-sync strong {
    display: block;
}

.employee-info span,
.employee-sync span,
.employee-sync small {
    color: var(--muted);
}

.employee-sync {
    padding: 12px;
    background: #f6f7f9;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.employee-sync small {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.employee-sync strong {
    font-size: 28px;
    line-height: 1.1;
}

.employee-form {
    display: grid;
    gap: 18px;
}

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

.form-grid label,
.camera-actions label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.camera-layout {
    display: grid;
    grid-template-columns: 260px minmax(260px, 1fr);
    gap: 22px;
    align-items: start;
}

.camera-box {
    position: relative;
    overflow: hidden;
    width: 240px;
    max-width: 100%;
    background: #111827;
    border-radius: 8px;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--line);
}

.camera-box video,
.camera-box canvas,
.camera-box .current-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-box canvas {
    display: none;
}

.camera-box .current-photo {
    display: none;
}

.camera-box.has-current-photo video,
.camera-box.has-current-photo canvas {
    display: none;
}

.camera-box.has-current-photo .current-photo {
    display: block;
}

.camera-box.has-photo video {
    display: none;
}

.camera-box.has-photo canvas {
    display: block;
}

.camera-box.has-photo .current-photo {
    display: none;
}

.camera-actions {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 12px;
    max-width: 460px;
}

.camera-actions .btn {
    width: 220px;
    max-width: 100%;
}

.camera-actions small {
    color: var(--muted);
}

.field-feedback {
    display: block;
    min-height: 18px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 400;
}

.field-feedback.is-valid {
    color: var(--green);
}

.field-feedback.is-invalid {
    color: var(--red);
}

.department-select {
    max-width: 100%;
}

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

.device-select-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.device-select-item span,
.device-select-item strong,
.device-select-item small {
    display: block;
}

.device-select-item small {
    color: var(--muted);
}

.settings-card {
    display: block;
    min-height: 150px;
    padding: 20px;
    color: var(--ink);
    text-decoration: none;
}

.settings-card:hover {
    border-color: var(--accent);
}

.settings-card span,
.settings-card strong,
.settings-card small {
    display: block;
}

.settings-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-card strong {
    margin-top: 12px;
    font-size: 22px;
}

.settings-card small {
    margin-top: 8px;
    color: var(--muted);
    font-size: 15px;
}

.edit-panel {
    max-width: 780px;
}

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

.edit-form label:not(.form-check) {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.page-footer {
    margin-top: auto;
    padding-top: 28px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.page-footer a {
    color: var(--muted);
    text-decoration: none;
}

.page-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
}

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

    .sidebar {
        position: static;
    }

    .summary-grid,
    .dashboard-layout,
    .dashboard-summary,
    .dashboard-actions,
    .quick-actions,
    .equipment-overview,
    .equipment-grid,
    .settings-grid,
    .employee-card,
    .form-grid,
    .camera-layout,
    .equipment-details,
    .readonly-grid {
        grid-template-columns: 1fr;
    }

    .pending-device,
    .pending-device-form,
    .portal-email-form,
    .access-row,
    .access-person-group summary,
    .timecard-employee,
    .timecard-punch,
    .timecard-signatures,
    .virtual-clock-grid,
    .virtual-clock-person {
        grid-template-columns: 1fr;
    }

    .access-row time,
    .access-row-status,
    .timecard-punch em,
    .virtual-clock-person .portal-avatar {
        justify-self: start;
        text-align: left;
    }

    .timecard-header {
        flex-direction: column;
    }

    .timecard-period {
        width: 100%;
        text-align: left;
    }

    .access-person-punches {
        padding: 0 12px 12px;
    }

    .topbar,
    .panel-header,
    .alert-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .recent-access-card {
        position: static;
    }

    .dashboard-topbar h1 {
        font-size: 26px;
    }
}

@media (max-width: 640px) {
    .portal-shell {
        width: min(100% - 20px, 100%);
        padding: 12px 0 22px;
    }

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

    .portal-topbar img {
        width: 180px;
        max-width: 78vw;
    }

    .portal-topbar nav {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .portal-topbar nav .btn {
        padding: 8px 10px;
        font-size: 14px;
        line-height: 1.2;
    }

    .portal-print-button {
        display: none;
    }

    .portal-hero {
        grid-template-columns: 62px minmax(0, 1fr);
        padding: 14px;
    }

    .portal-hero h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .portal-email-form {
        grid-template-columns: 1fr;
    }

    .portal-email-form .btn {
        width: 100%;
    }
}

@media print {
    @page {
        margin: 12mm;
    }

    body {
        background: #ffffff !important;
        color: #111827;
    }

    .sidebar,
    .page-footer,
    .portal-topbar,
    .portal-hero,
    .no-print {
        display: none !important;
    }

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

    .content {
        display: block;
        padding: 0;
    }

    .portal-shell {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .timecard-sheet {
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .timecard-header {
        padding-bottom: 12px;
    }

    .timecard-header img {
        width: 170px;
    }

    .timecard-header p {
        font-size: 12px;
    }

    .timecard-period,
    .timecard-meta span,
    .timecard-day {
        background: #ffffff;
    }

    .timecard-employee {
        padding: 14px 0;
    }

    .timecard-photo {
        width: 74px;
        height: 74px;
        border-radius: 12px;
    }

    .timecard-summary {
        display: none;
    }

    .print-only {
        display: block !important;
    }

    .portal-report-employee,
    .timecard-report-summary {
        display: block !important;
    }

    .portal-report-employee table,
    .timecard-report-summary table {
        margin: 8px 0 12px;
    }

    .timecard-day {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-top: 10px;
        border-radius: 0;
    }

    .timecard-day-head {
        padding: 7px 8px;
        background: #f3f4f6;
    }

    .timecard-punch {
        grid-template-columns: 82px minmax(120px, 1fr) minmax(120px, 1fr) 105px;
        padding: 6px 8px;
    }

    .timecard-punch em {
        padding: 3px 7px;
        font-size: 10px;
    }

    .timecard-punch time {
        font-size: 12px;
        font-weight: 700;
    }

    .timecard-punch span,
    .timecard-punch small {
        color: #111827;
        font-size: 11px;
    }

    .timecard-punch em {
        color: #111827 !important;
        background: transparent !important;
        border: 1px solid #cbd5e1;
        border-radius: 0;
        font-size: 10px;
        text-align: center;
    }

    .timecard-punch-head {
        background: #f3f4f6;
    }

    .timecard-punch-head time,
    .timecard-punch-head span,
    .timecard-punch-head small,
    .timecard-punch-head em {
        color: #374151 !important;
        font-size: 10px;
    }

    .timecard-signatures {
        margin-top: 42px;
    }
}
