:root {
  --orange-50: #fff8f1;
  --orange-100: #ffecd8;
  --orange-200: #ffd5ad;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --ink-950: #171410;
  --ink-900: #24201c;
  --ink-700: #514b45;
  --ink-500: #7d756d;
  --ink-300: #b8b0a8;
  --ink-200: #d9d3cd;
  --ink-100: #ebe7e3;
  --surface: #ffffff;
  --canvas: #f7f6f4;
  --green: #16835a;
  --green-bg: #eaf8f2;
  --blue: #2965c9;
  --blue-bg: #edf4ff;
  --purple: #7c4dcc;
  --purple-bg: #f3edff;
  --red: #c43d32;
  --red-bg: #fff0ee;
  --yellow: #9a6700;
  --yellow-bg: #fff8dd;
  --shadow-sm: 0 1px 2px rgba(34, 27, 20, .05), 0 4px 14px rgba(34, 27, 20, .035);
  --shadow-lg: 0 22px 60px rgba(34, 27, 20, .18);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink-900); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 23px; line-height: 1.15; letter-spacing: -.03em; }
h2 { margin-bottom: 8px; font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
h3 { margin-bottom: 0; font-size: 17px; line-height: 1.3; letter-spacing: -.02em; }
small { font-size: 12px; }
.muted { color: var(--ink-500); }
.small { font-size: 12px; }
.positive { color: var(--green) !important; }
.warning-text { color: var(--orange-600) !important; }
.danger-text { color: var(--red) !important; }
.number { text-align: right; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 244px; flex-direction: column; padding: 26px 16px 18px; background: var(--ink-950); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 25px; }
.brand-mark { display: inline-flex; width: 38px; height: 38px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 12px 12px 12px 4px; background: linear-gradient(145deg, var(--orange-400), var(--orange-600)); color: #fff; font-weight: 900; font-size: 20px; box-shadow: 0 8px 24px rgba(249, 115, 22, .25); }
.brand-mark.large { width: 48px; height: 48px; font-size: 24px; }
.brand strong { display: block; font-size: 18px; line-height: 1.1; }
.brand small { display: block; margin-top: 2px; color: #a9a39d; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; flex: 1; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; color: #aaa49e; font-size: 13px; font-weight: 600; transition: .18s ease; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(249,115,22,.22), rgba(249,115,22,.07)); color: #fff; box-shadow: inset 3px 0 var(--orange-500); }
.nav-icon { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; border-radius: 7px; background: rgba(255,255,255,.07); color: #ddd8d3; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.nav-link.active .nav-icon { background: var(--orange-500); color: #fff; }
.sidebar-footer { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-card { display: flex; align-items: center; gap: 9px; padding: 3px 6px 12px; }
.avatar { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: #3a342f; color: var(--orange-400); font-weight: 800; }
.user-meta { min-width: 0; }
.user-meta strong, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 12px; }
.user-meta small { color: #8f8983; font-size: 10px; text-transform: uppercase; }

.app-main { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 82px; align-items: center; justify-content: space-between; padding: 15px 32px; border-bottom: 1px solid rgba(217,211,205,.75); background: rgba(247,246,244,.9); backdrop-filter: blur(16px); }
.topbar .eyebrow { margin-bottom: 3px; }
.mobile-menu { display: none; border: 0; background: none; font-size: 20px; cursor: pointer; }
.page-content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 28px 32px 60px; }
.eyebrow { display: block; color: var(--orange-600); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.btn { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; background: transparent; font-weight: 700; font-size: 12px; cursor: pointer; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { border-color: var(--orange-500); background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); color: #fff; box-shadow: 0 5px 15px rgba(249,115,22,.2); }
.btn-primary:hover { background: linear-gradient(135deg, var(--orange-600), var(--orange-700)); box-shadow: 0 8px 20px rgba(249,115,22,.24); }
.btn-secondary { border-color: var(--ink-200); background: #fff; color: var(--ink-900); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--orange-300, #fdba74); color: var(--orange-700); }
.btn-ghost { color: var(--ink-500); }
.sidebar .btn-ghost { color: #918b85; }
.btn-ghost:hover { background: rgba(125,117,109,.08); color: var(--ink-900); }
.sidebar .btn-ghost:hover { background: rgba(255,255,255,.06); color: #fff; }
.btn-small { min-height: 32px; padding: 6px 10px; }
.btn-lg { min-height: 46px; padding: 11px 20px; font-size: 13px; }
.btn-block { width: 100%; }
.text-link, .field-link { color: var(--orange-600); font-size: 12px; font-weight: 700; }
.field-link { display: inline-block; margin-top: 6px; }
.icon-button { display: inline-flex; align-items: center; border: 0; background: none; color: var(--orange-600); font-weight: 700; font-size: 11px; cursor: pointer; white-space: nowrap; }
.success-link { color: var(--green); }

.card { border: 1px solid var(--ink-100); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-head { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--ink-100); }
.card-head .eyebrow { margin-bottom: 4px; }
.card-head > h3 { margin: 0; }
.hero-strip { position: relative; display: flex; min-height: 145px; align-items: center; justify-content: space-between; overflow: hidden; margin-bottom: 18px; padding: 28px 32px; border-radius: 20px; background: var(--ink-950); color: #fff; box-shadow: 0 16px 40px rgba(23,20,16,.13); }
.hero-strip::after { position: absolute; right: -70px; width: 280px; height: 280px; border: 46px solid rgba(249,115,22,.18); border-radius: 50%; content: ""; }
.hero-strip .eyebrow { color: var(--orange-400); }
.hero-strip h2 { margin: 3px 0 4px; font-size: 31px; }
.hero-strip p { margin: 0; color: #a9a39d; }
.hero-date { position: relative; z-index: 1; display: flex; width: 88px; height: 88px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.13); border-radius: 22px; background: rgba(255,255,255,.07); backdrop-filter: blur(8px); }
.hero-date strong { font-size: 33px; line-height: 1; }
.hero-date span { margin-top: 6px; color: var(--orange-300, #fdba74); font-size: 11px; font-weight: 700; text-transform: uppercase; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.stat-card { position: relative; display: flex; min-height: 125px; flex-direction: column; justify-content: center; overflow: hidden; padding: 20px; border: 1px solid var(--ink-100); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); transition: .18s ease; }
.stat-card::after { position: absolute; top: -22px; right: -22px; width: 75px; height: 75px; border-radius: 50%; background: currentColor; opacity: .07; content: ""; }
.stat-card:hover { transform: translateY(-2px); border-color: currentColor; }
.stat-card.orange { color: var(--orange-600); }
.stat-card.blue { color: var(--blue); }
.stat-card.green { color: var(--green); }
.stat-card.purple { color: var(--purple); }
.stat-card .stat-label { color: var(--ink-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat-card strong { margin: 4px 0 2px; color: var(--ink-950); font-size: 29px; line-height: 1; }
.stat-card small { color: var(--ink-500); }
.finance-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; padding: 18px 8px; border: 1px solid var(--ink-100); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.finance-strip > div { padding: 0 18px; border-right: 1px solid var(--ink-100); }
.finance-strip > div:last-child { border-right: 0; }
.finance-strip span, .metric span { display: block; margin-bottom: 4px; color: var(--ink-500); font-size: 11px; }
.finance-strip strong { font-size: 17px; }

.content-grid { display: grid; align-items: start; gap: 18px; }
.content-grid.two-one { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.content-grid.one-two { grid-template-columns: minmax(280px, .8fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.sticky-card { position: sticky; top: 100px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; border-bottom: 1px solid var(--ink-100); background: #fbfaf9; color: var(--ink-500); font-size: 10px; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #f0eeeb; color: var(--ink-700); font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fffaf5; }
td strong, td small { display: block; }
td strong { color: var(--ink-900); }
td small { margin-top: 2px; color: var(--ink-500); }
.record-link { color: var(--orange-700); font-weight: 800; }
.empty-cell { padding: 36px !important; color: var(--ink-500); text-align: center; }
.actions { display: flex; justify-content: flex-end; gap: 7px; }
.row-actions { display: flex; align-items: center; gap: 7px; }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: var(--ink-100); color: var(--ink-700); font-size: 10px; font-weight: 800; white-space: nowrap; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-new, .status-unpaid { background: var(--orange-100); color: var(--orange-700); }
.status-in-process, .status-partially-paid, .status-contacted { background: var(--blue-bg); color: var(--blue); }
.status-on-hold { background: var(--yellow-bg); color: var(--yellow); }
.status-ready, .status-paid, .status-renewed { background: var(--green-bg); color: var(--green); }
.status-closed, .status-active { background: #edf7f4; color: #327866; }
.status-cancelled, .status-rejected, .status-not-interested { background: var(--red-bg); color: var(--red); }
.status-present, .status-approved, .status-paid { background: var(--green-bg); color: var(--green); }
.status-remote { background: var(--blue-bg); color: var(--blue); }
.status-absent, .status-terminated, .status-resigned { background: var(--red-bg); color: var(--red); }
.status-leave, .status-on-leave, .status-pending, .status-half-day { background: var(--yellow-bg); color: var(--yellow); }
.status-draft { background: #f3f1ef; color: var(--ink-700); }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 7px; background: #f3f1ef; color: var(--ink-700); font-size: 10px; font-weight: 700; }
.pill.light { background: rgba(255,255,255,.12); color: var(--orange-300, #fdba74); }

.expiry-list { padding: 6px 18px 12px; }
.expiry-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--ink-100); }
.expiry-row:last-child { border-bottom: 0; }
.date-chip { display: flex; width: 42px; height: 45px; flex-direction: column; align-items: center; justify-content: center; border-radius: 9px; background: var(--orange-50); color: var(--orange-700); }
.date-chip strong { font-size: 16px; line-height: 1; }
.date-chip span { font-size: 9px; font-weight: 800; text-transform: uppercase; }
.expiry-row > div:nth-child(2) strong, .expiry-row > div:nth-child(2) span { display: block; }
.expiry-row > div:nth-child(2) span { color: var(--ink-500); font-size: 11px; }
.days-left { color: var(--ink-500); font-size: 11px; font-weight: 800; }
.date-block { display: flex; align-items: baseline; gap: 5px; }
.date-block strong { font-size: 22px; }
.date-block span { color: var(--ink-500); font-size: 11px; }
.days-badge { display: inline-flex; padding: 5px 8px; border-radius: 7px; background: #eef7f4; color: var(--green); font-size: 10px; font-weight: 800; }
.days-badge.soon { background: var(--orange-100); color: var(--orange-700); }
.days-badge.late { background: var(--red-bg); color: var(--red); }

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-actions.wrap { flex-wrap: wrap; }
.search-bar { display: flex; min-width: min(620px, 100%); gap: 8px; }
.search-bar input { flex: 1; }
.search-bar select { width: 165px; }
.status-tabs { display: flex; gap: 3px; overflow-x: auto; margin-bottom: 12px; padding: 4px; border: 1px solid var(--ink-100); border-radius: 11px; background: #fff; width: fit-content; box-shadow: var(--shadow-sm); }
.status-tabs a { padding: 7px 12px; border-radius: 8px; color: var(--ink-500); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-tabs a.active { background: var(--ink-950); color: #fff; }
.status-tabs.inline-tabs { margin-bottom: 0; }

label { display: block; color: var(--ink-700); font-size: 11px; font-weight: 700; }
label b { color: var(--orange-600); }
label small { color: var(--ink-500); font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid var(--ink-200); border-radius: 9px; outline: none; background: #fff; color: var(--ink-900); font-size: 12px; transition: .15s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--orange-400); box-shadow: 0 0 0 3px rgba(249,115,22,.1); }
textarea { resize: vertical; }
input[type=file] { padding: 8px; background: #fbfaf9; }
.form-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .7fr); align-items: start; gap: 18px; }
.form-card { padding-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; padding: 20px; }
.span-2 { grid-column: span 2; }
.form-sidebar { position: sticky; top: 100px; padding: 20px; }
.form-sidebar p { margin: 8px 0 18px; }
.form-sidebar .btn + .btn { margin-top: 7px; }
.stack-form { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-label { display: flex; align-items: center; gap: 8px; }
.check-label input { width: auto; margin: 0; accent-color: var(--orange-600); }

.account-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.account-card { display: flex; min-height: 135px; align-items: flex-start; gap: 12px; padding: 19px; border: 1px solid var(--ink-100); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.account-icon { display: flex; width: 38px; height: 38px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 10px; background: var(--orange-100); color: var(--orange-700); font-size: 10px; font-weight: 900; }
.account-card span, .account-card h3, .account-card strong, .account-card small { display: block; }
.account-card span { color: var(--ink-500); font-size: 10px; text-transform: uppercase; }
.account-card h3 { margin: 2px 0 10px; font-size: 13px; }
.account-card strong { font-size: 20px; }
.account-card small { color: var(--ink-500); }
.add-account { flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--orange-300, #fdba74); background: var(--orange-50); color: var(--orange-700); cursor: pointer; }
.add-account > span { color: var(--orange-600); font-size: 24px; }

.alert { position: relative; margin-bottom: 14px; padding: 12px 38px 12px 14px; border: 1px solid; border-radius: 10px; font-size: 12px; font-weight: 600; }
.alert button { position: absolute; top: 7px; right: 8px; border: 0; background: transparent; color: currentColor; font-size: 18px; cursor: pointer; }
.alert-success { border-color: #b9e4d2; background: var(--green-bg); color: var(--green); }
.alert-error { border-color: #facbc5; background: var(--red-bg); color: var(--red); }
.alert-warning { border-color: #f2d693; background: var(--yellow-bg); color: var(--yellow); }

.quick-create-wrap { display: grid; grid-template-columns: minmax(0, 750px) 260px; align-items: start; justify-content: center; gap: 22px; padding-top: 12px; }
.quick-create { overflow: hidden; }
.quick-heading { display: flex; align-items: center; gap: 14px; padding: 24px 26px; border-bottom: 1px solid var(--ink-100); }
.quick-heading h2 { margin: 2px 0 3px; }
.quick-heading p { margin: 0; color: var(--ink-500); }
.quick-icon { display: flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 15px; background: var(--orange-100); color: var(--orange-700); font-weight: 900; }
.quick-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px; }
.quick-fields select { min-height: 47px; }
.optional-details { margin: 0 26px 24px; border: 1px solid var(--ink-100); border-radius: 11px; background: #fbfaf9; }
.optional-details summary { display: flex; justify-content: space-between; padding: 12px 14px; color: var(--ink-700); font-size: 11px; font-weight: 800; cursor: pointer; }
.optional-details summary span { color: var(--ink-500); font-weight: 500; }
.optional-details[open] summary { border-bottom: 1px solid var(--ink-100); }
.compact-grid { padding: 16px; }
.quick-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 26px; border-top: 1px solid var(--ink-100); background: #fbfaf9; }
.workflow-preview { padding: 22px; border: 1px solid var(--ink-100); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.workflow-preview > .eyebrow { margin-bottom: 18px; }
.flow-step { display: flex; align-items: center; gap: 11px; color: var(--ink-500); }
.flow-step > span { display: flex; width: 31px; height: 31px; flex: 0 0 auto; align-items: center; justify-content: center; border: 1px solid var(--ink-200); border-radius: 50%; background: #fff; font-size: 11px; font-weight: 800; }
.flow-step strong, .flow-step small { display: block; }
.flow-step strong { color: var(--ink-900); font-size: 12px; }
.flow-step small { font-size: 10px; }
.flow-step.active > span { border-color: var(--orange-500); background: var(--orange-500); color: #fff; }
.flow-line { width: 1px; height: 24px; margin: 4px 0 4px 15px; background: var(--ink-200); }

.record-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.record-heading h2 { margin: 0; }
.record-heading p { margin: 4px 0 0; color: var(--ink-500); }
.breadcrumb { display: flex; gap: 6px; margin-bottom: 8px; color: var(--ink-500); font-size: 10px; font-weight: 600; }
.breadcrumb a { color: var(--orange-600); }
.title-row { display: flex; align-items: center; gap: 10px; }
.workflow-bar { display: flex; align-items: center; margin-bottom: 16px; padding: 14px 20px; border: 1px solid var(--ink-100); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.workflow-node { display: flex; align-items: center; gap: 7px; color: var(--ink-300); white-space: nowrap; }
.workflow-node span { display: flex; width: 25px; height: 25px; align-items: center; justify-content: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 800; }
.workflow-node strong { font-size: 10px; }
.workflow-node.done { color: var(--green); }
.workflow-node.current { color: var(--orange-600); }
.workflow-node.current span { border-color: var(--orange-500); background: var(--orange-500); color: #fff; box-shadow: 0 0 0 4px var(--orange-100); }
.workflow-bar i { flex: 1; height: 1px; min-width: 20px; margin: 0 10px; background: var(--ink-200); }
.workflow-bar i.done { background: #a5dbc9; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.compact-metrics { margin-bottom: 17px; }
.metric { min-height: 94px; padding: 16px 18px; border: 1px solid var(--ink-100); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.metric strong { display: block; font-size: 19px; }
.metric small { display: block; margin-top: 2px; color: var(--ink-500); }
.application-layout { grid-template-columns: minmax(0, 2.1fr) minmax(280px, .8fr) !important; }
.context-note { padding: 10px; border-radius: 8px; background: var(--orange-50); color: var(--ink-700); font-size: 10px; }
.detail-card dl { margin: 0; padding: 10px 20px 16px; }
.detail-card dl div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid var(--ink-100); }
.detail-card dt { color: var(--ink-500); font-size: 11px; }
.detail-card dd { margin: 0; color: var(--ink-900); font-size: 11px; font-weight: 700; text-align: right; }
.note-box { margin: 0 20px 20px; padding: 11px; border-left: 3px solid var(--orange-400); border-radius: 0 8px 8px 0; background: var(--orange-50); color: var(--ink-700); font-size: 11px; }
.document-list { padding: 8px 18px 15px; }
.document-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--ink-100); }
.document-row:last-child { border-bottom: 0; }
.document-row > div { flex: 1; }
.document-row strong, .document-row small { display: block; }
.document-row small, .document-row > span:last-child { color: var(--ink-500); font-size: 10px; }
.doc-icon { display: flex; width: 36px; height: 39px; align-items: center; justify-content: center; border-radius: 7px; background: var(--orange-100); color: var(--orange-700); font-size: 8px; font-weight: 900; }

dialog { max-width: calc(100vw - 28px); padding: 0; border: 0; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(23,20,16,.52); backdrop-filter: blur(4px); }
.dialog-card { display: flex; width: 440px; max-width: 100%; flex-direction: column; gap: 14px; padding: 20px; }
.dialog-card.wide { width: 700px; }
.dialog-card .form-grid { padding: 0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 2px; }
.dialog-head button { width: 31px; height: 31px; border: 0; border-radius: 50%; background: #f2efec; color: var(--ink-500); font-size: 18px; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 5px; }
.payment-highlight { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-radius: 10px; background: var(--orange-50); }
.payment-highlight span { color: var(--ink-500); font-size: 11px; }
.payment-highlight strong { color: var(--orange-700); font-size: 18px; }

.filter-card { margin-bottom: 14px; padding: 17px; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px,1fr)); gap: 10px; }
.filter-actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 13px; }
.report-metrics { margin-top: 0; }

.invoice-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.invoice-actions > div { display: flex; gap: 7px; }
.invoice-sheet { max-width: 900px; margin: 0 auto; padding: 48px 52px; border: 1px solid var(--ink-100); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.invoice-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 30px; border-bottom: 2px solid var(--ink-950); }
.invoice-brand { display: flex; align-items: center; gap: 10px; }
.invoice-brand strong, .invoice-brand span { display: block; }
.invoice-brand strong { font-size: 20px; }
.invoice-brand span { color: var(--ink-500); font-size: 10px; }
.invoice-title { text-align: right; }
.invoice-title span, .invoice-title strong { display: block; }
.invoice-title span { color: var(--orange-600); font-size: 11px; font-weight: 900; letter-spacing: .15em; }
.invoice-title strong { margin-top: 4px; font-size: 19px; }
.invoice-meta { display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; padding: 30px 0; }
.invoice-meta > div > span { display: block; margin-bottom: 7px; color: var(--ink-500); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-meta > div > strong { display: block; font-size: 17px; }
.invoice-meta p { margin: 5px 0 0; color: var(--ink-500); font-size: 11px; }
.invoice-meta dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 15px; margin: 0; }
.invoice-meta dt { color: var(--ink-500); font-size: 10px; }
.invoice-meta dd { margin: 0; font-size: 11px; font-weight: 700; text-align: right; }
.invoice-table { border: 1px solid var(--ink-100); }
.invoice-table td { height: 70px; }
.invoice-totals { display: flex; justify-content: flex-end; padding-top: 22px; }
.invoice-totals dl { display: grid; width: 330px; grid-template-columns: 1fr auto; gap: 9px 30px; margin: 0; }
.invoice-totals dt { color: var(--ink-500); font-size: 11px; }
.invoice-totals dd { margin: 0; font-weight: 700; text-align: right; }
.invoice-totals .grand { padding-top: 10px; border-top: 1px solid var(--ink-200); color: var(--ink-900); font-size: 14px; }
.invoice-totals .balance { padding: 9px 8px; border-radius: 5px; background: var(--orange-50); color: var(--orange-700); font-weight: 800; }
.payment-history { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--ink-100); }
.payment-history h3 { margin-bottom: 9px; font-size: 12px; }
.payment-history > div { display: flex; justify-content: space-between; padding: 7px 0; color: var(--ink-500); font-size: 10px; }
.payment-history strong { color: var(--green); }
.invoice-footer { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ink-100); color: var(--ink-500); font-size: 10px; }
.invoice-footer p { margin: 0; color: var(--ink-900); font-weight: 700; }
.invoice-note { margin-top: 25px; padding: 12px 14px; border-left: 3px solid var(--orange-400); border-radius: 0 8px 8px 0; background: var(--orange-50); }
.invoice-note strong { font-size: 10px; text-transform: uppercase; }
.invoice-note p { margin: 3px 0 0; color: var(--ink-700); font-size: 10px; }
.invoice-table.detailed td { height: auto; }

.direct-invoice-layout { display: grid; grid-template-columns: minmax(0,2.15fr) minmax(270px,.75fr); align-items: start; gap: 18px; }
.direct-invoice-aside { position: sticky; top: 100px; }
.invoice-form-alert { margin: 17px 20px 0; }
.invoice-builder-card { overflow: hidden; }
.invoice-builder-head, .invoice-builder-line { display: grid; grid-template-columns: minmax(150px,1.05fr) minmax(190px,1.35fr) 70px 105px 80px 115px 30px; align-items: center; gap: 8px; }
.invoice-builder-head { padding: 10px 17px; border-bottom: 1px solid var(--ink-100); background: #fbfaf9; color: var(--ink-500); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.invoice-builder-line { padding: 11px 17px; border-bottom: 1px solid var(--ink-100); }
.invoice-builder-line input, .invoice-builder-line select { min-width: 0; margin: 0; padding: 8px; }
.invoice-builder-line > strong { color: var(--ink-900); font-size: 11px; text-align: right; white-space: nowrap; }
.line-remove { display: flex; width: 27px; height: 27px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--red-bg); color: var(--red); font-size: 16px; cursor: pointer; }
.invoice-builder-footer { padding: 12px 17px; background: #fbfaf9; }
.invoice-builder-footer button { padding: 0; border: 0; background: none; cursor: pointer; }
.invoice-live-summary dl { display: grid; grid-template-columns: 1fr auto; gap: 11px 20px; margin: 0; padding: 20px; }
.invoice-live-summary dt { color: var(--ink-500); font-size: 11px; }
.invoice-live-summary dd { margin: 0; color: var(--ink-900); font-size: 12px; font-weight: 800; text-align: right; }
.invoice-live-summary .grand { padding-top: 12px; border-top: 1px solid var(--ink-200); color: var(--ink-950); font-size: 15px; }
.invoice-live-summary > .btn { width: calc(100% - 40px); margin-inline: 20px; }
.invoice-live-summary > .btn:last-child { margin-top: 5px; margin-bottom: 16px; }
.invoice-summary-note { margin: 0 20px 17px; padding: 10px; border-radius: 8px; background: var(--orange-50); color: var(--ink-700); font-size: 10px; }
.direct-invoice-help { padding: 19px; }
.direct-invoice-help ol { margin: 12px 0; padding-left: 20px; color: var(--ink-700); font-size: 11px; }
.direct-invoice-help li { margin-bottom: 5px; }
.direct-invoice-help p { margin: 0; color: var(--orange-700); font-size: 10px; font-weight: 800; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-500); text-align: center; }
.empty-state.compact { min-height: 100px; }
.empty-state.compact > span { color: var(--orange-500); font-weight: 900; }
.empty-state.compact p { margin: 5px 0 0; font-size: 11px; }
.empty-state.full { min-height: 60vh; }
.empty-state.full > span { color: var(--orange-200); font-size: 90px; font-weight: 900; line-height: 1; }
.empty-state.full p { color: var(--ink-500); }

.auth-shell { background: #fff; }
.login-page { display: grid; min-height: 100vh; grid-template-columns: minmax(450px, 1.15fr) minmax(400px, .85fr); }
.login-showcase { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 48px 55px; background: var(--ink-950); color: #fff; }
.login-showcase::before, .login-showcase::after { position: absolute; border-radius: 50%; content: ""; }
.login-showcase::before { right: -180px; bottom: -160px; width: 550px; height: 550px; border: 80px solid rgba(249,115,22,.14); }
.login-showcase::after { top: 24%; left: -90px; width: 220px; height: 220px; background: rgba(249,115,22,.05); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 21px; }
.login-brand small { color: #98918a; font-size: 10px; text-transform: uppercase; }
.showcase-copy { position: relative; z-index: 1; max-width: 620px; }
.showcase-copy h1 { margin: 18px 0 14px; font-size: clamp(42px, 5vw, 68px); line-height: .98; letter-spacing: -.055em; }
.showcase-copy p { max-width: 540px; margin: 0; color: #aaa39c; font-size: 16px; }
.showcase-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; }
.showcase-metrics strong, .showcase-metrics span { display: block; }
.showcase-metrics strong { color: var(--orange-400); font-size: 17px; }
.showcase-metrics span { color: #89827c; font-size: 10px; text-transform: uppercase; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #faf9f7; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 5px 0 5px; font-size: 28px; }
.login-card > p { margin-bottom: 28px; }
.login-card label { margin-bottom: 16px; }
.login-card input { min-height: 46px; background: #fff; }
.login-card .btn { margin-top: 6px; }
.login-hint { margin: 17px 0 0 !important; color: var(--ink-500); font-size: 10px; text-align: center; }

@media (max-width: 1180px) {
  .stats-grid, .account-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .content-grid.one-two { grid-template-columns: 320px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .app-main { width: 100%; }
  .topbar { padding: 14px 20px; }
  .mobile-menu { display: block; }
  .topbar > div { flex: 1; margin-left: 12px; }
  .page-content { padding: 22px 20px 50px; }
  .content-grid.two-one, .content-grid.one-two, .application-layout, .form-layout { grid-template-columns: 1fr !important; }
  .sticky-card, .form-sidebar { position: static; }
  .quick-create-wrap { grid-template-columns: 1fr; }
  .direct-invoice-layout { grid-template-columns: 1fr; }
  .direct-invoice-aside { position: static; }
  .workflow-preview { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 640px) {
  .topbar .btn { padding: 8px 10px; }
  .topbar h1 { font-size: 18px; }
  .page-content { padding-inline: 13px; }
  .stats-grid, .metric-grid, .account-grid, .finance-strip { grid-template-columns: 1fr 1fr; }
  .finance-strip > div { margin: 7px 0; border-right: 0; }
  .hero-strip { padding: 22px; }
  .hero-date { display: none; }
  .hero-strip h2 { font-size: 25px; }
  .quick-fields, .form-grid, .form-row, .filter-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .optional-details summary span { display: none; }
  .record-heading { align-items: flex-start; }
  .workflow-node strong { display: none; }
  .search-bar { min-width: 100%; flex-wrap: wrap; }
  .search-bar input { min-width: 100%; }
  .search-bar select { flex: 1; width: auto; }
  .invoice-sheet { padding: 28px 20px; border-radius: 10px; }
  .invoice-meta { grid-template-columns: 1fr; }
  .invoice-builder-head { display: none; }
  .invoice-builder-line { grid-template-columns: 1fr 1fr; padding: 14px; }
  .invoice-builder-line [data-line-service], .invoice-builder-line [data-line-description] { grid-column: span 2; }
  .invoice-builder-line > strong { text-align: left; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  .app-main { grid-column: auto; }
  .page-content { max-width: none; padding: 0; }
  .invoice-sheet { max-width: none; padding: 20px; border: 0; box-shadow: none; }
}

/* Advanced accounting and expense modules */
.page-intro { margin: 4px 0 0; color: var(--ink-500); font-size: 12px; }
.button-row { display: flex; gap: 8px; }
.expense-filters { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.expense-total { display: flex; min-height: 67px; flex-direction: column; justify-content: center; padding: 10px 13px; border: 1px solid var(--orange-200); border-radius: 10px; background: var(--orange-50); }
.expense-total span { color: var(--ink-500); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.expense-total strong { margin-top: 2px; color: var(--orange-700); font-size: 19px; }
.accounting-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.accounting-tabs { display: flex; gap: 3px; overflow-x: auto; margin-bottom: 12px; padding: 5px; border: 1px solid var(--ink-100); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.accounting-tabs a { padding: 8px 11px; border-radius: 8px; color: var(--ink-500); font-size: 10px; font-weight: 800; white-space: nowrap; }
.accounting-tabs a:hover { color: var(--orange-700); }
.accounting-tabs a.active { background: var(--orange-100); color: var(--orange-700); box-shadow: inset 0 0 0 1px var(--orange-200); }
.report-period { display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--ink-100); border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.report-period label { min-width: 150px; }
.report-period select, .report-period input { margin-top: 3px; padding-block: 7px; }
.accounting-overview { grid-template-columns: minmax(0, 2.1fr) minmax(270px, .8fr) !important; }
.payable-card { padding: 21px; background: linear-gradient(145deg, var(--ink-950), #2e2822); color: #fff; }
.payable-card > span { color: var(--orange-300, #fdba74); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.payable-card > strong { display: block; margin: 5px 0; font-size: 27px; }
.payable-card p { margin: 0 0 14px; color: #aaa39c; font-size: 11px; }
.payable-card a { color: var(--orange-400); font-size: 11px; font-weight: 800; }
.mini-account-list { padding: 6px 17px 13px; }
.mini-account-list a { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--ink-100); }
.mini-account-list a:last-child { border-bottom: 0; }
.mini-account-list strong, .mini-account-list span { display: block; }
.mini-account-list strong { font-size: 11px; }
.mini-account-list span { color: var(--ink-500); font-size: 9px; text-transform: uppercase; }
.mini-account-list b { color: var(--ink-900); font-size: 12px; white-space: nowrap; }
.account-type { display: inline-flex; padding: 4px 8px; border-radius: 7px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.type-asset { background: var(--blue-bg); color: var(--blue); }
.type-liability { background: var(--orange-100); color: var(--orange-700); }
.type-equity { background: var(--purple-bg); color: var(--purple); }
.type-income { background: var(--green-bg); color: var(--green); }
.type-expense { background: var(--red-bg); color: var(--red); }
.journal-break td { border-top: 2px solid var(--ink-100); }
.opening-row td { background: #fbfaf9; color: var(--ink-500); font-style: italic; }
.statement-card { max-width: 980px; margin: 0 auto; padding: 38px 45px; border: 1px solid var(--ink-100); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.statement-title { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid var(--ink-950); text-align: center; }
.statement-title span { color: var(--ink-500); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.statement-title h2 { margin: 4px 0 0; font-size: 25px; }
.statement-table { border: 1px solid var(--ink-100); }
.statement-table tfoot th { padding: 13px 14px; border-top: 2px solid var(--ink-950); background: #fff; color: var(--ink-950); font-size: 12px; }
.balance-check { margin-top: 15px; padding: 10px; border-radius: 8px; font-size: 11px; font-weight: 800; text-align: center; }
.balance-check.balanced { background: var(--green-bg); color: var(--green); }
.balance-check.unbalanced { background: var(--red-bg); color: var(--red); }
.statement-section { margin-bottom: 26px; }
.statement-section h3 { margin-bottom: 9px; padding-bottom: 7px; border-bottom: 1px solid var(--ink-200); color: var(--orange-700); font-size: 12px; text-transform: uppercase; }
.statement-section > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 7px 4px; color: var(--ink-700); font-size: 11px; }
.statement-section > div strong { color: var(--ink-900); }
.statement-section .statement-subtotal { margin-top: 6px; padding-top: 11px; border-top: 1px solid var(--ink-200); font-size: 12px; font-weight: 800; }
.statement-empty { margin: 0; padding: 12px 4px; color: var(--ink-500); font-size: 11px; }
.statement-net { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; border-radius: 10px; font-size: 15px; font-weight: 900; }
.statement-net.profit { background: var(--green-bg); color: var(--green); }
.statement-net.loss { background: var(--red-bg); color: var(--red); }
.balance-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.balance-equation { display: grid; grid-template-columns: auto 1fr auto auto 1fr; align-items: center; gap: 10px; margin-top: 12px; padding: 14px 17px; border-radius: 10px; background: var(--ink-950); color: #fff; }
.balance-equation span { color: #aaa39c; font-size: 10px; text-transform: uppercase; }
.balance-equation strong { text-align: right; }
.balance-equation i { color: var(--orange-400); font-style: normal; font-weight: 900; }

@media (max-width: 900px) {
  .accounting-overview { grid-template-columns: 1fr !important; }
  .expense-filters { grid-template-columns: repeat(2, minmax(140px,1fr)); }
  .balance-columns { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 640px) {
  .accounting-head { align-items: flex-start; }
  .button-row { width: 100%; }
  .button-row .btn { flex: 1; }
  .report-period { align-items: stretch; flex-direction: column; }
  .report-period label { min-width: 0; }
  .expense-filters { grid-template-columns: 1fr; }
  .statement-card { padding: 24px 16px; }
  .balance-equation { grid-template-columns: 1fr auto; }
  .balance-equation i { display: none; }
}

@media print {
  .accounting-head, .accounting-tabs, .report-period { display: none !important; }
  .statement-card { max-width: none; padding: 20px; border: 0; box-shadow: none; }
}

/* Human resources */
.hr-hero { display: flex; min-height: 145px; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 17px; padding: 28px 31px; border-radius: 19px; background: linear-gradient(125deg, #231e19 0%, #171410 60%, #45230f 100%); color: #fff; box-shadow: 0 16px 38px rgba(23,20,16,.13); }
.hr-hero h2 { margin: 3px 0 5px; font-size: 31px; }
.hr-hero p { margin: 0; color: #aaa39c; }
.hr-quick-actions { display: flex; gap: 8px; }
.hr-hero .btn-secondary { border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: #fff; box-shadow: none; }
.hr-stats { margin-bottom: 17px; }
.hr-module-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.hr-module-card { display: flex; min-height: 84px; align-items: center; gap: 11px; padding: 16px; border: 1px solid var(--ink-100); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); transition: .18s ease; }
.hr-module-card:hover { transform: translateY(-2px); border-color: var(--orange-200); }
.hr-module-icon { display: flex; width: 39px; height: 39px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 11px; background: var(--orange-100); color: var(--orange-700); font-size: 10px; font-weight: 900; }
.hr-module-card div { flex: 1; min-width: 0; }
.hr-module-card strong, .hr-module-card p { display: block; }
.hr-module-card strong { font-size: 12px; }
.hr-module-card p { overflow: hidden; margin: 2px 0 0; color: var(--ink-500); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hr-module-card b { color: var(--orange-500); }
.hr-side-list { padding: 6px 17px 13px; }
.hr-side-list > a, .side-list-static { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--ink-100); }
.hr-side-list > a:last-child, .side-list-static:last-child { border-bottom: 0; }
.hr-side-list strong, .hr-side-list span { display: block; }
.hr-side-list strong { font-size: 11px; }
.hr-side-list span:not(.status) { color: var(--ink-500); font-size: 9px; }
.hr-side-list b { font-size: 11px; white-space: nowrap; }
.hr-subnav { display: flex; gap: 3px; width: fit-content; overflow-x: auto; padding: 4px; border: 1px solid var(--ink-100); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.hr-subnav a { padding: 7px 11px; border-radius: 7px; color: var(--ink-500); font-size: 10px; font-weight: 800; white-space: nowrap; }
.hr-subnav a.active { background: var(--ink-950); color: #fff; }
.employee-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.employee-card { padding: 18px; border: 1px solid var(--ink-100); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.employee-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.employee-avatar { display: inline-flex; width: 43px; height: 43px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 13px; background: linear-gradient(145deg,var(--orange-400),var(--orange-600)); color: #fff; font-size: 17px; font-weight: 900; box-shadow: 0 7px 17px rgba(249,115,22,.19); }
.employee-avatar.large { width: 58px; height: 58px; border-radius: 16px; font-size: 23px; }
.employee-card h3 { font-size: 16px; }
.employee-card > p { min-height: 20px; margin: 3px 0 13px; color: var(--ink-500); font-size: 10px; }
.employee-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 15px; margin: 0 0 15px; padding: 12px; border-radius: 9px; background: #fbfaf9; }
.employee-card dt { color: var(--ink-500); font-size: 9px; }
.employee-card dd { margin: 2px 0 0; color: var(--ink-900); font-size: 10px; font-weight: 800; }
.employee-card-actions { display: flex; align-items: center; justify-content: space-between; }
.full-grid { grid-column: 1 / -1; min-height: 360px !important; }
.full-grid > span { font-size: 46px !important; }
.employee-profile-title { display: flex; align-items: center; gap: 14px; }
.attendance-filter { display: flex; align-items: flex-end; gap: 10px; }
.attendance-filter label { min-width: 190px; }
.attendance-metrics, .payroll-metrics { grid-template-columns: repeat(5,minmax(0,1fr)); }
.payroll-period { display: flex; align-items: flex-end; gap: 7px; }
.payroll-period label { min-width: 170px; }
.payroll-period input { padding-block: 7px; }
.payroll-empty { display: flex; min-height: 350px; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 18px; padding: 38px; text-align: center; }
.payroll-empty-icon { display: flex; width: 64px; height: 64px; align-items: center; justify-content: center; margin-bottom: 15px; border-radius: 19px; background: var(--orange-100); color: var(--orange-700); font-size: 16px; font-weight: 900; }
.payroll-empty h2 { margin: 4px 0 7px; }
.payroll-empty p { max-width: 510px; margin: 0 0 20px; color: var(--ink-500); }
.payroll-run-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.payroll-run-head h2 { margin: 0; }
.payroll-run-head p { margin: 4px 0 0; color: var(--ink-500); font-size: 11px; }
.table-input { min-width: 90px; margin: 0; padding: 7px 8px; }
.wide-input { min-width: 140px; }
table tfoot th { padding: 12px 14px; border-top: 2px solid var(--ink-200); background: #fbfaf9; color: var(--ink-900); font-size: 11px; }
.payroll-history { margin-top: 18px; }
.payslip-sheet { max-width: 800px; margin: 0 auto; padding: 45px 50px; border: 1px solid var(--ink-100); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.payslip-sheet > header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 26px; border-bottom: 2px solid var(--ink-950); }
.payslip-title { text-align: right; }
.payslip-title span, .payslip-title strong { display: block; }
.payslip-title span { color: var(--orange-600); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.payslip-title strong { margin-top: 4px; font-size: 18px; }
.payslip-employee { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; padding: 27px 0; }
.payslip-employee > div > span { color: var(--ink-500); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.payslip-employee > div > strong { display: block; margin-top: 5px; font-size: 17px; }
.payslip-employee p { margin: 4px 0 0; color: var(--ink-500); font-size: 10px; }
.payslip-employee dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; }
.payslip-employee dt { color: var(--ink-500); font-size: 10px; }
.payslip-employee dd { margin: 0; font-size: 10px; font-weight: 800; text-align: right; }
.payslip-lines { border: 1px solid var(--ink-100); border-radius: 10px; overflow: hidden; }
.payslip-lines > div { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--ink-100); font-size: 11px; }
.payslip-lines > div:last-child { border-bottom: 0; }
.payslip-net { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 17px 18px; border-radius: 10px; background: var(--ink-950); color: #fff; }
.payslip-net span { color: var(--orange-300); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.payslip-net strong { font-size: 22px; }
.payslip-sheet footer { display: flex; justify-content: space-between; margin-top: 35px; padding-top: 18px; border-top: 1px solid var(--ink-100); color: var(--ink-500); font-size: 9px; }
.payslip-sheet footer p { margin: 0; }

@media (max-width: 1180px) {
  .hr-module-grid, .employee-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .attendance-metrics, .payroll-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .hr-hero { align-items: flex-start; flex-direction: column; }
  .hr-quick-actions { width: 100%; }
  .hr-quick-actions .btn { flex: 1; }
  .hr-module-grid, .employee-grid { grid-template-columns: 1fr; }
  .attendance-filter, .payroll-period { align-items: stretch; flex-direction: column; }
  .attendance-filter label, .payroll-period label { min-width: 0; }
  .attendance-metrics, .payroll-metrics { grid-template-columns: 1fr 1fr; }
  .payslip-sheet { padding: 28px 20px; }
  .payslip-employee { grid-template-columns: 1fr; }
}

@media print {
  .payslip-sheet { max-width: none; padding: 20px; border: 0; box-shadow: none; }
}

