:root {
  --ink-950: #111315;
  --ink-900: #17191c;
  --ink-800: #25282d;
  --ink-700: #3c4148;
  --ink-600: #565d66;
  --ink-500: #727a85;
  --ink-400: #9aa1aa;
  --ink-300: #c6cbd1;
  --ink-200: #dde1e5;
  --ink-100: #eef0f2;
  --ink-50: #f7f8f9;
  --white: #ffffff;
  --brand: #f4c430;
  --brand-strong: #e2b21a;
  --brand-soft: #fff8da;
  --success: #198754;
  --success-soft: #e9f7ef;
  --warning: #a96500;
  --warning-soft: #fff4dc;
  --danger: #c9363b;
  --danger-soft: #fff0f0;
  --info: #2468b4;
  --info-soft: #edf5ff;
  --shadow-sm: 0 1px 2px rgb(17 19 21 / 5%), 0 2px 8px rgb(17 19 21 / 4%);
  --shadow-md: 0 12px 30px rgb(17 19 21 / 9%);
  --shadow-lg: 0 30px 70px rgb(17 19 21 / 18%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --sidebar-width: 264px;
  --topbar-height: 76px;
  --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-50);
  color: var(--ink-900);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { display: block; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--ink-900);
  color: var(--white);
  border-right: 1px solid rgb(255 255 255 / 7%);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 166px;
  padding: 16px 28px;
  text-decoration: none;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.brand img { width: 100%; max-width: 198px; height: auto; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px;
}

.nav-section {
  display: block;
  padding: 15px 13px 8px;
  color: #747b84;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 4px;
  padding: 12px 13px;
  color: #bec3ca;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.nav-link:hover { color: var(--white); background: rgb(255 255 255 / 6%); transform: translateX(2px); }
.nav-link.is-active { color: var(--ink-950); background: var(--brand); box-shadow: 0 8px 20px rgb(244 196 48 / 15%); }
.nav-link.is-active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 22px; background: var(--brand); border-radius: 0 4px 4px 0; }
.nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; fill: currentColor; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 17px 16px;
  border-top: 1px solid rgb(255 255 255 / 8%);
}

.user-summary { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.user-summary__text { min-width: 0; display: flex; flex-direction: column; }
.user-summary__text strong { overflow: hidden; color: #f5f6f7; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.user-summary__text small { color: #8f969f; font-size: 10px; }

.app-column { min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(20px, 3vw, 42px);
  background: rgb(255 255 255 / 91%);
  border-bottom: 1px solid var(--ink-200);
  backdrop-filter: blur(16px);
}

.topbar-title { display: flex; flex-direction: column; }
.topbar-title span { color: var(--ink-500); font-size: 11px; font-weight: 650; letter-spacing: .03em; }
.topbar-title strong { color: var(--ink-900); font-size: 17px; line-height: 1.25; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.mobile-menu-button { display: none !important; }

.main-content { width: 100%; max-width: 1600px; flex: 1; margin: 0 auto; padding: clamp(24px, 3vw, 42px); }

.app-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px clamp(24px, 3vw, 42px);
  color: var(--ink-400);
  border-top: 1px solid var(--ink-200);
  font-size: 11px;
}

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-heading h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.page-heading p { max-width: 720px; margin: 8px 0 0; color: var(--ink-600); font-size: 14px; }
.page-heading__actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.eyebrow { display: block; margin-bottom: 7px; color: var(--warning); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--ink-500); }
.text-small { font-size: 12px; }
.text-danger { color: var(--danger); }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .sensitive-value:focus-visible { outline: 3px solid rgb(244 196 48 / 35%); outline-offset: 2px; }
.button svg { width: 17px; height: 17px; fill: currentColor; }
.button--primary { color: var(--ink-950); background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 16px rgb(244 196 48 / 18%); }
.button--primary:hover { background: #ffcf35; box-shadow: 0 10px 22px rgb(244 196 48 / 25%); }
.button--secondary { color: var(--ink-800); background: var(--white); border-color: var(--ink-200); }
.button--secondary:hover { border-color: var(--ink-300); box-shadow: var(--shadow-sm); }
.button--dark { color: var(--white); background: var(--ink-900); border-color: var(--ink-900); }
.button--danger { color: var(--white); background: var(--danger); border-color: var(--danger); }
.button--danger-ghost { color: var(--danger); background: var(--danger-soft); border-color: #ffd9d9; }
.button--compact { min-height: 38px; padding: 7px 12px; font-size: 12px; }
.button--wide { width: 100%; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--ink-600);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.icon-button:hover { color: var(--ink-900); background: var(--ink-100); }
.icon-button svg { width: 20px; height: 20px; fill: currentColor; }
.icon-button--dark { width: 34px; height: 34px; color: #8f969f; }
.icon-button--dark:hover { color: var(--brand); background: rgb(255 255 255 / 7%); }

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: var(--ink-950);
  background: var(--brand);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  letter-spacing: -.02em;
}

.avatar--small { width: 35px; height: 35px; border-radius: 9px; font-size: 11px; }
.avatar--top { border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--ink-200); }
.avatar--large { width: 68px; height: 68px; border-radius: 18px; font-size: 20px; }

.card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 24px; border-bottom: 1px solid var(--ink-100); }
.card__header h2, .card__header h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.card__header p { margin: 4px 0 0; color: var(--ink-500); font-size: 12px; }
.card__body { padding: 24px; }
.card__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 24px; background: var(--ink-50); border-top: 1px solid var(--ink-100); border-radius: 0 0 var(--radius-md) var(--radius-md); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 16px; padding: 21px; background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.stat-card::after { content: ""; position: absolute; width: 68px; height: 68px; right: -28px; bottom: -31px; background: var(--brand); border-radius: 50%; opacity: .12; }
.stat-card__icon { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; color: var(--ink-900); background: var(--brand-soft); border-radius: 11px; }
.stat-card__icon svg { width: 21px; height: 21px; fill: currentColor; }
.stat-card__content span { color: var(--ink-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-card__content strong { display: block; margin-top: 3px; font-size: 27px; line-height: 1.15; letter-spacing: -.04em; }
.stat-card__content small { display: block; margin-top: 4px; color: var(--ink-400); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); gap: 20px; }
.dashboard-stack { display: grid; gap: 20px; align-content: start; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.quick-action { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--ink-200); border-radius: 11px; text-decoration: none; transition: border var(--transition), transform var(--transition), box-shadow var(--transition); }
.quick-action:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-sm); }
.quick-action__icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-900); background: var(--brand-soft); border-radius: 9px; }
.quick-action__icon svg { width: 18px; height: 18px; fill: currentColor; }
.quick-action strong { display: block; font-size: 12px; }
.quick-action small { display: block; color: var(--ink-500); font-size: 10px; }

.distribution-list { display: grid; gap: 15px; }
.distribution-row__labels { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.distribution-row__labels span:last-child { color: var(--ink-500); font-weight: 700; }
.progress { height: 7px; overflow: hidden; background: var(--ink-100); border-radius: 10px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

.filter-card { margin-bottom: 18px; padding: 14px; }
.filter-form { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(145px, .3fr)) auto; gap: 10px; align-items: end; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: var(--ink-400); pointer-events: none; }
.search-field input { padding-left: 41px; }

.table-card { overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 18px; color: var(--ink-500); background: var(--ink-50); border-bottom: 1px solid var(--ink-200); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 18px; border-bottom: 1px solid var(--ink-100); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #fffdf4; }
.employee-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.employee-cell__meta { min-width: 0; }
.employee-cell__meta a, .employee-cell__meta strong { display: block; color: var(--ink-900); font-size: 12px; font-weight: 750; text-decoration: none; }
.employee-cell__meta a:hover { text-decoration: underline; }
.employee-cell__meta small { display: block; overflow: hidden; max-width: 220px; color: var(--ink-500); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }
.table-action { width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--ink-500); background: var(--white); border: 1px solid var(--ink-200); border-radius: 7px; text-decoration: none; cursor: pointer; }
.table-action:hover { color: var(--ink-900); border-color: var(--brand); }
.table-action svg { width: 16px; height: 16px; fill: currentColor; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 30px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.badge--success { color: var(--success); background: var(--success-soft); }
.badge--warning { color: var(--warning); background: var(--warning-soft); }
.badge--danger { color: var(--danger); background: var(--danger-soft); }
.badge--neutral { color: var(--ink-600); background: var(--ink-100); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; background: var(--ink-50); border-top: 1px solid var(--ink-100); }
.pagination__meta { color: var(--ink-500); font-size: 11px; }
.pagination__links { display: flex; gap: 5px; }
.pagination__links a, .pagination__links span { min-width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-600); background: var(--white); border: 1px solid var(--ink-200); border-radius: 7px; font-size: 11px; font-weight: 700; text-decoration: none; }
.pagination__links a:hover, .pagination__links .is-current { color: var(--ink-950); background: var(--brand); border-color: var(--brand); }
.pagination__links .is-disabled { opacity: .45; }

.empty-state { padding: 58px 28px; text-align: center; }
.empty-state__icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--ink-500); background: var(--ink-100); border-radius: 17px; }
.empty-state__icon svg { width: 27px; height: 27px; fill: currentColor; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { max-width: 430px; margin: 0 auto 18px; color: var(--ink-500); font-size: 12px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.form-stack { display: grid; gap: 18px; }
.form-section { scroll-margin-top: 95px; }
.form-section__title { display: flex; gap: 12px; align-items: center; }
.form-section__number { width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-900); background: var(--brand); border-radius: 8px; font-size: 11px; font-weight: 850; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 17px; }
.field { grid-column: span 4; min-width: 0; }
.field--half { grid-column: span 6; }
.field--wide { grid-column: span 8; }
.field--full { grid-column: 1 / -1; }
.field--quarter { grid-column: span 3; }
.field label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--ink-700); font-size: 11px; font-weight: 750; }
.field label small { color: var(--ink-400); font-size: 9px; font-weight: 500; }
.field input, .field select, .field textarea, .filter-form input, .filter-form select {
  width: 100%;
  height: 43px;
  padding: 9px 12px;
  color: var(--ink-900);
  background: var(--white);
  border: 1px solid var(--ink-300);
  border-radius: 8px;
  font-size: 12px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover, .filter-form input:hover, .filter-form select:hover { border-color: var(--ink-400); }
.field input:focus, .field select:focus, .field textarea:focus, .filter-form input:focus, .filter-form select:focus { border-color: var(--brand-strong); box-shadow: 0 0 0 3px rgb(244 196 48 / 16%); outline: 0; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-400); }
.field-error { display: block; margin-top: 5px; color: var(--danger); font-size: 10px; font-weight: 650; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); background: var(--danger-soft); }
.form-help { margin-top: 5px; color: var(--ink-500); font-size: 10px; }
.checkbox-field { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 10px 12px; background: var(--ink-50); border: 1px solid var(--ink-200); border-radius: 8px; }
.checkbox-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand-strong); }
.checkbox-field label { margin: 0; font-size: 11px; }

.form-nav { position: sticky; top: calc(var(--topbar-height) + 20px); padding: 16px; }
.form-nav h3 { margin: 0 0 11px; padding: 0 5px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.form-nav a { display: flex; align-items: center; gap: 9px; padding: 9px; color: var(--ink-600); border-radius: 7px; font-size: 11px; font-weight: 650; text-decoration: none; }
.form-nav a:hover { color: var(--ink-900); background: var(--brand-soft); }
.form-nav a span { width: 21px; height: 21px; display: grid; place-items: center; color: var(--ink-700); background: var(--ink-100); border-radius: 6px; font-size: 9px; font-weight: 850; }
.form-nav__notice { margin-top: 13px; padding: 11px; color: var(--ink-600); background: var(--brand-soft); border-radius: 8px; font-size: 10px; }

.profile-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; padding: 23px; background: var(--ink-900); border-radius: var(--radius-md); color: var(--white); }
.profile-hero__info { min-width: 0; flex: 1; }
.profile-hero__info h1 { margin: 0; font-size: clamp(21px, 3vw, 29px); line-height: 1.2; letter-spacing: -.03em; }
.profile-hero__info p { margin: 5px 0 0; color: #aeb4bc; font-size: 12px; }
.profile-hero__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.profile-hero__meta span { padding: 4px 8px; color: #d9dde1; background: rgb(255 255 255 / 8%); border-radius: 20px; font-size: 9px; }
.profile-hero__actions { display: flex; gap: 8px; }

.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--ink-100); }
.detail-item { min-width: 0; padding: 16px 20px; background: var(--white); }
.detail-item dt { margin-bottom: 5px; color: var(--ink-500); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.detail-item dd { overflow-wrap: anywhere; margin: 0; color: var(--ink-800); font-size: 12px; font-weight: 620; }
.sensitive-value { width: fit-content; min-width: 70px; cursor: pointer; border-bottom: 1px dashed var(--ink-300); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .7fr); gap: 20px; align-items: start; }
.content-stack { display: grid; gap: 20px; }
.item-list { display: grid; gap: 9px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--ink-50); border: 1px solid var(--ink-100); border-radius: 10px; }
.list-item__icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: var(--ink-700); background: var(--white); border: 1px solid var(--ink-200); border-radius: 9px; }
.list-item__icon svg { width: 18px; height: 18px; fill: currentColor; }
.list-item__content { min-width: 0; flex: 1; }
.list-item__content strong { display: block; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.list-item__content small { display: block; margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.list-item__actions { display: flex; gap: 4px; }

.dropzone { position: relative; padding: 20px; text-align: center; background: var(--ink-50); border: 1px dashed var(--ink-300); border-radius: 10px; transition: border var(--transition), background var(--transition); }
.dropzone:hover { background: var(--brand-soft); border-color: var(--brand-strong); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.dropzone svg { width: 27px; height: 27px; margin: 0 auto 8px; fill: var(--ink-500); }
.dropzone strong { display: block; font-size: 11px; }
.dropzone span { display: block; margin-top: 3px; color: var(--ink-500); font-size: 9px; }
.file-name { overflow: hidden; margin-top: 8px !important; color: var(--ink-800) !important; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.document-group__description { margin: 0 0 16px; color: var(--ink-500); font-size: 10px; line-height: 1.5; }
.document-group__list { margin-bottom: 18px; }
.document-group__empty { margin: 0 0 16px; padding: 11px 12px; color: var(--ink-500); background: var(--ink-50); border: 1px solid var(--ink-100); border-radius: 9px; font-size: 10px; text-align: center; }

.inline-form { display: grid; gap: 12px; }
.inline-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid; border-radius: 9px; font-size: 11px; }
.alert--danger { color: #8d262b; background: var(--danger-soft); border-color: #ffd2d4; }
.alert--warning { color: #7a4b00; background: var(--warning-soft); border-color: #ffe3ad; }
.alert--info { color: #1b5592; background: var(--info-soft); border-color: #d5e8ff; }
.alert ul { margin: 0; padding-left: 18px; }

.toast-stack { position: fixed; z-index: 100; top: 18px; right: 18px; display: grid; gap: 8px; width: min(390px, calc(100vw - 36px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 14px; color: var(--ink-800); background: var(--white); border: 1px solid var(--ink-200); border-radius: 11px; box-shadow: var(--shadow-md); font-size: 11px; font-weight: 650; animation: toast-in 250ms ease both; }
.toast.is-leaving { animation: toast-out 250ms ease both; }
.toast__dot { width: 8px; height: 8px; flex: 0 0 auto; background: var(--info); border-radius: 50%; }
.toast--success .toast__dot { background: var(--success); }
.toast--warning .toast__dot { background: var(--warning); }
.toast--danger .toast__dot, .toast--error .toast__dot { background: var(--danger); }
.toast button { margin-left: auto; color: var(--ink-400); background: transparent; border: 0; cursor: pointer; font-size: 20px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(15px); } }

.confirm-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgb(17 19 21 / 68%); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 27px; text-align: center; }
.confirm-dialog__icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--danger); background: var(--danger-soft); border-radius: 50%; font-size: 21px; font-weight: 850; }
.confirm-dialog h2 { margin: 0; font-size: 18px; }
.confirm-dialog p { margin: 8px 0 22px; color: var(--ink-600); font-size: 12px; }
.confirm-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.auth-page { min-height: 100vh; background: var(--ink-900); }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .8fr) minmax(500px, 1.2fr); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--white); }
.auth-card { width: min(420px, 100%); }
.auth-brand { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 32px; padding: 14px 18px; background: var(--ink-900); border-radius: 14px; }
.auth-brand img { width: 214px; max-width: 100%; height: auto; }
.auth-card .eyebrow { margin-bottom: 9px; }
.auth-card h1 { margin: 0; font-size: 31px; line-height: 1.15; letter-spacing: -.04em; }
.auth-card > p { margin: 10px 0 27px; color: var(--ink-600); font-size: 13px; }
.auth-form { display: grid; gap: 17px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px; color: var(--ink-500); background: transparent; border: 0; cursor: pointer; font-size: 9px; font-weight: 800; }
.auth-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; color: var(--ink-400); font-size: 9px; }

.auth-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(45px, 6vw, 90px); color: var(--white); background: var(--ink-900); }
.auth-visual::before { content: ""; position: absolute; width: 620px; height: 620px; top: -290px; right: -250px; background: var(--brand); border-radius: 50%; opacity: .93; }
.auth-visual::after { content: "DM"; position: absolute; right: -25px; bottom: 80px; color: rgb(255 255 255 / 3%); font-size: clamp(250px, 30vw, 520px); font-weight: 900; line-height: .7; letter-spacing: -.13em; }
.auth-visual__content { position: relative; z-index: 1; max-width: 660px; }
.auth-visual__mark { width: 48px; height: 5px; margin-bottom: 25px; background: var(--brand); border-radius: 5px; }
.auth-visual h2 { margin: 0; font-size: clamp(34px, 5vw, 66px); line-height: 1.02; letter-spacing: -.055em; }
.auth-visual p { max-width: 520px; margin: 20px 0 0; color: #acb2ba; font-size: 14px; }
.auth-features { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 45px; }
.auth-feature { padding: 14px; background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 8%); border-radius: 11px; backdrop-filter: blur(10px); }
.auth-feature strong { display: block; color: var(--brand); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.auth-feature span { display: block; margin-top: 4px; color: #c2c7cd; font-size: 9px; }

.setup-page .auth-panel { align-items: flex-start; overflow-y: auto; }
.setup-page .auth-card { padding: 25px 0; }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: var(--ink-900); }
.error-card { width: min(540px, 100%); padding: 40px; background: var(--white); border-radius: 20px; text-align: center; box-shadow: var(--shadow-lg); }
.error-code { display: inline-grid; place-items: center; width: 68px; height: 68px; margin-bottom: 18px; color: var(--ink-950); background: var(--brand); border-radius: 18px; font-size: 22px; font-weight: 900; }
.error-card h1 { margin: 0; font-size: 25px; }
.error-card p { margin: 10px 0 22px; color: var(--ink-600); font-size: 12px; }

.sidebar-overlay { display: none; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-layout { grid-template-columns: 1fr; }
  .form-nav { display: none; }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 940px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); transition: transform 220ms ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 35; inset: 0; display: block; visibility: hidden; background: rgb(17 19 21 / 60%); border: 0; opacity: 0; transition: opacity 220ms ease, visibility 220ms; }
  .menu-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .app-column { margin-left: 0; }
  .mobile-menu-button { display: inline-grid !important; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: minmax(350px, .85fr) minmax(360px, 1fr); }
  .auth-visual { padding: 45px; }
  .auth-features { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --topbar-height: 66px; }
  .topbar { padding: 0 16px; }
  .topbar-title span { display: none; }
  .topbar-title strong { font-size: 15px; }
  .topbar-actions .button { display: none; }
  .main-content { padding: 22px 15px; }
  .app-footer { padding: 17px 15px; }
  .app-footer span:last-child { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-heading__actions { width: 100%; }
  .page-heading__actions .button { flex: 1; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 15px; gap: 10px; }
  .stat-card__icon { width: 37px; height: 37px; }
  .stat-card__content strong { font-size: 22px; }
  .filter-form { grid-template-columns: 1fr 1fr; }
  .filter-form .search-field { grid-column: 1 / -1; }
  .filter-form .button { grid-column: 1 / -1; }
  .card__header, .card__body { padding: 18px; }
  .form-grid { gap: 14px; }
  .field, .field--half, .field--wide, .field--quarter { grid-column: span 6; }
  .field--full { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-hero { align-items: flex-start; flex-wrap: wrap; }
  .profile-hero__actions { width: 100%; }
  .profile-hero__actions .button { flex: 1; }
  .inline-form-grid { grid-template-columns: 1fr; }
  .auth-layout { display: block; }
  .auth-panel { min-height: 100vh; padding: 28px 24px; }
  .auth-visual { display: none; }
  .auth-brand { margin-bottom: 30px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .field, .field--half, .field--wide, .field--quarter { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; }
  .profile-hero__actions { flex-direction: column; }
  .pagination { align-items: flex-start; flex-direction: column; }
}

@media print {
  body { background: var(--white); }
  .sidebar, .topbar, .app-footer, .page-heading__actions, .profile-hero__actions, .button, .table-actions, .toast-stack { display: none !important; }
  .app-column { margin: 0; }
  .main-content { max-width: none; padding: 0; }
  .card, .profile-hero { box-shadow: none; break-inside: avoid; }
  .profile-hero { color: var(--ink-900); background: var(--white); border: 1px solid var(--ink-200); }
  .profile-hero__info p { color: var(--ink-600); }
  .profile-hero__meta span { color: var(--ink-700); background: var(--ink-100); }
}
