@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-0: #0a0e14;
  --bg-1: #11161f;
  --bg-2: #1a2130;
  --bg-3: #232c3d;
  --border: #2a3447;
  --border-strong: #3a4763;

  --fg-0: #e6ebf2;
  --fg-1: #a8b2c7;
  --fg-2: #6b7591;

  --cyan: #22d3ee;
  --cyan-dim: #0e7c8a;
  --amber: #f59e0b;
  --green: #34d399;
  --red: #f87171;

  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 8px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-2); }
.dim { color: var(--fg-1); }
.right { text-align: right; }

/* ===== Buttons ============================================== */
button, .btn {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--fg-0);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all .15s;
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
}
button:hover:not(:disabled), .btn:hover { background: var(--bg-3); border-color: var(--cyan-dim); }
button:disabled { opacity: .5; cursor: not-allowed; }

button.primary, .primary {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: #001318;
  font-weight: 600;
}
button.primary:hover:not(:disabled), .primary:hover { background: var(--cyan); }

button.danger, .btn.danger {
  background: transparent;
  border-color: #5a2828;
  color: var(--red);
}
button.danger:hover:not(:disabled), .btn.danger:hover { background: #2a1414; border-color: var(--red); }

.block { width: 100%; }

/* ===== Forms ============================================== */
input, select {
  font-family: inherit;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--fg-0);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--cyan); }
input:disabled, select:disabled {
  background: var(--bg-2);
  color: var(--fg-2);
  cursor: not-allowed;
  opacity: .85;
}
select { cursor: pointer; }

label {
  display: block;
  font-size: 11px;
  color: var(--fg-1);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.inline-label { display: inline; margin: 0 10px 0 0; vertical-align: middle; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 18px; }
.field-hint {
  font-size: 11px;
  color: var(--fg-2);
  margin-top: 6px;
  line-height: 1.4;
}
.required {
  color: var(--red);
  margin-left: 2px;
}

.input-group { display: flex; }
.input-group input {
  border-top-right-radius: 0; border-bottom-right-radius: 0;
}
.input-suffix {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-left: none;
  border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm);
  color: var(--fg-1); font-size: 13px; white-space: nowrap;
}

/* Input s ikonkovými tlačidlami napravo */
.input-with-actions {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-actions input {
  padding-right: 72px; /* miesto pre 2 ikonky */
}
.btn-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--fg-2);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.btn-icon:hover {
  color: var(--cyan);
  background: rgba(34,211,238,.08);
}
.btn-icon.active {
  color: var(--cyan);
}
.input-with-actions .btn-icon:nth-of-type(1) { right: 34px; }
.input-with-actions .btn-icon:nth-of-type(2) { right: 6px; }

/* ===== Card ============================================== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }

/* ===== Tables ============================================== */
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
th {
  color: var(--fg-2);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .05em;
  background: var(--bg-2);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-2); }
td.empty { text-align: center; color: var(--fg-2); padding: 30px; }

/* ===== Badges ============================================== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-3);
  color: var(--fg-1);
}
.badge.cyan { background: rgba(34,211,238,.12); color: var(--cyan); }
.badge.amber { background: rgba(245,158,11,.12); color: var(--amber); }
.badge.green { background: rgba(52,211,153,.12); color: var(--green); }

/* ===== Alerts ============================================== */
.alert {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert.error {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.3);
  color: var(--red);
}

/* ===== Layout ============================================== */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--fg-1);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.admin-badge svg {
  color: var(--fg-2);
}
.btn-contact {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.3);
  color: var(--amber);
  display: inline-flex;
  align-items: center;
}
.btn-contact:hover {
  background: rgba(245,158,11,.15);
  border-color: var(--amber);
}

textarea {
  font-family: inherit;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--fg-0);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
textarea:focus { outline: none; border-color: var(--cyan); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-title { font-weight: 600; letter-spacing: .02em; }
.brand-sub { font-size: 11px; color: var(--fg-2); }

.container {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.toolbar-left select { min-width: 240px; width: auto; }

.domain-tag {
  display: inline-block;
  padding: 7px 14px;
  background: rgba(34,211,238,.08);
  border: 1px solid rgba(34,211,238,.25);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: .02em;
}

/* ===== Logo ============================================== */
.logo-square {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dim));
  display: grid;
  place-items: center;
  color: #001318;
  font-weight: 700;
  font-size: 22px;
  font-family: var(--font-mono);
}
.logo-square.sm {
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 14px;
}
.logo-square svg {
  width: 60%;
  height: 60%;
  display: block;
}

/* ===== Login screen ============================================== */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at top, #14202e, var(--bg-0));
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-head {
  text-align: center;
  margin-bottom: 22px;
}
.login-head .logo-square {
  margin: 0 auto 12px;
}
.login-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.login-head p {
  margin: 6px 0 0;
  font-size: 12px;
}

/* ===== Modal ============================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  width: 100%;
  max-width: 460px;
}
.modal h2 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 600;
}
.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
[hidden] { display: none !important; }

/* ===== Toast notifications ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-sm);
  padding: 12px 16px 12px 14px;
  min-width: 260px;
  max-width: 380px;
  color: var(--fg-0);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastIn .25s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.success .toast-icon { color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--cyan); }
.toast.leaving { animation: toastOut .2s ease-in forwards; }
.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.toast-msg { flex: 1; }
.toast-close {
  background: transparent;
  border: none;
  color: var(--fg-2);
  padding: 0 2px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  margin-left: 4px;
}
.toast-close:hover { color: var(--fg-0); background: transparent; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ===== Confirm modal ============================================ */
.confirm-modal {
  max-width: 420px;
}
.confirm-msg {
  color: var(--fg-1);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.confirm-msg strong {
  color: var(--fg-0);
  font-family: var(--font-mono);
}

/* ===== Actions cell s viacerými tlačidlami =============================== */
.actions-cell .btn {
  margin-left: 4px;
  /* Ikon-only square buttons */
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.actions-cell .btn:first-child {
  margin-left: 0;
}
.actions-cell .btn svg {
  width: 16px;
  height: 16px;
  display: block;
}
.btn-doc {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.3);
  color: var(--amber);
}
.btn-doc:hover {
  background: rgba(245,158,11,.15);
  border-color: var(--amber);
}
.btn-edit {
  color: var(--cyan);
}
.btn-edit:hover {
  background: rgba(34,211,238,.1);
  border-color: var(--cyan-dim);
}
