/* ─── Base ─────────────────────────────────────────────── */
body.admin-body {
  font-family: "Sarabun", sans-serif;
  background-color: #f3f4f6;
  color: #1f2937;
}

/* ─── Navbar ───────────────────────────────────────────── */
.admin-navbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.admin-navbar .navbar-logo {
  object-fit: contain;
}

.admin-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151 !important;
  padding: 0.4rem 0.6rem !important;
  border-radius: 0.375rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.admin-nav-link:hover {
  background-color: #f3f4f6;
  color: #4f46e5 !important;
}

.admin-nav-link.active {
  color: #4f46e5 !important;
  font-weight: 600;
}

.admin-user-menu {
  font-size: 0.875rem;
  color: #374151 !important;
}

.admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e0e7ff;
  color: #4f46e5;
  font-size: 0.8rem;
}

/* ─── Main content ─────────────────────────────────────── */
.admin-main {
  min-height: calc(100vh - 57px);
}

/* ─── Cards ────────────────────────────────────────────── */
.card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ─── Stat cards ───────────────────────────────────────── */
.stat-card .card-body {
  padding: 1.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.bg-primary-soft { background-color: #ede9fe; }
.bg-success-soft { background-color: #d1fae5; }
.bg-warning-soft { background-color: #fef3c7; }
.bg-danger-soft  { background-color: #fee2e2; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}

.stat-label {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 2px;
}

/* ─── Tables ───────────────────────────────────────────── */
.table {
  font-size: 0.875rem;
}

.table thead th {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #e5e7eb;
  background: #f9fafb;
}

.table tbody tr:hover {
  background-color: #f9fafb;
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn-primary {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

.btn-primary:hover {
  background-color: #4338ca;
  border-color: #4338ca;
}

.btn-outline-primary {
  color: #4f46e5;
  border-color: #4f46e5;
}

.btn-outline-primary:hover {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

/* ─── Badges ───────────────────────────────────────────── */
.badge.bg-success { background-color: #10b981 !important; }
.badge.bg-warning { background-color: #f59e0b !important; color: #fff !important; }
.badge.bg-danger  { background-color: #ef4444 !important; }

/* ─── Flash messages ───────────────────────────────────── */
.alert {
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

/* ─── Slide-over panel ─────────────────────────────────── */
.slide-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1040;
}

.slide-overlay.open { display: block; }

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 95vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.slide-panel.open { transform: translateX(0); }

.slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.slide-dl dt {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.slide-dl dd {
  font-size: 0.875rem;
  color: #111827;
  margin-bottom: 0;
}

/* ─── Login page ───────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ─── Category filter chips ────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  border-radius: 999px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chip:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

.chip.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

/* ─── Info stat icon ───────────────────────────────────── */
.bg-info-soft {
  background-color: rgba(6, 182, 212, 0.1);
}

/* ─── Message card (contact us inbox) ──────────────────── */
.msg-card {
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.msg-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-color: #4f46e5;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── Admin avatar in navbar ───────────────────────────── */
.admin-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* ─── Responsive adjustments ──────────────────────────── */
@media (max-width: 576px) {
  .slide-panel {
    width: 100%;
    max-width: 100vw;
  }

  .chip {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
  }
}

@media (max-width: 768px) {
  #dashboard-map {
    height: 350px !important;
  }
}

/* ─── Form validation errors ──────────────────────────── */
.field-error .form-control,
.field-error .form-select {
  border-color: #dc3545;
}

.field-error-message {
  color: #dc3545;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

/* ─── Lightbox fullscreen viewer ──────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1060;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  transition: transform 0.2s ease;
  cursor: grab;
}

.lightbox-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 1061;
}

/* ─── Loading states ──────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
  color: #6b7280;
  font-size: 0.875rem;
  border-radius: inherit;
}

.btn-loading {
  pointer-events: none;
  opacity: 0.75;
}

.geocode-status {
  font-size: 0.8125rem;
  transition: opacity 0.3s ease;
}

.geocode-status.fade-out {
  opacity: 0;
}

/* ─── Settings sidebar ────────────────────────────────── */
.settings-sidebar {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.settings-nav {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.settings-nav:hover {
  background: #f0f4f8;
  color: #4f46e5;
}

.settings-nav.active {
  background: #eff6ff;
  color: #4f46e5;
  border-left-color: #4f46e5;
  font-weight: 600;
}

@media (max-width: 768px) {
  .settings-sidebar {
    display: flex;
    overflow-x: auto;
    margin-bottom: 1rem;
  }
  .settings-nav {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 10px 14px;
  }
  .settings-nav.active {
    border-bottom-color: #4f46e5;
    border-left: none;
  }
}

/* ─── Slide-over carousel ─────────────────────────────── */
.slide-carousel {
  overflow: hidden;
  background: #f8fafc;
}

.slide-carousel .carousel-item {
  height: 220px;
}

.slide-carousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  background: #f8fafc;
}

.slide-carousel .carousel-indicators {
  margin-bottom: 0.5rem;
}

.slide-carousel .carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
}

.slide-carousel .carousel-indicators button.active {
  background-color: #4f46e5;
}
/* RID Design System — colors, fonts, spacing, motion tokens.
   Source: RIDDesignSystemWeb/colors_and_type.css. Font URLs rewritten
   to /fonts/rid/ (served from public/, not fingerprinted). */

@font-face { font-family: 'Noto Sans Thai'; font-weight: 100; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-Thin.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 200; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-ExtraLight.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 300; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-Light.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-Regular.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-Medium.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-SemiBold.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-Bold.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 800; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-ExtraBold.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai'; font-weight: 900; font-style: normal; font-display: swap; src: url(/fonts/rid/NotoSansThai-Black.ttf) format('truetype'); }

@font-face { font-family: 'Noto Sans Thai SemiCondensed'; font-weight: 400; font-display: swap; src: url(/fonts/rid/NotoSansThai_SemiCondensed-Regular.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai SemiCondensed'; font-weight: 500; font-display: swap; src: url(/fonts/rid/NotoSansThai_SemiCondensed-Medium.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai SemiCondensed'; font-weight: 600; font-display: swap; src: url(/fonts/rid/NotoSansThai_SemiCondensed-SemiBold.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai SemiCondensed'; font-weight: 700; font-display: swap; src: url(/fonts/rid/NotoSansThai_SemiCondensed-Bold.ttf) format('truetype'); }

@font-face { font-family: 'Noto Sans Thai Condensed'; font-weight: 400; font-display: swap; src: url(/fonts/rid/NotoSansThai_Condensed-Regular.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai Condensed'; font-weight: 500; font-display: swap; src: url(/fonts/rid/NotoSansThai_Condensed-Medium.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/rid/NotoSansThai_Condensed-SemiBold.ttf) format('truetype'); }
@font-face { font-family: 'Noto Sans Thai Condensed'; font-weight: 700; font-display: swap; src: url(/fonts/rid/NotoSansThai_Condensed-Bold.ttf) format('truetype'); }

:root {
  --rid-blue-50:   #e8f1fb;
  --rid-blue-100:  #c7daf3;
  --rid-blue-200:  #94b9e8;
  --rid-blue-300:  #5e94d9;
  --rid-blue-400:  #2f73c8;
  --rid-blue-500:  #1761b5;
  --rid-blue-600:  #114f99;
  --rid-blue-700:  #0d3e7a;
  --rid-blue-800:  #0a3263;
  --rid-blue-900:  #061f3f;

  --rid-gold-50:   #fff8e1;
  --rid-gold-100:  #ffeaa6;
  --rid-gold-300:  #f7c948;
  --rid-gold-500:  #e0a423;
  --rid-gold-700:  #a06f0e;

  --rid-green-50:  #e8f4ec;
  --rid-green-300: #5cb37a;
  --rid-green-500: #1f8a4c;
  --rid-green-700: #0f5e30;

  --rid-water-50:  #e6f6fb;
  --rid-water-300: #4cb8d4;
  --rid-water-500: #1791b3;
  --rid-water-700: #0e6b86;

  --rid-white:     #ffffff;
  --rid-paper:     #f7f8fb;
  --rid-cloud:     #eef1f6;
  --rid-line:      #d8dde6;
  --rid-mute:      #8893a4;
  --rid-ink-2:     #4a5566;
  --rid-ink:       #1a2330;
  --rid-black:     #0b0f17;

  --rid-success:   #1f8a4c;
  --rid-warning:   #d68a16;
  --rid-danger:    #c0392b;
  --rid-info:      var(--rid-blue-500);

  --rid-bg:            var(--rid-paper);
  --rid-bg-elevated:   var(--rid-white);
  --rid-bg-sunken:     var(--rid-cloud);
  --rid-bg-brand:      var(--rid-blue-500);
  --rid-bg-brand-deep: var(--rid-blue-800);
  --rid-bg-accent:     var(--rid-gold-500);

  --rid-fg:            var(--rid-ink);
  --rid-fg-2:          var(--rid-ink-2);
  --rid-fg-3:          var(--rid-mute);
  --rid-fg-on-brand:   var(--rid-white);
  --rid-fg-on-accent:  var(--rid-blue-900);

  --rid-border:        var(--rid-line);
  --rid-border-strong: #b9c1cf;
  --rid-link:          var(--rid-blue-600);
  --rid-link-hover:    var(--rid-blue-800);

  --rid-font-display:        'Noto Sans Thai Condensed', 'Noto Sans Thai', system-ui, sans-serif;
  --rid-font-body:           'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rid-font-ui:             'Noto Sans Thai SemiCondensed', 'Noto Sans Thai', system-ui, sans-serif;
  --rid-font-mono:           ui-monospace, 'SF Mono', Menlo, monospace;

  --rid-fs-display: 56px;   --rid-lh-display: 1.1;
  --rid-fs-h1:      40px;   --rid-lh-h1:      1.18;
  --rid-fs-h2:      30px;   --rid-lh-h2:      1.25;
  --rid-fs-h3:      22px;   --rid-lh-h3:      1.35;
  --rid-fs-h4:      18px;   --rid-lh-h4:      1.4;
  --rid-fs-body:    17px;   --rid-lh-body:    1.6;
  --rid-fs-small:   15px;   --rid-lh-small:   1.5;
  --rid-fs-eyebrow: 13px;   --rid-lh-eyebrow: 1.3;   --rid-tr-eyebrow: 0.08em;
  --rid-fs-caption: 12px;   --rid-lh-caption: 1.4;

  --rid-space-1: 4px;
  --rid-space-2: 8px;
  --rid-space-3: 12px;
  --rid-space-4: 16px;
  --rid-space-5: 20px;
  --rid-space-6: 24px;
  --rid-space-8: 32px;
  --rid-space-10: 40px;
  --rid-space-12: 48px;
  --rid-space-16: 64px;

  --rid-r-sm: 4px;
  --rid-r-md: 8px;
  --rid-r-lg: 12px;
  --rid-r-pill: 999px;

  --rid-shadow-1: 0 1px 2px rgba(11,15,23,0.06), 0 1px 1px rgba(11,15,23,0.04);
  --rid-shadow-2: 0 2px 6px rgba(11,15,23,0.08), 0 1px 2px rgba(11,15,23,0.04);
  --rid-shadow-3: 0 8px 20px rgba(11,15,23,0.10), 0 2px 6px rgba(11,15,23,0.06);
  --rid-shadow-brand: 0 6px 18px rgba(23,97,181,0.28);

  --rid-ease-out: cubic-bezier(.2,.8,.2,1);
  --rid-dur-fast: 120ms;
  --rid-dur-base: 200ms;
}
/* RID Design System — admin-v2 components.
   All rules scoped under .rid-admin so they cannot leak into legacy admin. */

.rid-admin {
  font-family: var(--rid-font-body);
  font-size: var(--rid-fs-body);
  line-height: var(--rid-lh-body);
  color: var(--rid-fg);
  background: var(--rid-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rid-admin *, .rid-admin *::before, .rid-admin *::after { box-sizing: border-box; }

.rid-admin h1, .rid-admin h2, .rid-admin h3, .rid-admin h4 {
  font-family: var(--rid-font-display);
  font-weight: 600;
  color: var(--rid-fg);
  margin: 0;
}
.rid-admin h1 { font-size: var(--rid-fs-h1); line-height: var(--rid-lh-h1); font-weight: 700; }
.rid-admin h2 { font-size: var(--rid-fs-h2); line-height: var(--rid-lh-h2); }
.rid-admin h3 { font-size: var(--rid-fs-h3); line-height: var(--rid-lh-h3); }
.rid-admin h4 { font-size: var(--rid-fs-h4); line-height: var(--rid-lh-h4); }

.rid-admin a { color: var(--rid-link); text-decoration: none; transition: color var(--rid-dur-fast) var(--rid-ease-out); }
.rid-admin a:hover { color: var(--rid-link-hover); text-decoration: underline; }

.rid-admin small { font-size: var(--rid-fs-small); line-height: var(--rid-lh-small); }

.rid-admin .rid-eyebrow {
  font-family: var(--rid-font-ui);
  font-size: var(--rid-fs-eyebrow);
  letter-spacing: var(--rid-tr-eyebrow);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rid-fg-2);
}

/* ── Layout shell ── */
.rid-admin-main { padding: var(--rid-space-8) var(--rid-space-6); max-width: 1440px; margin: 0 auto; }
.rid-admin-page-header { display: flex; align-items: center; justify-content: space-between; gap: var(--rid-space-4); margin-bottom: var(--rid-space-6); flex-wrap: wrap; }
.rid-admin-page-header h1 { font-size: var(--rid-fs-h2); }

/* ── Navbar ── */
.rid-navbar {
  background: var(--rid-bg-brand-deep);
  color: var(--rid-fg-on-brand);
  padding: var(--rid-space-3) var(--rid-space-6);
  box-shadow: var(--rid-shadow-1);
  display: flex;
  align-items: center;
  gap: var(--rid-space-6);
  font-family: var(--rid-font-ui);
}
.rid-navbar-brand { display: flex; align-items: center; gap: var(--rid-space-3); color: var(--rid-fg-on-brand); font-weight: 600; }
.rid-navbar-brand:hover { color: var(--rid-fg-on-brand); text-decoration: none; }
.rid-navbar-brand img { height: 36px; width: auto; }
.rid-navbar-title { display: flex; flex-direction: column; line-height: 1.15; }
.rid-navbar-title .lockup-th { font-size: 16px; font-weight: 600; }
.rid-navbar-title .lockup-en { font-size: 11px; opacity: 0.75; letter-spacing: 0.04em; }

.rid-navbar-links { display: flex; gap: var(--rid-space-1); list-style: none; padding: 0; margin: 0; flex: 1; flex-wrap: wrap; }
.rid-navbar-links a {
  color: rgba(255,255,255,0.85);
  padding: var(--rid-space-2) var(--rid-space-3);
  border-radius: var(--rid-r-md);
  font-size: 15px;
  font-weight: 500;
  transition: background var(--rid-dur-fast) var(--rid-ease-out), color var(--rid-dur-fast) var(--rid-ease-out);
}
.rid-navbar-links a:hover { background: rgba(255,255,255,0.08); color: var(--rid-fg-on-brand); text-decoration: none; }
.rid-navbar-links a.active { background: var(--rid-bg-accent); color: var(--rid-fg-on-accent); }

.rid-navbar-user { display: flex; align-items: center; gap: var(--rid-space-3); }
.rid-navbar-user-name { font-size: 15px; font-weight: 500; }
.rid-navbar-back-link { color: var(--rid-gold-300); font-size: 13px; padding: var(--rid-space-1) var(--rid-space-3); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--rid-r-pill); }
.rid-navbar-back-link:hover { color: var(--rid-gold-100); background: rgba(255,255,255,0.06); text-decoration: none; }

/* ── Buttons ── */
.rid-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rid-space-2);
  font-family: var(--rid-font-ui);
  font-size: 15px;
  font-weight: 600;
  padding: 10px var(--rid-space-5);
  border-radius: var(--rid-r-lg);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--rid-dur-fast) var(--rid-ease-out), transform var(--rid-dur-fast) var(--rid-ease-out), box-shadow var(--rid-dur-fast) var(--rid-ease-out);
}
.rid-btn:hover { text-decoration: none; }
.rid-btn:active { transform: translateY(1px); }
.rid-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.rid-btn-primary { background: var(--rid-bg-brand); color: var(--rid-fg-on-brand); }
.rid-btn-primary:hover { background: var(--rid-blue-600); color: var(--rid-fg-on-brand); box-shadow: var(--rid-shadow-brand); }

.rid-btn-secondary { background: var(--rid-bg-elevated); color: var(--rid-fg); border-color: var(--rid-border); }
.rid-btn-secondary:hover { background: var(--rid-bg-sunken); color: var(--rid-fg); }

.rid-btn-danger { background: var(--rid-danger); color: var(--rid-fg-on-brand); }
.rid-btn-danger:hover { background: #a53121; color: var(--rid-fg-on-brand); }

.rid-btn-ghost { background: transparent; color: var(--rid-fg-2); }
.rid-btn-ghost:hover { background: var(--rid-bg-sunken); color: var(--rid-fg); }

.rid-btn-sm { padding: 6px var(--rid-space-3); font-size: 13px; border-radius: var(--rid-r-md); }
.rid-btn-icon { padding: 8px; min-width: 36px; }

/* ── Cards ── */
.rid-card {
  background: var(--rid-bg-elevated);
  border: 1px solid var(--rid-border);
  border-radius: var(--rid-r-lg);
  box-shadow: var(--rid-shadow-1);
  padding: var(--rid-space-5);
}
.rid-card-padless { padding: 0; overflow: hidden; }
.rid-card-header { padding: var(--rid-space-4) var(--rid-space-5); border-bottom: 1px solid var(--rid-border); font-weight: 600; }

/* ── Stat tile (dashboard) ── */
.rid-stat {
  background: var(--rid-bg-elevated);
  border: 1px solid var(--rid-border);
  border-radius: var(--rid-r-lg);
  padding: var(--rid-space-5);
  display: flex;
  align-items: center;
  gap: var(--rid-space-4);
  transition: box-shadow var(--rid-dur-base) var(--rid-ease-out);
}
.rid-stat:hover { box-shadow: var(--rid-shadow-2); }
.rid-stat-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: var(--rid-r-lg);
  font-size: 22px;
  flex-shrink: 0;
}
.rid-stat-icon.tone-blue { background: var(--rid-blue-50); color: var(--rid-blue-600); }
.rid-stat-icon.tone-green { background: var(--rid-green-50); color: var(--rid-green-700); }
.rid-stat-icon.tone-gold { background: var(--rid-gold-50); color: var(--rid-gold-700); }
.rid-stat-icon.tone-water { background: var(--rid-water-50); color: var(--rid-water-700); }
.rid-stat-value { font-family: var(--rid-font-display); font-size: var(--rid-fs-h2); line-height: 1.1; font-weight: 700; }
.rid-stat-label { font-size: var(--rid-fs-small); color: var(--rid-fg-2); margin-top: 2px; }

.rid-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--rid-space-4);
  margin-bottom: var(--rid-space-6);
}

/* ── Tables ── */
.rid-table-wrap { overflow-x: auto; border: 1px solid var(--rid-border); border-radius: var(--rid-r-lg); background: var(--rid-bg-elevated); }
.rid-table { width: 100%; border-collapse: collapse; font-family: var(--rid-font-ui); font-size: 15px; }
.rid-table thead th {
  text-align: left;
  padding: var(--rid-space-3) var(--rid-space-4);
  font-size: var(--rid-fs-eyebrow);
  letter-spacing: var(--rid-tr-eyebrow);
  text-transform: uppercase;
  color: var(--rid-fg-2);
  background: var(--rid-bg-sunken);
  border-bottom: 1px solid var(--rid-border);
  white-space: nowrap;
}
.rid-table tbody td {
  padding: var(--rid-space-3) var(--rid-space-4);
  border-bottom: 1px solid var(--rid-border);
  vertical-align: middle;
}
.rid-table tbody tr:last-child td { border-bottom: 0; }
.rid-table tbody tr:hover { background: rgba(23,97,181,0.04); }
.rid-table .rid-table-actions { display: flex; gap: var(--rid-space-1); }
.rid-table-empty { padding: var(--rid-space-10); text-align: center; color: var(--rid-fg-3); }

/* ── Forms ── */
.rid-field { display: flex; flex-direction: column; gap: var(--rid-space-2); margin-bottom: var(--rid-space-4); }
.rid-label { font-size: var(--rid-fs-small); font-weight: 600; color: var(--rid-fg-2); }
.rid-input, .rid-select {
  font-family: var(--rid-font-body);
  font-size: var(--rid-fs-body);
  padding: 10px var(--rid-space-3);
  border: 1px solid var(--rid-border);
  border-radius: var(--rid-r-md);
  background: var(--rid-bg-elevated);
  color: var(--rid-fg);
  transition: border-color var(--rid-dur-fast) var(--rid-ease-out), box-shadow var(--rid-dur-fast) var(--rid-ease-out);
  width: 100%;
}
.rid-input:focus, .rid-select:focus {
  outline: none;
  border-color: var(--rid-blue-500);
  box-shadow: 0 0 0 3px rgba(23,97,181,0.18);
}
.rid-input.is-error { border-color: var(--rid-danger); }
.rid-error-msg { font-size: 13px; color: var(--rid-danger); }
.rid-readonly-value { padding: 10px 0; color: var(--rid-fg); font-size: var(--rid-fs-body); }

/* ── Badges ── */
.rid-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--rid-font-ui);
  font-size: var(--rid-fs-caption);
  font-weight: 600;
  padding: 3px var(--rid-space-2);
  border-radius: var(--rid-r-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rid-badge.tone-success { background: var(--rid-green-50); color: var(--rid-green-700); }
.rid-badge.tone-warning { background: var(--rid-gold-50); color: var(--rid-gold-700); }
.rid-badge.tone-danger  { background: #fdecea;            color: var(--rid-danger); }
.rid-badge.tone-info    { background: var(--rid-water-50); color: var(--rid-water-700); }
.rid-badge.tone-neutral { background: var(--rid-bg-sunken); color: var(--rid-fg-2); }

/* ── Flash / Alert ── */
.rid-flash { padding: var(--rid-space-4) var(--rid-space-5); border-radius: var(--rid-r-md); margin-bottom: var(--rid-space-5); border: 1px solid; box-shadow: var(--rid-shadow-1); display: flex; align-items: center; gap: var(--rid-space-3); }
.rid-flash.tone-success { background: var(--rid-green-50); border-color: var(--rid-green-300); color: var(--rid-green-700); }
.rid-flash.tone-danger  { background: #fdecea;             border-color: #f1b0a8;             color: var(--rid-danger); }

/* ── Search row / filters ── */
.rid-filter-row { display: flex; flex-wrap: wrap; gap: var(--rid-space-3); align-items: end; margin-bottom: var(--rid-space-4); }
.rid-filter-row .rid-field { margin-bottom: 0; flex: 0 1 220px; }

/* ── Pagination ── */
.rid-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: var(--rid-space-4); flex-wrap: wrap; gap: var(--rid-space-3); }
.rid-pagination .pagy.nav { display: flex; gap: 4px; }
.rid-pagination .pagy.nav a, .rid-pagination .pagy.nav span {
  padding: 6px var(--rid-space-3);
  border: 1px solid var(--rid-border);
  border-radius: var(--rid-r-md);
  background: var(--rid-bg-elevated);
  color: var(--rid-fg);
  font-size: 14px;
  text-decoration: none;
  font-family: var(--rid-font-ui);
}
.rid-pagination .pagy.nav a:hover { background: var(--rid-bg-sunken); }
.rid-pagination .pagy.nav .current, .rid-pagination .pagy.nav .active { background: var(--rid-bg-brand); color: var(--rid-fg-on-brand); border-color: var(--rid-bg-brand); }
.rid-pagination .pagy.nav .disabled { opacity: 0.45; pointer-events: none; }
.rid-pagination-meta { color: var(--rid-fg-3); font-size: var(--rid-fs-small); }

/* ── Map (dashboard) ── */
.rid-map { height: min(560px, 60vh); border-radius: var(--rid-r-lg); border: 1px solid var(--rid-border); overflow: hidden; }
.rid-chip-row { display: flex; flex-wrap: wrap; gap: var(--rid-space-2); margin-bottom: var(--rid-space-3); }
.rid-chip {
  background: var(--rid-bg-sunken);
  color: var(--rid-fg-2);
  border: 1px solid transparent;
  border-radius: var(--rid-r-pill);
  padding: 5px var(--rid-space-3);
  font-family: var(--rid-font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--rid-dur-fast) var(--rid-ease-out);
}
.rid-chip:hover { background: var(--rid-blue-50); color: var(--rid-blue-700); }
.rid-chip.active { background: var(--rid-bg-brand); color: var(--rid-fg-on-brand); }

/* ── Utility helpers ── */
.rid-mute { color: var(--rid-fg-3); }
.rid-text-mono { font-family: var(--rid-font-mono); font-size: 0.92em; }
.rid-row { display: flex; gap: var(--rid-space-3); align-items: center; }
.rid-stack { display: flex; flex-direction: column; gap: var(--rid-space-3); }
/*


 */
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
