/* ============================================================================
   Koper.Cloud client portal — housestyle
   ----------------------------------------------------------------------------
   Derived from the koper.cloud website stylesheet (Hustbee):
     dark navy #111a2b · primary yellow #ffc600 (dark text) · blue family
     #5993fa / #2a74e3 / #3d5e98 · Montserrat · pill buttons · light blue
     surfaces #f4f8fe / #eaf2fe · borders #dce2ea
   All values live in the tokens below; components follow automatically.
   ========================================================================= */
@import url("https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700&display=swap");

:root {
  /* brand (values from the live koper.cloud stylesheets) */
  --brand: #283141;            /* header navy (custom.css #header-holder) */
  --brand-deep: #111a2b;       /* fullpage login / footer navy */
  --brand-ink: #ffffff;
  --brand-ink-dim: #91a0bd;    /* footer link grey-blue */
  --mark: #ffc600;             /* the yellow of the logo mark - accents only */
  --accent: #2b74e3;           /* functional buttons (.btn-default) */
  --accent-ink: #ffffff;
  --accent-strong: #1d67d8;    /* button hover */
  --accent-soft: #eaf2fe;
  --cta: #51bcfe;              /* hbtn-primary - the sky-blue CTA */
  --cta-ink: #0c090d;
  --cta-strong: #2ba7f2;
  --link: #2b74e3;
  --link-strong: #1d67d8;
  --outline: #2b74e3;          /* panel border (panel-sidebar) */

  /* workspace */
  --bg: #f4f8fe;               /* light blue section background */
  --card: #ffffff;
  --line: #dce2ea;             /* form-control border */
  --line-soft: #eaf2fe;        /* light blue fill */
  --ink: #101b2c;              /* body text */
  --ink-soft: #596475;
  --heading: #333c4f;          /* row-title */
  --heading-strong: #3d5e98;   /* table headers, small titles */

  /* semantics (site badge palette) */
  --ok: #1e7e34;
  --ok-soft: #e5f4ea;
  --danger: #cc1d00;
  --danger-soft: #ffe9e5;
  --warn: #8a6414;
  --warn-soft: #fff3cd;

  /* shape & type */
  --radius: 10px;
  --radius-small: 5px;
  --radius-pill: 50px;
  --sans: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-strong); }
h1 { font-size: 1.65rem; font-weight: 700; color: var(--heading); letter-spacing: -0.01em; margin: 0 0 0.15rem; }
h2 { font-size: 1.02rem; font-weight: 700; color: var(--heading-strong); margin: 0 0 0.6rem; }
.sub { color: var(--ink-soft); font-weight: 300; margin: 0 0 1rem; }
.mono { font-family: var(--mono); font-size: 0.86em; }
.wrap { word-break: break-all; }

/* ---------------------------------------------------------------- layout */
.shell { display: flex; min-height: 100vh; }
.rail {
  width: 222px; flex: 0 0 auto;
  background: var(--brand); color: var(--brand-ink);
  display: flex; flex-direction: column;
  padding: 1.5rem 0.9rem;
}
.brand {
  font-weight: 700; font-size: 1.1rem;
  line-height: 1.25; letter-spacing: 0.01em;
  border-left: 3px solid var(--mark); padding-left: 0.7rem;
  margin-bottom: 1.8rem; color: var(--brand-ink); text-decoration: none; display: block;
}
.brand img { max-width: 122px; height: auto; max-height: 52px; display: block; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  color: var(--brand-ink-dim); text-decoration: none; padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  border-radius: 6px; border-left: 3px solid transparent;
  transition: all 0.3s ease;
}
.rail nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.rail nav a.on { background: rgba(255,255,255,0.1); color: #fff; border-left-color: var(--mark); }
.rail-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(145,160,189,0.35); }
.who { display: block; font-family: var(--mono); font-size: 0.76rem; color: var(--brand-ink-dim); word-break: break-all; margin-bottom: 0.5rem; }
.page { flex: 1; padding: 2.2rem 2.6rem; max-width: 1080px; }
.page-head { margin-bottom: 1.4rem; }

/* --------------------------------------- status strip (dashboard) */
.strip {
  display: flex; gap: 0; margin-bottom: 1.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.strip-item { flex: 1; display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.1rem; }
.strip-item + .strip-item { border-left: 1px solid var(--line); }
.strip-name { font-weight: 600; font-size: 0.92rem; color: var(--heading); }
.strip-state { color: var(--ink-soft); font-weight: 300; font-size: 0.78rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.off { background: var(--line); }

/* ------------------------------------------------------ cards & tiles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tile {
  display: block; background: var(--card); border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem; text-decoration: none; color: var(--ink);
  transition: all 0.3s ease;
}
.tile h2 { color: var(--link); font-weight: 400; font-size: 1.15rem; transition: all 0.3s ease; }
.tile:hover { box-shadow: 0 0 0 2px var(--outline); }
.tile:hover h2 { font-weight: 600; }
.tile p { color: var(--ink-soft); font-weight: 300; margin: 0.3rem 0 0; font-size: 0.9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.server-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.limits { color: var(--ink-soft); font-weight: 300; }

/* ------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--heading-strong); background: #fcfcfd; }
td { font-weight: 300; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.3s ease; }
tbody tr:hover { background: var(--line-soft); }
.num { text-align: right; }

/* ----------------------------------------------------- chips & flashes */
.chip {
  display: inline-block; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.15rem 0.55rem; border-radius: 3px;
  background: var(--line-soft); color: var(--heading-strong);
}
.chip.state-running, .chip.state-active, .chip.state-paid, .chip.state-answered
  { background: var(--ok-soft); color: var(--ok); }
.chip.state-offline, .chip.state-stopped, .chip.state-suspended,
.chip.state-late, .chip.state-unpaid
  { background: var(--danger-soft); color: var(--danger); }
.chip.state-open, .chip.state-sent
  { background: var(--warn-soft); color: var(--warn); }
.chip.state-closed { background: var(--line-soft); color: var(--ink-soft); }
.flash { border-radius: var(--radius-small); padding: 0.7rem 1rem; border: 1px solid; margin: 0 0 1.1rem; }
.flash.err { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }
.flash.warn { background: var(--warn-soft); border-color: var(--warn-soft); color: var(--warn); }
.flash.ok { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); }
.empty { color: var(--ink-soft); font-weight: 300; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; }

/* -------------------------------------------------------------- forms */
label { display: block; font-weight: 400; font-size: 0.9rem; color: #3b4155; margin: 0.8rem 0 0.3rem; }
input, select, textarea {
  width: 100%; padding: 0.6rem 0.9rem; font: inherit; font-weight: 400;
  color: #3b4155;
  border: 1px solid var(--line); border-radius: var(--radius-small); background: #fff;
  transition: all 0.3s ease;
}
input:hover, select:hover, textarea:hover { border-color: #bcc8d7; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--link);
  box-shadow: inset 0 0 0 0.12rem rgba(82,136,232,0.35);
}
button:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
input.slim { padding: 0.3rem 0.5rem; min-width: 7rem; }
input.big { font-size: 1.4rem; letter-spacing: 0.35em; text-align: center; }
.secret { font-size: 1.15rem; letter-spacing: 0.12em; background: var(--line-soft); padding: 0.6rem 0.9rem; border-radius: var(--radius-small); }
button {
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0;
  border-radius: var(--radius-pill); padding: 0.6rem 1.5rem; margin-top: 0.9rem;
  transition: all 0.3s ease;
}
button:hover { background: var(--accent-strong); }
button.ghost {
  background: transparent; color: var(--link); border: 1px solid var(--line);
  padding: 0.28rem 0.9rem; margin-top: 0; font-weight: 500; font-size: 0.85rem;
}
button.ghost:hover { border-color: var(--outline); background: var(--line-soft); }
button.danger { color: var(--danger); border-color: var(--danger-soft); }
button.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.actions form { display: inline; }
.grid-form { max-width: 480px; }
.btnlike { font-weight: 600; }

/* -------------------------------------------------------- sign-in gate */
/* mirrors the site's login: fullpage navy, borderless inputs, inset ring */
body.gate { display: grid; place-items: center; min-height: 100vh; background: var(--brand-deep); }
.gate-card { width: min(420px, 92vw); padding: 2.2rem 2.3rem; border: 0; }
.gate-card h1 { font-size: 1.25rem; color: var(--heading-strong); border-left: 3px solid var(--mark); padding-left: 0.7rem; }
.gate-card img { max-width: 122px; height: auto; margin-bottom: 1rem; }
.gate-card label { color: #6a81ac; }
.gate-card input {
  border: 0; background: var(--line-soft); margin-bottom: 0.4rem;
}
.gate-card input:focus-visible {
  box-shadow: inset 0 0 0 0.15rem #5288e8; background: #fff;
}
.gate-card button {
  background: #374154; color: #fff; font-weight: 500; font-size: 1rem;
  padding: 0.65rem 2.1rem;
}
.gate-card button:hover { background: #2d3545; }

/* --------------------------------------------------- invoice overview */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .2rem; transition: all 0.3s ease; }
.stat:hover { border-color: var(--outline); }
.stat-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--heading-strong); }
.stat-value { font-size: 1.35rem; font-weight: 400; color: #3375e7; }
.stat-sub { font-size: .78rem; font-weight: 300; color: var(--ink-soft); }

/* ------------------------------------------------------------ tickets */
.msg { border-left: 3px solid var(--line); }
.msg-staff { border-left-color: var(--mark); background: #fffbee; }
.msg-head { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 .4rem; }
.msg-body { white-space: pre-wrap; margin: 0; font-weight: 300; }

/* ------------------------------------------------- hosting management */
.inline-form { display: flex; align-items: end; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }
.joined { display: inline-flex; align-items: center; }
.joined .suffix { padding: 0 .4rem; color: var(--ink-soft); }

/* ---------------------------------- checkbox labels (settings + admin) */
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; font-size: 0.88rem; color: #8490aa; }
label.check input { width: auto; margin: 0; accent-color: #384365; }
label.check:hover { color: #5a667c; }
label.check.slim { display: inline-flex; margin-right: .6rem; font-size: .76rem; }
td.comps { white-space: nowrap; }

/* --------------------------------------------------------- responsive */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail { width: auto; flex-direction: row; align-items: center; gap: 1rem; padding: 0.7rem 1rem; }
  .brand { margin: 0; font-size: 0.95rem; }
  .brand img { max-height: 34px; }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  .rail-foot { margin: 0 0 0 auto; border: none; padding: 0; display: flex; align-items: center; gap: 0.6rem; }
  .who { margin: 0; }
  .page { padding: 1.2rem; }
  .strip { flex-direction: column; }
  .strip-item + .strip-item { border-left: none; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* pay page */
.payline { display: flex; gap: 2.2rem; flex-wrap: wrap; align-items: flex-start; }
.paydetails { flex: 1 1 300px; }
.payqr { flex: 0 1 260px; text-align: center; }
.epc-qr { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: var(--radius-small); }
table.plain, table.plain td { border: 0; background: transparent; }
table.plain td { padding: 0.3rem 0.9rem 0.3rem 0; font-weight: 300; }
table.plain td:first-child { color: var(--ink-soft); }
.strong { font-weight: 600; }
a.paybtn { display: inline-block; background: var(--cta); color: var(--cta-ink); font-weight: 600; font-size: 0.82rem; text-decoration: none; padding: 0.25rem 0.9rem; border-radius: var(--radius-pill); transition: all 0.3s ease; }
a.paybtn:hover { background: var(--cta-strong); color: var(--cta-ink); }
a.ghostlink { font-size: 0.85rem; }

/* SSO sign-in */
a.ssobtn { display: block; text-align: center; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; padding: 0.65rem 1rem; border-radius: var(--radius-pill); margin: 0.4rem 0 0.2rem; transition: all 0.3s ease; }
a.ssobtn:hover { background: var(--accent-strong); color: var(--accent-ink); }
.divider { display: flex; align-items: center; gap: 0.8rem; color: var(--ink-soft); font-size: 0.8rem; margin: 1rem 0 0.4rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
button.secondary { background: transparent; color: var(--link); border: 1px solid var(--outline); }
button.secondary:hover { background: var(--accent-soft); color: var(--link-strong); }

/* hosting section tabs */
.tabbar { display: flex; gap: 0.4rem; margin: 0 0 1.4rem; border-bottom: 1px solid var(--line); }
.tabbar a { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; padding: 0.5rem 0.9rem; border-bottom: 3px solid transparent; }
.tabbar a:hover { color: var(--link); }
.tabbar a.on { color: var(--heading); border-bottom-color: var(--mark); }

/* dashboard open invoices */
.open-invoices { border-left: 3px solid var(--mark); }
