@import url('https://fonts.googleapis.com/css2?family=Adamina&family=Kantumruy+Pro:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --green-dark: #0A210F;
  --green: #14591D;
  --green-light: #EAF3E8;
  --olive: #A2AD59;
  --orange: #FF8C42;
  --cream: #FBF7F4;
  --white: #FFFFFF;
  --text: #1F2A20;
  --muted: #748074;
  --border: #E2E8E1;
  --red: #C94C4C;
  --yellow: #D89B2B;
  --font: 'Kantumruy Pro', Arial, Helvetica, sans-serif;
  --font-serif: 'Adamina', Georgia, serif;
}

body { font-family: var(--font); background: #F5F7F4; color: var(--text); display: flex; min-height: 100vh; }
h1,h2,h3,h4 { font-family: var(--font); }
a { color: inherit; }

/* ===== SIDEBAR ===== */
.sidebar { width: 250px; background: var(--green-dark); color: #fff; min-height: 100vh; position: fixed; left: 0; top: 0; bottom: 0; display: flex; flex-direction: column; z-index: 100; }
.brand { padding: 26px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand h2 { font-size: 19px; letter-spacing: .3px; }
.brand p { font-size: 12px; color: #AFC1B0; margin-top: 5px; }
.menu { padding: 18px 12px; flex: 1; overflow-y: auto; }
.menu-title { font-size: 10px; color: #7D947F; text-transform: uppercase; padding: 0 12px; margin: 15px 0 8px; letter-spacing: 1px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 8px; color: #D6E0D7; text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 3px; cursor: pointer; transition: .18s; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-item.active { background: var(--green); color: #fff; }
.menu-icon { width: 20px; text-align: center; }
.sidebar-bottom { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.1); }
.site-link { display: block; font-size: 12px; color: #AFC1B0; text-decoration: none; margin-bottom: 14px; }
.site-link:hover { color: var(--orange); }
.admin-profile { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--olive); color: var(--green-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.admin-info strong { display: block; font-size: 13px; }
.admin-info span { font-size: 11px; color: #9BAD9E; }

/* ===== MAIN ===== */
.main { margin-left: 250px; width: calc(100% - 250px); min-height: 100vh; }
.topbar { min-height: 70px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 12px 32px; position: sticky; top: 0; z-index: 50; gap: 16px; }
.page-title h1 { font-size: 21px; }
.page-title p { font-family: var(--font-serif); font-size: 13px; color: var(--muted); margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.notification { position: relative; font-size: 20px; cursor: pointer; }
.notification-badge { position: absolute; top: -5px; right: -6px; background: var(--orange); color: #fff; font-size: 9px; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mobile-toggle { display: none; font-size: 22px; background: none; border: none; cursor: pointer; }
.content { padding: 28px 32px; }

/* ===== KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 27px; font-weight: 700; margin-top: 10px; }
.kpi-sub { font-size: 11px; color: var(--green); margin-top: 7px; }
.kpi-sub.warn { color: var(--yellow); } .kpi-sub.mut { color: var(--muted); }

/* ===== SECTION ===== */
.section { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 22px; overflow: hidden; }
.section-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-header h2 { font-size: 16px; }
.section-header p { font-family: var(--font-serif); font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.section-body { padding: 20px; }

/* ===== TABLE ===== */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 13px 15px; background: #F8FAF7; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
td { padding: 14px 15px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FafcF9; }
.booking-code { font-weight: 700; color: var(--green); }
.small-text { font-size: 11px; color: var(--muted); margin-top: 4px; }
.cell-strong { font-weight: 600; }

/* ===== STATUS ===== */
.status { display: inline-flex; padding: 5px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-warning { background: #FFF4D9; color: #9A6A00; }
.status-success { background: #E5F3E5; color: #286A2C; }
.status-danger { background: #FCE8E8; color: #A73838; }
.status-info { background: #E7F0F5; color: #34677C; }
.status-muted { background: #EDF0EC; color: #66756A; }

/* ===== BUTTON ===== */
button { border: none; cursor: pointer; font-family: inherit; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; font-family: var(--font); text-decoration: none; transition: .15s; }
.btn-primary { background: var(--green); color: #fff; } .btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); } .btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: #FCE8E8; color: var(--red); } .btn-danger:hover { background: #f8dada; }
.btn-orange { background: var(--orange); color: #fff; } .btn-orange:hover { background: #f07a2c; }
.btn-sm { padding: 6px 10px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== TOOLBAR / FILTER ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; min-width: 240px; flex: 1; max-width: 360px; }
.search input { border: none; outline: none; font-family: var(--font); font-size: 13px; width: 100%; background: transparent; }
.tabs { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.tab { padding: 7px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: transparent; }
.tab.active { background: var(--green); color: #fff; }
.tab .count { font-size: 10px; opacity: .8; margin-left: 4px; }

/* ===== FORM ===== */
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label.flabel { display: block; font-size: 12.5px; font-weight: 600; color: var(--green-dark); margin-bottom: 6px; }
.finput, select.finput, textarea.finput { width: 100%; font-family: var(--font); font-size: 13.5px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); }
.finput:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,89,29,.12); }
textarea.finput { min-height: 80px; resize: vertical; }
.fhint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #cbd3c9; border-radius: 999px; transition: .2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ===== PROGRESS ===== */
.bar { height: 8px; background: #EDF0EC; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.bar.warn > span { background: var(--yellow); }
.bar.danger > span { background: var(--red); }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }

/* ===== CALENDAR ===== */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.calendar-title { font-weight: 700; font-size: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.calendar-day-name { text-align: center; font-size: 10px; color: var(--muted); padding-bottom: 5px; font-weight: 600; }
.calendar-day { min-height: 62px; border-radius: 7px; padding: 7px; background: #F7F9F6; font-size: 11px; position: relative; }
.calendar-day.empty { background: transparent; }
.calendar-day.green { border-left: 4px solid #63A368; }
.calendar-day.yellow { border-left: 4px solid var(--yellow); }
.calendar-day.red { border-left: 4px solid var(--red); }
.calendar-capacity { font-size: 9px; color: var(--muted); margin-top: 6px; }
.legend { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.legend span { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ===== INVENTORY ===== */
.inventory-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.inventory-item:last-child { border-bottom: none; }
.inventory-name { font-size: 13px; font-weight: 600; }
.inventory-count { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stock { text-align: right; font-weight: 700; font-size: 14px; }
.stock span { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }

/* ===== SERVICE CARD ===== */
.svc-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.svc { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.svc .ic { font-size: 26px; margin-bottom: 10px; }
.svc h3 { font-size: 16px; margin-bottom: 4px; }
.svc p { font-family: var(--font-serif); font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.svc .price { font-size: 20px; font-weight: 700; color: var(--green); }
.svc .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ===== CHART (pure CSS) ===== */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .col .bar-v { width: 60%; max-width: 44px; background: linear-gradient(180deg, #2c7a34, var(--green)); border-radius: 6px 6px 0 0; transition: .3s; }
.chart .col:hover .bar-v { background: linear-gradient(180deg, var(--orange), #e5772a); }
.chart .col .val { font-size: 11px; font-weight: 700; color: var(--green-dark); }
.chart .col .lbl { font-size: 11px; color: var(--muted); }
.breakdown-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.breakdown-row .name { width: 130px; font-size: 13px; font-weight: 600; }
.breakdown-row .bar { flex: 1; }
.breakdown-row .amt { width: 110px; text-align: right; font-size: 13px; font-weight: 600; color: var(--green); }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 16px 20px; }
.pagination button { min-width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 600; color: var(--text); }
.pagination button.active { background: var(--green); color: #fff; border-color: var(--green); }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,33,15,.55); display: none; align-items: center; justify-content: center; z-index: 999; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { width: 800px; max-width: 100%; max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 14px; }
.modal.sm { width: 520px; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; }
.modal-header h2 { font-size: 18px; }
.close { font-size: 22px; cursor: pointer; color: var(--muted); background: none; border: none; }
.modal-body { padding: 24px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 22px; }
.detail-box { padding: 15px; background: #F8FAF7; border-radius: 8px; }
.detail-label { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.detail-value { font-size: 14px; font-weight: 600; margin-top: 6px; }
.modal-section { margin-top: 22px; }
.modal-section h3 { font-size: 14px; margin-bottom: 12px; }
.price-summary { background: var(--green-light); padding: 18px; border-radius: 10px; margin-top: 15px; }
.price-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.price-total { border-top: 1px solid #C8D9C5; margin-top: 8px; padding-top: 12px; font-weight: 700; font-size: 16px; }
.proof-box { height: 220px; border-radius: 10px; background: linear-gradient(160deg,#cfd8e0,#8ba0b0); display: grid; place-items: center; color: #fff; font-weight: 600; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 22px; border-top: 1px solid var(--border); margin-top: 22px; flex-wrap: wrap; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .grid-2, .grid-3, .svc-grid, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); transition: .25s; width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100%; }
  .mobile-toggle { display: block; }
  .content { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-title h1 { font-size: 17px; }
  .chart { gap: 8px; }
}

/* ===== Flash message ===== */
.flash { padding: 13px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; font-weight: 600; }
.flash-ok { background: #E5F3E5; color: #286A2C; border: 1px solid #cbe6cb; }
.flash-err { background: #FCE8E8; color: #A73838; border: 1px solid #f3d2d2; }
