/* ===========================================================================
   plop-portals — stylesheet
   Reuses the Fonocal marketing site's "Coral Slate" design system (same
   surfaces, type, and coral accent) so the portals feel like the same company.
   This file is portal-specific: forms, data tables, status badges — the
   components a backend tool needs, which the marketing CSS doesn't have.
   =========================================================================== */

/* ---- Fonts: import the same three the marketing site uses ---- */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces — shared, never themed (verbatim from the marketing site) */
  --bg:          #0c0c10;
  --panel:       #0e0e12;
  --card:        #111118;
  --card-hi:     #14141e;
  --border:      #1e1e2a;
  --border-hi:   #2a2a38;

  /* Text — shared */
  --white:       #ffffff;
  --body:        #e8e8f0;
  --mid:         #d0d0e8;
  --muted:       #9090a8;
  --dim:         #5a5a72;
  --green:       #44cc88;
  --amber:       #e0a030;
  --red:         #e0604a;

  /* Accent — CORAL. The admin portal is Fonocal-branded, so we use the
     Low-End Control coral as the portal accent (handoff: portals reuse the
     Coral Slate look). */
  --accent:       #d85a30;
  --accent-mid:   #993c1d;
  --accent-dark:  #712b13;
  --accent-pale:  #f0997b;
  --accent-ghost: rgba(216,90,48,0.08);
  --accent-glow:  rgba(216,90,48,0.12);
  --accent-line:  rgba(216,90,48,0.2);

  /* Type */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-pale); text-decoration: none; }
a:hover { color: var(--accent); }

code, .mono { font-family: var(--font-mono); }

/* ---- Layout shell ---- */
.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--white);
}
.brand .brand-sub {
  color: var(--accent);
  margin-left: 8px;
  font-weight: 700;
}

.topbar nav { display: flex; gap: 22px; align-items: center; }
.topbar nav a { color: var(--muted); font-weight: 500; font-size: 14px; }
.topbar nav a:hover { color: var(--body); }

/* ---- Headings ---- */
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: var(--white);
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  margin: 32px 0 14px;
}
.subtitle { color: var(--muted); margin-bottom: 28px; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 18px;
}
.card-hi { background: var(--card-hi); border-color: var(--border-hi); }

/* ---- Forms ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: 7px;
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 11px 13px;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}
input::placeholder { color: var(--dim); }

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: #14070a;
  border: none;
  border-radius: 7px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}
button:hover, .btn:hover { background: var(--accent-pale); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-hi);
}
.btn-ghost:hover { background: var(--card-hi); color: var(--body); }

/* ---- Inline form row (search box + button side by side) ---- */
.search-row { display: flex; gap: 10px; align-items: flex-end; }
.search-row .field { flex: 1; margin-bottom: 0; }

/* ---- Messages ---- */
.msg {
  border-radius: 7px;
  padding: 12px 15px;
  font-size: 14px;
  margin-bottom: 18px;
}
.msg-error  { background: rgba(224,96,74,0.10);  border: 1px solid rgba(224,96,74,0.3);  color: #f0a092; }
.msg-warn   { background: rgba(224,160,48,0.10); border: 1px solid rgba(224,160,48,0.3); color: #e8c87a; }
.msg-info   { background: var(--accent-ghost);   border: 1px solid var(--accent-line);   color: var(--accent-pale); }

/* ---- Definition list (key/value detail display) ---- */
.detail {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 20px;
}
.detail dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.detail dd {
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 13.5px;
  word-break: break-all;
}

/* ---- Data table (machines list, licences list) ---- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-hi);
}
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  color: var(--mid);
}
tr:last-child td { border-bottom: none; }

/* ---- Status badges ---- */
.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 5px;
}
.badge-active    { background: rgba(68,204,136,0.12); color: var(--green); }
.badge-suspended { background: rgba(224,96,74,0.12);  color: var(--red); }
.badge-other     { background: var(--card-hi);        color: var(--muted); }

/* ---- Slot counter (X of 3 machines) ---- */
.slots {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mid);
}
.slots .slots-used { color: var(--accent-pale); font-weight: 500; }

/* ---- Empty state ---- */
.empty {
  color: var(--dim);
  font-size: 14px;
  padding: 8px 0;
}

/* ---- Centered single-card layouts (login) ---- */
.center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.center-card { width: 100%; max-width: 380px; }
.center-card .brand { display: block; text-align: center; margin-bottom: 24px; }

/* ---- Footer note ---- */
.foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 12.5px;
}

/* ---- Utility ---- */
.row-actions { display: flex; gap: 10px; margin-top: 24px; }
.back-link { color: var(--muted); font-size: 13px; }
