/* @us 657 — Dashboard styles (https://dev.azure.com/domesprojektai/log/_workitems/edit/657) */
/* =============================================================================
   LOG — stiliai (dizaino kalba perpanaudota iš teciobankas, mėlyna tema)
   ============================================================================= */

:root {
  --background: #f4f7fc;
  --foreground: #1c2534;
  --card: #ffffff;
  --primary: #3b82f6;
  --secondary: #e3edfd;
  --muted: #e9eef7;
  --muted-foreground: #64748b;
  --accent: #4caf82;
  --destructive: #e8553e;
  --border: rgba(28, 37, 52, 0.12);
  --input-background: #f0f5fd;
  --ring: rgba(59, 130, 246, 0.35);

  --r-xl: 0.75rem;
  --r-2xl: 1rem;
  --r-3xl: 1.5rem;

  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

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

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
strong { font-weight: 800; }
code { background: var(--muted); padding: 0.1rem 0.35rem; border-radius: 0.35rem; font-size: 0.82em; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244, 247, 252, 0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid rgba(59, 130, 246, 0.15);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0; }
.logo { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; text-decoration: none; }
.logo-badge {
  width: 2.5rem; height: 2.5rem; border-radius: var(--r-2xl);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: linear-gradient(135deg, #e8f1fe, #d5e6fc);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.logo-title { font-family: var(--font-head); font-weight: 900; font-size: 1.15rem; line-height: 1; color: var(--foreground); }

.top-nav { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  padding: 0.4rem 0.8rem; border-radius: 999px; text-decoration: none;
  font-family: var(--font-head); font-weight: 700; font-size: 0.85rem;
  color: var(--foreground); transition: background 0.15s;
}
.nav-link:hover { background: var(--muted); }
.nav-muted { color: var(--muted-foreground); }

/* ---------- Main layout ---------- */
main.wrap { padding-top: 1.25rem; padding-bottom: 2.5rem; display: flex; flex-direction: column; gap: 1.25rem; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.stat { border-radius: var(--r-2xl); padding: 1rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.stat .stat-value { font-family: var(--font-head); font-weight: 900; font-size: 1.35rem; line-height: 1.1; }
.stat .stat-label { font-family: var(--font-head); font-weight: 700; font-size: 0.7rem; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-blue { background: #eef6ff; border: 1.5px solid #b8d8f8; }
.stat-blue .stat-value { color: #1a5fa8; } .stat-blue .stat-label { color: #3a8edc; }
.stat-green { background: #f0faf5; border: 1.5px solid #b8e8cd; }
.stat-green .stat-value { color: #1e7a4a; } .stat-green .stat-label { color: #4caf82; }
.stat-gray { background: #f2f4f8; border: 1.5px solid #d5dbe6; }
.stat-gray .stat-value { color: #3a4658; } .stat-gray .stat-label { color: #64748b; }

/* ---------- Card ---------- */
.card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--r-2xl); }
.empty-card { padding: 2.5rem 1.5rem; text-align: center; }
.empty-card h2 { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; margin: 0 0 0.5rem; }
.empty-card p { color: var(--muted-foreground); font-size: 0.9rem; margin: 0 auto; max-width: 32rem; line-height: 1.6; }

/* ---------- Filtrai ---------- */
.filters { display: flex; gap: 1rem; padding: 1rem 1.25rem; align-items: flex-end; flex-wrap: wrap; }
.filter { min-width: 12rem; }
.filter .input { padding: 0.55rem 0.75rem; }
.filter-sync { margin-left: auto; min-width: 0; align-self: center; }
.sync-note { font-family: var(--font-head); font-weight: 600; font-size: 0.78rem; color: var(--muted-foreground); }

/* ---------- Įrašų kortelė + lentelė ---------- */
.tx-card { overflow: hidden; }
.tx-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); gap: 0.75rem; flex-wrap: wrap; }
.tx-title { font-family: var(--font-head); font-weight: 800; font-size: 1rem; }
.tx-count { font-family: var(--font-head); font-weight: 700; font-size: 0.78rem; color: var(--muted-foreground); }

.table-scroll { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.log-table th {
  text-align: left; padding: 0.6rem 1rem;
  font-family: var(--font-head); font-weight: 800; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground);
  border-bottom: 1px solid var(--border); background: #fafbfe;
  white-space: nowrap;
}
.log-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.log-table tbody tr:last-child td { border-bottom: none; }
.log-table tbody tr:hover { background: rgba(233, 238, 247, 0.45); }
.log-table .num { text-align: right; }
.log-table .nowrap { white-space: nowrap; }
.log-table.small { font-size: 0.78rem; }
.log-table.small th, .log-table.small td { padding: 0.45rem 0.75rem; }
.comment-cell { min-width: 14rem; color: var(--muted-foreground); }
.wi-link { color: var(--primary); text-decoration: none; font-weight: 600; }
.wi-link:hover { text-decoration: underline; }

/* ---------- Ženkliukai ---------- */
.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  font-family: var(--font-head); font-weight: 800; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-ok    { background: #f0faf5; color: #1e7a4a; border: 1px solid #b8e8cd; }
.badge-warn  { background: #fdf6e0; color: #8a6418; border: 1px solid #ecd9a0; }
.badge-err   { background: #fff0f0; color: #c0392b; border: 1px solid #f8c0c0; }
.badge-admin { background: #eef6ff; color: #1a5fa8; border: 1px solid #b8d8f8; }

/* ---------- Admin ---------- */
.admin-card { overflow: hidden; }
.admin-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.sync-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-inline { width: auto; padding: 0.65rem 1.25rem; }
.hint { font-size: 0.8rem; color: var(--muted-foreground); margin: 0; line-height: 1.6; }

.user-block { border: 1.5px solid var(--border); border-radius: var(--r-xl); padding: 1rem; }
.user-block + .user-block { margin-top: 0; }
.user-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.user-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-family: var(--font-head); font-size: 0.92rem; }
.user-email { color: var(--muted-foreground); font-weight: 600; font-size: 0.8rem; }
.user-actions { display: flex; gap: 0.5rem; }

.btn-mini {
  padding: 0.35rem 0.8rem; border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; font-size: 0.75rem;
  background: var(--muted); color: var(--foreground); transition: background 0.12s;
}
.btn-mini:hover { background: #dde5f2; }
.btn-mini-danger { background: #fff0f0; color: #c0392b; }
.btn-mini-danger:hover { background: #ffe2e2; }
.btn-mini-primary { background: var(--primary); color: #fff; margin-top: 0.6rem; }
.btn-mini-primary:hover { background: #2f6fe0; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.35rem 1rem; }
.project-check {
  display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 0.85rem;
  padding: 0.25rem 0;
}
.project-check input { width: 1rem; height: 1rem; accent-color: var(--primary); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 1rem; }
.field-label { display: block; font-family: var(--font-head); font-weight: 700; font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 0.375rem; }
.input {
  width: 100%; padding: 0.75rem 1rem; border-radius: var(--r-xl);
  border: 1px solid var(--border); background: var(--input-background); outline: none;
  font-family: var(--font-body); color: var(--foreground);
}
.input:focus { box-shadow: 0 0 0 2px var(--ring); }
.input.pin { text-align: center; letter-spacing: 0.5em; font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; }

.btn-primary { width: 100%; padding: 0.875rem; border-radius: var(--r-xl); color: #fff; font-family: var(--font-head); font-weight: 800; background: var(--primary); transition: filter 0.12s; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger { width: 100%; padding: 0.75rem; border-radius: var(--r-xl); color: var(--destructive); font-family: var(--font-head); font-weight: 700; background: #fef2f0; margin-top: 0.5rem; }
.btn-secondary {
  display: block; width: 100%; padding: 0.75rem; border-radius: var(--r-xl);
  background: var(--muted); color: var(--foreground);
  font-family: var(--font-head); font-weight: 700; font-size: 0.95rem;
  text-align: center; text-decoration: none; transition: background 0.12s;
  border: none;
}
.btn-secondary:hover { background: #dde5f2; }
.btn-secondary.btn-inline { width: auto; padding: 0.65rem 1.25rem; }

/* =============================================================================
   Autentifikacija (prisijungimas / registracija / patvirtinimas / paskyra)
   — perpanaudota iš teciobankas / perkubulve-auth-kit.
   ============================================================================= */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.25rem; padding: 1.5rem 1rem;
}
.auth-logo { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; }
.auth-card { width: 100%; max-width: 26rem; padding: 1.75rem; }
.auth-title { font-family: var(--font-head); font-weight: 900; font-size: 1.35rem; margin: 0 0 0.25rem; color: var(--foreground); }
.auth-sub { font-family: var(--font-head); font-weight: 600; font-size: 0.85rem; color: var(--muted-foreground); margin: 0 0 1.25rem; line-height: 1.5; }
.auth-links { margin-top: 1.25rem; text-align: center; font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; }
.auth-links a { color: var(--primary); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-divider { margin: 0 0.5rem; color: var(--muted-foreground); }
.auth-check { display: flex; align-items: center; gap: 0.5rem; margin: -0.25rem 0 1rem; font-family: var(--font-head); font-weight: 600; font-size: 0.85rem; color: var(--muted-foreground); cursor: pointer; }
.auth-check input { width: 1rem; height: 1rem; accent-color: var(--primary); }
.auth-back { margin-bottom: 0.75rem; font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; }
.auth-back a { color: var(--muted-foreground); text-decoration: none; }
.auth-back a:hover { color: var(--foreground); }

/* ---------- Pranešimai ---------- */
.alert { border-radius: var(--r-xl); padding: 0.75rem 1rem; margin-bottom: 0; font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; line-height: 1.5; }
.auth-card .alert { margin-bottom: 1rem; }
.alert-success { background: #f0faf5; border: 1.5px solid #b8e8cd; color: #1e7a4a; }
.alert-error   { background: #fff0f0; border: 1.5px solid #f8c0c0; color: #c0392b; }
.alert-info    { background: #eef6ff; border: 1.5px solid #b8d8f8; color: #1a5fa8; }

/* ---------- Slaptažodžio taisyklės ---------- */
.password-rules { list-style: none; margin: 0.5rem 0 0; padding: 0; font-family: var(--font-head); font-weight: 600; font-size: 0.78rem; color: var(--muted-foreground); }
.password-rules li { padding-left: 1.25rem; position: relative; margin-top: 2px; }
.password-rules li::before { content: '○'; position: absolute; left: 0.25rem; }
.password-rules li.rule-ok   { color: #1e7a4a; }
.password-rules li.rule-ok::before { content: '✓'; }
.password-rules li.rule-fail { color: #c0392b; }
.password-rules li.rule-fail::before { content: '✕'; }
.match-msg { display: block; margin-top: 0.375rem; font-family: var(--font-head); font-weight: 700; font-size: 0.78rem; min-height: 1rem; }
.match-ok   { color: #1e7a4a; }
.match-fail { color: #c0392b; }

/* ---------- Paskyros puslapis ---------- */
.account-block { border: 1.5px solid var(--border); border-radius: var(--r-2xl); padding: 0.25rem 1rem; margin-bottom: 1.5rem; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.625rem 0; font-family: var(--font-head); font-weight: 700; font-size: 0.9rem; }
.account-row + .account-row { border-top: 1px solid var(--border); }
.account-label { color: var(--muted-foreground); font-weight: 600; }
.account-section-title { font-family: var(--font-head); font-weight: 800; font-size: 1rem; margin: 1.5rem 0 0.5rem; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .filters { flex-direction: column; align-items: stretch; }
  .filter { min-width: 0; }
  .filter-sync { margin-left: 0; }
  .stat .stat-value { font-size: 1.15rem; }
}
