:root {
  --gold: #bd8317;
  --gold-dark: #94620c;
  --gold-deep: #5e410f;
  --gold-soft: #fff6df;
  --gold-pale: #fffaf0;
  --ink: #252721;
  --text: #33372f;
  --muted: #858a80;
  --line: #e8eae4;
  --bg: #f5f6f3;
  --white: #fff;
  --green: #258761;
  --green-soft: #eaf7f1;
  --red: #c34c42;
  --red-soft: #fff0ed;
  --blue: #4b76a8;
  --blue-soft: #edf4fb;
  --violet: #7a65a3;
  --shadow: 0 10px 35px rgba(36, 38, 30, .06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(189, 131, 23, .18); outline-offset: 1px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* Login */
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(470px, .95fr); background: var(--white); }
.login-brand-panel { position: relative; overflow: hidden; padding: 44px 6vw; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 88% 14%, rgba(255,221,134,.23), transparent 30%), radial-gradient(circle at 10% 90%, rgba(255,222,139,.12), transparent 30%), linear-gradient(145deg, #3b2c12 0%, #785313 52%, #a87516 100%); }
.login-brand-panel:before, .login-brand-panel:after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; width: 520px; height: 520px; right: -270px; bottom: -160px; }
.login-brand-panel:after { width: 400px; height: 400px; right: -210px; bottom: -100px; }
.login-brand { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.login-brand img { width: 74px; height: 74px; object-fit: contain; border-radius: 16px; mix-blend-mode: screen; }
.login-brand span { font-size: 16px; letter-spacing: 2px; color: #f8e9c4; }
.login-message { position: relative; z-index: 1; margin: 60px 0; }
.eyebrow { color: var(--gold); letter-spacing: 2px; font-size: 11px; font-weight: 750; margin-bottom: 14px; }
.eyebrow.light { color: #e7c678; }
.login-message h1 { font-size: clamp(34px, 3.4vw, 52px); line-height: 1.38; margin: 0 0 24px; letter-spacing: -1.5px; font-weight: 650; }
.login-message p { font-size: 16px; line-height: 1.9; color: #e2d8c3; }
.login-feature-row { display: flex; gap: 12px; margin-top: 36px; }
.login-feature-row span { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); padding: 9px 16px; border-radius: 30px; color: #f5e8cb; }
.login-footer { color: #cbbd9f; font-size: 12px; letter-spacing: 2px; }
.login-form-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; position: relative; }
.login-card { width: min(390px, 100%); }
.login-card h2 { font-size: 28px; margin: 0 0 10px; color: var(--ink); }
.login-card > .muted { margin: 0 0 36px; }
.field-label { display: block; font-weight: 600; font-size: 13px; margin: 20px 0 8px; }
.field-label .required, label.required:before { color: var(--red); content: "*"; margin-right: 4px; }
.input-with-icon { height: 46px; border: 1px solid #dfe2da; border-radius: 9px; display: flex; align-items: center; padding: 0 13px; gap: 10px; transition: .2s; }
.input-with-icon:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(189,131,23,.1); }
.input-with-icon > span { color: #92968c; }
.input-with-icon input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; color: var(--ink); }
.input-with-icon .icon-button { border: 0; padding: 4px; }
.form-error { min-height: 28px; padding-top: 8px; color: var(--red); font-size: 12px; }
.demo-account { display: flex; gap: 8px; color: #8b8c80; font-size: 12px; line-height: 1.7; background: var(--gold-pale); border-radius: 8px; padding: 12px; margin-top: 20px; }
.demo-account svg { width: 15px; height: 15px; margin-top: 2px; color: var(--gold); }
.login-copyright { position: absolute; bottom: 24px; color: #a1a49b; font-size: 12px; }
.mobile-login-logo { display: none; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 244px; height: 100vh; position: fixed; z-index: 40; left: 0; top: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand-block { height: 78px; display: flex; align-items: center; gap: 10px; padding: 10px 20px; cursor: pointer; border-bottom: 1px solid #f1f2ee; }
.brand-block img { width: 52px; height: 56px; object-fit: contain; }
.brand-block strong { display: block; color: var(--gold-deep); font-size: 20px; line-height: 1.2; letter-spacing: -.5px; }
.brand-block strong span { font-size: 16px; color: var(--ink); margin-left: 2px; }
.brand-block small { color: #97998f; font-size: 10px; letter-spacing: 1.2px; }
.company-switch { margin: 16px 14px 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; display: flex; align-items: center; gap: 9px; text-align: left; }
.company-switch > span:nth-child(2) { flex: 1; }
.company-switch small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 2px; }
.company-switch strong { font-size: 13px; font-weight: 600; }
.company-switch > span:last-child svg { width: 14px; color: #999; }
.company-icon { width: 30px; height: 30px; background: var(--gold-soft); color: var(--gold); border-radius: 7px; }
.company-icon svg { width: 16px; }
.main-nav { padding: 4px 12px 12px; overflow-y: auto; flex: 1; }
.nav-section-title { font-size: 10px; color: #a2a69b; letter-spacing: 1px; padding: 18px 12px 7px; }
.nav-item { width: 100%; height: 41px; border: 0; background: transparent; border-radius: 8px; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #63675e; margin: 2px 0; transition: .16s; position: relative; }
.nav-item svg { width: 18px; }
.nav-item:hover { background: #f7f7f3; color: var(--ink); }
.nav-item.active { color: var(--gold-dark); background: var(--gold-soft); font-weight: 650; }
.nav-item.active:before { content: ""; position: absolute; left: -12px; height: 20px; width: 3px; border-radius: 0 4px 4px 0; background: var(--gold); }
.nav-badge { margin-left: auto; min-width: 19px; height: 19px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 5px; }
.sidebar-bottom { padding: 12px; border-top: 1px solid var(--line); }
.sidebar-budget { padding: 12px; background: #fafaf7; border-radius: 9px; margin-bottom: 10px; }
.sidebar-budget > div:first-child { display: flex; justify-content: space-between; font-size: 11px; }
.sidebar-budget strong { color: var(--gold-dark); }
.sidebar-budget small { color: #999d93; font-size: 10px; }
.progress { height: 7px; border-radius: 10px; background: #eceee8; overflow: hidden; }
.progress.thin { height: 5px; margin: 9px 0 7px; }
.progress i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #d7ad4c, var(--gold)); transition: width .5s; }
.progress i.warning { background: #d17c43; }
.progress i.danger { background: var(--red); }
.sidebar-user { border: 0; background: transparent; display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; padding: 8px; border-radius: 8px; }
.sidebar-user:hover { background: #f7f8f4; }
.sidebar-user > span:nth-child(2) { flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #d9b45b, #aa7414); color: #fff; font-weight: 650; }
.main-area { margin-left: 244px; min-width: 0; flex: 1; }
.topbar { height: 78px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 25; backdrop-filter: blur(14px); }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.breadcrumb { color: #a0a39b; font-size: 10px; margin-bottom: 5px; }
.breadcrumb span:first-child { margin: 0 5px; }
.topbar h1 { font-size: 18px; margin: 0; color: var(--ink); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.icon-button { width: 36px; height: 36px; border: 0; background: transparent; display: inline-grid; place-items: center; border-radius: 8px; color: #71766b; padding: 0; }
.icon-button:hover { background: #f2f3ef; }
.mobile-menu { display: none; }
.search-trigger { height: 36px; width: 214px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: #969a91; border: 1px solid var(--line); background: #f8f9f6; border-radius: 8px; text-align: left; }
.search-trigger > span:nth-child(2) { flex: 1; }
kbd { border: 1px solid #e0e2dc; background: #fff; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-family: inherit; }
.notification-button { border: 1px solid var(--line); position: relative; }
.notification-button i { position: absolute; width: 6px; height: 6px; background: var(--red); border: 2px solid #fff; border-radius: 50%; box-sizing: content-box; top: 6px; right: 6px; }
.notification-button b { position: absolute; top: -4px; right: -5px; min-width: 17px; height: 17px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
input[type="checkbox"] { accent-color: var(--gold); width: 17px; height: 17px; }
.btn { min-height: 36px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 550; transition: .16s; white-space: nowrap; }
.btn:hover { border-color: #cfd2c9; background: #fafbf8; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #c28b23, #a66f11); border-color: #ad7716; box-shadow: 0 4px 10px rgba(170,113,15,.15); }
.btn-primary:hover { background: linear-gradient(135deg, #b27b17, #94610c); border-color: #9f6a10; }
.btn-danger { color: #fff; background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #ad4037; }
.btn-text { border: 0; background: transparent; color: var(--gold-dark); padding: 5px 8px; min-height: 28px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 46px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.page-content { padding: 26px 28px 44px; max-width: 1580px; margin: 0 auto; }

/* Shared components */
.page-intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-intro h2 { font-size: 22px; margin: 0 0 7px; color: var(--ink); }
.page-intro p { margin: 0; color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px rgba(30,35,24,.015); }
.card-header { padding: 19px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eff0ec; }
.card-header h3 { font-size: 15px; margin: 0; color: var(--ink); }
.card-header p { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
.card-body { padding: 21px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 13px; }
.section-title h3 { margin: 0; font-size: 16px; color: var(--ink); }
.section-title small { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 9px; font-size: 11px; white-space: nowrap; }
.pill:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-pending { color: #a56c0c; background: #fff5db; }
.pill-approved { color: var(--green); background: var(--green-soft); }
.pill-rejected { color: var(--red); background: var(--red-soft); }
.pill-draft { color: #777c72; background: #eff0ec; }
.amount { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); white-space: nowrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .empty-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 15px; background: var(--gold-soft); color: var(--gold); }
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { color: var(--text); margin: 0 0 8px; }

/* Dashboard */
.welcome-strip { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.welcome-strip h2 { font-size: 23px; margin: 0 0 7px; color: var(--ink); font-weight: 650; }
.welcome-strip p { color: var(--muted); margin: 0; }
.date-chip { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: #73786e; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.stat-card { padding: 19px; min-height: 137px; position: relative; overflow: hidden; }
.stat-card:after { content: ""; position: absolute; width: 100px; height: 100px; border-radius: 50%; right: -55px; top: -55px; background: var(--gold-soft); opacity: .65; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: #777c72; font-size: 12px; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.8px; color: var(--ink); margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; font-weight: 550; margin-right: 2px; }
.stat-foot { color: #969a90; font-size: 11px; }
.stat-foot strong { color: var(--green); font-weight: 550; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .85fr); gap: 16px; margin-top: 16px; }
.chart-legend { display: flex; align-items: center; gap: 18px; font-size: 11px; color: var(--muted); }
.chart-legend span:before { content: ""; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; display: inline-block; margin-right: 6px; }
.line-chart { width: 100%; height: 224px; overflow: visible; }
.line-chart .grid-line { stroke: #eceee8; stroke-width: 1; }
.line-chart .axis-text { fill: #999d93; font-size: 10px; }
.line-chart .area { fill: url(#goldArea); stroke: none; }
.line-chart .line { fill: none; stroke: #bd8317; stroke-width: 2.5; }
.line-chart .point { fill: #fff; stroke: #bd8317; stroke-width: 2; }
.category-content { display: flex; flex-direction: column; align-items: center; }
.donut-wrap { position: relative; width: 150px; height: 150px; margin: 8px auto 20px; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; }
.donut:after { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: #fff; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; }
.donut-center strong { font-size: 20px; color: var(--ink); }
.donut-center small { color: var(--muted); margin-top: 4px; }
.category-list { width: 100%; }
.category-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 12px; }
.category-row i { width: 7px; height: 7px; border-radius: 2px; }
.category-row span:nth-child(2) { flex: 1; color: #71766c; }
.category-row strong { font-weight: 600; }
.quick-entry-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.quick-entry { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 17px; display: flex; align-items: center; gap: 12px; text-align: left; transition: .18s; }
.quick-entry:hover { border-color: #d8bb79; transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-entry > span:nth-child(2) { flex: 1; }
.quick-entry strong, .quick-entry small { display: block; }
.quick-entry strong { margin-bottom: 5px; color: var(--ink); }
.quick-entry small { color: var(--muted); font-size: 11px; }
.quick-entry > span:last-child { color: #b4b7af; }
.quick-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.quick-icon.gold { background: var(--gold-soft); color: var(--gold); }
.quick-icon.green { background: var(--green-soft); color: var(--green); }
.quick-icon.blue { background: var(--blue-soft); color: var(--blue); }
.quick-icon.violet { background: #f1edf8; color: var(--violet); }
.quick-icon svg { width: 20px; height: 20px; }

/* Tables and filters */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: #8a8f84; font-size: 11px; font-weight: 550; padding: 13px 18px; background: #fafbf9; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 15px 18px; border-bottom: 1px solid #eff0ec; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: .12s; }
tbody tr:hover { background: #fcfcf9; }
.record-link { border: 0; padding: 0; background: transparent; text-align: left; color: var(--text); }
.record-link strong { display: block; font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-link small { color: #9a9d95; font-size: 10px; }
.record-link:hover strong { color: var(--gold-dark); }
.type-cell { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.type-mini { width: 28px; height: 28px; border-radius: 7px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.type-mini svg { width: 14px; height: 14px; }
.table-actions { display: flex; gap: 5px; }
.filter-bar { display: flex; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.filter-search { min-width: 230px; flex: 1; max-width: 360px; height: 36px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.filter-search input { border: 0; outline: 0; min-width: 0; flex: 1; }
.filter-search svg { width: 16px; color: #979b91; }
.filter-select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 30px 0 10px; background: #fff; color: #64695f; }
.filter-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.tabs { display: flex; gap: 25px; padding: 0 21px; border-bottom: 1px solid var(--line); background: #fff; }
.tab { border: 0; background: transparent; padding: 16px 1px 13px; color: var(--muted); position: relative; }
.tab.active { color: var(--gold-dark); font-weight: 650; }
.tab.active:after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--gold); }
.tab b { font-size: 10px; border-radius: 10px; background: #f0f1ed; padding: 1px 6px; margin-left: 5px; }

/* Forms */
.form-page { max-width: 1060px; margin: 0 auto; }
.form-page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.back-button { border: 1px solid var(--line); background: #fff; }
.form-page-head h2 { margin: 0 0 5px; font-size: 21px; }
.form-page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
.form-card { padding: 25px 28px; }
.form-section-title { font-size: 15px; color: var(--ink); margin: 0 0 22px; display: flex; align-items: center; gap: 8px; }
.form-section-title:before { content: ""; width: 3px; height: 15px; background: var(--gold); border-radius: 3px; }
.form-section-title:not(:first-child) { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 12px; font-weight: 550; margin-bottom: 8px; }
.form-group label.required:before { content: "*"; color: var(--red); margin-right: 4px; }
.form-control { width: 100%; height: 41px; border: 1px solid #dfe2da; border-radius: 8px; padding: 0 12px; background: #fff; color: var(--text); transition: .16s; }
.form-control:focus { border-color: #c4963a; box-shadow: 0 0 0 3px rgba(189,131,23,.08); outline: 0; }
textarea.form-control { min-height: 94px; resize: vertical; padding-top: 11px; line-height: 1.6; }
.form-hint { color: #a0a49a; font-size: 10px; margin-top: 6px; }
.money-input { display: flex; align-items: center; border: 1px solid #dfe2da; border-radius: 8px; overflow: hidden; height: 41px; }
.money-input:focus-within { border-color: #c4963a; box-shadow: 0 0 0 3px rgba(189,131,23,.08); }
.money-input > span { padding-left: 12px; color: #8a8e84; }
.money-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0 8px; font-variant-numeric: tabular-nums; }
.money-input b { align-self: stretch; display: flex; align-items: center; padding: 0 12px; background: #f6f7f4; border-left: 1px solid var(--line); color: #777c72; font-size: 11px; font-weight: 500; }
.form-total { background: var(--gold-pale); border: 1px solid #f0e2bd; padding: 14px 16px; border-radius: 9px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.form-total span { color: #847352; }
.form-total strong { font-size: 22px; color: var(--gold-dark); }
.detail-list { display: flex; flex-direction: column; gap: 12px; }
.detail-row { border: 1px solid var(--line); background: #fafbf9; border-radius: 10px; padding: 17px; position: relative; }
.detail-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.detail-row-head strong { font-size: 12px; }
.detail-row-head button { border: 0; color: #a0a49a; background: transparent; padding: 4px; }
.detail-row-head button:hover { color: var(--red); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.detail-grid .form-group label { font-size: 11px; }
.add-detail { border: 1px dashed #d8c18b; color: var(--gold-dark); background: var(--gold-pale); width: 100%; margin-top: 12px; }
.upload-zone { border: 1px dashed #d8dcd2; border-radius: 9px; padding: 19px; text-align: center; transition: .16s; }
.upload-zone:hover { border-color: var(--gold); background: var(--gold-pale); }
.upload-zone input { display: none; }
.upload-zone label { cursor: pointer; color: var(--gold-dark); display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }
.upload-zone p { margin: 7px 0 0; color: #a0a49a; font-size: 10px; }
.attachment-list { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.attachment-item { display: flex; align-items: center; gap: 9px; background: #f7f8f5; border-radius: 7px; padding: 8px 10px; font-size: 11px; }
.attachment-item > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-item small { color: var(--muted); }
.attachment-item button { border: 0; background: transparent; color: #999; padding: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); margin-top: 26px; padding-top: 20px; }
.approval-side { position: sticky; top: 100px; }
.approval-side .card-body { padding: 20px; }
.approval-side h3 { margin: 0 0 7px; font-size: 14px; }
.approval-side > .card-body > p { color: var(--muted); font-size: 11px; margin: 0 0 20px; line-height: 1.6; }
.flow-step { display: flex; gap: 11px; min-height: 66px; position: relative; }
.flow-step:not(:last-child):before { content: ""; position: absolute; left: 13px; top: 29px; bottom: 0; width: 1px; background: #e2e4de; }
.flow-node { width: 27px; height: 27px; border-radius: 50%; background: #f0f1ed; color: #8b9086; display: grid; place-items: center; z-index: 1; }
.flow-node svg { width: 13px; }
.flow-step.current .flow-node { color: var(--gold-dark); background: var(--gold-soft); border: 1px solid #e3c47d; }
.flow-step strong, .flow-step small { display: block; }
.flow-step strong { font-size: 12px; margin: 2px 0 4px; }
.flow-step small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-tip { margin-top: 14px; background: #f0f5f2; border: 1px solid #e0ebe4; border-radius: 10px; padding: 13px; display: flex; gap: 8px; color: #718175; font-size: 11px; line-height: 1.6; }
.form-tip svg { color: var(--green); width: 15px; }

/* Budgets */
.budget-hero { background: linear-gradient(120deg, #3e321a, #735316); color: #fff; padding: 27px; border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; overflow: hidden; position: relative; }
.budget-hero:after { content: ""; position: absolute; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: -100px; top: -130px; }
.budget-hero h2 { margin: 0 0 8px; font-size: 22px; }
.budget-hero p { margin: 0; color: #daceb3; }
.budget-hero-value { text-align: right; z-index: 1; }
.budget-hero-value strong { display: block; font-size: 32px; color: #f3d686; }
.budget-hero-value small { color: #daceb3; }
.budget-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.budget-row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.budget-row:last-child { border-bottom: 0; }
.budget-row-top { display: flex; align-items: center; margin-bottom: 10px; }
.budget-row-top strong { flex: 1; }
.budget-row-top span { font-size: 12px; color: var(--muted); }
.budget-row-top b { color: var(--text); }
.budget-row-top button { margin-left: 10px; }
.budget-row-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 7px; }
.saving-card { padding: 16px; border-radius: 10px; background: #f8faf6; margin-bottom: 10px; display: flex; gap: 12px; }
.saving-card > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.saving-card h4 { margin: 0 0 6px; font-size: 13px; }
.saving-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.saving-card strong { color: var(--green); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 18px; align-items: start; }
.settings-menu { padding: 9px; }
.settings-menu button { width: 100%; border: 0; background: transparent; border-radius: 8px; padding: 12px; text-align: left; display: flex; gap: 9px; align-items: center; color: var(--muted); }
.settings-menu button.active { background: var(--gold-soft); color: var(--gold-dark); font-weight: 600; }
.settings-section { padding: 24px; }
.settings-section h3 { margin: 0 0 5px; }
.settings-section > p { color: var(--muted); margin: 0 0 22px; }
.info-banner { padding: 14px 16px; background: var(--blue-soft); color: #58718d; border-radius: 9px; display: flex; gap: 9px; line-height: 1.7; font-size: 12px; margin-bottom: 20px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { color: var(--muted); margin-top: 5px; }
.switch { width: 40px; height: 22px; border: 0; background: #d9ddd3; border-radius: 20px; padding: 3px; transition: .2s; }
.switch i { display: block; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch.on { background: var(--gold); }
.switch.on i { transform: translateX(18px); }

/* Modal, drawer, toast */
.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(24,27,21,.35); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s; }
.modal { background: #fff; border-radius: 15px; width: min(460px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 25px 70px rgba(20,25,16,.22); animation: slideUp .2s; }
.modal-lg { width: min(650px, 100%); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--line); }
.drawer-backdrop { justify-content: flex-end; padding: 0; }
.drawer { height: 100vh; width: min(620px, 95vw); background: #fff; overflow-y: auto; box-shadow: -20px 0 60px rgba(20,25,16,.16); animation: slideLeft .2s; }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); z-index: 2; }
.drawer-header h3 { margin: 0 0 5px; }
.drawer-header small { color: var(--muted); }
.drawer-body { padding: 24px; }
.drawer-amount { background: var(--gold-pale); border: 1px solid #eee0bb; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.drawer-amount small { color: #95805a; }
.drawer-amount strong { display: block; font-size: 29px; color: var(--gold-dark); margin: 6px 0; }
.detail-list-info { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.info-item small, .info-item strong { display: block; }
.info-item small { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.info-item strong { font-size: 13px; font-weight: 550; line-height: 1.6; }
.info-item.full { grid-column: 1 / -1; }
.drawer-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.drawer-section h4 { margin: 0 0 15px; }
.audit-step { display: flex; gap: 12px; position: relative; min-height: 60px; }
.audit-step:not(:last-child):before { content: ""; position: absolute; left: 5px; top: 13px; bottom: 0; width: 1px; background: #e0e3dc; }
.audit-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); margin-top: 3px; z-index: 1; }
.audit-step strong { display: block; font-size: 12px; }
.audit-step small { color: var(--muted); font-size: 10px; }
.audit-step p { margin: 5px 0 0; color: var(--red); font-size: 11px; }
.drawer-actions { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; flex-wrap: wrap; }
.discussion-list { display: flex; flex-direction: column; gap: 12px; }
.discussion-item { display: flex; gap: 10px; }
.discussion-item strong, .discussion-item small, .discussion-item p { display: block; }
.discussion-item strong { font-size: 12px; }
.discussion-item small { color: var(--muted); font-size: 10px; margin: 3px 0 5px; }
.discussion-item p { margin: 0; background: #f6f7f4; border-radius: 9px; padding: 9px 11px; font-size: 12px; line-height: 1.6; }
.toast-container { position: fixed; z-index: 120; top: 90px; right: 24px; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 400px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(30,35,24,.14); border-radius: 10px; padding: 13px 16px; display: flex; gap: 10px; align-items: center; animation: slideLeft .2s; }
.toast > span { color: var(--green); }
.toast.error > span { color: var(--red); }
.toast p { margin: 0; font-size: 12px; line-height: 1.5; }
.ui-update-banner { position: fixed; z-index: 130; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; box-shadow: 0 16px 44px rgba(30,35,24,.16); animation: slideLeft .2s; }
.ui-update-banner span { font-size: 12px; color: var(--text); }
.ui-update-banner button { height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: 12px; cursor: pointer; color: var(--muted); }
.ui-update-banner button.primary { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.quick-menu { position: fixed; z-index: 70; right: 28px; top: 70px; width: 300px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 15px 45px rgba(30,35,24,.15); }
.quick-menu button { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; width: 100%; padding: 10px; border-radius: 8px; text-align: left; }
.quick-menu button:hover { background: #f7f8f4; }
.quick-menu button > span:nth-child(2) { flex: 1; }
.quick-menu strong, .quick-menu small { display: block; }
.quick-menu strong { font-size: 12px; }
.quick-menu small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.sidebar-mask { display: none; }
.skeleton { background: linear-gradient(90deg, #f1f2ee 25%, #f8f9f6 50%, #f1f2ee 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: 8px; min-height: 100px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes skeleton { to { background-position: -200% 0; } }

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-entry-grid { grid-template-columns: repeat(2, 1fr); }
  .search-trigger { width: 170px; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.open { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20,25,16,.35); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: grid; }
  .dashboard-grid, .budget-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .approval-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-tip { margin-top: 0; }
  .login-view { grid-template-columns: 1fr 1fr; }
  .login-brand-panel { padding: 35px; }
}
@media (max-width: 700px) {
  .login-view { display: block; background: var(--bg); padding: 30px 18px; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: calc(100vh - 60px); padding: 20px; }
  .login-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 22px; }
  .mobile-login-logo { display: block; text-align: center; margin-bottom: 18px; }
  .mobile-login-logo img { width: 90px; height: 90px; object-fit: contain; }
  .login-copyright { position: static; margin-top: 25px; }
  .topbar { height: 68px; padding: 0 15px; }
  .breadcrumb { display: none; }
  .topbar h1 { font-size: 16px; }
  .topbar-actions { gap: 6px; }
  .search-trigger, .notification-button { display: none; }
  #quick-new { font-size: 0; width: 38px; padding: 0; }
  #quick-new svg { width: 18px; }
  #quick-new span:last-child { display: none; }
  .page-content { padding: 18px 14px 35px; }
  .welcome-strip h2 { font-size: 20px; }
  .date-chip { display: none; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 15px; min-height: 125px; }
  .stat-value { font-size: 21px; }
  .quick-entry-grid { grid-template-columns: 1fr; }
  .card-header, .card-body { padding: 16px; }
  .form-card { padding: 20px 16px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .approval-side { display: block; }
  .form-tip { margin-top: 12px; }
  .page-intro { align-items: flex-start; gap: 12px; }
  .page-intro h2 { font-size: 20px; }
  .page-intro .btn { font-size: 11px; padding: 7px 9px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-menu button { white-space: nowrap; }
  .budget-hero { display: block; }
  .budget-hero-value { text-align: left; margin-top: 20px; }
  .filter-count { display: none; }
  .filter-search { min-width: 100%; max-width: none; }
  .quick-menu { right: 14px; top: 61px; }
  .detail-list-info { grid-template-columns: 1fr; }
  .info-item.full { grid-column: auto; }
  .toast-container { left: 14px; right: 14px; top: 78px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}
