/* ── Vesim brand tokens ─────────────────────────────────────────── */
:root {
  --teal:        #206688;
  --teal-dark:   #184e69;
  --teal-light:  #e8f3f8;
  --amber:       #fab751;
  --amber-dark:  #e09e36;
  --red:         #fa1751;
  --text:        #1a2533;
  --text-muted:  #6b7a8d;
  --border:      #d0dbe6;
  --bg:          #f4f7fa;
  --white:       #ffffff;
  --radius:      6px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
}

/* ── Reset & base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────── */
.container {
  max-width: 1400px;
  width: 95%;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  background: var(--teal);
  color: var(--white);
  height: 52px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: .02em;
}

.topbar-brand .brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  display: inline-block;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.topbar-nav a {
  color: rgba(255,255,255,.85);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: background .15s, color .15s;
}

.topbar-nav a:hover,
.topbar-nav a.active {
  background: rgba(255,255,255,.15);
  color: var(--white);
  text-decoration: none;
}

.topbar-nav a.active {
  background: rgba(255,255,255,.2);
  font-weight: 600;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .875rem;
  color: rgba(255,255,255,.8);
}

.topbar-user a {
  color: rgba(255,255,255,.7);
  font-size: .825rem;
  border: 1px solid rgba(255,255,255,.3);
  padding: 3px 10px;
  border-radius: var(--radius);
  transition: background .15s;
}

.topbar-user a:hover {
  background: rgba(255,255,255,.15);
  color: var(--white);
  text-decoration: none;
}

/* accent stripe under topbar */
.topbar-stripe {
  height: 3px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-dark) 100%);
}

/* ── Page content wrapper ───────────────────────────────────────── */
.page {
  padding: 28px 0 48px;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: .9rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: 100%;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

table.data th {
  background: var(--teal);
  color: var(--white);
  padding: 9px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

table.data th:first-child { border-radius: 0; }

table.data td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tr:last-child td { border-bottom: none; }

table.data tr:hover td { background: var(--teal-light); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--teal-dark);
  color: var(--white);
  text-decoration: none;
}

.btn-amber {
  background: var(--amber);
  color: var(--text);
}
.btn-amber:hover {
  background: var(--amber-dark);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
}
.btn-outline:hover {
  background: var(--teal-light);
  text-decoration: none;
}

.btn-sm { padding: 4px 10px; font-size: .8rem; }
.btn-lg { padding: 11px 24px; font-size: 1rem; }

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

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(32,102,136,.12);
}

.form-control.is-invalid { border-color: var(--red); }

.form-error {
  font-size: .8rem;
  color: var(--red);
  margin-top: 4px;
}

/* ── Badges / status ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-green  { background: #d4edda; color: #1a6b30; }
.badge-red    { background: #fde8ec; color: #9b1c2e; }
.badge-amber  { background: #fff3cd; color: #7d5a0a; }
.badge-blue   { background: #dbeafe; color: #1e429f; }
.badge-gray   { background: #e9ecef; color: #495057; }

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 16px;
  border-left: 4px solid transparent;
}
.alert-error   { background: #fde8ec; border-color: var(--red);   color: #7a1020; }
.alert-success { background: #d4edda; border-color: #28a745;      color: #155724; }
.alert-info    { background: #dbeafe; border-color: var(--teal);  color: #1e3a5f; }
.alert-warning { background: #fff3cd; border-color: var(--amber); color: #7d5a0a; }

/* ── Login page ─────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 60%, #2980a8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.login-header {
  background: var(--teal);
  padding: 32px 36px 28px;
  text-align: center;
  position: relative;
}

.login-header::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--amber), var(--amber-dark));
}

.login-logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: .06em;
}

.login-logo span {
  color: var(--amber);
}

.login-tagline {
  color: rgba(255,255,255,.7);
  font-size: .825rem;
  margin-top: 4px;
}

.login-body { padding: 32px 36px 28px; }

.login-body .form-control {
  padding: 10px 14px;
  font-size: .95rem;
}

.login-submit {
  width: 100%;
  padding: 11px;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 6px;
}

.login-footer {
  padding: 14px 36px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Utilities ──────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.mt-1 { margin-top:  6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom:  6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
