/* CSG CRM — SII Czech Republic visual identity
   Palette: SII deep navy-blue primary + fresh green accent on clean white. */
:root {
  --sii-navy: #001a70;        /* deep corporate blue */
  --sii-blue: #0046c8;        /* primary interactive blue */
  --sii-blue-light: #e8eefc;  /* tinted blue surfaces */
  --sii-green: #78be20;       /* signature "Let's Tech Together" green */
  --sii-green-dark: #5a9416;
  --ink: #14213d;             /* near-black text */
  --ink-soft: #5a6478;        /* secondary text */
  --line: #e4e8f0;            /* borders */
  --bg: #f4f6fb;              /* app background */
  --surface: #ffffff;
  --danger: #d92d20;
  --shadow-sm: 0 1px 3px rgba(0, 26, 112, 0.08);
  --shadow-md: 0 6px 20px rgba(0, 26, 112, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--sii-navy);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 3px var(--sii-green);
}

.brand-sii {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--sii-navy);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.brand-sub { font-size: 12px; color: #b9c4e8; margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 20px; }

.metrics { display: flex; gap: 18px; }
.metric { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.metric-value { font-weight: 700; font-size: 18px; }
.metric-label { font-size: 11px; color: #b9c4e8; text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value.green { color: var(--sii-green); }

/* ---------------- Buttons ---------------- */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sii-green); color: #06340a; }
.btn-primary:hover { background: var(--sii-green-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f0f2f7; }
.btn-danger { color: var(--danger); border-color: #f3c4bf; }
.btn-danger:hover { background: #fdecea; }

/* ---------------- Board ---------------- */
.board-wrap { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 20px; }

.board {
  display: flex;
  gap: 16px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.column {
  flex: 0 0 288px;
  display: flex;
  flex-direction: column;
  background: #eef1f7;
  border-radius: var(--radius);
  max-height: 100%;
  border: 1px solid var(--line);
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 2px solid transparent;
}
.column-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--sii-navy); }
.column-count {
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--sii-blue);
  border-radius: 20px;
  padding: 2px 8px;
}

.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 40px;
}
.column-body.drop-hover { background: var(--sii-blue-light); box-shadow: inset 0 0 0 2px var(--sii-blue); border-radius: var(--radius-sm); }

.column-add {
  margin: 4px 10px 12px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.column-add:hover { color: var(--sii-blue); border-color: var(--sii-blue); background: #fff; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--sii-green);
  cursor: grab;
  transition: box-shadow 0.15s ease, transform 0.08s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card.dragging { opacity: 0.5; cursor: grabbing; }
.card-name { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.card-role { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
.card-role .company { color: var(--sii-blue); font-weight: 600; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-soft);
  background: #f1f4f9;
  border-radius: 20px;
  padding: 3px 9px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip:hover { background: var(--sii-blue-light); color: var(--sii-blue); }
.chip.linkedin { background: #e8f0fe; color: #0a66c2; font-weight: 600; }
.chip.linkedin:hover { background: #0a66c2; color: #fff; }
.chip svg { width: 12px; height: 12px; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 12, 48, 0.55);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(2px);
}
/* The [hidden] attribute must win over the display rule above, otherwise the
   modal stays visible on load and cannot be closed. */
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 12, 48, 0.4);
  max-height: 92vh;
  overflow-y: auto;
  animation: pop 0.16s ease;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--sii-navy);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: #b9c4e8; font-size: 26px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: #fff; }

.modal-body { padding: 20px 22px 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  transition: border 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--sii-blue);
  box-shadow: 0 0 0 3px var(--sii-blue-light);
  background: #fff;
}

.modal-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.modal-actions .spacer { flex: 1; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sii-navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 200;
  animation: rise 0.2s ease;
}
.toast.error { background: var(--danger); }
@keyframes rise { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------------- Empty state ---------------- */
.empty-col {
  font-size: 12.5px;
  color: #aab2c4;
  text-align: center;
  padding: 20px 8px;
  font-style: italic;
}

@media (max-width: 640px) {
  .metrics { display: none; }
  .brand-sub { display: none; }
  .field-row { flex-direction: column; gap: 0; }
}

/* ---- Login page ---- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 12, 48, 0.18);
  padding: 38px 36px 34px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  border-top: 4px solid var(--sii-green, #78be20);
}
.login-brand {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  background: var(--sii-navy, #001a70);
  border-radius: 12px;
}
.login-brand .brand-sii {
  color: #fff;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 1px;
}
.login-title { font-size: 22px; font-weight: 800; color: var(--sii-navy, #001a70); }
.login-sub { font-size: 13px; color: #6b7796; margin-top: 4px; margin-bottom: 26px; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-size: 13px; font-weight: 600; color: #33405e; }
.login-form input {
  padding: 11px 13px;
  border: 1px solid #d3daea;
  border-radius: 8px;
  font-size: 15px;
}
.login-form input:focus { outline: none; border-color: var(--sii-navy, #001a70); }
.login-btn { margin-top: 12px; width: 100%; justify-content: center; padding: 11px; }
.login-error {
  color: var(--danger, #d23b3b);
  font-size: 13px;
  background: #fdeaea;
  border-radius: 6px;
  padding: 8px 10px;
}
