:root {
  --brand: #0f3d3e;
  --brand-light: #16585a;
  --accent: #e8b34b;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7686;
  --border: #e1e4e8;
  --danger: #c0392b;
  --success: #1e7e34;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--brand-light); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.topbar { background: var(--brand); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { color: #fff; font-size: 20px; font-weight: 700; text-decoration: none; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: #d7e2e2; text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: #fff; }
.nav-user { color: #9fb8b8; font-size: 13px; }

/* Buttons */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 6px; font-size: 14px;
  font-weight: 600; text-decoration: none; border: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #3a2b06 !important; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-dark { background: var(--brand); color: #fff !important; }
.btn-dark:hover { background: var(--brand-light); }
.btn-outline { border: 1px solid #5c7a7a; color: #fff !important; padding: 7px 14px; }
.btn-danger { background: var(--danger); color: #fff !important; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* Cards & layout */
main.container { padding-top: 28px; padding-bottom: 48px; min-height: calc(100vh - 160px); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 6px 0 18px; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.stat .num { font-size: 28px; font-weight: 700; color: var(--brand); }
.stat .label { color: var(--muted); font-size: 13px; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-light); outline-offset: 0; border-color: var(--brand-light); }
.field { margin-bottom: 16px; }
.form-narrow { max-width: 480px; margin: 0 auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.flash-success { background: #e6f4ea; color: #1e7e34; border: 1px solid #b7e1c1; }
.flash-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.flash-info { background: #e8f0fe; color: #1a56db; border: 1px solid #c3d4fd; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
table.data tr:hover td { background: #fafbfc; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.s-order-placed { background: #e8f0fe; color: #1a56db; }
.s-pending-payment { background: #fdf3e0; color: #9a6b0f; }
.s-content-in-production { background: #ede8fd; color: #5a3ec8; }
.s-pending-content-approval { background: #fdeaf2; color: #b0316e; }
.s-submitted-to-publisher { background: #e0f3f4; color: #0f6b6d; }
.s-live { background: #e6f4ea; color: #1e7e34; }
.s-pending { background: #fdf3e0; color: #9a6b0f; }
.s-approved { background: #e6f4ea; color: #1e7e34; }
.s-rejected { background: #fdecea; color: #c0392b; }

/* Publisher order form */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 160px; }
.pub-row-details { background: #fafbfc; }
.pub-row-details td { padding: 12px; }
.pub-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .pub-inputs { grid-template-columns: 1fr; } }
.order-bar {
  position: sticky; bottom: 0; background: var(--brand); color: #fff; border-radius: 10px;
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px; box-shadow: 0 -4px 16px rgba(0,0,0,.12);
}
.order-bar .total { font-size: 18px; font-weight: 700; }

/* Status timeline (client order view) */
.timeline { list-style: none; padding: 0; margin: 16px 0 0; }
.timeline li { position: relative; padding: 0 0 22px 30px; color: var(--muted); }
.timeline li::before {
  content: ""; position: absolute; left: 6px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: #cfd6de; border: 2px solid #cfd6de;
}
.timeline li::after {
  content: ""; position: absolute; left: 11px; top: 21px; bottom: -2px; width: 2px; background: #e1e4e8;
}
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--text); }
.timeline li.done::before { background: var(--success); border-color: var(--success); }
.timeline li.current { color: var(--brand); font-weight: 700; }
.timeline li.current::before { background: #fff; border-color: var(--brand); }

/* Hero (public landing) */
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { font-size: 34px; margin-bottom: 12px; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 26px; font-size: 17px; }

.footer { border-top: 1px solid var(--border); padding: 18px 0; color: var(--muted); font-size: 13px; }
.actions-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-inline form { display: inline; margin: 0; }
