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

/* =====================  OCEAN THEME  ===================== */
:root {
  --ink: #142f07;            /* deep sea navy */
  --ink-soft: #344a2a;       /* sea mist */
  --line: #d5ecc9;
  --bg: #eefae9;
  --panel: #ffffff;
  --accent: #1f5c06;         /* ocean teal-blue */
  --accent-dark: #1f5c06;
  --accent-2: #51be1b;       /* aqua */
  --accent-soft: #e0f6d5;
  --navy: #142f07;
  --good: #0a5c42;
  --good-bg: #dcf5ec;
  --warn: #9a5b00;
  --warn-bg: #fdf1d8;
  --radius: 12px;
  --shadow: 0 6px 22px rgba(34, 80, 11, .08);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: 'Poppins', 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 220' preserveAspectRatio='none'><path fill='%2314b8c8' fill-opacity='.10' d='M0,128 C240,40 480,200 720,120 C960,40 1200,190 1440,100 L1440,220 L0,220 Z'/><path fill='%230e7c9b' fill-opacity='.10' d='M0,160 C260,90 520,220 780,150 C1040,80 1240,200 1440,140 L1440,220 L0,220 Z'/></svg>") bottom / 100% 220px no-repeat fixed,
    linear-gradient(180deg, #e3f8d9 0%, #eefae9 38%, #f6fcf2 100%) fixed;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { font-family: var(--font-head); color: var(--navy); letter-spacing: -0.01em; }
h1 { font-size: 26px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 18px; margin: 0 0 16px; font-weight: 600; }
.subtitle { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 24px; }

/* ---------- top bar with wave edge ---------- */
.topbar {
  position: relative;
  background: linear-gradient(120deg, #142f07 0%, #25560c 55%, #1f5c06 100%);
  padding: 14px 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40' preserveAspectRatio='none'><path fill='%23e3f5fa' d='M0,22 C180,0 360,40 540,22 C720,4 900,40 1080,22 C1260,6 1350,30 1440,18 L1440,40 L0,40 Z'/></svg>") bottom / 100% 100% no-repeat;
  pointer-events: none;
}
.topbar .brand { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: .2px; color: #fff; }
.topbar .brand span { color: #94ea69; }
.topbar .who { font-size: 13px; color: #cdeebc; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar a.btn-link {
  color: #e7f9dd; text-decoration: none;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  padding: 6px 13px; border-radius: 999px; transition: all .15s;
}
.topbar a.btn-link:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.55); color: #fff; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 22px 24px 90px; }
.center-wrap { max-width: 430px; margin: 70px auto; padding: 0 20px; }

/* ---------- cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=tel], input[type=email], input[type=number], input[type=date], textarea, select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit; font-size: 14px;
  margin-bottom: 16px;
  background: #fcfefa;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(81, 190, 27, .22); }
input[type=file] { font-size: 13px; max-width: 100%; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } .topbar { padding: 12px 14px 24px; } .wrap { padding: 18px 14px 80px; } }

/* ---------- buttons ---------- */
button, .btn {
  display: inline-block;
  background: linear-gradient(135deg, #1f5c06 0%, #1f5c06 100%);
  color: #fff;
  border: none;
  padding: 10px 19px;
  border-radius: 10px;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(56, 130, 19, .28);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
button:hover, .btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(56, 130, 19, .34); color: #fff; }
.btn-secondary, button.btn-secondary {
  background: #fff; color: var(--accent-dark); border: 1px solid #c1e5af; box-shadow: none;
}
.btn-secondary:hover, button.btn-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); box-shadow: none; filter: none; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #e6f3df; white-space: nowrap; }
th { color: #466c33; font-weight: 600; font-size:13px; text-transform: uppercase; letter-spacing: 0.05em; background: #f0fbea; }
th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; }
tr:hover td { background: #f4fcf0; }
.table-scroll { overflow-x: auto; }

/* ---------- badges / flashes ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size:13px; font-weight: 600; }
.badge-yes { background: var(--good-bg); color: var(--good); }
.badge-no { background: #ecf5e8; color: var(--ink-soft); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-flag { background: #fde8e6; color: #8b1c12; }

.flash { padding: 13px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; border: 1px solid transparent; }
.flash-success { background: var(--good-bg); color: var(--good); border-color: #bfe9d9; }
.flash-error { background: #fdeceb; color: #8b1c12; border-color: #f6cfcb; }

/* ---------- stat tiles ---------- */
.stat-row { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 130px;
  background: linear-gradient(160deg, #ffffff 0%, #eefbe8 100%);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat .num { font-family: var(--font-head); font-size: 27px; font-weight: 600; color: var(--navy); }
.stat .lbl { font-size:13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

.actions-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input { width: auto; margin-bottom: 0; }
.summary-list { font-size: 13.5px; color: var(--ink-soft); }
.summary-list li { margin-bottom: 4px; }

/* ---------- billing / recordings ---------- */
table.mini { width: 100%; font-size: 13px; margin-top: 8px; }
table.mini td { padding: 6px 8px; border-bottom: 1px solid #e6f3df; vertical-align: top; white-space: normal; }
.nav-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.inline-form { display: inline; }
.inline-form input, .inline-form select { width: auto; margin: 0 4px 0 0; padding: 6px 8px; }
details.rec-detail > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
audio { height: 36px; max-width: 270px; border-radius: 999px; }
.rec-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.btn-dl { padding: 6px 14px; font-size: 13px; border-radius: 999px; background: linear-gradient(135deg, #51be1b, #1f5c06); }
.rec-name { font-size:13px; color: var(--ink-soft); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ---------- sign-in pages (no top bar) ---------- */
.center-wrap .card { border-radius: 20px; padding: 32px 30px; box-shadow: 0 18px 50px rgba(34, 80, 11, .16); }
.center-wrap h1 { text-align: center; font-size: 30px; }
.center-wrap h1 span, h1 span { color: var(--accent-2); }
.center-wrap .subtitle { text-align: center; }


/* =====================  OCEAN — extra beauty  ===================== */
::selection { background: #51be1b; color: #fff; }
html { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #b8e1a4; border-radius: 10px; border: 2px solid #eefae9; }
::-webkit-scrollbar-thumb:hover { background: #8fcf6f; }

/* page header turns into an ocean banner (first .actions-row on a page, set by footer script) */
.actions-row.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(115deg, #142f07 0%, #29610e 52%, #51be1b 135%);
  color: #fff; border-radius: 22px; padding: 28px 30px 44px; margin-bottom: 24px;
  box-shadow: 0 16px 38px rgba(34, 80, 11, .26);
}
.actions-row.hero > * { position: relative; z-index: 2; }
.actions-row.hero h1 { color: #fff; font-size: 29px; text-shadow: 0 2px 10px rgba(0,0,0,.18); }
.actions-row.hero .subtitle { color: #cfefbe; margin-bottom: 0; }
.actions-row.hero .subtitle a, .actions-row.hero a.btn-link { color: #fff; }
.actions-row.hero .btn-secondary { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.42); backdrop-filter: blur(4px); }
.actions-row.hero .btn-secondary:hover { background: rgba(255,255,255,.28); color: #fff; }
.actions-row.hero .btn:not(.btn-secondary) { background: #fff; color: #1f5c06; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.actions-row.hero::before {
  content: ""; position: absolute; right: -50px; top: -60px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(148, 234, 105,.5), rgba(81, 190, 27,0) 68%); z-index: 1;
}
.actions-row.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; z-index: 1;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'><path fill='%23ffffff' fill-opacity='.16' d='M0,20 C100,0 200,40 300,20 C400,0 500,40 600,20 C700,0 800,40 900,20 C1000,0 1100,40 1200,20 L1200,40 L0,40 Z'/></svg>") repeat-x 0 0 / 600px 30px;
  animation: wave 9s linear infinite;
}
@keyframes wave { from { background-position-x: 0; } to { background-position-x: -600px; } }

/* stat tiles: coloured accents */
.stat { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(34, 80, 11,.14); }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(81, 190, 27,.22), rgba(81, 190, 27,0) 70%); }
.stat-row .stat:nth-child(5n+1) { border-left-color: #51be1b; }
.stat-row .stat:nth-child(5n+2) { border-left-color: #4cb119; }
.stat-row .stat:nth-child(5n+3) { border-left-color: #6bd636; }
.stat-row .stat:nth-child(5n+4) { border-left-color: #4c8d2b; }
.stat-row .stat:nth-child(5n+5) { border-left-color: #f2b45a; }
.stat-row .stat:nth-child(5n+5)::after { background: radial-gradient(circle, rgba(242,180,90,.25), rgba(242,180,90,0) 70%); }

/* cards: small wave-coloured underline under headings */
.card > h2:first-child::after { content: ""; display: block; width: 38px; height: 3px; border-radius: 3px; margin-top: 7px; background: linear-gradient(90deg, #51be1b, #1f5c06); }
.card { transition: box-shadow .15s; }
.card:hover { box-shadow: 0 10px 30px rgba(34, 80, 11, .12); }

/* tables */
tbody tr:nth-child(even) td { background: #f9fef7; }
tbody tr:hover td { background: #eaf9e2; }
.table-scroll { border-radius: 12px; }

/* links that look like buttons in the card toolbars */
a.btn-link { color: var(--accent); text-decoration: none; font-weight: 500; }
a.btn-link:hover { text-decoration: underline; }

/* ---------- sign-in / agent pages: full ocean scene ---------- */
body.auth {
  min-height: 100vh;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 260' preserveAspectRatio='none'><path fill='%23ffffff' fill-opacity='.10' d='M0,140 C240,50 480,220 720,130 C960,40 1200,200 1440,110 L1440,260 L0,260 Z'/><path fill='%23ffffff' fill-opacity='.14' d='M0,180 C260,110 520,240 780,170 C1040,100 1240,220 1440,160 L1440,260 L0,260 Z'/></svg>") bottom / 100% 260px no-repeat fixed,
    radial-gradient(900px 500px at 15% 10%, rgba(148, 234, 105,.35), rgba(148, 234, 105,0) 60%),
    linear-gradient(160deg, #142f07 0%, #29610e 55%, #51be1b 120%) fixed;
}
body.auth .center-wrap .card, body.auth .agent-wrap .card { background: rgba(255,255,255,.96); border: 0; box-shadow: 0 24px 60px rgba(12, 29, 4, .38); }
body.auth .center-wrap h1, body.auth .agent-brand { color: #142f07; }
body.auth .agent-brand { color: #fff; font-family: var(--font-head); font-size: 22px; }
body.auth .agent-brand span { color: #94ea69; }
body.auth .btn-ghost { color: #1f5c06; border-color: #1f5c06; background: #fff; }
body.auth .step { border-top-color: #d5ecc9; }
