/* base.css: Global app styling (layout, cards, buttons, forms, footer) */

:root {
  --ln-bg: #f6f7fb;
  --ln-surface: #ffffff;
  --ln-text: #0f172a;
  --ln-muted: rgba(15, 23, 42, 0.68);
  --ln-border: rgba(15, 23, 42, 0.10);
  --ln-primary: #2563eb;
  --ln-primary-2: #1d4ed8;
  --ln-danger: #b91c1c;
  --ln-success: #15803d;
  --ln-warning: #b45309;
  --ln-radius: 14px;
  --ln-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  --ln-shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.08);
}

html, body {
  min-height: 100%;
}

html {
  background: var(--ln-bg);
}

body {
  font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ln-text);
  background: var(--ln-bg);
  position: relative;
}

/* App layout: make footer stick to bottom on short pages */
body.ln-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.ln-main {
  flex: 1;
  display: block;
}

/* Fixed background layer so long pages don't show hard gradient seams */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(37, 99, 235, 0.10), transparent 55%),
    radial-gradient(900px 600px at 85% 15%, rgba(29, 78, 216, 0.08), transparent 55%),
    radial-gradient(900px 650px at 50% 100%, rgba(99, 102, 241, 0.06), transparent 60%),
    var(--ln-bg);
}

/* Layout wrapper used by most pages */
.base-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2.25rem 1rem 2.5rem;
}

.base-card {
  background: var(--ln-surface);
  border: 1px solid var(--ln-border);
  border-radius: var(--ln-radius);
  box-shadow: var(--ln-shadow);
  padding: 2rem;
  margin: 0;
}

/* Reusable width variants to avoid inline styles in templates */
.base-card.base-card--md {
  max-width: 820px;
  width: 100%;
}

.base-card.base-card--lg {
  max-width: 1200px;
  width: 100%;
}

@media (max-width: 576px) {
  .base-card {
    padding: 1.25rem;
  }
}

.base-logo {
  max-width: 40%;
  margin-bottom: 1rem;
}

.base-header {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ln-text);
  margin-bottom: 1rem;
}

.base-button {
  background-color: var(--ln-primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.85rem;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  line-height: 1.1;
  transition: background-color 0.18s ease, transform 0.05s ease;
}

.base-button:hover {
  background-color: var(--ln-primary-2);
}

.base-button:active {
  transform: translateY(1px);
}

/* Secondary variant (used as class on <a> with base-button) */
.base-button.secondary {
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.base-button.secondary:hover {
  background: rgba(15, 23, 42, 0.10);
}

/* Small action button for tables/cards */
.ln-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.42rem 0.65rem;
  min-height: 38px;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  line-height: 1.1;
  transition: background-color 0.18s ease, transform 0.05s ease;
}

.ln-btn:active {
  transform: translateY(1px);
}

.ln-btn.ln-btn--soft {
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.86);
}

.ln-btn.ln-btn--soft:hover {
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.90);
}

.ln-btn.ln-btn--primary {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.22);
  color: rgba(29, 78, 216, 1);
}

.ln-btn.ln-btn--primary:hover {
  background: rgba(37, 99, 235, 0.16);
  color: rgba(29, 78, 216, 1);
}

/* Status badges */
.ln-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.82);
}

.ln-badge--success {
  background: rgba(21, 128, 61, 0.12);
  border-color: rgba(21, 128, 61, 0.22);
  color: var(--ln-success);
}

.ln-badge--warning {
  background: rgba(180, 83, 9, 0.12);
  border-color: rgba(180, 83, 9, 0.22);
  color: var(--ln-warning);
}

.base-form-group {
  margin-bottom: 1.25rem;
}

.base-form-group label {
  font-weight: 600;
  color: var(--ln-text);
  margin-bottom: 0.4rem;
  display: block;
}

.base-form-group input,
.base-form-group select,
.base-form-group textarea {
  width: 100%;
  padding: 0.62rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--ln-border);
  background: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.base-form-group input:focus,
.base-form-group select:focus,
.base-form-group textarea:focus {
  background: #fff;
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.base-alert-danger {
  background: rgba(185, 28, 28, 0.10);
  color: var(--ln-danger);
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(185, 28, 28, 0.22);
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Bootstrap alerts polish */
.alert {
  border-radius: 0.95rem;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.alert-info {
  background: rgba(37, 99, 235, 0.08);
  color: rgba(15, 23, 42, 0.86);
  border-color: rgba(37, 99, 235, 0.16);
}

/* Tables (used in overview/detail pages)
   IMPORTANT: Don't override Bootstrap's .table-dark variables, otherwise text becomes unreadable
*/
.table:not(.table-dark) {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(15, 23, 42, 0.03);
  --bs-table-hover-bg: rgba(37, 99, 235, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
}

.table:not(.table-dark) thead th {
  color: rgba(15, 23, 42, 0.78);
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(15, 23, 42, 0.02);
}

.table td, .table th {
  vertical-align: middle;
}

/* Footer */
footer.footer {
  min-height: 72px;
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--ln-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ln-muted);
  display: flex;
  align-items: center;
}

footer.footer a {
  color: var(--ln-text);
  text-decoration: none;
}

footer.footer a:hover {
  text-decoration: underline;
}
