/* ============ Nona Lodge Management System — admin theme ============ */
:root {
  --green: #176B4D;
  --green-dark: #0F4C37;
  --green-mid: #2E8B67;
  --soft: #EAF4ED;
  --soft-2: #F4FAF6;
  --orange: #F29A38;
  --orange-soft: #FEF1E2;
  --cream: #FFF9F0;
  --white: #FFFFFF;
  --ink: #26352D;
  --muted: #6E8078;
  --line: #E2ECE6;
  --line-soft: #EEF5F0;
  --danger: #C4402F;
  --danger-soft: #FBEAE7;
  --blue: #2C6E9B;
  --blue-soft: #E8F1F8;
  --purple: #6A4C93;
  --purple-soft: #F0EAF7;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(23, 107, 77, .06), 0 2px 8px rgba(38, 53, 45, .04);
  --shadow: 0 8px 28px rgba(23, 61, 44, .08);
  --shadow-lg: 0 24px 60px rgba(15, 76, 55, .16);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--soft-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0 0 8px; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; }
.hidden { display: none !important; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: 0 0 250px; background: linear-gradient(180deg, #124B36 0%, #0E3F2E 100%);
  color: #DCEDE4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  padding: 18px 14px 14px; z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sidebar-brand strong { display: block; color: #fff; font-size: 15px; letter-spacing: .01em; }
.sidebar-brand small { color: #93B8A7; font-size: 11px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--orange), #E07C1F); color: #fff; font-weight: 800; font-size: 17px;
  font-family: 'Fraunces', Georgia, serif; flex: 0 0 36px;
}
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 4px; }
.nav-label { color: #6F9987; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; margin: 14px 10px 4px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  color: #CBE2D7; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.is-active { background: rgba(242,154,56,.18); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.nav a .ico { width: 18px; height: 18px; opacity: .9; flex: 0 0 18px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 8px 2px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-foot small { color: #7FA695; font-size: 11px; }
.side-link { color: #D5E9DE; font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 13px 24px; background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.search-wrap { position: relative; flex: 1; max-width: 460px; }
.search-wrap input {
  width: 100%; border: 1px solid var(--line); background: var(--white); border-radius: 11px;
  padding: 9px 13px 9px 36px; font: inherit; font-size: 13px; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236E8078' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
.search-wrap input:focus { outline: 2px solid rgba(23,107,77,.18); border-color: var(--green-mid); }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 13px; box-shadow: var(--shadow); padding: 6px; z-index: 50; max-height: 380px; overflow: auto;
}
.search-results a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 13px; }
.search-results a:hover { background: var(--soft); }
.search-results .sr-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid transparent; padding: 5px 8px; border-radius: 11px; cursor: pointer; font: inherit; color: var(--ink); }
.user-btn:hover { background: var(--soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-mid)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.user-meta { text-align: left; line-height: 1.15; }
.user-meta strong { display: block; font-size: 12.5px; }
.user-meta small { color: var(--muted); font-size: 10.5px; text-transform: capitalize; }
.user-dropdown { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 60; }
.user-dropdown button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 11px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.user-dropdown button:hover { background: var(--soft); }
.dd-head { padding: 8px 11px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.dd-head strong { display: block; font-size: 13px; } .dd-head small { color: var(--muted); font-size: 11.5px; }

.view { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 27px; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------------- buttons / forms ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent;
  background: var(--white); color: var(--ink); padding: 9px 15px; border-radius: 10px; font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: transform .06s, box-shadow .15s, background .15s; white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--green), #1E7C5A); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(23,107,77,.28); }
.btn-accent { background: linear-gradient(135deg, var(--orange), #E4841B); color: #fff; }
.btn-outline { border-color: var(--line); background: #fff; color: var(--green); }
.btn-outline:hover { background: var(--soft); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--soft); color: var(--green); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: var(--soft); color: var(--green); width: 36px; height: 36px; border-radius: 10px; font-size: 17px; cursor: pointer; }
.only-mobile { display: none !important; }

label { display: block; font-size: 12px; font-weight: 600; color: #445A50; margin-bottom: 10px; }
label input, label select, label textarea, .input {
  display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font: inherit; font-size: 13px; color: var(--ink); background: #fff;
}
label input:focus, label select:focus, label textarea:focus, .input:focus {
  outline: 2px solid rgba(23,107,77,.15); border-color: var(--green-mid);
}
label input[type=checkbox], label input[type=radio] { display: inline-block; width: auto; margin: 0 6px 0 0; vertical-align: -2px; }
label.check-line { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; padding-top: 22px; }
textarea { resize: vertical; min-height: 68px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.form-grid > * { min-width: 0; }
input, select, textarea { max-width: 100%; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 9px 12px; border-radius: 9px; font-size: 12.5px; margin: 8px 0; }
.form-ok { background: var(--soft); color: var(--green); padding: 9px 12px; border-radius: 9px; font-size: 12.5px; margin: 8px 0; }
.hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.searchbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.searchbar input, .searchbar select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 12.5px; background: #fff; }
.searchbar input[type=search] { min-width: 220px; }

/* ---------------- cards / grids ---------------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; min-width: 0; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.kpi-grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-dash { grid-template-columns: 2fr 1fr; }
.section-title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 17px; margin: 26px 0 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--soft); opacity: .7; }
.kpi .kpi-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.kpi .kpi-value { font-size: 25px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.02em; }
.kpi .kpi-foot { color: var(--muted); font-size: 11.5px; }
.kpi.accent { background: linear-gradient(135deg, var(--green), #1E7C5A); border: 0; color: #fff; }
.kpi.accent .kpi-label, .kpi.accent .kpi-foot { color: #C6E5D7; }
.kpi.accent::after { background: rgba(255,255,255,.08); }
.kpi.warm { background: linear-gradient(135deg, #FFF3E3, #FFE8CF); border-color: #F6D9B4; }
.kpi .kpi-ico { position: absolute; right: 16px; top: 16px; font-size: 20px; z-index: 1; }
.kpi-mini { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--soft-2); border: 1px solid var(--line-soft); }

/* ---------------- tables ---------------- */
.table-wrap { max-width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
table.table { width: 100%; border-collapse: collapse; font-size: 12.8px; min-width: 620px; }
table.table th {
  text-align: left; background: var(--soft-2); color: var(--muted); font-size: 10.5px; letter-spacing: .07em;
  text-transform: uppercase; padding: 10px 13px; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap;
}
table.table td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.table tbody tr:hover { background: #FAFDFB; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table td.num, table.table th.num { text-align: right; white-space: nowrap; }
table.table .strong { font-weight: 700; }
table.table tfoot td { font-weight: 700; background: var(--soft-2); }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.row-actions .btn { flex: 0 1 auto; }
.link-btn { background: none; border: 0; padding: 4px 7px; border-radius: 7px; color: var(--green); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.link-btn:hover { background: var(--soft); }
.link-btn.danger { color: var(--danger); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.green { background: var(--soft); color: #14724F; }
.badge.orange { background: var(--orange-soft); color: #B76A0C; }
.badge.blue { background: var(--blue-soft); color: #23628C; }
.badge.red { background: var(--danger-soft); color: #A93222; }
.badge.purple { background: var(--purple-soft); color: #5B3F80; }
.badge.grey { background: #F0F2F1; color: #5E6F67; }
.badge.plain::before { display: none; }

/* ---------------- charts ---------------- */
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 10px; }
.chart-head h3 { margin: 0; font-size: 15px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-list { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; flex: 1; min-width: 140px; }
.donut-list div { display: flex; justify-content: space-between; gap: 10px; }

/* occupancy bars */
.occ-list { display: flex; flex-direction: column; gap: 9px; }
.occ-row { display: grid; grid-template-columns: 78px 1fr 44px; align-items: center; gap: 10px; font-size: 12px; }
.occ-bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.occ-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-mid), var(--green)); }

/* ---------------- workflow ---------------- */
.workflow { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 8px; }
.wf-step { flex: 1; min-width: 132px; position: relative; padding-right: 8px; }
.wf-step button {
  width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 13px; cursor: pointer; font: inherit; transition: all .15s; box-shadow: var(--shadow-sm);
}
.wf-step button:hover { border-color: var(--green-mid); transform: translateY(-2px); box-shadow: var(--shadow); }
.wf-step .wf-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.wf-step .wf-count { font-size: 22px; font-weight: 800; color: var(--green); line-height: 1.2; }
.wf-step .wf-hint { font-size: 10.5px; color: var(--muted); }
.wf-step:not(:last-child)::after {
  content: '›'; position: absolute; right: -2px; top: 34px; color: #B9CCC2; font-size: 20px; z-index: 2;
}
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.pipe-col { background: var(--soft-2); border: 1px solid var(--line-soft); border-radius: 13px; padding: 11px; min-height: 120px; }
.pipe-col h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 9px; display: flex; justify-content: space-between; }
.pipe-item { background: #fff; border-radius: 9px; padding: 8px 9px; margin-bottom: 6px; font-size: 12px; border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); }
.pipe-item .pi-meta { color: var(--muted); font-size: 10.5px; display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; }

/* ---------------- lists / tasks ---------------- */
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line-soft);
  border-radius: 12px; background: #fff;
}
.task:hover { border-color: var(--line); background: #FBFDFC; }
.task-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--soft); font-size: 15px; flex: 0 0 32px; }
.task-body { flex: 1; min-width: 0; }
.task-body strong { font-size: 13px; display: block; }
.task-body small { color: var(--muted); font-size: 11.5px; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); font-size: 13px; }
.empty .emoji { font-size: 26px; display: block; margin-bottom: 6px; opacity: .8; }

/* ---------------- calendar ---------------- */
.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.cal { border-collapse: separate; border-spacing: 0; min-width: 900px; width: 100%; font-size: 11.5px; }
.cal th { position: sticky; top: 0; background: var(--soft-2); color: var(--muted); font-weight: 700; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 10.5px; z-index: 2; }
.cal th .day-name { display: block; text-transform: uppercase; letter-spacing: .05em; font-size: 9.5px; }
.cal td { border-bottom: 1px solid var(--line-soft); padding: 0; height: 42px; }
.cal .room-col { position: sticky; left: 0; background: #fff; border-right: 1px solid var(--line); padding: 6px 10px; min-width: 150px; z-index: 3; }
.cal .room-col strong { display: block; font-size: 12px; }
.cal .room-col small { color: var(--muted); font-size: 10px; }
.cal .cell { position: relative; min-width: 34px; text-align: center; cursor: pointer; }
.cal .cell.today { background: rgba(242,154,56,.09); }
.cal .cell.weekend { background: #FBFCFB; }
.cal .cell .bar {
  position: absolute; left: 2px; right: 2px; top: 9px; height: 24px; border-radius: 7px;
  font-size: 10px; color: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-weight: 600; padding: 0 4px; white-space: nowrap;
}
.bar.checked-in { background: linear-gradient(135deg, #176B4D, #2E8B67); }
.bar.confirmed { background: linear-gradient(135deg, #2C6E9B, #3E8AB8); }
.bar.pending { background: linear-gradient(135deg, #E0A02F, #F29A38); color: #402D0A; }
.bar.checked-out { background: #A9B7B0; }
.bar.blocked { background: repeating-linear-gradient(45deg, #C9D6CF, #C9D6CF 6px, #DCE6E0 6px, #DCE6E0 12px); color: #44574E; }
.bar.maintenance { background: #DDB6A6; color: #6B2B18; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* room cards */
.room-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.room-tile .rt-photo { height: 130px; background-size: cover; background-position: center; position: relative; }
.room-tile .rt-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.room-tile .rt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.room-tile h4 { margin: 0; }
.room-tile .rt-price { font-weight: 800; color: var(--green); font-size: 14px; }
.room-tile .rt-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }

/* ---------------- pos ---------------- */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.pos-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.pos-item { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 11px; cursor: pointer; text-align: left; font: inherit; box-shadow: var(--shadow-sm); transition: all .12s; }
.pos-item:hover { border-color: var(--green-mid); transform: translateY(-2px); box-shadow: var(--shadow); }
.pos-item strong { display: block; font-size: 12.5px; line-height: 1.3; margin-bottom: 4px; }
.pos-item .pi-price { color: var(--green); font-weight: 700; font-size: 12.5px; }
.pos-item .pi-cat { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pos-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pos-cats button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.pos-cats button.is-active { background: var(--green); color: #fff; border-color: var(--green); }
.cart { position: sticky; top: 78px; }
.cart-items { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: #FBFDFC; }
.cart-line strong { font-size: 12.5px; }
.cart-line small { color: var(--muted); font-size: 11px; }
.qty-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.qty-ctrl button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; line-height: 1; color: var(--green); }
.totals { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 17px; font-weight: 800; color: var(--green); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 3px; }

/* ---------------- modal / toast ---------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,44,33,.45); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 440px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 19px; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 20px; flex-wrap: wrap; }
.modal-close { background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.toast-root { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 200; max-width: 340px; }
.toast { background: #fff; border-left: 4px solid var(--green); box-shadow: var(--shadow-lg); border-radius: 11px; padding: 12px 15px; font-size: 13px; animation: slideIn .18s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--blue); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* detail layout */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 13px; }
.dl dt { color: var(--muted); font-size: 12px; }
.dl dd { margin: 0; font-weight: 500; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat-box { background: var(--soft-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 11px 13px; }
.stat-box small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat-box strong { font-size: 17px; }
.balance-box { background: linear-gradient(135deg, #FFF7EC, #FFF1DF); border: 1px solid #F5DCBC; border-radius: 13px; padding: 14px; }
.balance-box strong { font-size: 22px; color: #A9600B; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 13px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.is-active { color: var(--green); border-bottom-color: var(--green); }
.chip-list { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--soft); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; color: #2C6A50; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-mid); margin-top: 5px; flex: 0 0 9px; }
.settings-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.settings-nav button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 13px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.settings-nav button.is-active { background: var(--soft); color: var(--green); border-color: #C9E2D5; }
.matrix { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 720px; }
.matrix th, .matrix td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead th { background: var(--soft-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.matrix input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--green); }
.img-field { display: flex; gap: 10px; align-items: flex-start; }
.img-preview { width: 72px; height: 72px; border-radius: 10px; background: var(--soft) center/cover; border: 1px solid var(--line); flex: 0 0 72px; }
.receipt { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #fff; padding: 6px; }
.receipt table { width: 100%; }
.receipt td { padding: 2px 0; }
.receipt .r-head { text-align: center; margin-bottom: 8px; }
.receipt .r-head strong { font-family: 'Fraunces', Georgia, serif; font-size: 16px; }
.receipt .r-tot { border-top: 1px dashed #999; margin-top: 6px; padding-top: 5px; }

/* mobile bottom nav & fab */
.mobile-nav { display: none; }
.fab { display: none; }

/* auth pages */
.auth-body { min-height: 100vh; background: radial-gradient(1000px 600px at 10% -10%, #D9EEE2 0%, transparent 60%), radial-gradient(900px 500px at 100% 0%, #FFEBD2 0%, transparent 55%), var(--soft-2); display: flex; align-items: center; justify-content: center; padding: 26px; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; max-width: 1000px; width: 100%; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); }
.auth-wrap--single { display: block; max-width: 440px; }
.auth-hero { background: linear-gradient(150deg, #0F4C37, #176B4D 55%, #1F7C5A); color: #fff; padding: 46px 40px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.auth-hero h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 32px; letter-spacing: -.02em; }
.auth-hero p { color: #C8E3D6; font-size: 13.5px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .02em; margin-bottom: 14px; }
.auth-points { margin: 14px 0 0; padding-left: 18px; color: #D6EBE0; font-size: 12.5px; display: flex; flex-direction: column; gap: 7px; }
.auth-card { padding: 44px 40px; }
.auth-card h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 24px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; font-size: 12.5px; }
.demo-creds { margin-top: 20px; background: var(--soft-2); border: 1px dashed #CFE3D7; border-radius: 11px; padding: 11px 13px; font-size: 11.5px; color: #46604F; display: flex; flex-direction: column; gap: 4px; }
.demo-creds strong { font-size: 12px; color: var(--green); }
.demo-creds code { background: #fff; padding: 1px 4px; border-radius: 4px; font-size: 11px; }

/* responsive */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-dash { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; }
  .cart { position: static; }
}
@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pipeline { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar { width: 216px; flex-basis: 216px; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-flex !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-102%); transition: transform .22s ease;
    width: 260px; flex-basis: 260px; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .view { padding: 16px; padding-bottom: 96px; }
  .topbar { padding: 10px 14px; gap: 9px; }
  .user-meta { display: none; }
  .search-wrap { max-width: none; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 45; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); padding: 4px 8px; border-radius: 9px; font-weight: 600; }
  .mobile-nav a.is-active { color: var(--green); background: var(--soft); }
  .mobile-nav .ico { width: 19px; height: 19px; }
  .fab {
    display: inline-flex; position: fixed; right: 18px; bottom: 76px; width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), #E4841B); color: #fff; border: 0; font-size: 26px;
    align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(242,154,56,.42); z-index: 46; cursor: pointer;
  }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-head h1 { font-size: 22px; }
  .auth-wrap { grid-template-columns: 1fr; max-width: 480px; }
  .auth-hero { display: none; }
  .auth-card { padding: 30px 24px; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .wf-step { min-width: 150px; }
  .dl { grid-template-columns: 110px 1fr; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; overflow: auto; }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px; }
  .kpi .kpi-value { font-size: 20px; }
  .topbar-right .btn-sm { padding: 7px 10px; }
  .pos-menu { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .sidebar, .topbar, .mobile-nav, .fab, .page-head .actions, .row-actions, .tabs { display: none !important; }
  .view { padding: 0; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
}
