:root {
    --ink: #102a43;
    --muted: #627d98;
    --line: #d9e2ec;
    --surface: #ffffff;
    --wash: #f3f7fa;
    --blue: #176b87;
    --green: #1f8a70;
    --amber: #c57a11;
    --red: #c2414c;
    --shadow: 0 18px 45px rgba(16, 42, 67, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 4%, rgba(31, 138, 112, .11), transparent 25rem),
        linear-gradient(180deg, #eef5f7 0, #f8fafc 22rem, #f4f7fa 100%);
    font-family: Tahoma, Arial, sans-serif;
    min-height: 100vh;
}

button, input, select { font: inherit; }

.topbar {
    min-height: 78px;
    padding: 14px max(24px, calc((100vw - 1180px) / 2));
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(217, 226, 236, .9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 21px; }
.brand small { display: block; color: var(--muted); margin-top: 3px; }
.brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #176b87, #1f8a70);
    box-shadow: 0 10px 24px rgba(23, 107, 135, .24);
    font-size: 24px;
    font-weight: 800;
}

.topbar-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.demo-pill { color: #8a4b08; background: #fff1cf; padding: 7px 11px; border-radius: 999px; font-weight: 700; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 34px auto 60px; }

.hero {
    border-radius: 28px;
    padding: 38px 42px;
    color: #fff;
    background:
        linear-gradient(125deg, rgba(6, 44, 64, .96), rgba(23, 107, 135, .94) 58%, rgba(31, 138, 112, .92)),
        #102a43;
    box-shadow: 0 24px 56px rgba(16, 42, 67, .2);
    display: flex;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border: 38px solid rgba(255, 255, 255, .05);
    border-radius: 50%;
    left: -75px;
    top: -120px;
}

.hero h1 { margin: 8px 0 10px; font-size: clamp(29px, 4vw, 45px); max-width: 720px; }
.hero p { margin: 0; color: rgba(255, 255, 255, .78); line-height: 1.8; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--green); margin: 0 0 6px; }
.hero .eyebrow { color: #8de0c8; }
.hero-date { min-width: 135px; padding: 18px 24px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 22px; background: rgba(255, 255, 255, .08); text-align: center; }
.hero-date span, .hero-date small { display: block; color: rgba(255, 255, 255, .7); }
.hero-date strong { display: block; font-size: 46px; margin: 4px 0; }

.notice { border-radius: 14px; padding: 14px 17px; margin: 18px 0; border: 1px solid; line-height: 1.6; }
.notice.info { background: #e8f4f8; border-color: #b6dbe7; color: #13556d; }
.notice.success { background: #e9f7f1; border-color: #bce3d3; color: #176d58; }
.notice.warning { background: #fff5df; border-color: #f0d59d; color: #8a570a; }
.notice.danger { background: #fff0f1; border-color: #efc0c5; color: #9f2f3a; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.stat-card { background: var(--surface); border-radius: 19px; padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(217, 226, 236, .72); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 5px; background: var(--blue); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; font-size: 34px; margin: 8px 0 5px; }
.stat-card small { font-size: 12px; }
.stat-card.accent-green::before { background: var(--green); }
.stat-card.accent-amber::before { background: var(--amber); }
.stat-card.accent-red::before { background: var(--red); }

.panel { background: var(--surface); border: 1px solid rgba(217, 226, 236, .78); border-radius: 24px; padding: 26px; margin-top: 22px; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 23px; }
.muted { color: var(--muted); font-size: 13px; }

.employee-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.employee-card { border: 1px solid var(--line); border-radius: 18px; padding: 17px; display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: start; transition: transform .18s ease, box-shadow .18s ease; }
.employee-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16, 42, 67, .07); }
.avatar { width: 44px; height: 44px; border-radius: 14px; background: #e8f2f5; color: var(--blue); display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.employee-copy h3 { margin: 1px 0 5px; font-size: 16px; }
.employee-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.employee-times { display: flex; gap: 16px; margin-top: 13px; color: var(--muted); font-size: 12px; }
.employee-times strong { color: var(--ink); margin-right: 4px; }
.employee-actions { grid-column: 2 / 4; }
.employee-actions form { display: flex; gap: 8px; }

.status { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status.present { background: #e6f6f0; color: #16745b; }
.status.late { background: #fff2d7; color: #9b5a05; }
.status.absent { background: #ffedef; color: #a9323e; }
.status.leave { background: #e9eefb; color: #435caa; }
.status.unknown { background: #edf2f7; color: #627d98; }

button, .button-link {
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}

button.secondary { background: #eaf1f4; color: var(--ink); }
button:disabled { opacity: .45; cursor: not-allowed; }

.filters { display: grid; grid-template-columns: 1fr 1fr 1.25fr auto; gap: 12px; align-items: end; padding: 17px; border-radius: 16px; background: var(--wash); }
.filters label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.filters input, .filters select { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 12px; color: var(--ink); }

.report-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.report-summary span { background: #f5f8fa; border: 1px solid var(--line); padding: 9px 12px; border-radius: 11px; color: var(--muted); font-size: 12px; }
.report-summary strong { color: var(--ink); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th { text-align: right; font-size: 12px; color: var(--muted); background: #f7f9fb; padding: 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid #edf2f6; font-size: 13px; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.empty-state { text-align: center; padding: 32px; color: var(--muted); }

footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto 30px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
footer button { background: transparent; color: var(--blue); border: 1px solid var(--line); }

.setup-body { display: grid; place-items: center; padding: 24px; }
.setup-card { width: min(580px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 36px; box-shadow: var(--shadow); }
.setup-card .brand-mark { margin-bottom: 22px; }
.setup-card h1 { margin: 0 0 12px; font-size: 30px; }
.setup-card > p { color: var(--muted); line-height: 1.8; }
.setup-list { margin: 24px 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.setup-list li { display: flex; align-items: center; gap: 11px; padding: 13px; border-radius: 13px; background: var(--wash); }
.setup-list span { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; }
.setup-card .privacy-note { color: #8a570a; background: #fff5df; border: 1px solid #f0d59d; padding: 13px; border-radius: 12px; }

@media (max-width: 850px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .employee-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .topbar { position: static; }
    .topbar-meta > span:last-child { display: none; }
    .page-shell { width: min(100% - 20px, 1180px); margin-top: 18px; }
    .hero { padding: 27px 23px; border-radius: 22px; }
    .hero-date { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 17px; }
    .panel { padding: 18px; border-radius: 19px; }
    .panel-heading { align-items: start; }
    .report-heading { flex-direction: column; }
    .filters { grid-template-columns: 1fr; }
    .employee-card { grid-template-columns: auto 1fr; }
    .employee-card > .status { grid-column: 1; grid-row: 2; }
    .employee-actions { grid-column: 2; }
    footer { align-items: flex-start; flex-direction: column; }
}

@media print {
    body { background: #fff; }
    .topbar, .hero, .stats-grid, .employee-grid, .filters, .button-link, .notice, footer { display: none !important; }
    .page-shell, .panel { width: 100%; margin: 0; box-shadow: none; border: 0; padding: 0; }
    .panel:first-of-type { display: none; }
}

/* Multi-company control panel */
.dashboard { width: min(1180px, calc(100% - 32px)); margin: 30px auto 60px; display: grid; gap: 22px; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 21px; }
.user-menu { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.user-menu form, .card-action, td form { margin: 0; }
.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
.danger-text { color: var(--red); }
.hero.compact { align-items: center; padding: 31px 36px; }
.hero.compact h1 { margin: 4px 0 10px; font-size: clamp(28px, 4vw, 46px); }
.hero.compact p:not(.eyebrow) { max-width: 680px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.8; }
.hero-stat, .schedule-card { min-width: 190px; padding: 18px 22px; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(255,255,255,.1); backdrop-filter: blur(7px); }
.hero-stat strong { display: block; font-size: 40px; }
.hero-stat span, .schedule-card span, .schedule-card small { color: rgba(255,255,255,.75); }
.schedule-card { display: grid; gap: 7px; }
.schedule-card strong { font-size: 21px; direction: ltr; text-align: right; }
.panel { margin: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.section-heading h2 { margin: 3px 0 0; font-size: 23px; }
.secure-note { color: #1f6d5b; background: #e8f7f1; border: 1px solid #bde5d8; padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; align-items: end; }
.stack-form { display: grid; gap: 14px; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label, .stack-form label, .report-filters label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px 12px; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,135,.12); }
label small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.form-action { display: flex; align-items: end; }
.schedule-builder { grid-column: 1 / -1; display: grid; grid-template-columns: auto repeat(4,minmax(130px,1fr)); align-items: end; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--wash); }
.schedule-builder[hidden] { display: none; }
.schedule-builder > strong { align-self: center; color: var(--ink); }
.schedule-builder > p { grid-column: span 3; margin: 0; color: var(--muted); line-height: 1.7; font-size: 12px; }
.shift-fieldset { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; }
.shift-fieldset legend { padding: 0 7px; color: var(--blue); font-size: 12px; font-weight: 800; }
.primary, .secondary { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
.primary { background: linear-gradient(135deg,var(--blue),var(--green)); color: #fff; }
.secondary { background: #eaf1f4; color: var(--ink); }
.wide { width: 100%; }
.alert { padding: 13px 16px; border-radius: 13px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.alert.success { color: #16624f; background: #e8f7f1; border-color: #bde5d8; }
.alert.danger { color: #9d2e39; background: #ffedef; border-color: #f3c6cb; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(990px,100%); display: grid; grid-template-columns: 1.15fr .85fr; background: #fff; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; box-shadow: 0 28px 70px rgba(16,42,67,.14); }
.auth-intro { padding: 56px; color: #fff; background: linear-gradient(145deg,#0b3950,#176b87 58%,#1f8a70); }
.brand-line { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.brand-line strong { font-size: 24px; }
.auth-intro h1 { margin: 7px 0 14px; font-size: clamp(32px,5vw,50px); }
.auth-intro > p:not(.eyebrow) { line-height: 1.9; color: rgba(255,255,255,.78); }
.feature-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 13px; }
.feature-list li::before { content: '✓'; display: inline-grid; place-items: center; width: 23px; height: 23px; margin-left: 9px; border-radius: 8px; background: rgba(255,255,255,.15); }
.auth-card { padding: 48px 40px; align-self: center; }
.auth-card h1, .auth-card h2 { margin: 5px 0 22px; }
.auth-card > p { color: var(--muted); line-height: 1.8; }
.company-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.company-card { border: 1px solid var(--line); border-radius: 18px; padding: 19px; background: #fbfdfe; }
.company-card.inactive { opacity: .7; }
.company-head { display: flex; justify-content: space-between; gap: 12px; }
.company-head h3 { display: inline; margin: 0; font-size: 19px; }
.company-head p { margin: 5px 0 0 20px; color: var(--muted); direction: ltr; text-align: right; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-left: 8px; border-radius: 50%; background: var(--green); }
.company-card.inactive .status-dot { background: #8b9baa; }
.company-metrics { display: flex; gap: 20px; margin: 18px 0 10px; color: var(--muted); font-size: 12px; }
.company-metrics strong { color: var(--ink); font-size: 18px; }
.schedule { color: var(--muted); font-size: 12px; }
.company-card details { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 12px; }
.company-card summary { cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 700; }
.inline-password { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; }
.inline-device { display: flex; align-items: center; gap: 6px; min-width: 150px; }
.inline-device input { width: 86px; min-width: 70px; padding: 8px 9px; }
.inline-device button { padding: 8px 10px; }
.device-import-details { min-width: 230px; }
.device-import-details summary { cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 800; }
.device-import { display: grid; gap: 8px; margin-top: 9px; padding: 10px; border-radius: 12px; background: var(--wash); }
.device-import label { font-size: 11px; }
.device-import input, .device-import select { margin-top: 4px; padding: 8px 9px; }
.movement-table td:nth-child(1), .movement-table td:nth-child(2), .movement-table td:nth-child(4), .movement-table td:nth-child(6), .movement-table td:nth-child(7) { direction: ltr; white-space: nowrap; }
.movement-table td:nth-child(2) strong { font-size: 15px; color: var(--blue); }
.professional-report { overflow: hidden; }
.period-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 18px; }
.period-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; }
.period-card.morning { background: linear-gradient(135deg,#eef8ff,#f7fbff); border-color: #cfe9f8; }
.period-card.evening { background: linear-gradient(135deg,#fff7e7,#fffaf2); border-color: #f1dfbb; }
.period-card span { margin-left: auto; color: var(--ink); font-weight: 800; }
.period-card strong { direction: ltr; color: var(--blue); }
.period-card.evening strong { color: #9b650c; }
.period-card i { color: var(--muted); font-style: normal; }
.period-report-table thead tr:first-child th { text-align: center; }
.period-report-table .group-morning { color: #176b87; background: #eaf6fc; }
.period-report-table .group-evening { color: #8b5b0b; background: #fff3db; }
.period-report-table td { text-align: center; vertical-align: middle; }
.period-report-table td:nth-child(2) { min-width: 150px; text-align: right; }
.time-chip { display: inline-flex; justify-content: center; min-width: 58px; padding: 7px 9px; border-radius: 10px; direction: ltr; font-weight: 800; }
.time-chip.in { color: #176b87; background: #e8f5fb; }
.time-chip.out { color: #8b5b0b; background: #fff2d9; }
.worked-total { color: var(--green); direction: rtl; white-space: nowrap; }
.card-action { margin-top: 12px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pill { display: inline-flex; align-items: center; width: max-content; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pill.success { color: #16624f; background: #e6f6f0; }
.pill.warning { color: #935805; background: #fff1d2; }
.pill.danger { color: #9d2e39; background: #ffedef; }
.pill.info { color: #31589d; background: #eaf0ff; }
.pill.muted { color: #627d98; background: #edf2f7; }
.attendance-form { grid-template-columns: repeat(3,minmax(0,1fr)); }
.report-filters { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; align-items: end; gap: 12px; padding: 15px; margin-bottom: 18px; border-radius: 15px; background: var(--wash); }
.button-link { display: inline-flex; align-items: center; }
.stats-grid article { background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 19px; box-shadow: var(--shadow); }
.stats-grid article > span, .stats-grid article small { color: var(--muted); }
.stats-grid article strong { display: block; margin: 7px 0 3px; font-size: 31px; }
.footer { justify-content: center; }

@media (max-width: 900px) {
    .form-grid, .attendance-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .company-grid, .two-column { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-intro { padding: 38px; }
    .brand-line { margin-bottom: 25px; }
    .report-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
    .dashboard { width: min(100% - 18px,1180px); margin-top: 15px; }
    .topbar { padding-inline: 13px; }
    .user-menu > span { display: none; }
    .hero.compact { padding: 25px 21px; flex-direction: column; align-items: stretch; }
    .hero-stat, .schedule-card { min-width: 0; }
    .form-grid, .attendance-form, .report-filters, .form-pair, .inline-password { grid-template-columns: 1fr; }
    .schedule-builder { grid-template-columns: 1fr; }
    .schedule-builder > p { grid-column: 1; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .period-legend { grid-template-columns: 1fr; }
    .period-card { flex-wrap: wrap; }
    .auth-body { padding: 10px; }
    .auth-intro, .auth-card { padding: 30px 23px; }
}

/* Enterprise tenant workspace */
.tenant-app {
    background: #f4f6f9;
    color: #172235;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
.tenant-app .app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0,1fr); }
.tenant-app .app-sidebar {
    position: sticky; top: 0; height: 100vh; z-index: 30;
    display: flex; flex-direction: column; padding: 25px 18px 18px;
    background: #0f1f33; color: #dce6f2; border-left: 1px solid rgba(255,255,255,.06);
}
.app-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 23px; color: #fff; text-decoration: none; }
.app-brand span:last-child { display: grid; gap: 1px; }
.app-brand strong { font-size: 21px; letter-spacing: -.02em; }
.app-brand small { color: #8fa4bb; font-size: 11px; }
.app-logo { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg,#1f8a70,#2bb594); font-size: 22px; font-weight: 800; box-shadow: 0 10px 24px rgba(43,181,148,.22); }
.company-identity { display: flex; align-items: center; gap: 11px; padding: 13px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.045); }
.company-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: #213650; color: #8de0c8; font-weight: 800; }
.company-identity div { min-width: 0; display: grid; gap: 3px; }
.company-identity small { color: #8fa4bb; font-size: 10px; }
.company-identity strong { overflow: hidden; color: #fff; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.side-nav { display: grid; gap: 5px; }
.side-nav a { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; min-height: 46px; padding: 7px 10px; border-radius: 11px; color: #9fb2c7; text-decoration: none; font-size: 13px; font-weight: 600; transition: .18s ease; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.055); }
.side-nav a.active { color: #fff; background: linear-gradient(100deg,rgba(43,181,148,.24),rgba(43,181,148,.09)); box-shadow: inset -3px 0 #2bb594; }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #91a7bd; font-size: 17px; }
.side-nav a.active .nav-icon { color: #8de0c8; background: rgba(43,181,148,.12); }
.side-nav b { min-width: 22px; padding: 3px 6px; border-radius: 999px; color: #dce6f2; background: rgba(255,255,255,.09); text-align: center; font-size: 10px; }
.side-nav b.warning-count { color: #ffd58b; background: rgba(197,122,17,.18); }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.user-identity { display: flex; align-items: center; gap: 9px; padding: 0 8px 13px; }
.user-identity div { display: grid; gap: 2px; }
.user-identity strong { color: #fff; font-size: 12px; }
.user-identity small { color: #8198af; font-size: 10px; }
.presence-dot { width: 9px; height: 9px; border: 2px solid #0f1f33; border-radius: 50%; background: #39c89f; box-shadow: 0 0 0 2px rgba(57,200,159,.2); }
.sidebar-logout { width: 100%; padding: 9px; color: #9fb2c7; background: transparent; border: 1px solid rgba(255,255,255,.09); }
.sidebar-logout:hover { color: #fff; background: rgba(255,255,255,.05); }
.app-main { min-width: 0; background: #f4f6f9; }
.app-toolbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px 34px; background: rgba(255,255,255,.94); border-bottom: 1px solid #e4e9f0; backdrop-filter: blur(12px); }
.app-toolbar p { margin: 0 0 3px; color: #8a97a8; font-size: 11px; }
.app-toolbar h1 { margin: 0; color: #152237; font-size: 23px; letter-spacing: -.02em; }
.app-toolbar div > span:not(.live-status) { display: block; margin-top: 3px; color: #7a899d; font-size: 11px; }
.toolbar-meta { display: flex; align-items: center; gap: 12px; color: #657489; font-size: 12px; }
.toolbar-meta time { direction: ltr; padding: 8px 11px; border: 1px solid #e2e8ef; border-radius: 9px; background: #f8fafc; }
.live-status { display: inline-flex !important; align-items: center; gap: 7px; margin: 0 !important; padding: 8px 11px; border-radius: 999px; color: #14745c !important; background: #e8f7f1; font-size: 11px !important; font-weight: 700; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: #29ad86; box-shadow: 0 0 0 4px rgba(41,173,134,.12); }
.tenant-app .dashboard { width: auto; max-width: 1540px; margin: 0; padding: 28px 34px 52px; gap: 20px; }
.tenant-app .alert { margin: 0; }
.welcome-strip { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px 27px; border: 1px solid #dfe6ee; border-radius: 18px; background: linear-gradient(120deg,#fff 55%,#eef8f5); box-shadow: 0 10px 28px rgba(23,34,53,.045); }
.welcome-strip h2 { margin: 2px 0 5px; font-size: 24px; }
.welcome-strip p { margin: 0; color: #748297; font-size: 13px; }
.quick-link { white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
.metric-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 19px; border: 1px solid #e1e7ee; border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(23,34,53,.035); }
.metric-icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 13px; font-size: 19px; font-style: normal; font-weight: 800; }
.metric-icon.blue { color: #27629f; background: #eaf3fc; }
.metric-icon.green { color: #168066; background: #e8f7f1; }
.metric-icon.amber { color: #a4660b; background: #fff4df; }
.metric-icon.red { color: #b63c48; background: #ffedef; }
.metric-card div { min-width: 0; display: grid; }
.metric-card small { color: #738196; font-size: 11px; }
.metric-card strong { margin: 2px 0; color: #152237; font-size: 27px; line-height: 1.1; }
.metric-card em { color: #9aa6b5; font-size: 10px; font-style: normal; white-space: nowrap; }
.tenant-app .panel { padding: 22px; border: 1px solid #e1e7ee; border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(23,34,53,.035); }
.tenant-app .section-heading { align-items: flex-start; margin-bottom: 18px; }
.tenant-app .section-heading h2 { margin: 2px 0 0; color: #152237; font-size: 19px; }
.section-copy { margin: 6px 0 0; color: #8190a2; font-size: 11px; line-height: 1.65; }
.tenant-app .eyebrow { color: #1b8c70; font-size: 10px; letter-spacing: .05em; }
.text-link { color: #177b65; text-decoration: none; font-size: 11px; font-weight: 700; }
.overview-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.75fr); gap: 20px; }
.shift-timeline { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.shift-timeline article { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; padding: 14px; border: 1px solid #e5eaf0; border-radius: 13px; background: #f9fbfc; }
.shift-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #16765f; background: #e7f5f0; font-weight: 800; }
.shift-timeline article div { display: grid; gap: 4px; }
.shift-timeline small { color: #8491a2; font-size: 10px; }
.shift-timeline strong { direction: ltr; color: #1d2a3d; font-size: 15px; text-align: right; }
.shift-timeline strong i { padding: 0 5px; color: #9aa6b5; font-size: 10px; font-style: normal; font-weight: 400; }
.shift-duration { color: #66758a; font-size: 10px; white-space: nowrap; }
.grace-line { display: flex; justify-content: space-between; margin-top: 12px; padding: 12px 14px; border-radius: 11px; color: #7e8c9e; background: #f5f7fa; font-size: 11px; }
.grace-line strong { color: #97600e; }
.connection-orb { width: 10px; height: 10px; border-radius: 50%; background: #29ad86; box-shadow: 0 0 0 6px rgba(41,173,134,.11); }
.integration-card { background: linear-gradient(145deg,#fff,#f3faf8) !important; }
.integration-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 5px 0 18px; }
.integration-metrics div { padding: 11px 7px; border: 1px solid #e3ece9; border-radius: 11px; background: rgba(255,255,255,.72); text-align: center; }
.integration-metrics strong, .integration-metrics span { display: block; }
.integration-metrics strong { font-size: 21px; }
.integration-metrics span { margin-top: 3px; color: #8491a2; font-size: 9px; }
.activity-list { display: grid; }
.activity-list article { display: grid; grid-template-columns: 39px minmax(0,1fr) 70px auto; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid #eef1f5; }
.activity-list article:last-child { border: 0; }
.activity-avatar, .employee-cell > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #27629f; background: #eaf3fc; font-weight: 800; }
.activity-list article div { min-width: 0; display: grid; gap: 3px; }
.activity-list strong { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.activity-list small { color: #8a97a8; font-size: 10px; }
.activity-list time { direction: ltr; color: #1e6c83; font-size: 13px; font-weight: 800; }
.empty-state.refined { display: grid; justify-items: center; gap: 6px; padding: 45px 20px; }
.empty-state.refined > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #74869a; background: #edf2f6; font-size: 21px; }
.empty-state.refined strong { color: #35445a; }
.empty-state.refined p { margin: 0; color: #8a97a8; font-size: 11px; }
.employee-add-form { grid-template-columns: repeat(4,minmax(0,1fr)); }
.employee-shift-note { align-self: end; grid-column: span 3; margin: 0; }
.tenant-app input, .tenant-app select { min-height: 43px; border-color: #dce3eb; border-radius: 9px; background: #fff; font-size: 12px; }
.tenant-app input:focus, .tenant-app select:focus { border-color: #248d75; box-shadow: 0 0 0 3px rgba(36,141,117,.11); }
.tenant-app .primary { border-radius: 9px; background: #177d67; box-shadow: 0 7px 16px rgba(23,125,103,.15); }
.tenant-app .primary:hover { background: #116b58; }
.tenant-app .secondary { border: 1px solid #dfe5ec; border-radius: 9px; background: #f6f8fa; }
.tenant-app .ghost { border-color: #dfe5ec; border-radius: 8px; }
.tenant-app .secure-note { border-radius: 9px; }
.employee-directory, .device-panel, .movement-panel { padding: 0 !important; overflow: hidden; }
.employee-directory > .section-heading, .device-panel > .section-heading, .movement-panel > .section-heading { padding: 22px 22px 0; }
.employee-cell { display: flex; align-items: center; gap: 9px; min-width: 160px; }
.employee-cell > span { width: 32px; height: 32px; flex: 0 0 32px; }
.code-value { direction: ltr; display: inline-block; color: #34516d; font-family: Consolas, monospace; font-size: 11px; }
.schedule-text { display: block; max-width: 270px; color: #6f7e91; line-height: 1.55; }
.tenant-app .table-wrap { scrollbar-color: #ccd5df transparent; }
.tenant-app table { min-width: 900px; }
.tenant-app th { padding: 12px 14px; color: #6f7d90; background: #f6f8fa; border-color: #e7ebf0; font-size: 10px; font-weight: 700; }
.tenant-app td { padding: 12px 14px; color: #344359; border-color: #edf0f4; font-size: 11px; }
.tenant-app tbody tr:hover { background: #fafcfd; }
.tenant-app .pill { padding: 5px 9px; font-size: 9px; }
.linked-user { display: inline-flex; align-items: center; gap: 6px; color: #176f5b; font-size: 11px; font-weight: 700; }
.linked-user i { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #26a681; font-size: 10px; font-style: normal; }
.device-summary, .report-overview { display: grid; grid-template-columns: 1.4fr repeat(3,1fr); gap: 14px; }
.device-summary article, .report-overview article { min-height: 88px; display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid #e1e7ee; border-radius: 14px; background: #fff; box-shadow: 0 7px 20px rgba(23,34,53,.03); }
.device-summary article:not(:first-child), .report-overview article { display: grid; align-content: center; gap: 4px; }
.device-summary small, .report-overview small { color: #8390a2; font-size: 10px; }
.device-summary strong { font-size: 19px; }
.device-summary article:not(:first-child) strong, .report-overview article:not(:first-child) strong { font-size: 23px; }
.attendance-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(300px,.7fr); gap: 20px; }
.policy-flow { display: grid; gap: 10px; }
.policy-flow article { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid #e4e9ef; border-radius: 12px; background: #f9fbfc; }
.policy-flow article > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #18765f; background: #e6f5f0; font-weight: 800; }
.policy-flow article div { display: grid; gap: 3px; }
.policy-flow strong { font-size: 12px; }
.policy-flow small { direction: ltr; color: #7d8b9d; font-size: 11px; text-align: right; }
.policy-note { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 13px; border-radius: 11px; color: #8b5b0b; background: #fff4e2; }
.policy-note strong { font-size: 18px; }
.policy-note span { font-size: 10px; }
.shift-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.settings-panel { max-width: 930px; }
.settings-form { gap: 18px; }
.wide-field { max-width: 560px; }
.compact-field { max-width: 260px; }
.settings-actions { display: flex; align-items: center; gap: 14px; padding-top: 5px; }
.settings-actions span { color: #8491a2; font-size: 10px; }
.tenant-app .shift-fieldset { padding: 16px; border-color: #dfe5ec; background: #fafcfd; }
.report-overview { grid-template-columns: 1.4fr .8fr .8fr; }
.report-overview article:first-child strong { direction: ltr; font-size: 13px; }
.report-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.report-type-switch a { display: flex; align-items: center; gap: 13px; min-height: 76px; padding: 15px 18px; border: 1px solid #dfe5ec; border-radius: 14px; color: #637286; background: #fff; text-decoration: none; box-shadow: 0 7px 20px rgba(23,34,53,.025); transition: .18s ease; }
.report-type-switch a:hover { border-color: #b8d9cf; transform: translateY(-1px); }
.report-type-switch a.active { border-color: #72b9a6; background: linear-gradient(135deg,#f1faf7,#fff); box-shadow: inset -3px 0 #1c8b70,0 8px 22px rgba(28,139,112,.07); }
.report-type-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; color: #59708a; background: #edf2f7; font-size: 20px; font-weight: 800; }
.report-type-switch a.active .report-type-icon { color: #14735c; background: #def3ec; }
.report-type-switch a div { display: grid; gap: 4px; }
.report-type-switch strong { color: #1d2b3f; font-size: 14px; }
.report-type-switch small { color: #8290a2; font-size: 10px; }
.report-actions { display: flex; gap: 8px; }
.report-title-row { align-items: center !important; }
.tenant-app .professional-report { padding: 22px 0 0 !important; }
.professional-report > .section-heading, .professional-report > .period-legend, .professional-report > .window-grid, .professional-report > .report-filters { margin-right: 22px; margin-left: 22px; }
.general-report .report-filters-contained { margin: 0 22px 18px; }
.window-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 17px; }
.window-card { overflow: hidden; border: 1px solid #dfe6ed; border-radius: 13px; background: #fbfcfd; }
.window-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #f1f7fa; border-bottom: 1px solid #dfe9ee; }
.window-card.evening header { background: #fff7e8; border-color: #efe2c7; }
.window-card header span { color: #35536e; font-size: 11px; font-weight: 800; }
.window-card header strong { direction: ltr; color: #1b6982; font-size: 13px; }
.window-card.evening header strong { color: #96600b; }
.window-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #edf1f4; }
.window-card > div:last-child { border: 0; }
.window-card > div span { color: #7d8a9b; font-size: 10px; }
.window-card > div strong { direction: ltr; color: #27394f; font-size: 12px; }
.tenant-app .period-card { min-height: 62px; border-radius: 12px; }
.tenant-app .report-filters { padding: 13px; border: 1px solid #e5eaf0; border-radius: 12px; background: #f7f9fb; }
.report-table-wrap { border-top: 1px solid #e5eaf0; }
.tenant-app .period-report-table { min-width: 1180px; }
.tenant-app .period-report-table thead th { position: sticky; top: 0; z-index: 2; }
.movement-panel { scroll-margin-top: 20px; }
.movement-time { direction: ltr; display: inline-block; color: #147b83; font-size: 13px; }
.app-footer { padding: 15px 34px 24px; color: #98a4b4; font-size: 10px; text-align: center; }

@media (max-width: 1180px) {
    .tenant-app .app-shell { grid-template-columns: 224px minmax(0,1fr); }
    .tenant-app .app-sidebar { padding-inline: 13px; }
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .employee-add-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .employee-shift-note { grid-column: span 1; }
}

@media (max-width: 820px) {
    .tenant-app .app-shell { display: block; }
    .tenant-app .app-sidebar { position: relative; height: auto; padding: 13px; }
    .app-brand { padding: 0 3px 12px; }
    .company-identity, .sidebar-foot { display: none; }
    .side-nav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .side-nav::-webkit-scrollbar { display: none; }
    .side-nav a { flex: 0 0 auto; grid-template-columns: 25px auto auto; min-height: 39px; padding: 5px 10px; }
    .side-nav a.active { box-shadow: inset 0 -2px #2bb594; }
    .nav-icon { width: 23px; height: 23px; font-size: 14px; }
    .app-toolbar { padding: 14px 18px; }
    .app-toolbar div > span:not(.live-status), .toolbar-meta .live-status { display: none !important; }
    .tenant-app .dashboard { padding: 18px 15px 38px; }
    .overview-layout, .attendance-layout { grid-template-columns: 1fr; }
    .device-summary, .report-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .window-grid { grid-template-columns: 1fr; }
    .shift-timeline { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .app-toolbar h1 { font-size: 19px; }
    .toolbar-meta time { display: none; }
    .welcome-strip { align-items: flex-start; flex-direction: column; padding: 19px; }
    .welcome-strip h2 { font-size: 20px; }
    .metric-grid, .employee-add-form, .shift-settings, .device-summary, .report-overview, .report-type-switch { grid-template-columns: 1fr; }
    .metric-card { padding: 15px; }
    .tenant-app .panel { padding: 17px; border-radius: 14px; }
    .activity-list article { grid-template-columns: 36px minmax(0,1fr) auto; }
    .activity-list article .pill { grid-column: 2 / 4; }
    .settings-actions, .report-title-row, .report-actions { align-items: stretch; flex-direction: column; }
    .professional-report > .section-heading, .professional-report > .period-legend, .professional-report > .window-grid, .professional-report > .report-filters { margin-right: 15px; margin-left: 15px; }
    .general-report .report-filters-contained { margin-right: 15px; margin-left: 15px; }
}

@media print {
    .tenant-app .app-sidebar, .tenant-app .app-toolbar, .tenant-app .app-footer, .tenant-app .report-overview, .tenant-app .report-filters, .tenant-app .report-actions, .tenant-app .movement-panel { display: none !important; }
    .tenant-app .app-shell { display: block; }
    .tenant-app .dashboard { max-width: none; padding: 0; }
    .tenant-app .professional-report { display: block !important; border: 0; box-shadow: none; }
}
