/* Local base styles that work without external CDNs. */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --border: #dee2e6;
  --primary: #0d6efd;
  --primary-strong: #0b5ed7;
  --secondary: #6c757d;
  --danger: #dc3545;
  --warning: #ffc107;
  --success: #198754;
  --dark: #212529;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 0.75rem;
}

.container-fluid {
  width: 100%;
  padding: 0 0.75rem;
}

.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-lg-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.me-auto { margin-right: auto; }
.me-2 { margin-right: 0.5rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.d-flex { display: flex; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }
.flex-nowrap { flex-wrap: nowrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.text-end { text-align: right; }
.text-muted { color: var(--muted); }
.text-light { color: #f8f9fa; }
.text-secondary { color: #adb5bd; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.small { font-size: 0.875rem; }
.h4 { font-size: 1.5rem; }
.h5 { font-size: 1.25rem; }
.h6 { font-size: 1rem; }
.w-100 { width: 100%; }

.bg-light { background: var(--bg); }
.bg-dark { background: var(--dark); }

.navbar {
  position: relative;
  padding: 0.5rem 0;
}

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar-brand {
  color: #fff;
  font-weight: 700;
  margin-right: 1rem;
}

.navbar-brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

.is-tauri-app .navbar-brand-logo {
  height: 20px;
}

.is-tauri-app .nav-link {
  font-size: 0.92rem;
  padding: 0.3rem 0.5rem;
}

.is-tauri-app .btn.btn-sm {
  font-size: 0.82rem;
}

.is-tauri-app .hide-in-tauri {
  display: none !important;
}

.navbar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.35rem 0.6rem;
  border-radius: 0.35rem;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.card.border-0 { border: 0; }
.shadow-sm { box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-responsive {
  overflow-x: auto;
}

.form-control,
.form-select,
textarea {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background: #fff;
  color: var(--text);
}

.form-check-input {
  width: 1rem;
  height: 1rem;
}

.btn {
  display: inline-block;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background: #e9ecef;
}

.btn:hover { text-decoration: none; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-outline-primary { color: var(--primary); background: transparent; border-color: var(--primary); }
.btn-outline-secondary { color: var(--secondary); background: transparent; border-color: var(--secondary); }
.btn-outline-danger { color: var(--danger); background: transparent; border-color: var(--danger); }
.btn-outline-light { color: #f8f9fa; background: transparent; border-color: #f8f9fa; }
.btn-light { color: #212529; background: #f8f9fa; border-color: #f8f9fa; }

.btn[class*="btn-outline-"] {
  background: #ffffff !important;
}

.navbar .btn[class*="btn-outline-"] {
  background: transparent !important;
}

.alert {
  position: relative;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.alert-success { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.alert-info { background: #cff4fc; color: #055160; border-color: #b6effb; }
.alert-warning { background: #fff3cd; color: #664d03; border-color: #ffecb5; }
.alert-danger { background: #f8d7da; color: #842029; border-color: #f5c2c7; }

.login-brand-block {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.login-brand-logo {
  width: min(520px, 100%);
  max-width: 100%;
  display: block;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(15, 23, 42, 0.18));
}

@media (max-width: 991.98px) {
  .navbar-nav {
    flex-wrap: wrap;
  }

  .login-brand-logo {
    width: min(420px, 100%);
  }
}
