:root {
    --bg: #f4f6fa; --panel: #ffffff; --text: #1d2939; --muted: #667085; --line: #e4e7ec;
    --accent: #2563eb; --accent-soft: #eff4ff; --ok: #12b76a; --warn: #f79009; --danger: #f04438; --yellow: #eab308;
    --nav: #101828; --nav-text: #d0d5dd;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex-shrink: 0; background: var(--nav); color: var(--nav-text); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { color: #fff; font-weight: 800; font-size: 17px; padding: 0 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; flex-shrink: 0; }
.quote-from { display: flex; gap: 14px; align-items: flex-start; }
.quote-logo { max-width: 90px; max-height: 90px; object-fit: contain; }
.gstin-result { padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.gstin-result.ok { background: #ecfdf3; color: #067647; }
.gstin-result.error { background: #fef3f2; color: #b42318; }
.office-list { margin-bottom: 12px; }
.office-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shift-edit { flex-basis: 100%; padding-top: 10px; }
.shift-form { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 10px; }
.shift-add { margin-top: 12px; }
.shift-add > summary { display: inline-flex; list-style: none; }
.shift-add > summary::-webkit-details-marker { display: none; }
.shift-add[open] > summary { margin-bottom: 4px; }
.office-editor { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.office-step { margin: 16px 0 8px; font-size: 15px; }
.office-coordinates summary { cursor: pointer; color: var(--muted); }
.office-map { height: 320px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
.office-map .leaflet-interactive:focus { outline: none; }
.map-results { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.map-results button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); font: inherit; cursor: pointer; }
.map-results button:last-child { border-bottom: 0; }
.map-results button:hover { background: var(--accent-soft); }
.map-results .map-results-note { padding: 10px 12px; color: var(--danger); }
.map-results .map-results-note.hint { color: #b54708; background: #fffaeb; }
.legal-page { max-width: 760px; margin: 0 auto; padding: 32px 18px 48px; background: var(--panel); min-height: 100vh; line-height: 1.65; }
.legal-page h2 { margin-top: 26px; }
.legal-page li { margin-bottom: 6px; }
.logo-preview { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.nav-group { margin-top: 14px; padding: 0 10px 4px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #98a2b3; }
.sidebar a.nav-link { display: flex; justify-content: space-between; align-items: center; color: var(--nav-text); padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.sidebar a.nav-link:hover, .sidebar a.nav-link.active { background: #1d2939; color: #fff; }
/* Sidebar: main sections that fold open to their sub pages */
.nav-menu { display: flex; flex-direction: column; gap: 2px; }
.nav-main { gap: 10px; justify-content: flex-start !important; }
.nav-main > span:not(.nav-badge) { flex: 1; }
.nav-icon { flex-shrink: 0; opacity: .85; }
.sidebar .nav-section > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; color: var(--nav-text); padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.sidebar .nav-section > summary:hover { background: #1d2939; color: #fff; }
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-caret { flex-shrink: 0; margin-left: 4px; opacity: .6; transition: transform .15s; }
.nav-section[open] > summary .nav-caret { transform: rotate(90deg); }
.sidebar .nav-section > summary.current { color: #fff; }
.nav-children { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 19px; padding-left: 12px; border-left: 1px solid #344054; }
.sidebar a.nav-sub { padding: 7px 10px; font-weight: 500; font-size: 13.5px; }
.sidebar a.nav-sub.active { background: var(--accent); color: #fff; }
.nav-status { display: block; font-size: 11px; font-weight: 600; color: #6ce9a6; }
.nav-status.off { color: #fda29b; }
.nav-badge { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 800; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 16px; cursor: pointer; }
.dashboard-header-greeting { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.dashboard-header-greeting strong { overflow: hidden; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-header-greeting span { color: var(--muted); font-size: 12px; }
.dashboard-company-mark { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; padding: 0; font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dashboard-company-logo { display: block; width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.dashboard-company-initial { display: grid; width: 100%; height: 100%; place-items: center; background: linear-gradient(145deg, #2563eb, #1d4ed8); color: #fff; font-size: 19px; font-weight: 900; }
.bell { position: relative; font-size: 20px; color: var(--text); }
.bell .count { position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 800; padding: 0 5px; }
.content { padding: 24px; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { font-size: 24px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.contact-search { position: relative; }
.contact-suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin-top: 4px; max-height: 60vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .15); }
.contact-suggestions[hidden] { display: none; }
.contact-suggestion { display: block; padding: 9px 12px; color: var(--text); }
.contact-suggestion:hover { background: #f2f4f7; }
.contact-suggestion.linked { padding-left: 26px; font-size: 13px; }
.contact-suggestion .badge { margin-right: 6px; }
.contact-suggestions .empty { padding: 10px 12px; }
label, .label { font-size: 12px; font-weight: 700; color: #344054; }
input[type=text], input[type=tel], input[type=url], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=month], input[type=file], input[type=search], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #d0d5dd; border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.error-text { color: var(--danger); font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn.secondary { background: #fff; color: var(--text); border-color: #d0d5dd; }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn[hidden] { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #f2f4f7; color: #344054; white-space: nowrap; }
.badge.pending { background: #fffaeb; color: #b54708; }
.badge.approved, .badge.success, .badge.completed { background: #ecfdf3; color: #027a48; }
.badge.rejected, .badge.danger { background: #fef3f2; color: #b42318; }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.whatsapp-card-head { justify-content: space-between; margin-bottom: 18px; }
.whatsapp-card-head h2, .whatsapp-console h2 { margin: 0 0 5px; }
.whatsapp-qr-wrap { display: grid; place-items: center; gap: 8px; padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.whatsapp-qr-wrap[hidden] { display: none; }
.whatsapp-qr-wrap img { width: min(280px, 100%); aspect-ratio: 1; }
.whatsapp-qr-timer { padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.whatsapp-qr-timer[hidden] { display: none; }
.whatsapp-number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 560px)); gap: 16px; margin-bottom: 18px; }
.whatsapp-number-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.whatsapp-number-settings { display: grid; gap: 12px; margin: 18px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.whatsapp-number-settings .btn { width: auto; justify-self: start; }
.whatsapp-remove-number { display: inline-flex; }
.whatsapp-connection-actions form { display: inline-flex; }
.whatsapp-add-number { display: grid; grid-template-columns: minmax(220px, 420px) auto; align-items: end; gap: 12px; max-width: 650px; padding: 18px; border: 1px dashed #b9c7e6; border-radius: 12px; background: #f8faff; }
.whatsapp-add-number .field { margin-bottom: 0; }
.whatsapp-message-form { max-width: 760px; }
.whatsapp-message-form > .btn { margin-top: 2px; }
.whatsapp-console .field { margin-bottom: 14px; }
.whatsapp-api-key { margin-top: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.whatsapp-group-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.whatsapp-tool-panel { padding: 0; overflow: hidden; box-shadow: 0 1px 3px rgba(16, 24, 40, .04); }
.whatsapp-tool-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; cursor: pointer; list-style: none; }
.whatsapp-tool-toggle::-webkit-details-marker { display: none; }
.whatsapp-tool-toggle > span:first-child { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.whatsapp-tool-toggle strong { color: var(--text); font-size: 17px; }
.whatsapp-tool-toggle small { color: var(--muted); font-size: 13px; font-weight: 500; }
.whatsapp-tool-toggle::after { content: '+'; flex: 0 0 auto; color: var(--accent); font-size: 25px; font-weight: 500; line-height: 1; }
.whatsapp-tool-panel[open] > .whatsapp-tool-toggle::after { content: '−'; }
.whatsapp-tool-panel[open] > .whatsapp-tool-toggle { background: var(--accent-soft); }
.whatsapp-tool-body { margin: 0 22px; padding: 20px 0 22px; border-top: 1px solid var(--line); }
.whatsapp-tool-panel + .whatsapp-tool-panel { margin-top: 12px; }
.whatsapp-group-list-table { margin-top: 12px; }
.api-code { overflow-x: auto; margin: 6px 0 14px; padding: 12px; border-radius: 10px; background: #101828; color: #d1fadf; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.urgency { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.urgency.green { background: var(--ok); } .urgency.yellow { background: var(--yellow); } .urgency.orange { background: var(--warn); } .urgency.red { background: var(--danger); } .urgency.done { background: #98a2b3; }
.task-row.red td:first-child { box-shadow: inset 3px 0 var(--danger); }
.task-row.orange td:first-child { box-shadow: inset 3px 0 var(--warn); }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.alert.success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.alert.error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert.warn { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.progress { height: 8px; background: #eaecf0; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
dl.details { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
dl.details dt { color: var(--muted); font-weight: 600; }
dl.details dd { margin: 0; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 0; padding: 0; list-style: none; }
.pagination li > a, .pagination li > span { display: block; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pagination li.active > span { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination li.disabled > span { color: #98a2b3; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.inline-form { display: inline; }
.kid-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 8px; margin-bottom: 8px; align-items: end; }
.kid-dob { display: flex; flex-direction: column; gap: 2px; }

/* Task replies, read like a chat: your own on the right. */
.replies { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.reply { max-width: 85%; align-self: flex-start; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: #f2f4f7; }
.reply.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: var(--accent-soft); }
.reply-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.reply-body { white-space: pre-line; overflow-wrap: anywhere; }
.reply-photo { display: block; max-width: 100%; max-height: 260px; margin-top: 8px; border-radius: 8px; }
.reply-form { border-top: 1px solid var(--line); padding-top: 14px; }
.reply-form textarea { min-height: 0; margin-bottom: 10px; border-radius: 12px; }
.reply-tools { display: flex; gap: 8px; align-items: center; }
.reply-photo-button { flex-shrink: 0; cursor: pointer; }
.reply-status { flex: 1; min-width: 0; }
.reply-send { flex-shrink: 0; }
.reply-photo-preview { position: relative; display: inline-block; margin-bottom: 10px; }
.reply-photo-preview img { display: block; max-height: 120px; max-width: 160px; border-radius: 10px; border: 1px solid var(--line); }
.reply-photo-remove { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--text); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }

/* Attendance */
.attendance-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.attendance-strip.pending { background: #fef3f2; border-color: #f97066; color: #b42318; font-weight: 700; }
.attendance-strip.pending strong { color: #b42318; }
.attendance-strip strong { color: var(--accent); white-space: nowrap; }

/* Dashboard announcements and ads: a clean promo card directly below the greeting. */
.dashboard-carousel { position: relative; overflow: hidden; margin-bottom: 14px; border-radius: 20px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); }
.dashboard-banner-track { display: flex; transition: transform .45s ease; }
.dashboard-banner { flex: 0 0 100%; min-height: 124px; display: flex; position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #172554, #1e3a8a); }
.dashboard-banner::before { content: ""; position: absolute; right: -60px; bottom: -100px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .055); }
.dashboard-banner.banner-indigo { background: linear-gradient(135deg, #252154, #4338ca); }
.dashboard-banner.banner-amber { background: linear-gradient(135deg, #3b2518, #78350f); }
.dashboard-banner.banner-green { background: linear-gradient(135deg, #12382f, #065f46); }
.dashboard-banner.banner-dark { background: linear-gradient(135deg, #17191e, #272a31); }
.dashboard-banner-content { position: relative; z-index: 2; width: 100%; padding: 14px 22px 20px; align-self: center; }
.dashboard-banner.has-image .dashboard-banner-content { width: 68%; }
.dashboard-banner h2 { max-width: 650px; margin: 0 0 4px; font-size: 20px; line-height: 1.18; }
.dashboard-banner p { max-width: 650px; margin: 0 0 8px; opacity: .82; white-space: pre-line; }
.dashboard-banner img { width: 32%; height: calc(100% - 24px); position: absolute; z-index: 2; right: 12px; top: 12px; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .22)); }
.dashboard-banner-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: #f97316; color: #fff; font-weight: 800; box-shadow: 0 5px 14px rgba(249, 115, 22, .25); }
.dashboard-banner-dots { position: absolute; z-index: 4; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 6px; }
.dashboard-banner-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .55); cursor: pointer; transition: width .2s, background .2s; }
.dashboard-banner-dots button.active { width: 20px; background: #fff; }
.dashboard-banner-admin-preview { display: block; width: 100%; max-width: 520px; max-height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.dashboard-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dashboard-quick-actions .btn { min-height: 44px; }
.renewal-near { color: var(--danger); font-weight: 700; }
.essential-document img { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; border: 1px solid var(--line); }
.essential-details { white-space: pre-line; margin-bottom: 10px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.video-card { margin-bottom: 0; }
.video-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin-bottom: 10px; background: #f2f4f7; }
.visiting-card { max-width: 420px; margin: 0 auto 16px; padding: 22px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #1e3a8a, #2563eb); box-shadow: 0 10px 28px rgba(16, 24, 40, .22); }
.visiting-card-top { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.visiting-card-top img, .visiting-card-initial { width: 52px; height: 52px; flex-shrink: 0; object-fit: contain; border-radius: 12px; background: #fff; }
.visiting-card-initial { display: grid; place-items: center; color: #1e3a8a; font-size: 22px; font-weight: 800; }
.visiting-card-person { margin: 18px 0 14px; }
.visiting-card-person h2 { margin: 0 0 2px; color: #fff; font-size: 24px; }
.visiting-card-lines { display: grid; gap: 5px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.visiting-card-actions { justify-content: center; margin-bottom: 18px; }
.visiting-card-qr { max-width: 420px; margin: 0 auto 18px; text-align: center; }
.visiting-card-qr [data-card-qr] { display: inline-block; padding: 10px; background: #fff; }
.visiting-card-page { max-width: 460px; margin: 0 auto; padding: 28px 16px; }
.dashboard-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dashboard-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px 6px; text-align: center; color: var(--text); font-size: 14px; font-weight: 700; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.dashboard-tile:hover { border-color: var(--accent); }
button.dashboard-tile { width: 100%; font-family: inherit; cursor: pointer; }
.dashboard-tile { position: relative; }
.dashboard-tile .nav-badge { position: absolute; top: 6px; right: 6px; margin: 0; }
.dashboard-tile svg { color: var(--accent); }
.dashboard-tiles.three-per-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.attendance-step { padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: #f2f4f7; font-weight: 600; }
.attendance-step.ok { background: #ecfdf3; color: #067647; }
.attendance-step.error { background: #fef3f2; color: #b42318; }
.attendance-selfie { cursor: pointer; margin-bottom: 10px; width: 100%; }
.attendance-preview { display: block; }
.attendance-preview[hidden] { display: none; }
.fingerprint-suggestion { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.fingerprint-suggestion[hidden] { display: none; }
.team-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.team-head-title { min-width: 0; }
.team-head h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.present-count { display: flex; align-items: baseline; gap: 4px; flex-shrink: 0; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.present-count strong { color: #027a48; font-size: 26px; line-height: 1; }
.team-progress { height: 6px; margin-bottom: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.team-progress span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.team-controls { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.team-controls input { min-width: 0; width: 100%; height: 40px; padding-top: 0; padding-bottom: 0; }
.team-controls .team-excel { display: flex; align-items: center; height: 40px; white-space: nowrap; }
.team-filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.team-filters::-webkit-scrollbar { display: none; }
.team-filters a { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.team-filters a i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.team-filters a.is-present i { background: var(--ok); }
.team-filters a.is-absent i { background: var(--danger); }
.team-filters a.is-late i, .team-filters a.is-break i { background: var(--warn); }
.team-filters a.is-leave i { background: var(--accent); }
.team-filters a b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #f2f4f7; font-size: 12px; text-align: center; }
.team-filters a.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.team-filters a.active i { background: #fff; }
.team-filters a.active b { background: rgba(255, 255, 255, .22); color: #fff; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-row { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; background: var(--panel); }
.team-row.is-present { border-left-color: var(--ok); }
.team-row.is-working { border-left-color: var(--warn); }
.team-row.is-absent, .team-row.is-rejected { border-left-color: var(--danger); }
.team-row.is-leave { border-left-color: var(--accent); }
.team-avatar { flex-shrink: 0; }
.team-avatar img, .team-row-initial { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.team-row-initial { display: grid; place-items: center; background: #f2f4f7; color: var(--muted); font-weight: 700; font-size: 16px; }
.team-row.is-absent .team-row-initial { background: #fef3f2; color: #b42318; }
.team-row.is-leave .team-row-initial { background: var(--accent-soft); color: var(--accent); }
.team-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.team-row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.team-row-name { min-width: 0; display: flex; flex-direction: column; }
.team-row-name strong { font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row-name .small { line-height: 1.3; }
.team-row-top .badge { flex-shrink: 0; margin-top: 1px; }
.team-row-times { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 700; }
.team-row-times span { padding: 3px 8px; border-radius: 8px; background: #f2f4f7; white-space: nowrap; }
.team-row-times em { font-style: normal; font-weight: 600; color: var(--muted); margin-right: 2px; }
.team-row-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.team-row-place { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row-note { font-style: italic; }
.team-empty { padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); }
[data-married-only][hidden] { display: none; }
.input-with-picker { position: relative; }
.input-with-picker input { width: 100%; padding-right: 46px; }
.contact-picker { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--accent); cursor: pointer; }
.contact-picker[hidden] { display: none; }
.header-language select { width: 92px; padding: 5px 6px; font-size: 13px; border-radius: 8px; }
.attendance-break { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.selfie-camera { position: fixed; inset: 0; z-index: 60; overflow: hidden; background: #000; }
.selfie-camera[hidden] { display: none; }
.selfie-camera video { width: 100%; height: 100%; object-fit: contain; transform: scaleX(-1); }
.selfie-oval { position: absolute; top: 50%; left: 50%; width: 60vw; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border: 3px dashed #fff; border-radius: 50%; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6); }
.selfie-oval.ready { border: 4px solid #32d583; }
.selfie-hint { position: absolute; top: calc(env(safe-area-inset-top) + 24px); left: 16px; right: 16px; color: #fff; font-weight: 700; text-align: center; }
.selfie-actions .btn:disabled { opacity: .5; }
.selfie-actions { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 24px); display: flex; justify-content: center; gap: 12px; }
.attendance-submit { width: 100%; padding: 14px; font-size: 16px; }
.attendance-submit:disabled { opacity: .5; cursor: not-allowed; }
input:disabled { background: #f2f4f7; color: var(--muted); cursor: not-allowed; }
.attendance-mark { display: inline-flex; gap: 8px; align-items: center; text-align: left; }
.attendance-mark img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }

/* Sales pipeline */
.stage-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.stage-tabs a { flex: 1; min-width: 96px; display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); }
.stage-tabs a span { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.stage-tabs a strong { font-size: 20px; }
.stage-tabs a small { color: var(--muted); }
.stage-tabs a.active { border-color: var(--accent); background: var(--accent-soft); }
.pipeline { display: flex; margin-bottom: 18px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pipeline div { flex: 1; padding: 9px 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel); border-right: 1px solid var(--line); }
.pipeline div:last-child { border-right: 0; }
.pipeline div.done { background: var(--accent); color: #fff; }
.quote-line { display: grid; grid-template-columns: 3fr 1fr 1fr 1.3fr 1fr 1.2fr; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quote-amount { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 700; padding-bottom: 10px; }
.quote-amount .reply-photo-remove { position: static; flex-shrink: 0; }
.quote-totals { margin: 14px 0; padding: 12px; border-radius: 12px; background: #f9fafb; max-width: 320px; margin-left: auto; }
.quote-totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.quote-totals .grand { font-size: 18px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.print-page { background: #e4e7ec; }
.print-toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 12px; }
.quote-sheet { max-width: 820px; margin: 0 auto 24px; background: #fff; padding: 36px; border-radius: 4px; box-shadow: 0 4px 24px rgba(16, 24, 40, .12); }
.quote-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--accent); padding-bottom: 16px; }
.quote-head h1 { font-size: 22px; }
.quote-meta { text-align: right; }
.quote-meta h2 { color: var(--accent); letter-spacing: .1em; margin-bottom: 6px; }
.quote-to { margin: 18px 0; }
.quote-table { margin-top: 10px; }
.slip-details { margin: 16px 0; }
.slip-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-top: 14px; }
.slip-net { margin-top: 16px; padding: 14px; border-radius: 10px; background: #f2f4f7; }
.slip-net > div:first-child { display: flex; justify-content: space-between; align-items: center; }
.slip-net strong { font-size: 20px; }
.quote-table th { background: #f2f4f7; }
.quote-table .num { text-align: right; white-space: nowrap; }
.quote-table tfoot td { border-bottom: 0; padding: 5px 12px; }
.quote-table tfoot .grand td { font-size: 17px; font-weight: 800; border-top: 2px solid var(--text); }
.quote-terms { margin-top: 22px; font-size: 13px; }
.quote-sign { margin-top: 40px; text-align: right; font-weight: 700; }
@media print {
    .no-print { display: none !important; }
    .print-page { background: #fff; }
    .quote-sheet { box-shadow: none; padding: 0; max-width: none; }
}

/* One-tap call / WhatsApp and the follow-up prompt after it */
.contact-action.whatsapp { color: #067647; border-color: #abefc6; }
.contact-quick { gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.contact-quick .btn { padding: 5px 9px; font-size: 12px; }
.call-prompt { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .22); }
.call-prompt[hidden] { display: none; }

/* Phone-only pieces stay out of the desktop layout. */
.tabbar, .mobile-only, .sidebar-account, .drawer-backdrop { display: none; }
.notify-prompt { width: 100%; margin-bottom: 14px; padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--accent); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    /* Stat tiles sit side by side like an app's summary row. */
    .grid-3:has(> .stat) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .grid-4:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 12px; }
    .stat span { font-size: 10px; }
    .stat strong { font-size: 20px; }

    .sidebar { position: fixed; left: -290px; width: 280px; z-index: 40; transition: left .2s; display: flex; flex-direction: column; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
    .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(16, 24, 40, .35); }
    .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(16, 24, 40, .45); }
    .sidebar-account { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #1d2939; color: #fff; }
    .sidebar-account .small { color: #98a2b3; }

    .menu-toggle { display: inline-block; }
    .dashboard-quick-actions { display: none; }
    .dashboard-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
    .topbar { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
    .topbar-right { gap: 11px; }
    .topbar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
    .dashboard-header-greeting strong { font-size: 17px; }
    .dashboard-header-greeting span { font-size: 11px; }
    .dashboard-company-mark { width: 40px; height: 40px; border-radius: 11px; cursor: pointer; }
    .content { padding: 14px; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
    .page-head h1 { font-size: 20px; }
    .card { padding: 14px; border-radius: 14px; }
    .dashboard-carousel { border-radius: 18px; }
    .dashboard-banner { min-height: 118px; }
    .dashboard-banner-content { padding: 12px 14px 18px; }
    .dashboard-banner.has-image .dashboard-banner-content { width: 69%; }
    .dashboard-banner h2 { font-size: 16px; }
    .dashboard-banner p { margin-bottom: 7px; font-size: 12px; line-height: 1.3; }
    .dashboard-banner img { width: 26%; height: calc(100% - 20px); right: 7px; top: 10px; }
    .dashboard-banner-link { padding: 4px 10px; font-size: 12px; }

    /* Bottom tab bar, like an installed app. */
    .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
    .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
    .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .tabbar .active { color: var(--accent); }
    .tabbar .tab-primary svg { width: 44px; height: 44px; margin-top: -20px; padding: 10px; border-radius: 50%; background: var(--accent); color: #fff; stroke-width: 2.4; box-shadow: 0 6px 16px rgba(37, 99, 235, .4); }
    .tabbar .tab-primary { color: var(--accent); }
    .install-banner { bottom: calc(72px + env(safe-area-inset-bottom)); }
    .call-prompt { bottom: calc(76px + env(safe-area-inset-bottom)); }

    /* Tables become a list of cards; JS copies each column name onto its cell. */
    .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
    .table-wrap thead { display: none; }
    .table-wrap tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .table-wrap tr:last-child { border-bottom: 0; }
    /* Label floats left, the value (one or more lines) sits on the right. */
    .table-wrap td { padding: 3px 0; border: 0; text-align: right; }
    .table-wrap td::after { content: ""; display: table; clear: both; }
    .table-wrap td[data-label]::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; text-align: left; padding-top: 2px; }
    .table-wrap td .progress { margin-left: auto; max-width: 160px; }
    /* The first cell is the card's title. */
    .table-wrap td:first-child { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
    .table-wrap td:first-child::before { display: none; }
    .table-wrap td:empty, .table-wrap td[data-label=""] { display: none; }
    .table-wrap td:not([data-label]):not(:first-child) { text-align: left; padding-top: 6px; }
    .task-row.red td:first-child, .task-row.orange td:first-child { box-shadow: none; }
    .task-row.red { box-shadow: inset 3px 0 var(--danger); padding-left: 10px; }
    .task-row.orange { box-shadow: inset 3px 0 var(--warn); padding-left: 10px; }

    /* 16px stops iPhone zooming into fields; bigger tap targets. */
    input[type=text], input[type=tel], input[type=url], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=month], input[type=search], select, textarea { font-size: 16px; padding: 11px 12px; }
    .btn { padding: 11px 16px; }
    .btn.sm { padding: 7px 12px; font-size: 13px; }
    .page-head > .btn, .page-head > .actions { width: 100%; }
    .page-head > .btn, .page-head > .actions > .btn, .page-head > .actions > form, .page-head > .actions > form > .btn { flex: 1; }
    .whatsapp-tool-toggle { padding: 16px; }
    .whatsapp-tool-body { margin: 0 16px; padding: 16px 0; }
    .whatsapp-number-card { padding: 14px; }
    .whatsapp-connection-actions { align-items: stretch; }
    .whatsapp-connection-actions form { flex: 1 1 150px; }
    .whatsapp-connection-actions .btn { width: 100%; }
    .whatsapp-add-number { grid-template-columns: 1fr; padding: 14px; }
    .whatsapp-add-number .btn { width: 100%; }

    dl.details { grid-template-columns: 1fr; }
    .kid-row { grid-template-columns: 1fr; }
    .quote-line { grid-template-columns: 1fr 1fr; }
    .quote-line .quote-item, .quote-line .quote-amount { grid-column: 1 / -1; }
    .quote-sheet { padding: 18px; border-radius: 0; }
    .slip-columns { grid-template-columns: 1fr; }
    .quote-head { flex-direction: column; }
    .quote-meta { text-align: left; }
    .quote-sheet .quote-table, .quote-sheet .quote-table tbody, .quote-sheet .quote-table tr, .quote-sheet .quote-table td { display: revert; }
    .quote-table { font-size: 12px; }
    .quote-table th, .quote-table td { padding: 6px 4px; }
}

.install-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); }
.install-banner[hidden] { display: none; }
.install-banner img { border-radius: 10px; flex-shrink: 0; }
.install-text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; }
.install-close { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.voice-task { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--accent-soft); border-color: #c7d7fe; }
.voice-task[hidden] { display: none; }
.voice-task-button { min-height: 44px; }
.voice-task-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 200px; }
.voice-task-countdown { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.voice-task-countdown[hidden] { display: none; }

/* Section heads in the rights lists (team member and designation forms). */
.rights-section { margin: 16px 0 6px; padding-bottom: 4px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
