:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --ink: #162019;
  --muted: #657067;
  --line: #d8e1d5;
  --panel: #ffffff;
  --panel-2: #edf4ec;
  --green: #1f7a4c;
  --green-dark: #145537;
  --blue: #1f5f99;
  --gold: #a56b13;
  --red: #b93d32;
  --shadow: 0 18px 45px rgba(28, 47, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(31, 122, 76, 0.08), rgba(31, 95, 153, 0.06)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: 260px 1fr;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  background: #102019;
  color: #f7fbf6;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8322c;
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #aebdb4;
  font-size: 13px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  color: #cfdbd3;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.icon {
  width: 20px;
  text-align: center;
  color: #8fd5aa;
}

.sidebar-panel {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 6px;
}

.sidebar-panel span {
  color: #b8c8be;
  font-size: 13px;
}

.panel-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-shell {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  margin: 0 0 6px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.searchbox {
  height: 42px;
  min-width: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.searchbox input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.primary-button,
.ghost-button,
.danger-button,
.text-button,
.icon-button {
  border-radius: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  padding: 0 14px;
}

.primary-button {
  background: var(--green);
  color: white;
  border-color: var(--green);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--green-dark);
}

.ghost-button {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

.danger-button {
  background: #fff1ef;
  color: var(--red);
  border-color: #f1c5bf;
}

.text-button {
  background: transparent;
  color: var(--green);
  padding: 0;
  min-height: auto;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 24px;
  background: var(--panel-2);
  border-color: var(--line);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 13px;
}

.chip.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
.kanban-column,
.calendar-day,
.tool-table-wrap {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 17px;
  display: grid;
  gap: 6px;
}

.metric span,
.metric small,
.muted {
  color: var(--muted);
}

.metric strong {
  font-size: 28px;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.booking-list {
  display: grid;
  gap: 10px;
}

.booking-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.booking-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.booking-title {
  display: grid;
  gap: 3px;
}

.booking-title strong {
  font-size: 16px;
}

.booking-title span,
.booking-meta,
.booking-notes {
  color: var(--muted);
  font-size: 13px;
}

.booking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.status {
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #eaf3ff;
  color: var(--blue);
}

.status[data-status="Lead mới"] {
  background: #f1f4f0;
  color: #526158;
}

.status[data-status="Đã chốt"] {
  background: #edf8f1;
  color: var(--green);
}

.status[data-status="Đang review"] {
  background: #fff6e7;
  color: var(--gold);
}

.status[data-status="Đã publish"] {
  background: #eef6ff;
  color: var(--blue);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
}

.checklist {
  display: grid;
  gap: 12px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #26332a;
}

.checklist input {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-column {
  min-height: 440px;
  padding: 12px;
}

.kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.kanban-items {
  display: grid;
  gap: 10px;
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.calendar-day {
  min-height: 390px;
  padding: 14px;
}

.day-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.day-head strong,
.day-head span {
  display: block;
}

.day-head span {
  color: var(--muted);
  font-size: 13px;
}

.mini-event {
  border-left: 3px solid var(--green);
  background: #f7fbf6;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.mini-event strong,
.mini-event span {
  display: block;
}

.mini-event span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tool-table-wrap {
  overflow-x: auto;
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.tool-table th,
.tool-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.tool-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.booking-modal {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(15, 31, 22, 0.28);
  padding: 0;
}

.booking-modal::backdrop {
  background: rgba(9, 20, 14, 0.55);
}

.booking-form {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-panel {
    display: none;
  }

  .topbar,
  .work-grid {
    display: grid;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .searchbox {
    min-width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 18px;
  }

  .sidebar {
    padding: 16px;
  }

  .nav-item span:last-child {
    display: none;
  }

  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .booking-top,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions span {
    display: none;
  }
}
