/* ═══════════════════════════════════════════════════════════════
   inpublico.lt — Shared UI Components
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Design tokens (align with admin.css) */
  --brand-dark:   #111111;
  --brand-accent: #c4f040;
  --text-primary: #111111;
  --text-muted:   #888888;
  --bg-light:     #eaeae5;
  --border:       #d6d6d1;
  --success:      #16a34a;
  --warning:      #d97706;
  --danger:       #dc2626;
  --radius:       10px;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
}

/* ─── Auth pages (login / register) ────────────────────────── */
.auth-page {
  min-height: calc(100vh - 48px);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-light);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.10);
  border: 1px solid var(--border);
  padding: 40px;
  width: 100%; max-width: 420px;
}

.auth-card__logo {
  text-align: center; margin-bottom: 24px;
}
.auth-card__logo a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  background: var(--brand-dark);
  border-radius: 12px;
  color: #fff; font-size: 13px; font-weight: 900;
  letter-spacing: -.06em; text-decoration: none;
}

.auth-card__title {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em;
  margin: 0 0 4px; text-align: center; color: var(--brand-dark);
}

.auth-card__subtitle {
  text-align: center; color: var(--text-muted);
  margin-bottom: 24px; font-size: .875rem;
}

.auth-card__footer {
  text-align: center; margin-top: 20px;
  font-size: .875rem; color: var(--text-muted);
}
.auth-card__footer a { color: var(--brand-dark); font-weight: 600; }

.auth-card--center { text-align: center; }
.auth-card__icon { font-size: 2.5rem; margin: 16px 0; }
.auth-card__icon--success { color: var(--success); }

/* ─── Dashboard cards ───────────────────────────────────────── */
.dashboard__welcome {
  display: flex; align-items: flex-start;
  flex-direction: column; gap: 4px;
  margin-bottom: 28px;
}
.dashboard__welcome h1 { margin: 0; }
.dashboard__welcome p  { color: var(--text-muted); font-size: .9rem; margin: 0; }

.dashboard__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 14px;
}

.dash-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 16px;
  text-decoration: none; color: var(--text-primary);
  transition: box-shadow .15s, transform .12s;
  position: relative;
}
.dash-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dash-card--primary { border-color: var(--brand-dark); background: #f8f8f5; }
.dash-card--alert   { border-color: var(--warning); background: #fffbf0; }
.dash-card__icon    { font-size: 1.8rem; color: var(--brand-dark); }
.dash-card__label   { font-size: .8rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.dash-card__value   { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.dash-card__badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--danger); color: #fff;
  border-radius: 8px; min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; padding: 0 4px;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card__body    { padding: 24px; }
.card__section { padding: 24px; }
.card__section + .card__section { border-top: 1px solid var(--border); }
.card--split { display: grid; grid-template-columns: 1fr 1fr; gap:1rem;}
.card--decision { border-color: var(--border); }

/* ─── Page header ───────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.page-header h1 { margin: 0; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-header__meta { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block; font-weight: 600; margin: 0;
  font-size: .85rem; color: var(--text-primary);
}

.optional { font-size: .75rem; color: var(--text-muted); font-weight: 400; }

.form-control {
  display: block; width: 100%;
  padding: 9px 13px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: .875rem; font-family: inherit;
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box; line-height: 1.5;
}
.form-control:focus {
  outline: none; border-color: #555;
  box-shadow: 0 0 0 3px rgba(0,0,0,.07);
}
.form-control:disabled { background: #f4f4f0; color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control   { cursor: pointer; height: 45px; }

.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; display: block; }
.form-row--split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group--checkbox label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .9rem; pointer-events: none;
}
.input-prefix-wrap .form-control { padding-left: 26px; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 9px; border: none; cursor: pointer;
  font-size: .875rem; font-weight: 600; font-family: inherit;
  text-decoration: none;
  transition: background .12s, opacity .12s;
  white-space: nowrap; line-height: 1;
  user-select: none;
}

.btn--primary   { background: var(--brand-dark); color: #fff; }
.btn--primary:hover { background: #2a2a2a; color: #fff; }

.btn--accent    { background: var(--brand-accent); color: var(--brand-dark); }
.btn--accent:hover { background: #b8e030; }

.btn--secondary { background: rgba(0,0,0,.07); color: var(--text-primary); }
.btn--secondary:hover { background: rgba(0,0,0,.11); }

.btn--success   { background: #dcfce7; color: #15803d; }
.btn--success:hover { background: #bbf7d0; }

.btn--danger    { background: #fee2e2; color: #dc2626; }
.btn--danger:hover { background: #fecaca; }

.btn--warning   { background: #fef9c3; color: #92400e; }
.btn--warning:hover { background: #fef08a; }

.btn--sm  { padding: 5px 12px; font-size: .78rem; border-radius: 7px; }
.btn--lg  { padding: 12px 26px; font-size: 1rem; }
.btn--full { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ─── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 10px; margin-bottom: 16px;
  font-size: .875rem; border: 1px solid transparent;
}
.alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert--error   { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert--info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ─── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}

.badge--role  { background: #f1f5f9; color: #475569; }
.badge--ai    { background: var(--brand-accent); color: var(--brand-dark); }

/* ─── Status badges ─────────────────────────────────────────── */
.status-badge, .badge--draft, .badge--pending,
.badge--submitted, .badge--under_review,
.badge--approved, .badge--active, .badge--completed,
.badge--published, .badge--rejected, .badge--failed,
.badge--suspended, .badge--killed, .badge--archived {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}

.status-badge--draft,     .badge--draft     { background: #f1f5f9; color: #64748b; }
.status-badge--pending,   .badge--pending   { background: #fef9c3; color: #854d0e; }
.status-badge--submitted, .badge--submitted { background: #eff6ff; color: #1d4ed8; }
.status-badge--under_review, .badge--under_review { background: #fff7ed; color: #c2410c; }
.status-badge--approved,  .badge--approved  { background: #dcfce7; color: #15803d; }
.status-badge--active,    .badge--active    { background: #dcfce7; color: #15803d; }
.status-badge--completed, .badge--completed { background: #dcfce7; color: #15803d; }
.status-badge--published, .badge--published { background: #111111; color: #fff; }
.status-badge--rejected,  .badge--rejected  { background: #fee2e2; color: #dc2626; }
.status-badge--failed,    .badge--failed    { background: #fee2e2; color: #dc2626; }
.status-badge--suspended, .badge--suspended { background: #fee2e2; color: #dc2626; }
.status-badge--killed,    .badge--killed    { background: #111; color: var(--brand-accent); }
.status-badge--archived,  .badge--archived  { background: #f1f5f9; color: #94a3b8; }

/* ─── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-top: 20px;
}
.pagination__btn {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 8px;
  font-size: .82rem; font-weight: 600;
  background: rgba(0,0,0,.06); color: var(--text-primary);
  text-decoration: none; transition: background .12s;
}
.pagination__btn:hover { background: rgba(0,0,0,.10); }
.pagination__btn--active { background: var(--brand-dark); color: #fff; }

/* ─── Tables (data- and admin-) ─────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}
.data-table th {
  text-align: left; padding: 10px 16px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); border-bottom: 1.5px solid var(--border);
  background: transparent;
}
.data-table td {
  padding: 12px 16px; border-bottom: 1px solid #e8e8e4;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(0,0,0,.018); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Card Table (server-management-table style) ────────────── */
.ct-scroll { overflow-x: auto; }

.card-table { width: 100%; min-width: 580px; }

.card-table__header {
  display: grid;
  grid-template-columns: var(--ct-cols, 1fr);
  gap: 12px;
  padding: 6px 16px 10px;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
}

.card-table__row {
  position: relative;
  display: grid;
  grid-template-columns: var(--ct-cols, 1fr);
  gap: 12px;
  background: rgba(0,0,0,.025);
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 6px;
  overflow: hidden;
  align-items: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card-table__row:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 2px rgba(0,0,0,.09);
}

/* Status gradient overlay (right → transparent) */
.card-table__row::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--ct-gradient, transparent);
  pointer-events: none;
}
.card-table__row--active,
.card-table__row--approved,
.card-table__row--completed    { --ct-gradient: linear-gradient(to left, rgba(22,163,74,.08)  0%, transparent 40%); }
.card-table__row--published    { --ct-gradient: linear-gradient(to left, rgba(17,17,17,.07)   0%, transparent 40%); }
.card-table__row--pending      { --ct-gradient: linear-gradient(to left, rgba(217,119,6,.09)  0%, transparent 40%); }
.card-table__row--submitted,
.card-table__row--under_review { --ct-gradient: linear-gradient(to left, rgba(29,78,216,.07)  0%, transparent 40%); }
.card-table__row--rejected,
.card-table__row--failed,
.card-table__row--suspended    { --ct-gradient: linear-gradient(to left, rgba(220,38,38,.08)  0%, transparent 40%); }
.card-table__row--draft,
.card-table__row--inactive,
.card-table__row--archived     { --ct-gradient: linear-gradient(to left, rgba(100,116,139,.05) 0%, transparent 40%); }

/* Row number (large muted) */
.ct-num {
  font-size: 1.2rem; font-weight: 800;
  color: rgba(0,0,0,.13); line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Status pill — bordered variant matching card-table aesthetic */
.status-pill {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 8px;
  font-size: .73rem; font-weight: 600;
  white-space: nowrap; border: 1px solid; line-height: 1.3;
}
.status-pill--active,
.status-pill--approved,
.status-pill--completed    { background: rgba(22,163,74,.10);   border-color: rgba(22,163,74,.30);   color: #15803d; }
.status-pill--published    { background: rgba(17,17,17,.07);    border-color: rgba(17,17,17,.22);    color: #111; }
.status-pill--pending      { background: rgba(217,119,6,.10);   border-color: rgba(217,119,6,.30);   color: #92400e; }
.status-pill--submitted    { background: rgba(29,78,216,.09);   border-color: rgba(29,78,216,.25);   color: #1d4ed8; }
.status-pill--under_review { background: rgba(194,65,12,.09);   border-color: rgba(194,65,12,.25);   color: #c2410c; }
.status-pill--rejected,
.status-pill--failed,
.status-pill--suspended    { background: rgba(220,38,38,.10);   border-color: rgba(220,38,38,.30);   color: #dc2626; }
.status-pill--draft        { background: rgba(100,116,139,.09); border-color: rgba(100,116,139,.25); color: #475569; }
.status-pill--inactive     { background: rgba(100,116,139,.09); border-color: rgba(100,116,139,.25); color: #475569; }
.status-pill--archived     { background: rgba(148,163,184,.10); border-color: rgba(148,163,184,.30); color: #94a3b8; }

/* Staggered entrance animation */
@keyframes ct-row-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.card-table__body .card-table__row { animation: ct-row-in .35s ease both; }
.card-table__body .card-table__row:nth-child(1)  { animation-delay: .04s; }
.card-table__body .card-table__row:nth-child(2)  { animation-delay: .08s; }
.card-table__body .card-table__row:nth-child(3)  { animation-delay: .12s; }
.card-table__body .card-table__row:nth-child(4)  { animation-delay: .16s; }
.card-table__body .card-table__row:nth-child(5)  { animation-delay: .20s; }
.card-table__body .card-table__row:nth-child(6)  { animation-delay: .24s; }
.card-table__body .card-table__row:nth-child(7)  { animation-delay: .28s; }
.card-table__body .card-table__row:nth-child(8)  { animation-delay: .32s; }
.card-table__body .card-table__row:nth-child(9)  { animation-delay: .36s; }
.card-table__body .card-table__row:nth-child(10) { animation-delay: .40s; }

/* ─── Approval dots (review queue) ─────────────────────────── */
.approval-dots { display: flex; align-items: center; gap: 5px; }
.approval-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #e2e8f0; border: 2px solid #cbd5e1;
}
.approval-dot--filled { background: var(--success); border-color: var(--success); }
.approval-dots small  { font-size: .72rem; color: var(--text-muted); }

/* ─── Detail grid (record show pages) ──────────────────────── */
.detail-grid { width: 100%; }

.detail-row {
  display: flex; align-items: baseline;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.detail-row:last-child { border-bottom: none; }

.detail-block {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-block:last-child { border-bottom: none; }

.detail-label {
  font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  flex: 0 0 35%; white-space: nowrap;
}
.detail-value { text-align: right; flex: 1; font-size: .9rem; }
.detail-content { margin-top: 8px; line-height: 1.6; font-size: .9rem; }

/* ─── Empty state ───────────────────────────────────────────── */
.empty-state {
  padding: 48px; text-align: center;
  color: var(--text-muted); font-size: .9rem;
}

/* ─── Misc ──────────────────────────────────────────────────── */
.bell-btn        { display: none; } /* replaced by topbar bell */
.top-rhs-selector { display: none; } /* replaced by topbar user btn */

/* Quill editor overrides */
.ql-editor { font-size: 15px; line-height: 1.7; min-height: 280px; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .auth-card   { padding: 28px 20px; }
  .form-row--split { grid-template-columns: 1fr; gap: 0; }
  .form-group { margin-block-end: 0; }
  .card--split { grid-template-columns: 1fr; }
  .card__section + .card__section { border-left: none; border-top: 1px solid var(--border); }
  .dashboard__cards { grid-template-columns: repeat(2, 1fr); }
}
