:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #17231e;
  background: #f5f7f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --green: #118263;
  --green-dark: #0a6c52;
  --line: #e8edeb;
  --muted: #78857f;
  --ink: #17231e;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f5f7f6; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .92fr) minmax(450px, 1.08fr); background: white; }
.login-panel { display: flex; flex-direction: column; padding: 32px clamp(25px, 6vw, 82px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #f8fafc; text-decoration: none; }
.brand-dark { color: #17231e; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: white; font-size: 22px; font-weight: 800; }
.brand b { display: block; font-size: 18px; letter-spacing: -.5px; }
.brand small { display: block; margin-top: 3px; color: #929e98; font-size: 8px; font-weight: 800; letter-spacing: 1.5px; }
.login-content { width: min(100%, 400px); align-self: center; margin: auto; padding: 44px 0; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: 1.45px; }
.login-content h1 { margin: 0; color: #1c2923; font-size: clamp(29px, 4vw, 38px); line-height: 1.13; letter-spacing: -1.5px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.65; }
.login-content > .muted { margin: 12px 0 28px; }
.form-stack { display: grid; gap: 9px; }
.form-stack label, .form-grid label, .field-label { color: #49564f; font-size: 11px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 40px; border: 1px solid #dfe6e2; border-radius: 7px; outline: 0; background: #fff; color: #26332c; padding: 9px 11px; font-size: 12px; }
input:focus, select:focus, textarea:focus { border-color: #4ab391; box-shadow: 0 0 0 3px rgba(17,130,99,.1); }
.form-stack input { margin-bottom: 7px; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; padding: 0 13px; font-size: 11px; font-weight: 750; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-quiet { border-color: #e1e7e3; background: white; color: #526058; }
.button-quiet:hover { background: #f6f8f7; }
.button-wide { width: 100%; min-height: 44px; margin-top: 6px; }
.button-small { min-height: 31px; padding: 0 10px; }
.setup-link { display: block; margin: 15px auto 0; border: 0; background: none; color: var(--green-dark); font-size: 11px; font-weight: 700; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 27px 0 0; color: #97a19b; font-size: 10px; }
.lock-icon { font-size: 15px; }
.error-message { margin: 2px 0; color: #b63d36; font-size: 11px; line-height: 1.45; }

.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vw, 112px); background: linear-gradient(140deg, #10271f, #164334 58%, #10251e); color: white; }
.art-glow { position: absolute; width: 750px; height: 750px; right: -330px; top: -250px; border: 1px solid rgba(152,230,196,.11); border-radius: 50%; box-shadow: 0 0 0 84px rgba(152,230,196,.025), 0 0 0 170px rgba(152,230,196,.02); }
.art-content, .art-footer { position: relative; z-index: 1; }
.art-badge { display: inline-flex; align-items: center; gap: 8px; color: #b9d8cb; font-size: 9px; font-weight: 800; letter-spacing: 1.2px; }
.art-badge i { width: 7px; height: 7px; border-radius: 50%; background: #58d49e; box-shadow: 0 0 11px #58d49e; }
.art-content h2 { margin: 21px 0 13px; font-size: clamp(39px, 5.3vw, 58px); line-height: 1.03; letter-spacing: -2px; }
.art-content > p { max-width: 390px; color: #b8cbc2; font-size: 13px; line-height: 1.75; }
.art-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 54px; }
.art-stats > div { min-height: 104px; display: flex; flex-direction: column; justify-content: center; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 12px; background: rgba(255,255,255,.045); }
.stat-icon { margin-bottom: 8px; color: #6dd6aa; font-size: 19px; }
.art-stats b { font-size: 10px; }
.art-stats small { margin-top: 5px; color: #a9beb4; font-size: 8px; }
.art-footer { position: absolute; right: 26px; bottom: 23px; color: #98b3a7; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }
.art-footer span { margin: 0 5px; color: #59d19c; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; width: 232px; display: flex; flex-direction: column; padding: 22px 14px 14px; background: #112019; color: #cad5cf; }
.sidebar > .brand { padding: 0 8px 27px; }
.sidebar .brand-mark { width: 35px; height: 35px; border-radius: 10px; font-size: 19px; }
.sidebar .brand b { font-size: 16px; }
.sidebar .brand small { color: #7d8c83; font-size: 7px; }
.nav-caption { padding: 0 11px 9px; color: #74857b; font-size: 8px; font-weight: 800; letter-spacing: 1.3px; }
.navigation { display: grid; gap: 3px; overflow-y: auto; }
.nav-item { width: 100%; min-height: 39px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 7px; padding: 0 11px; background: transparent; color: #b3c0b9; text-align: left; font-size: 11px; font-weight: 650; }
.nav-item > span:first-child { width: 18px; color: #889990; font-size: 15px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.055); color: white; }
.nav-item.active { background: rgba(24,153,113,.2); color: #7be0b9; }
.nav-item.active > span:first-child { color: #7be0b9; }
.sidebar-bottom { margin-top: auto; padding-top: 10px; }
.support-card { display: flex; align-items: center; gap: 9px; margin: 0 2px 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 10px 8px; }
.support-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #263b30; color: #b8c8bf; font-size: 11px; }
.support-card b, .support-card small { display: block; }
.support-card b { color: #d3ddd7; font-size: 9px; }
.support-card small { margin-top: 4px; color: #85958b; font-size: 8px; }
.logout-item { border-top: 1px solid rgba(255,255,255,.07); border-radius: 0; }

.app-main { min-height: 100vh; margin-left: 232px; }
.topbar { position: sticky; top: 0; z-index: 3; height: 61px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 27px; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: #98a29c; font-size: 10px; }
.breadcrumbs i { color: #c3cbc6; font-style: normal; }
.breadcrumbs b { color: #35433b; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.today-label { margin-right: 7px; color: #86928b; font-size: 9px; }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e5f4ed; color: #108060; font-size: 10px; font-weight: 800; }
.user-label { max-width: 160px; overflow: hidden; color: #45534b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu { display: none !important; }
.page-content { width: min(100%, 1480px); min-height: calc(100vh - 107px); margin: 0 auto; padding: 28px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; color: #1b2921; font-size: 28px; letter-spacing: -1px; }
.page-heading .eyebrow { margin-bottom: 6px; }
.page-heading .muted { margin: 6px 0 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 15px; }
.metric, .card { border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 2px 6px rgba(18,38,27,.02); }
.metric { min-height: 121px; padding: 14px 15px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #78857d; font-size: 10px; font-weight: 650; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #e9f7f1; color: #148763; font-size: 15px; }
.metric-icon.amber { background: #fff6e6; color: #c28a24; }
.metric-icon.blue { background: #eef4ff; color: #4e79ca; }
.metric-icon.violet { background: #f2edfc; color: #8561bc; }
.metric strong { display: block; margin-top: 9px; color: #202c25; font-size: 25px; letter-spacing: -.7px; }
.metric small { display: block; margin-top: 4px; color: #99a39d; font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(270px,.8fr); gap: 14px; }
.card { padding: 17px; margin-bottom: 14px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-heading h2 { margin: 0; color: #28352d; font-size: 14px; }
.card-heading .muted { margin: 4px 0 0; font-size: 9px; }
.quick-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.quick-action { min-height: 74px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid #e8eeea; border-radius: 8px; padding: 12px 10px; background: white; color: #49574f; text-align: left; }
.quick-action:hover { border-color: #b7ddcd; background: #f7fcf9; }
.quick-action > span:first-child { color: var(--green); font-size: 16px; }
.quick-action b, .quick-action small { display: block; }
.quick-action b { font-size: 10px; }
.quick-action small { margin-top: 5px; color: #98a39c; font-size: 8px; line-height: 1.4; }
.chart-bars { height: 170px; display: flex; align-items: end; gap: 10px; border-bottom: 1px solid #e9eeeb; padding: 8px 4px 0; }
.chart-column { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 6px; color: #89968e; font-size: 8px; }
.chart-column .bar { width: min(100%,34px); min-height: 3px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg,#52c49a,#148565); }
.chart-column .bar-label { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.search-field { min-width: 160px; flex: 1; display: flex; align-items: center; gap: 7px; border: 1px solid #e1e7e3; border-radius: 7px; padding-left: 9px; color: #89958e; }
.search-field input { min-height: 35px; border: 0; padding: 7px 8px 7px 0; box-shadow: none; }
.filter-select { width: auto; min-width: 130px; min-height: 35px; padding: 6px 9px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 8px; border-bottom: 1px solid #edf1ee; color: #939e97; font-size: 8px; font-weight: 800; letter-spacing: .55px; white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid #f0f3f1; color: #5b6860; font-size: 10px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.primary-cell { color: #344139; font-weight: 700; }
.secondary-cell { display: block; margin-top: 3px; color: #99a39d; font-size: 8px; font-weight: 400; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 7px; background: #eaf7f0; color: #12815f; font-size: 8px; font-weight: 750; white-space: nowrap; }
.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.badge.warning { background: #fff6e6; color: #ac771a; }
.badge.danger { background: #fff0ef; color: #bb4942; }
.badge.neutral { background: #eff2f0; color: #727d76; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.row-action { min-height: 25px; border: 1px solid #e5eae7; border-radius: 5px; padding: 0 7px; background: white; color: #536159; font-size: 8px; font-weight: 700; }
.row-action:hover { border-color: #b8ddce; color: #0a7758; }
.row-action.danger:hover { border-color: #f0c4c0; color: #b43e36; }
.empty-state { padding: 29px 12px; color: #94a099; text-align: center; font-size: 10px; }
.pagination { min-height: 38px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #87938c; font-size: 9px; }
.pagination button { min-height: 27px; border: 1px solid #e0e6e2; border-radius: 5px; padding: 0 8px; background: white; color: #46534b; font-size: 9px; }
.pagination button:disabled { opacity: .45; cursor: default; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-grid label { display: grid; align-content: start; gap: 6px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid textarea { min-height: 65px; resize: vertical; }
.sale-lines { display: grid; gap: 8px; }
.sale-line { display: grid; grid-template-columns: minmax(190px,1fr) 105px 118px 30px; align-items: end; gap: 8px; }
.sale-line label { display: grid; gap: 5px; color: #78847c; font-size: 9px; font-weight: 700; }
.sale-line input, .sale-line select { min-height: 34px; font-size: 10px; }
.remove-line { width: 28px; height: 30px; border: 0; border-radius: 5px; background: #fff0ef; color: #bd4d44; font-size: 16px; }
.line-heading { display: flex; align-items: center; justify-content: space-between; margin: 17px 0 9px; color: #4c5a51; font-size: 10px; font-weight: 750; }
.sale-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; border-top: 1px solid #edf1ee; padding-top: 12px; }
.sale-summary strong { color: #25332b; font-size: 17px; }
.item-list { display: grid; gap: 8px; }
.item-select-row { display: grid; grid-template-columns: minmax(150px,1fr) 95px 100px 28px; align-items: end; gap: 7px; }
.item-select-row label { display: grid; gap: 5px; color: #78847c; font-size: 9px; }
.footer { padding: 0 28px 17px; color: #a0aaa4; font-size: 9px; }
.footer span { margin: 0 5px; color: #c1c9c4; }

.modal { width: min(650px,calc(100vw - 24px)); max-height: 90vh; overflow: auto; border: 1px solid #e4eae6; border-radius: 11px; padding: 19px; box-shadow: 0 20px 70px rgba(10,30,20,.24); }
.modal::backdrop { background: rgba(13,28,20,.5); backdrop-filter: blur(2px); }
.modal form { display: grid; gap: 13px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { margin: 0; color: #28362e; font-size: 19px; }
.modal-header .eyebrow { margin: 0 0 5px; }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #e2e8e4; border-radius: 7px; background: white; color: #657269; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 3px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 10; max-width: min(390px,calc(100vw - 30px)); transform: translateY(12px); opacity: 0; pointer-events: none; border-radius: 8px; padding: 11px 14px; background: #153a2b; color: #e9fff4; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 10px; transition: .18s; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { background: #6c2c27; color: white; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 1050px) {
  .sidebar { width: 210px; }
  .app-main { margin-left: 210px; }
  .page-content { padding: 23px 20px; }
  .topbar { padding: 0 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; padding: 24px 23px; }
  .login-art { display: none; }
  .sidebar { width: 245px; transform: translateX(-105%); transition: transform .18s ease; box-shadow: 14px 0 30px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .topbar { height: 55px; gap: 8px; padding: 0 12px; }
  .mobile-menu { display: grid !important; flex-shrink: 0; }
  .breadcrumbs { margin-right: auto; }
  .today-label { display: none; }
  .page-content { padding: 20px 13px; }
  .page-heading { align-items: flex-start; }
  .footer { padding: 0 13px 15px; }
}
@media (max-width: 500px) {
  .topbar-user { gap: 7px; }
  .user-label { max-width: 95px; }
  .page-heading { flex-direction: column; }
  .page-heading > .button { width: 100%; }
  .metric { min-height: 111px; padding: 11px; }
  .metric strong { font-size: 22px; }
  .metric-top { font-size: 9px; }
  .card { padding: 13px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-action { min-height: 57px; }
  .table-toolbar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .sale-line { grid-template-columns: minmax(140px,1fr) 75px 28px; gap: 6px; }
  .sale-line .line-price { grid-column: 1 / 3; }
  .sale-line .remove-line { grid-column: 3; grid-row: 1 / span 2; }
  .art-stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
