:root {
  color-scheme: light;
  --bg: #f3f7f7;
  --surface: #ffffff;
  --surface-2: #edf5f3;
  --text: #17272a;
  --muted: #6d7d80;
  --border: #dce7e5;
  --primary: #087f6d;
  --primary-dark: #066657;
  --primary-soft: #e1f3ef;
  --blue: #2563a7;
  --blue-soft: #e7f0fc;
  --orange: #a95e08;
  --orange-soft: #fff0dc;
  --red: #b84037;
  --red-soft: #fce9e7;
  --purple: #7652ad;
  --purple-soft: #f0eafa;
  --shadow: 0 18px 45px rgba(26, 55, 59, .09);
  --radius: 15px;
  --font: "Leelawadee UI", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: var(--font); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); }
.login-brand { padding: 52px clamp(42px, 7vw, 100px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: linear-gradient(145deg, #075f55, #087f6d 60%, #0c947e); position: relative; overflow: hidden; }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.login-brand::before { width: 460px; height: 460px; right: -140px; top: 14%; }
.login-brand::after { width: 310px; height: 310px; right: -65px; top: 26%; }
.brand-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 600; }
.brand-symbol { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; background: var(--primary); font-weight: 700; }
.login-brand .brand-symbol { color: var(--primary); background: #fff; }
.login-copy { position: relative; z-index: 1; max-width: 580px; }
.eyebrow { display: inline-block; margin-bottom: 20px; padding: 6px 10px; border-radius: 99px; background: rgba(255,255,255,.12); font-size: 12px; letter-spacing: .04em; }
.login-copy h1 { margin-bottom: 18px; font-size: clamp(35px, 4.5vw, 58px); font-weight: 500; line-height: 1.15; letter-spacing: -.03em; }
.login-copy p { max-width: 520px; color: rgba(255,255,255,.76); font-size: 16px; line-height: 1.75; }
.feature-strip { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 22px; color: rgba(255,255,255,.85); font-size: 13px; }
.login-panel { display: grid; place-items: center; padding: 36px; background: var(--surface); }
.login-card { width: min(390px, 100%); display: grid; gap: 18px; }
.login-card h2 { margin-bottom: 5px; font-size: 28px; font-weight: 600; }
.login-card p { color: var(--muted); }
.login-card label, .field { display: grid; gap: 7px; color: var(--text); font-size: 13px; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; outline: none; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,109,.12); }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; }
.demo-accounts { color: var(--muted); font-size: 12px; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.demo-accounts summary { color: var(--primary); cursor: pointer; }
.demo-accounts p { margin: 8px 0 0; font-size: 11px; }
.mobile-brand { display: none; align-items: center; gap: 10px; }
.btn { min-height: 40px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface); font-weight: 500; }
.btn:hover { background: var(--bg); }
.btn.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--red); border-color: #efc7c3; background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn.small { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.btn.block { width: 100%; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 9px; }
.icon-button:hover { color: var(--text); background: var(--surface-2); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; gap: 24px; padding: 22px 14px; background: var(--surface); border-right: 1px solid var(--border); }
.sidebar > .brand-lockup { padding: 0 8px; }
.main-nav { display: grid; gap: 4px; }
.main-nav button { min-height: 42px; width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; }
.main-nav button:hover { color: var(--text); background: var(--bg); }
.main-nav button.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-icon { width: 20px; text-align: center; font-size: 18px; }
.nav-section { margin: 16px 10px 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.sidebar-profile { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 13px 7px 0; border-top: 1px solid var(--border); }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong, .profile-copy small { overflow: hidden; display: block; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; }.profile-copy small { color: var(--muted); font-size: 10px; }
.workspace { min-width: 0; }
.topbar { height: 69px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.global-search { width: min(420px, 45vw); display: flex; align-items: center; gap: 8px; padding: 0 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.global-search input { min-height: 39px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.topbar-spacer { flex: 1; }.today-label { color: var(--muted); font-size: 12px; }
.notification-button { color: var(--primary); font-size: 10px; }
.menu-button { display: none; }
.page-content { padding: 27px 28px 40px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.page-header h1 { margin-bottom: 4px; font-size: 25px; font-weight: 600; letter-spacing: -.02em; }
.page-header p { margin: 0; color: var(--muted); }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 16px; }
.metric-card, .panel, .entity-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.metric-card { padding: 16px; }
.metric-card .metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-card .metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.metric-card strong { display: block; margin: 9px 0 2px; font-size: 25px; font-weight: 600; }
.metric-card small { color: var(--muted); font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr); gap: 16px; }
.panel { min-width: 0; padding: 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-header h2 { margin: 0; font-size: 16px; font-weight: 600; }.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 9px; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 500; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px 9px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr.clickable:hover { background: #f8fbfa; }
.data-table .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.primary-text { display: block; color: var(--text); font-weight: 600; }.secondary-text { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; font-size: 11px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.waiting { color: var(--orange); background: var(--orange-soft); }.status.success { color: var(--primary); background: var(--primary-soft); }.status.info { color: var(--blue); background: var(--blue-soft); }.status.danger { color: var(--red); background: var(--red-soft); }.status.neutral { color: var(--muted); background: var(--bg); }.status.purple { color: var(--purple); background: var(--purple-soft); }
.task-list { display: grid; gap: 9px; }
.task-item { display: flex; gap: 11px; padding: 12px; border-radius: 11px; background: var(--bg); }
.task-item > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--surface); }
.task-item strong { display: block; font-size: 12px; }.task-item small { color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 13px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toolbar .search-field { min-width: 220px; flex: 1; }.toolbar select { width: auto; min-width: 160px; }
.empty-state { padding: 52px 22px; color: var(--muted); text-align: center; }.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.entity-card { padding: 16px; }
.entity-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.entity-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: 17px; }
.entity-card h3 { margin: 13px 0 3px; font-size: 14px; }.entity-card p { min-height: 36px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.entity-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.kebab { border: 0; color: var(--muted); background: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field.full { grid-column: 1 / -1; }.field small { color: var(--muted); }
.required::after { content: " *"; color: var(--red); }
.line-items { margin-top: 7px; }
.line-item { display: grid; grid-template-columns: minmax(180px, 1fr) 90px 90px 120px 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.line-item input { min-width: 0; }
.line-total { text-align: right; font-variant-numeric: tabular-nums; }
.remove-line { width: 34px; height: 34px; border: 0; border-radius: 8px; color: var(--red); background: var(--red-soft); }
.form-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; margin-top: 10px; }.form-total strong { font-size: 20px; }
.dialog { width: min(680px, calc(100vw - 24px)); max-height: 92vh; padding: 0; border: 0; border-radius: 17px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.dialog.wide-dialog { width: min(960px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(17,32,35,.46); backdrop-filter: blur(3px); }
.dialog-frame > header { display: flex; justify-content: space-between; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--border); }
.dialog-frame > header h2 { margin-bottom: 3px; font-size: 19px; }.dialog-frame > header p { margin: 0; color: var(--muted); font-size: 12px; }
.dialog-body { max-height: calc(92vh - 145px); overflow-y: auto; padding: 20px 21px; }
.dialog-frame > footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 21px; border-top: 1px solid var(--border); }
.dialog-error { flex: 1; margin-right: 8px; text-align: left; }
.detail-top { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; padding-bottom: 17px; border-bottom: 1px solid var(--border); }
.detail-facts { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.fact { padding: 11px; border-radius: 10px; background: var(--bg); }.fact small { display: block; margin-bottom: 3px; color: var(--muted); }.fact strong { font-size: 12px; }
.detail-section { margin-top: 20px; }.detail-section h3 { font-size: 14px; }
.timeline { position: relative; display: grid; gap: 14px; padding-left: 17px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 7px; width: 1px; background: var(--border); }
.timeline-item { position: relative; }.timeline-item::before { content: ""; position: absolute; left: -16px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-item strong { display: block; font-size: 12px; }.timeline-item p { margin: 2px 0; color: var(--muted); font-size: 11px; }.timeline-item time { color: var(--muted); font-size: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }.tabs button { padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; }.tabs button.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.permission-matrix { display: grid; gap: 14px; }.permission-group { padding: 13px; border: 1px solid var(--border); border-radius: 11px; }.permission-group h3 { margin-bottom: 10px; font-size: 13px; }.permission-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.check-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }.check-field input { width: 16px; min-height: 16px; }
.bar-list { display: grid; gap: 12px; }.bar-row { display: grid; grid-template-columns: 160px 1fr 110px; gap: 12px; align-items: center; }.bar-row progress { width: 100%; height: 9px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: var(--bg); }.bar-row progress::-webkit-progress-bar { background: var(--bg); }.bar-row progress::-webkit-progress-value { background: var(--primary); border-radius: 99px; }.bar-row progress::-moz-progress-bar { background: var(--primary); border-radius: 99px; }.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 12px 14px; border-radius: 11px; color: #fff; background: #19383a; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }.toast.error { background: #9e352f; }
@keyframes toast-in { from { transform: translateY(7px); opacity: 0; } }
.skeleton { min-height: 16px; border-radius: 7px; background: linear-gradient(90deg,#edf2f1,#f8fbfa,#edf2f1); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
@media (max-width: 1000px) { .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.content-grid { grid-template-columns: 1fr; } }
@media (max-width: 780px) {
  .login-page { grid-template-columns: 1fr; }.login-brand { display: none; }.login-panel { min-height: 100vh; }.mobile-brand { display: flex; margin-bottom: 15px; }
  .app-shell { grid-template-columns: 1fr; }.sidebar { width: 242px; position: fixed; left: -255px; transition: left .2s; box-shadow: var(--shadow); }.app-shell.menu-open .sidebar { left: 0; }.menu-button { display: grid; }
  .topbar { padding: 0 14px; }.today-label { display: none; }.global-search { width: min(360px, 55vw); }.page-content { padding: 21px 15px 32px; }.page-header { align-items: flex-start; flex-direction: column; }.detail-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) { .metric-grid, .card-grid, .form-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }.topbar .btn.primary { width: 40px; overflow: hidden; white-space: nowrap; padding: 8px 9px; }.global-search { flex: 1; width: auto; }.line-item { grid-template-columns: 1fr 70px 70px; }.line-item input:nth-child(4), .line-total { display: none; }.permission-list { grid-template-columns: 1fr; }.bar-row { grid-template-columns: 100px 1fr; }.bar-value { grid-column: 2; }.dialog-body { padding: 16px; } }
