:root {
  color-scheme: light;
  --ink: #25202d;
  --muted: #625b6c;
  --surface: #fff;
  --page: #f6f5f9;
  --line: #e5e0eb;
  --nav: #252033;
  --accent: #553578;
  --accent-deep: #41265f;
  --gold: #e5c887;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.45rem); line-height: 1.16; letter-spacing: -.045em; }
h2 { font-size: 1.12rem; letter-spacing: -.015em; }
a { color: var(--accent); text-decoration: none; font-weight: 650; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8f64c6; outline-offset: 3px; }
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.shell main { width: 100%; max-width: 99rem; padding: 2.7rem clamp(1.3rem, 3.9vw, 4.25rem); }
.sidebar {
  background: var(--nav); color: #fff; padding: 1.8rem 1rem 1.2rem;
  display: flex; flex-direction: column; align-self: start; min-height: 100vh;
  position: sticky; top: 0;
}
.brand, .login-brand { display: flex; align-items: center; gap: .75rem; letter-spacing: .115em; font-weight: 750; }
.brand { color: #fff; margin: 0 .5rem 2.65rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 2.45rem; height: 2.45rem; display: grid; place-items: center;
  background: #3c2d49; border: 1px solid #806b79; color: var(--gold);
  font: 1.45rem Georgia, serif; border-radius: .68rem; letter-spacing: 0; flex: 0 0 auto;
}
.brand small { color: #d3c8dd; display: block; font-size: .8rem; letter-spacing: normal; font-weight: 500; }
.sidebar nav { display: grid; gap: .32rem; }
.sidebar nav a {
  color: #e0dbe8; display: flex; gap: .75rem; align-items: center;
  padding: .64rem .82rem; border-radius: .56rem; font-size: .94rem; font-weight: 600;
}
.sidebar nav a:hover { background: #352b47; text-decoration: none; }
.sidebar nav a.selected { background: #413051; color: #fff; }
.symbol { position: relative; width: 1rem; height: 1rem; display: inline-block; flex: 0 0 auto; color: #c5accf; }
.symbol::before, .symbol::after { content: ""; display: block; position: absolute; }
.symbol.home::before { inset: 1px; border: 1.5px solid; border-radius: 3px; }
.symbol.home::after { inset: 5px 4px; border-top: 1.5px solid; border-bottom: 1.5px solid; }
.symbol.staff::before { width: 5px; height: 5px; inset: 0 auto auto 4px; border: 1.5px solid; border-radius: 50%; }
.symbol.staff::after { inset: 8px 1px 0; border: 1.5px solid; border-radius: 6px 6px 2px 2px; }
.symbol.doc::before { inset: 0 2px; border: 1.5px solid; border-radius: 2px; }
.symbol.doc::after { inset: 5px 5px; border-top: 1.5px solid; border-bottom: 1.5px solid; }
.symbol.leave::before { inset: 2px 0 0; border: 1.5px solid; border-radius: 3px; }
.symbol.leave::after { inset: 6px 0 auto; border-top: 1.5px solid; }
.account-bar { margin-top: auto; padding: 1.05rem .55rem 0; border-top: 1px solid #52465e; }
.account-name { font-weight: 700; overflow-wrap: anywhere; }
.account-role, .account-actions { color: #d3c8dd; font-size: .85rem; }
.account-actions { display: flex; gap: 1rem; align-items: center; margin-top: .6rem; }
.account-actions a, .account-actions button { color: #efe4f7; }
.account-actions button { padding: .2rem 0; border: 0; min-height: 0; background: none; }
.account-actions button:hover { text-decoration: underline; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; margin-bottom: 1.75rem; }
.page-header p { color: var(--muted); margin-top: .45rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.metric, .panel, .login { background: var(--surface); border: 1px solid var(--line); border-radius: .88rem; }
.metric { min-height: 7rem; padding: 1rem 1.13rem; display: flex; flex-direction: column; justify-content: space-between; gap: .25rem; color: var(--ink); }
.metric span { color: var(--muted); font-size: .9rem; font-weight: 650; }
.metric strong { color: var(--ink); font-size: 2rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
a.metric:hover, a.store-tile:hover { text-decoration: none; border-color: #a987bd; background: #faf7fe; }
.panel { padding: 1.3rem; }
.store-panel { margin-bottom: 1.4rem; }
.stores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.store-tile { border: 1px solid var(--line); border-radius: .6rem; padding: .72rem .83rem; display: grid; }
.store-tile strong { font-weight: 700; color: var(--ink); }
.store-tile span { font-size: .87rem; color: var(--muted); }
.section-table { padding: 0; overflow: hidden; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; }
.section-pad { padding: 0 1.3rem 1.3rem; }
.section-pad p { margin-bottom: .8rem; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .93rem; }
th, td { padding: .78rem 1rem; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 1.3rem; }
th:last-child, td:last-child { padding-right: 1.3rem; }
thead th { background: #faf9fc; color: #574d63; font-weight: 650; white-space: nowrap; }
td small, .history small { display: block; color: var(--muted); font-size: .82rem; }
td.strong { font-weight: 650; }
.badge {
  display: inline-flex; align-items: center; min-height: 1.75rem; white-space: nowrap;
  padding: .12rem .55rem; font-size: .82rem; font-weight: 700; border-radius: .35rem;
  background: #f0edf3; color: #574c62;
}
.badge.manager, .badge.pending { background: #fff1d9; color: #77521a; }
.badge.center { background: #eee4f9; color: #503172; }
.badge.approved, .badge.present { background: #e3f3e8; color: #215a39; }
.badge.used { background: #e2edf9; color: #28537b; }
.badge.rejected { background: #f7e7ec; color: #862e4d; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; padding: 1.15rem 1.3rem; }
.filters label { min-width: 10rem; }
.filter-reset { align-self: center; font-size: .91rem; }
input, select, button { font: inherit; }
input:not([type=checkbox]), select {
  border: 1px solid #cfc6da; background: #fff; color: var(--ink); border-radius: .48rem;
  padding: .5rem .62rem; min-width: 0; width: 100%; min-height: 2.64rem; display: block;
}
select {
  appearance: none; padding-right: 1.7rem;
  background-image: linear-gradient(45deg, transparent 50%, #61546c 50%), linear-gradient(135deg, #61546c 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%; background-size: 4px 4px; background-repeat: no-repeat;
}
input[type=checkbox] { width: 1.14rem; height: 1.14rem; accent-color: var(--accent); }
label { font-size: .9rem; font-weight: 650; display: grid; gap: .3rem; }
label.check { display: flex; align-items: center; gap: .45rem; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  padding: .5rem .85rem; min-height: 2.64rem; border-radius: .5rem; border: 1px solid transparent;
  font-size: .94rem; font-weight: 700; cursor: pointer;
}
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-deep); text-decoration: none; }
.secondary { background: #f5f0fa; color: var(--accent-deep); border-color: #e3d8ee; }
.secondary:hover, .danger:hover { background: #eee3f6; text-decoration: none; }
.danger { background: #fff; border-color: #e9cbd5; color: #8d3152; }
.stack { display: grid; gap: .95rem; }
.narrow { max-width: 36rem; }
.form-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem; }
.hint, .empty { color: var(--muted); }
.hint { font-size: .9rem; }
.empty { padding: 1.2rem 1.3rem; border-top: 1px solid var(--line); }
.back { display: inline-block; margin-bottom: .95rem; font-size: .9rem; }
.account-panel, .action-panel { margin-top: 1rem; }
.account-panel h2, .action-panel h2 { margin-bottom: .85rem; }
.account-disable { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.details { margin: .55rem 0 0; }
.details div { display: flex; justify-content: space-between; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.details div:last-child { border: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.history { display: grid; gap: .7rem; list-style: none; padding: 0; margin: .65rem 0 0; }
.history li { border-left: 2px solid #ab8bc1; padding-left: .75rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .75rem; }
.notice { border: 1px solid #d1e5da; background: #eaf6ef; color: #215d3e; border-radius: .55rem; padding: .72rem .95rem; margin-bottom: 1.1rem; }
.notice.error { border-color: #ead1da; background: #faedf2; color: #7a2747; }
.anonymous { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(ellipse at 75% 15%, #eae0f2, transparent 55%), var(--page); }
.anonymous main { width: min(100%, 29rem); }
.login { padding: clamp(1.4rem, 4vw, 2.3rem); box-shadow: 0 12px 36px #3d254d12; }
.login-brand { margin-bottom: 1.35rem; color: var(--accent-deep); }
.login p { margin-top: .5rem; color: var(--muted); }
.login .stack { margin-top: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 66rem) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 50rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-height: 0; position: static; gap: .75rem; padding: .9rem 1rem; }
  .brand { margin: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { padding: .45rem .55rem; }
  .account-bar { padding: .5rem 0 0; display: flex; gap: .5rem 1rem; flex-wrap: wrap; align-items: center; }
  .account-actions { margin: 0; }
  .shell main { padding-top: 1.35rem; }
}
@media (max-width: 34rem) {
  .detail-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-header { align-items: start; flex-direction: column; }
  .metric { padding: .7rem; }
  .filters label { width: 100%; }
}

.document-list { margin-top: 1rem; }
.document-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
