:root {
  color-scheme: light;
  --bg: #f5f8f7;
  --text: #182420;
  --hint: #65756e;
  --card: #ffffff;
  --accent: #00ad8b;
  --button: #007e65;
  --button-text: #ffffff;
  --tint: #e9f6f1;
  --danger: #b13e42;
  --border: #dde7e2;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
main { max-width: 1160px; min-height: var(--tg-viewport-stable-height, 100vh); margin: 0 auto; padding: max(28px, var(--tg-content-safe-area-inset-top, 0px)) 36px calc(28px + env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 30px; font-weight: 550; letter-spacing: -1px; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.4px; margin-bottom: 20px; }
h3 { font-size: 15px; font-weight: 600; }
p { margin-bottom: 12px; }
small, .muted { color: var(--hint); }
a { color: var(--button); text-underline-offset: 3px; overflow-wrap: anywhere; }
button, select, input, textarea { font: inherit; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 10px 18px; font-weight: 600; color: var(--button-text); background: var(--button); cursor: pointer; transition: background .15s, border-color .15s; }
button:hover { background: #006b56; }
button.secondary { color: var(--text); background: var(--card); border-color: var(--border); }
button.secondary:hover { background: var(--tint); border-color: #aacfc0; }
button.danger { background: var(--danger); }
button.danger:hover { background: #962e32; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid #009575; outline-offset: 3px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke-width: 1.6; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 42px; flex-shrink: 0; }
.wordmark { font-size: 28px; line-height: 1.1; letter-spacing: 3px; font-weight: 350; white-space: nowrap; }
.wordmark span { color: #a9bbb2; margin: 0 6px; font-weight: 300; }
.brand-caption { margin-top: 6px; font-size: 9px; font-weight: 650; letter-spacing: 2px; color: var(--hint); text-transform: uppercase; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: #e0efe8; color: #27624f; font-weight: 600; }
.account-details { display: grid; font-size: 12px; min-width: 0; }
.account-details strong { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-details small { font-size: 11px; }
nav { display: flex; gap: 5px; padding: 6px; background: #eaf0ed; border-radius: 12px; margin-bottom: 30px; }
nav button { flex: 1; min-width: 0; padding: 10px 8px; border: 0; background: transparent; color: var(--hint); font-size: 13px; font-weight: 500; white-space: nowrap; }
nav button:hover { background: #dfeae4; }
nav button.active { background: var(--card); color: var(--button); box-shadow: 0 2px 5px #193e2010; font-weight: 650; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--button); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 34px 36px; background: #e8f3ed; border: 1px solid #d4e8dd; border-radius: 16px; }
.hero-copy { position: relative; z-index: 1; max-width: 530px; }
.hero h1 { margin: 18px 0 12px; font-size: clamp(30px, 4.5vw, 44px); line-height: 1.12; font-weight: 400; letter-spacing: -1.7px; }
.hero h1 span { color: var(--button); }
.hero p { color: #526d60; max-width: 400px; font-size: 14px; line-height: 1.7; margin-bottom: 22px; }
.hero-art { width: 190px; height: 195px; flex-shrink: 0; color: #a9d8c5; }
.date-tag { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #d0e3d8; border-radius: 6px; padding: 6px 10px; font-size: 11px; color: #3a5d4c; }
.date-tag .icon { width: 15px; height: 15px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-heading h2 { font-size: 16px; margin: 0; }
.section-heading small { font-size: 11px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.quick-action { display: flex; justify-content: flex-start; align-items: flex-start; gap: 14px; text-align: left; padding: 22px; background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 13px; }
.quick-action:hover { background: #fafffc; border-color: #99cdb7; }
.icon-box { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--tint); color: var(--button); flex-shrink: 0; }
.quick-action strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.quick-action small { display: block; font-size: 12px; font-weight: 400; line-height: 1.6; }
.action-arrow { margin-left: auto; align-self: center; color: #7f9c8c; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.org-card { display: flex; align-items: center; gap: 12px; padding: 18px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.org-monogram { display: grid; place-items: center; width: 46px; height: 46px; background: #eef4f0; border-radius: 9px; color: #4b6558; font-size: 12px; letter-spacing: 1px; flex-shrink: 0; }
.org-card strong { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.org-card small { display: block; font-size: 11px; margin-top: 2px; }
.org-card .status-dot { margin-left: auto; flex-shrink: 0; }
.info-strip { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0 0; padding: 15px 18px; color: var(--hint); font-size: 12px; border: 1px dashed #cfdfd5; border-radius: 10px; }
.info-strip .icon { width: 17px; height: 17px; color: var(--button); margin-top: 1px; }
.info-strip p { margin: 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 26px; margin: 16px 0; }
.card > .muted { font-size: 13px; }
.grid { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
label { display: grid; align-content: start; gap: 7px; font-size: 12px; font-weight: 550; margin: 7px 0; color: #4f6157; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; color: var(--text); background: #fafcfb; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-weight: 400; font-size: 14px; }
input:hover, select:hover, textarea:hover { border-color: #aecab9; }
input:focus, select:focus, textarea:focus { border-color: var(--button); background: var(--card); }
input::placeholder, textarea::placeholder { color: #829188; }
select[multiple] { min-height: 105px; }
select[multiple] option { padding: 5px 8px; border-radius: 4px; }
textarea { min-height: 100px; resize: vertical; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
form + form { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.hidden, [hidden] { display: none !important; }
.notice { border: 1px solid #baddca; border-radius: 10px; padding: 14px 16px; margin: 16px 0; background: var(--tint); color: #245b44; font-size: 13px; overflow-wrap: anywhere; }
.notice.error { border-color: #f0cace; background: #fff1f2; color: #963238; }
.table-wrap { overflow: auto; max-height: 65vh; border: 1px solid var(--border); border-radius: 10px; margin-top: 18px; }
table { border-collapse: collapse; width: 100%; min-width: 780px; font-size: 12px; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); padding: 13px 14px; }
th { position: sticky; top: 0; background: #eef5f0; font-size: 11px; font-weight: 600; color: #4b6859; z-index: 1; }
tbody tr:nth-child(even) { background: #fafcfb; }
tbody tr:hover { background: #f0f8f3; }
.badge { display: inline-block; border-radius: 5px; padding: 4px 8px; font-size: 11px; white-space: nowrap; background: #e7f3eb; color: #286343; }
.badge.absent { background: #fcecec; color: #963b40; }
.record-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.record-row p { margin: 0; overflow-wrap: anywhere; }
.record-row small { display: block; margin-top: 3px; }
#users-list, #absence-list { margin-top: 28px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 24px 0 0; margin-top: 8px; color: #74867a; font-size: 10px; letter-spacing: .4px; }
.footer-brand { color: #466951; letter-spacing: 1.5px; }
.loading { min-height: 65vh; display: grid; place-content: center; text-align: center; color: var(--hint); }
.loading p { margin-top: 16px; font-size: 13px; }
.spinner { width: 30px; height: 30px; margin: auto; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  main { padding-inline: 20px; padding-top: max(20px, var(--tg-content-safe-area-inset-top, 0px)); }
  .account-details { max-width: 160px; }
  .hero { padding: 26px; }
  .hero-art { width: 125px; height: 155px; }
  .quick-action { padding: 18px; gap: 10px; }
  .action-arrow { display: none; }
  nav { margin-bottom: 22px; }
  nav button { flex-direction: column; gap: 5px; font-size: 10px; padding: 9px 3px; }
}
@media (max-width: 480px) {
  body { font-size: 13px; }
  main { padding-inline: 14px; }
  .masthead { gap: 10px; padding-bottom: 18px; }
  .brand { gap: 8px; }
  .brand-mark { width: 27px; height: 34px; }
  .wordmark { font-size: 21px; letter-spacing: 2px; }
  .wordmark span { margin: 0 2px; }
  .brand-caption { font-size: 7px; letter-spacing: 1.4px; }
  .account { gap: 6px; }
  .avatar { display: none; }
  .account-details { max-width: 130px; text-align: right; font-size: 11px; }
  .account-details small { font-size: 9px; }
  .hero { padding: 24px; }
  .hero-art { position: absolute; right: -30px; bottom: -20px; opacity: .27; width: 150px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 13px; max-width: 250px; }
  .hero .actions button { padding-inline: 14px; font-size: 12px; }
  .quick-grid { grid-template-columns: 1fr; gap: 10px; }
  .quick-action { padding: 18px; }
  .action-arrow { display: block; }
  .org-grid { grid-template-columns: 1fr; gap: 8px; }
  .org-card { padding: 13px 16px; }
  .org-monogram { width: 38px; height: 38px; }
  .card { padding: 20px 16px; }
  .grid { grid-template-columns: 1fr; gap: 3px; }
  input, select, textarea { font-size: 16px; }
  .section-heading { margin-top: 24px; }
  .section-heading small { font-size: 10px; }
  .record-row { align-items: flex-start; }
  .record-row button { font-size: 12px; padding-inline: 12px; }
  .app-footer { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
