:root {
  --primary: #0d9488;
  --sidebar: #0f172a;
  --accent: #f59e0b;
  --coral: #f97360;
  --ink: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --bg: #f7f9fc;
  --danger: #c53030;
  --success: #15803d;
  --shadow: 0 12px 34px rgba(15, 23, 42, .075);
  --shadow-lg: 0 28px 80px rgba(15, 23, 42, .18);
  --app-font: "Poppins", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading-font: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--app-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); }
h1, h2, .hero h2, .login-brand h1 { font-family: var(--heading-font); letter-spacing: -.015em; }
.hidden { display: none !important; }

/* Glassmorphism login */
.login-view {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 20%, rgba(13, 148, 136, .28), transparent 34%),
    radial-gradient(circle at 84% 78%, rgba(245, 158, 11, .28), transparent 30%),
    linear-gradient(140deg, #e7f7f5 0%, #f7f9fc 46%, #fff5df 100%);
}
.login-view::before,
.login-view::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(8px);
  opacity: .5;
}
.login-view::before { left: -130px; bottom: -90px; background: #5eead4; }
.login-view::after { right: -120px; top: -100px; background: #fbbf24; }
.login-card {
  width: min(960px, 100%);
  min-height: 570px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 30px;
  background: rgba(255, 255, 255, .68);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(140%);
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px;
  color: #fff;
  text-align: center;
  background: linear-gradient(155deg, rgba(13, 148, 136, .92), rgba(15, 23, 42, .96)), var(--sidebar);
}
.login-brand img {
  width: min(280px, 84%);
  height: 230px;
  margin-bottom: 26px;
  padding: 17px;
  border-radius: 26px;
  background: rgba(255, 255, 255, .96);
  object-fit: contain;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}
.login-brand span { color: #99f6e4; font-size: 12px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; }
.login-brand h1 { margin: 6px 0 2px; font-size: clamp(36px, 5vw, 48px); }
.login-brand p { margin: 0; color: #d7fffa; font-size: 17px; }
.login-card form { display: flex; flex-direction: column; justify-content: center; padding: 64px 56px; }
.login-card h2 { margin: 0 0 7px; font-size: 34px; }
.login-card form > p { margin: 0 0 30px; color: var(--muted); }
.login-card label,
.form-grid label { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; font-size: 12px; font-weight: 750; }
.login-card small { margin-top: 20px; color: var(--muted); line-height: 1.6; }

/* Application shell */
.app { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 280px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  color: #fff;
  background: radial-gradient(circle at 0 100%, rgba(13, 148, 136, .25), transparent 38%), linear-gradient(180deg, var(--sidebar), #111c32);
  box-shadow: 8px 0 30px rgba(15, 23, 42, .08);
}
.brand { display: flex; align-items: center; gap: 13px; padding: 4px 10px 23px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand img { width: 56px; height: 56px; padding: 4px; border-radius: 14px; background: #fff; object-fit: contain; }
.brand strong { display: block; font-family: var(--heading-font); font-size: 21px; }
.brand span { display: block; margin-top: 2px; color: #99f6e4; font-size: 12px; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; overflow: auto; padding: 18px 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.24) transparent; }
.nav-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 0;
  border-radius: 12px;
  color: #dce5f2;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 650;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .09); transform: translateX(2px); }
.nav-item.active { color: #fff; background: linear-gradient(105deg, var(--primary), #0f766e); box-shadow: 0 9px 20px rgba(13, 148, 136, .24); }
.nav-item span:first-child { width: 22px; color: #5eead4; text-align: center; }
.nav-item.active span:first-child { color: #fff; }
.side-user { margin-top: auto; padding: 16px 8px 0; display: grid; grid-template-columns: 40px 1fr 32px; gap: 9px; align-items: center; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-user .avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #3a2600; background: var(--accent); font-weight: 850; }
.side-user strong, .side-user span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-user strong { font-size: 13px; }
.side-user span { color: #a8b7cb; font-size: 11px; }
.side-user button { border: 0; color: #fff; background: transparent; cursor: pointer; font-size: 23px; }
.workspace { min-height: 100vh; margin-left: 280px; }
.topbar { position: sticky; top: 0; z-index: 10; height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 18px 38px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px); }
.topbar span { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.topbar h1 { margin: 2px 0 0; font-size: 25px; }
.secure { color: var(--muted); font-size: 12px; }
.content { max-width: 1800px; margin: auto; padding: 32px 38px 56px; }
.mobile-head { display: none; }

/* Content surfaces */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 154px;
  padding: 30px 34px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(115deg, var(--sidebar), var(--primary));
  box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
}
.hero::after { content: ""; position: absolute; right: -45px; bottom: -92px; width: 270px; height: 270px; border-radius: 50%; border: 45px solid rgba(255,255,255,.08); }
.hero > * { position: relative; z-index: 1; }
.hero h2 { margin: 8px 0 5px; font-size: clamp(27px, 3.2vw, 38px); }
.hero p { margin: 0; color: #d9fffa; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 22px 0; }
.stat, .panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.stat { position: relative; min-height: 142px; padding: 22px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(15, 23, 42, .11); }
.stat::after { content: ""; position: absolute; inset: auto -28px -42px auto; width: 115px; height: 115px; border-radius: 50%; background: rgba(13,148,136,.07); }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; float: right; border-radius: 12px; color: #fff; background: var(--primary); font-size: 18px; }
.stat-icon.gold { color: #4b3100; background: var(--accent); }
.stat-icon.coral { background: var(--coral); }
.stat span { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat strong { display: block; margin-top: 8px; font-size: 34px; line-height: 1.1; }
.panel { margin-bottom: 20px; padding: 23px; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel h2 { margin: 0; font-size: 23px; }
.panel h3 { margin: 0 0 12px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.info-tile { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfe; }

/* Controls */
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; color: var(--sidebar); background: #e7f6f4; font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.badge.orange { color: #8a5400; background: #fff2ce; }
.badge.green { color: #166534; background: #dcfce7; }
.badge.red { color: #991b1b; background: #fee2e2; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.toolbar label, .balance-controls label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 750; }
.toolbar input, .toolbar select { min-width: 160px; }
.primary, .secondary, .danger, .ghost {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.primary { color: #fff; background: linear-gradient(115deg, var(--primary), #0f766e); box-shadow: 0 8px 18px rgba(13, 148, 136, .18); }
.secondary { color: #0f5f59; background: #e3f5f3; }
.danger { color: var(--danger); background: #fff0f0; }
.ghost { color: var(--ink); border-color: var(--line); background: #fff; }
.primary:hover, .secondary:hover, .danger:hover, .ghost:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,23,42,.1); }
button:disabled { cursor: not-allowed; opacity: .45; transform: none !important; box-shadow: none !important; }
.wide { width: 100%; padding: 13px; }
.icon-button { min-height: 34px; padding: 7px 10px; border-radius: 9px; }
.button-link { white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea, .login-card input, .toolbar input, .toolbar select, .balance-controls input, .balance-controls select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}
textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .login-card input:focus, .toolbar input:focus, .toolbar select:focus, .balance-controls input:focus, .balance-controls select:focus {
  outline: 3px solid rgba(13, 148, 136, .16);
  border-color: var(--primary);
}
.checks { display: flex; flex-wrap: wrap; gap: 13px; margin: 6px 0 17px; }
.checks label { display: flex; align-items: center; gap: 7px; font-size: 12px; }

/* Data tables and rosters */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.data-table, .roster { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.data-table th, .data-table td, .roster th, .roster td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
.data-table th, .roster th { position: sticky; top: 0; z-index: 1; color: #334155; background: #eef5f5; font-weight: 800; white-space: nowrap; }
.data-table tbody tr:hover > td { background: #fbfdfd; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.actions { white-space: nowrap; }
.empty { padding: 32px; color: var(--muted); text-align: center; }
.roster th, .roster td { min-width: 77px; border-right: 1px solid var(--line); text-align: center; }
.roster .name { position: sticky; left: 0; z-index: 2; min-width: 210px; background: #fff; text-align: left; }
.roster th.name { z-index: 4; background: #e0f2f1; }
.roster select { width: 62px; padding: 8px 4px; border: 1px solid #cbd5e1; border-radius: 9px; color: var(--ink); background: #fff; font-weight: 800; }
.roster select.shift-off, .roster-code.shift-off { color: #991b1b; border-color: #f3caca; background: #fdecec !important; }
.roster select.shift-off:hover, .roster select.shift-off:focus { background: #fadede !important; box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.roster select.shift-rec, .roster-code.shift-rec { color: #2563eb !important; background: #fff !important; }
.roster .weekend { background: #fff5cf; }
.roster-review-card { border-color: var(--line) !important; background: #fbfcfe !important; }
.roster-code { min-width: 38px; display: inline-flex; justify-content: center; padding: 5px 7px; border-radius: 8px; color: var(--ink); background: #fff; font-weight: 850; }

/* Leave balance directory */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-bottom: 20px; }
.balance { padding: 15px; border-left: 5px solid var(--primary); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.balance span { display: block; color: var(--muted); font-size: 11px; }
.balance strong { font-size: 25px; }
.balance-controls { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) 110px auto; align-items: end; gap: 12px; margin-bottom: 15px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #f8fbfb; }
.balance-controls label { margin: 0; }
.balance-control-actions { display: flex; align-items: end; gap: 8px; }
.balance-directory .data-table { min-width: 850px; }
.person-summary td { vertical-align: middle; }
.balance-toggle { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #b9ddd8; border-radius: 9px; color: var(--primary); background: #eefaf8; cursor: pointer; font-size: 19px; line-height: 1; font-weight: 700; }
.balance-detail-row > td { padding: 15px !important; background: #f8fafc !important; }
.leave-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.leave-type-card { position: relative; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--leave-color, var(--primary)); border-radius: 13px; background: #fff; }
.leave-type-card > div > strong, .leave-type-card > div > span { display: block; }
.leave-type-card > div > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.leave-type-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.leave-type-card dl div { min-width: 0; }
.leave-type-card dt { overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.leave-type-card dd { margin: 2px 0 0; font-weight: 800; }
.leave-type-card button { justify-self: start; }
.negative { color: var(--danger); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 16px 0 0; color: var(--muted); font-size: 12px; }

/* Notifications */
.notification-list { display: grid; gap: 10px; }
.notification-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: border .18s ease, transform .18s ease; }
.notification-card:hover { transform: translateY(-1px); }
.notification-card.is-unread { border-color: #f6c35e; background: linear-gradient(100deg, #fff9e9, #fff); }
.notification-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--primary); font-weight: 900; }
.notification-card.is-unread .notification-icon { color: #493000; background: var(--accent); }
.notification-copy p { margin: 5px 0 0; }
.notification-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }

/* Shared utilities and modal */
.muted { color: var(--muted); font-size: 12px; }
.toast { position: fixed; top: 22px; right: 22px; z-index: 100; max-width: 430px; padding: 13px 18px; border-radius: 12px; color: #fff; background: var(--sidebar); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-90px); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #991b1b; }
dialog { width: min(720px, calc(100% - 24px)); max-height: calc(100vh - 28px); overflow: auto; padding: 0; border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(15, 23, 42, .62); backdrop-filter: blur(3px); }
.dialog-card { margin: 0; padding: 0; }
.dialog-card > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 17px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-card > header h2 { margin: 0; font-size: 22px; }
.dialog-card > header button { width: 38px; height: 38px; border: 0; border-radius: 10px; color: var(--ink); background: #f1f5f9; cursor: pointer; font-size: 26px; line-height: 1; }
.dialog-card > #dialog-body { padding: 22px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.quick-note { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--primary); border-radius: 9px; color: var(--muted); background: #eef8f7; font-size: 11px; }
.section-label { margin: 22px 0 9px; color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.report-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.report-buttons a { text-decoration: none; }
.status-dot { width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--success); }
.status-dot.off { background: #94a3b8; }

/* v5.1 roster period controls and exports */
.roster-period-bar { align-items: end; padding: 14px; border: 1px solid #d8ebe8; border-radius: 15px; background: linear-gradient(115deg, #f5fbfa, #fffaf0); }
.date-range-chip { min-height: 42px; display: inline-flex; align-items: center; padding: 9px 13px; border: 1px solid #bfe2dd; border-radius: 11px; color: #0f5f59; background: #e8f7f5; font-size: 11px; font-weight: 850; white-space: nowrap; }
.readonly-date { color: #475569 !important; background: #f1f5f9 !important; }
.inline-check { min-height: 42px; flex-direction: row !important; align-items: center; padding: 0 9px; border-radius: 10px; background: rgba(255,255,255,.72); }
.inline-check input { min-width: 0 !important; width: auto !important; min-height: 0 !important; }
.export-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 15px; border: 1px solid transparent; border-radius: 11px; color: #fff; cursor: pointer; font-weight: 800; transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; }
.export-button::before { font-size: 13px; }
.export-button.excel { background: linear-gradient(115deg, #15803d, #0f6b34); box-shadow: 0 8px 18px rgba(21,128,61,.17); }
.export-button.excel::before { content: "X"; }
.export-button.pdf { background: linear-gradient(115deg, #dc4b42, #b91c1c); box-shadow: 0 8px 18px rgba(185,28,28,.16); }
.export-button.pdf::before { content: "PDF"; font-size: 9px; }
.export-button:hover { transform: translateY(-2px); filter: saturate(1.08); box-shadow: 0 12px 24px rgba(15,23,42,.16); }

/* Status categories: Pending opens first */
.request-tabs { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 9px; margin: 4px 0 18px; }
.request-tab { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; color: #475569; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.request-tab strong { min-width: 25px; padding: 3px 7px; border-radius: 999px; color: var(--sidebar); background: #eef2f7; text-align: center; }
.request-tab:hover { transform: translateY(-2px); border-color: #91d1c9; box-shadow: 0 9px 21px rgba(13,148,136,.1); }
.request-tab.active { color: #fff; border-color: var(--primary); background: linear-gradient(115deg, var(--primary), #0f766e); box-shadow: 0 10px 23px rgba(13,148,136,.2); }
.request-tab.active strong { color: #0f5f59; background: #fff; }
.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 11px 13px; border-radius: 12px; background: #f8fafc; }
.queue-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.queue-heading span { color: var(--muted); font-size: 11px; }

/* Separate protected Master Administrator dashboard */
.master-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 190px; padding: 33px 36px; border: 1px solid rgba(245,158,11,.35); border-radius: 25px; color: #fff; background: radial-gradient(circle at 85% 18%, rgba(245,158,11,.3), transparent 30%), radial-gradient(circle at 6% 100%, rgba(13,148,136,.48), transparent 35%), linear-gradient(120deg, #0f172a, #16243d); box-shadow: 0 24px 60px rgba(15,23,42,.2); }
.master-hero::after { content: ""; position: absolute; z-index: -1; right: -85px; top: -125px; width: 330px; height: 330px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 70px rgba(245,158,11,.22); animation: masterGlow 5s ease-in-out infinite alternate; }
.master-kicker { color: #5eead4; font-size: 10px; font-weight: 900; letter-spacing: .22em; }
.master-hero h2 { margin: 8px 0 6px; font-size: clamp(32px, 4vw, 48px); }
.master-hero p { max-width: 720px; margin: 0; color: #dce8f6; }
.master-version { min-width: 150px; padding: 16px 19px; border: 1px solid rgba(255,255,255,.17); border-radius: 17px; background: rgba(255,255,255,.08); backdrop-filter: blur(12px); }
.master-version span, .master-version strong { display: block; }
.master-version span { color: #fcd77e; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.master-version strong { margin-top: 4px; font-size: 23px; }
.master-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 21px 0; }
.master-stat { width: 100%; min-height: 145px; padding: 20px; border: 1px solid #dbe7e5; border-top: 3px solid var(--primary); border-radius: 17px; color: inherit; background: #fff; box-shadow: var(--shadow); cursor: pointer; text-align: left; animation: riseIn .42s both; }
.master-stat:nth-child(2) { animation-delay: .04s; }.master-stat:nth-child(3) { animation-delay: .08s; }.master-stat:nth-child(4) { animation-delay: .12s; }.master-stat:nth-child(5) { animation-delay: .16s; }.master-stat:nth-child(6) { animation-delay: .2s; }
.master-stat.warning { border-top-color: var(--accent); }.master-stat.coral { border-top-color: var(--coral); }
.master-stat > span, .master-stat small { display: block; color: var(--muted); }
.master-stat > span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.master-stat > strong { display: block; margin: 8px 0 7px; color: var(--sidebar); font-size: 32px; line-height: 1; }
.master-stat > strong em { color: #94a3b8; font-size: 17px; font-style: normal; }
.master-stat small { font-size: 10px; }
.master-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 19px; }
.master-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.master-action-grid button { display: grid; grid-template-columns: 41px 1fr; grid-template-rows: auto auto; column-gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fbfdfd; cursor: pointer; text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.master-action-grid button > span { grid-row: 1 / 3; width: 41px; height: 41px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--primary), #0f766e); font-size: 18px; }
.master-action-grid button strong { align-self: end; }.master-action-grid button small { color: var(--muted); }
.master-action-grid button:hover { transform: translateY(-2px); border-color: #84cdc4; box-shadow: 0 12px 25px rgba(13,148,136,.11); }
.master-status dl { margin: 0; }.master-status dl > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }.master-status dl > div:last-child { border-bottom: 0; }.master-status dt { color: #475569; font-weight: 700; }.master-status dd { margin: 0; }
.hr-command-hero { background: radial-gradient(circle at 85% 18%, rgba(245,158,11,.22), transparent 30%), radial-gradient(circle at 6% 100%, rgba(13,148,136,.58), transparent 35%), linear-gradient(120deg, #0b3b4a, #0f172a); }

/* Glass dashboard detail popup */
.dashboard-detail-dialog { width: min(1040px, calc(100% - 26px)); border: 1px solid rgba(255,255,255,.75); background: rgba(247,249,252,.88); backdrop-filter: blur(22px) saturate(135%); }
.dashboard-detail-dialog::backdrop { background: radial-gradient(circle at 18% 15%, rgba(13,148,136,.28), transparent 34%), radial-gradient(circle at 84% 82%, rgba(245,158,11,.2), transparent 32%), rgba(15,23,42,.68); backdrop-filter: blur(8px); }
.dashboard-detail-dialog .dialog-card > header { background: rgba(255,255,255,.84); backdrop-filter: blur(18px); }
.dashboard-detail-dialog .table-wrap { max-height: min(58vh, 560px); box-shadow: 0 18px 45px rgba(15,23,42,.08); }
.dashboard-detail-summary { margin-bottom: 14px; padding: 14px 16px; border: 1px solid rgba(13,148,136,.2); border-radius: 14px; background: linear-gradient(120deg, rgba(231,246,244,.88), rgba(255,248,229,.82)); }
.dashboard-detail-summary span { color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.dashboard-detail-summary p { margin: 5px 0 0; color: #475569; }
.dashboard-detail-loading { min-height: 180px; display: grid; place-items: center; color: var(--muted); }
.dashboard-detail-close { margin-top: 15px; }

/* Subtle edge lighting and motion */
.edge-card { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.panel.edge-card:hover, .roster-review-card.edge-card:hover, .stat.edge-card:hover, .master-stat.edge-card:hover { transform: translateY(-2px); border-color: rgba(13,148,136,.45); box-shadow: 0 17px 40px rgba(13,148,136,.11), 0 0 0 1px rgba(13,148,136,.08); }
.master-hero.edge-card:hover { transform: translateY(-2px); box-shadow: 0 26px 65px rgba(15,23,42,.24), 0 0 30px rgba(13,148,136,.13); }
@keyframes riseIn { from { opacity: 0; transform: translateY(11px); } to { opacity: 1; transform: none; } }
@keyframes masterGlow { from { transform: scale(.94); opacity: .55; } to { transform: scale(1.05); opacity: 1; } }

@media (max-width: 1100px) {
  .sidebar { width: 238px; }
  .workspace { margin-left: 238px; }
  .content { padding: 25px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-controls { grid-template-columns: 1fr 1fr; }
  .master-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .master-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .login-view { padding: 14px; }
  .login-card { min-height: auto; grid-template-columns: 1fr; border-radius: 23px; }
  .login-brand { padding: 26px; }
  .login-brand img { height: 125px; margin-bottom: 11px; }
  .login-brand h1 { font-size: 31px; }
  .login-card form { padding: 32px 27px; }
  .sidebar { width: min(290px, 88vw); transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .workspace { margin-left: 0; padding-top: 62px; }
  .mobile-head { position: fixed; inset: 0 0 auto 0; z-index: 15; height: 62px; display: flex; align-items: center; gap: 12px; padding: 8px 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
  .mobile-head button { border: 0; background: transparent; font-size: 23px; }
  .mobile-head img { width: 40px; height: 40px; object-fit: contain; }
  .topbar { position: static; height: auto; padding: 16px 20px; }
  .secure { display: none; }
  .content { padding: 18px 14px 40px; }
  .cards { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; padding: 25px 23px; }
  .hero .badge:last-child { display: none; }
  .panel { padding: 16px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; }
  .toolbar label, .toolbar input, .toolbar select, .toolbar button, .toolbar a { width: 100%; }
  .form-grid, .split, .balance-controls { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .balance-control-actions, .balance-control-actions a { width: 100%; }
  .pagination { flex-wrap: wrap; }
  .request-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-period-bar .date-range-chip { width: 100%; justify-content: center; }
  .master-hero { align-items: flex-start; flex-direction: column; padding: 27px 23px; }
  .master-version { width: 100%; }
  .master-stat-grid, .master-action-grid { grid-template-columns: 1fr; }
  .notification-card { grid-template-columns: 38px 1fr; align-items: start; }
  .notification-action { grid-column: 2; }
  .dialog-card > #dialog-body { padding: 18px; }
  .data-table th, .data-table td { padding: 9px; }
  .roster .name { min-width: 155px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.site-copyright {
  color: #64748b;
  font-size: 12px;
  letter-spacing: .04em;
  text-align: center;
  padding: 14px 18px;
}
.login-card .site-copyright { grid-column: 1 / -1; border-top: 1px solid rgba(226,232,240,.7); background: rgba(255,255,255,.48); }
.workspace { display: flex; flex-direction: column; }
.workspace .content { flex: 1 0 auto; }
.app-copyright { margin-top: auto; border-top: 1px solid #e2e8f0; background: rgba(255,255,255,.72); }
.participant-type { display: inline-flex; margin-top: 5px; padding: 3px 8px; border-radius: 999px; background: #e6f5f3; color: #0f766e; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.participant-section-title { margin: 22px 0 10px; color: #0f172a; font-family: var(--display-font); }
