/* Electronic Board — Shared brand styles
   App-specific components go in each app's own static/styles.css */

:root {
  --green:        #288e37;
  --green-dark:   #1f6d2a;
  --green-soft:   #d9ecdd;
  --green-text:   #155b22;

  --magenta:      #b9165c;
  --magenta-dark: #9a1049;
  --magenta-soft: #f7dbe8;
  --magenta-text: #7f0e3f;

  --yellow:       #d2d800;
  --yellow-soft:  #fafac0;
  --yellow-text:  #6e6e00;

  --blue:         #82b5e2;
  --blue-soft:    #e6f0fa;
  --blue-text:    #2c6aa0;

  --black:        #0f172a;
  --muted:        #64748b;
  --faint:        #94a3b8;
  --bg:           #f5f7fa;
  --card:         #ffffff;
  --border:       #e6ebf1;
  --border-soft:  #f1f4f8;

  --radius:       14px;
  --radius-sm:    8px;
  --radius-xs:    4px;

  --shadow-sm:    0 1px 2px rgba(15,23,42,0.04);
  --shadow:       0 1px 3px rgba(15,23,42,0.05), 0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg:    0 4px 8px rgba(15,23,42,0.06), 0 12px 28px rgba(15,23,42,0.09);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--black);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  margin: 0 0 0.5em 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

a { color: inherit; text-decoration: none; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
}
.container.narrow { max-width: 880px; }

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  letter-spacing: 3px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--black);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { height: 34px; display: block; }
.topbar nav { display: flex; gap: 10px; align-items: center; }
.topbar nav a {
  color: var(--muted);
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
}
.topbar nav a:hover { background: var(--bg); color: var(--black); text-decoration: none; }
.topbar-home {
  color: var(--green-text) !important;
  font-weight: 600 !important;
  border: 1px solid var(--green-soft);
}
.topbar-home:hover { background: var(--green-soft) !important; color: var(--green-dark) !important; }

.topbar-user {
  color: var(--muted);
  font-size: 13px;
  padding: 7px 0 7px 14px;
  margin-left: 6px;
  white-space: nowrap;
}
.topbar-logout {
  color: var(--magenta-text) !important;
  border: 1px solid var(--magenta-soft);
  font-weight: 600 !important;
}
.topbar-logout:hover { background: var(--magenta-soft) !important; color: var(--magenta-dark) !important; }

/* ── Page hero ──────────────────────────────────────────────────────────── */
.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-hero h1 { font-size: 28px; font-weight: 700; margin: 0 0 4px 0; letter-spacing: -0.5px; }
.page-hero .subtitle { color: var(--muted); font-size: 14px; }
.page-hero .right { display: flex; gap: 8px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.card-title .accent {
  width: 4px; height: 22px; border-radius: 2px;
  background: var(--green);
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}
.card-title .right { font-size: 12px; font-weight: 500; color: var(--muted); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 24px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}
.flash-ok    { background: var(--green-soft);   color: var(--green-text); }
.flash-error { background: var(--magenta-soft); color: var(--magenta-text); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--black);
  color: white;
  border: 0;
  padding: 9px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  font-family: inherit;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { background: #1e293b; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green); }
.btn.primary:hover { background: var(--green-dark); }
.btn.ghost { background: white; color: var(--black); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--magenta); }
.btn.danger:hover { background: var(--magenta-dark); }
.btn.blue { background: var(--blue-text); color: white; }
.btn.blue:hover { background: #245a8a; }
.btn.sm { padding: 6px 10px; font-size: 12px; }

/* ── Search box (pill-style input + button) ─────────────────────────────── */
.search-box { display: flex; gap: 8px; margin-bottom: 14px; }
.search-box input {
  flex: 1; padding: 13px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--black); font-size: 15px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search-box input::placeholder { color: var(--faint); }
.search-box input:focus {
  outline: none; background: #fff; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40,142,55,0.15);
}
.search-box button {
  padding: 13px 26px; border-radius: 999px; border: 0;
  background: var(--green); color: #fff; font-weight: 700;
  font-size: 15px; cursor: pointer;
  transition: background .15s, transform .05s;
}
.search-box button:hover { background: var(--green-dark); }
.search-box button:active { transform: translateY(1px); }
.search-box button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Section title (small uppercase label above a block) ────────────────── */
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 0; font-weight: 700;
}
.section-title-wrap { margin: 0 0 12px; }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 24px; }
.tabs button {
  background: transparent; border: 0; padding: 10px 18px 12px; margin-bottom: -1px;
  font-size: 14px; color: var(--muted); font-weight: 600; cursor: pointer;
  border-bottom: 3px solid transparent; transition: color .12s, border-color .12s;
}
.tabs button:hover { color: var(--black); }
.tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Modal / overlay ────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 100; overflow-y: auto; padding: 32px 16px;
}
.modal-back[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: var(--radius); max-width: 960px; width: 100%;
  padding: 20px 24px 28px; box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 18px; margin: 0; color: var(--black); }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-head .close {
  background: transparent; border: 0; font-size: 22px; color: var(--muted);
  cursor: pointer; padding: 4px 10px; border-radius: 6px;
}
.modal-head .close:hover { background: var(--bg); color: var(--black); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.4;
}
.badge-ok   { background: var(--green-soft);   color: var(--green-text); }
.badge-nok  { background: var(--magenta-soft); color: var(--magenta-text); }
.badge-warn { background: var(--yellow-soft);  color: var(--yellow-text); }
.badge.dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  display: inline-block;
}
