/* ═══════════════════════════════════════════════════
   AGRITRACK UNIFIED STYLESHEET
   Consolidated styling for UI consistency
   ═══════════════════════════════════════════════════ */

:root {
  /* Common Design System Palette */
  --green-deep:       #1a3d2b;
  --green-mid:        #3B6D11;
  --green-fresh:      #52913a;
  --green-light:      #EAF3DE;
  --green-pale:       #f4f9f1;
  --green-border:     #cde3bc;
  --green-text:       #6a8f55;
  --green-hint:       #9ab87a;
  --amber-icon:       #854F0B;
  --amber-bg:         #FEF6E8;
  --text-dark:        #1a2e10;
  --text-soft:        #6a8f55;
  --card-bg:          #ffffff;
  --page-bg:          #f4f9f1;
  --shadow-card:      0 12px 48px rgba(26,61,43,0.12), 0 2px 6px rgba(26,61,43,0.06);
  --shadow-btn:       0 4px 16px rgba(59,109,17,0.32);
  --shadow-layout:    0 12px 48px rgba(26,61,43,0.08);

  /* Unified Layout Dimensions */
  --sidebar-w:        75px;
  --topbar-h:         70px;

  /* Drawing Tool Accent Colors */
  --color-blue:       #2563eb;
  --color-green:      #16a34a;
  --color-red:        #dc2626;
  --color-charcoal:   #475569;
  --color-indigo:     #4f46e5;
  --color-purple:     #9333ea;

  /* Status & Alerts Color Tokens */
  --status-success:    #137333;
  --status-success-bg: #e6f4ea;
  --status-warning:    #b06000;
  --status-warning-bg: #fff1e0;
  --status-danger:     #c5221f;
  --status-danger-bg:  #fce8e6;

  /* Telemetry Status Tokens */
  --status-avail:      #10b981;
  --status-use:        #3b82f6;
  --status-maint:      #f59e0b;
  --status-unavail:    #ef4444;
}

/* ── BASE RESET ────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--page-bg);
  min-height: 100vh;
  display: flex;
  overflow-x: clip;
}

/* ── DECORATIVE BACKGROUNDS ────────────────────────── */
.bg-pattern, .bg-dots {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #b8d9a0 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.content::before, .bg-blob-tr {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #c8e6b0 0%, transparent 65%);
  top: -150px;
  right: -150px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.content::after, .bg-blob-bl {
  content: '';
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #d4ebbf 0%, transparent 65%);
  bottom: -100px;
  left: 100px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

/* ── SIDEBAR SYSTEM ────────────────────────────────── */
.sidebar, .w-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--green-deep);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.25s ease;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(26,61,43,0.15);
}

.sidebar.collapsed, .w-sidebar.collapsed {
  width: 64px;
}

.sidebar-brand, .w-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.sidebar-brand-icon, .w-brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-icon svg, .w-brand-icon svg {
  width: 18px; height: 18px;
}

.sidebar-brand-name, .w-brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.sidebar-brand-name span, .w-brand-name em {
  color: #7dcc5a;
  font-style: normal;
}

.sidebar-section-label, .w-sec-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 1.25rem 20px 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.sidebar.collapsed .sidebar-section-label,
.w-sidebar.collapsed .w-sec-label {
  opacity: 0;
}

.sidebar-nav, .w-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}
.sidebar-nav::-webkit-scrollbar, .w-nav::-webkit-scrollbar {
  width: 0;
}

.nav-item, .w-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  color: rgba(255,255,255,0.55);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.nav-item:hover, .w-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}
.nav-item.active, .w-nav-item.active {
  background: rgba(59,109,17,0.35);
  color: #fff;
  border-left: 3px solid var(--green-fresh);
}
.nav-item.active .nav-icon, .w-nav-item.active .w-nav-icon {
  color: #7dcc5a;
}

.nav-icon, .w-nav-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.nav-icon svg, .w-nav-icon svg {
  width: 17px; height: 17px;
}

.nav-label, .w-nav-label {
  overflow: hidden;
}
.sidebar.collapsed .nav-label,
.w-sidebar.collapsed .w-nav-label,
.sidebar.collapsed .sidebar-brand-name,
.w-sidebar.collapsed .w-brand-name {
  display: none;
}

.sidebar-footer, .w-sidebar-footer {
  padding: 1rem 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.sidebar.collapsed .sidebar-footer,
.w-sidebar.collapsed .w-sidebar-footer {
  display: none;
}

/* ── LAYOUT RUNWAY ─────────────────────────────────── */
.layout, .w-layout {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
  position: relative;
  z-index: 1;
}
.layout.expanded, .w-layout.expanded {
  margin-left: 64px;
}

/* ── TOPBAR SYSTEM ─────────────────────────────────── */
.topbar, .w-topbar {
  height: var(--topbar-h);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 950;
  gap: 16px;
  border-bottom: 1px solid var(--green-border);
  box-shadow: 0 2px 10px rgba(10, 25, 49, 0.05);
}

.topbar-left, .w-topbar-left {
  display: flex; align-items: center; gap: 12px;
}

.collapse-btn, .w-collapse-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--green-deep);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: background 0.15s;
  flex-shrink: 0;
}
.collapse-btn:hover, .w-collapse-btn:hover {
  background: #243326;
}
.collapse-btn svg, .w-collapse-btn svg {
  width: 16px; height: 16px;
}

.topbar-right, .w-topbar-right {
  display: flex; align-items: center; gap: 14px;
}

.topbar-bell, .w-bell {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--amber-bg);
  border: 1px solid #f0c278;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--amber-icon);
  position: relative;
  flex-shrink: 0;
}
.topbar-bell svg, .w-bell svg {
  width: 16px; height: 16px;
}
.topbar-bell .badge, .w-bell .dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #ffffff;
}

.topbar-greeting, .w-greeting {
  font-size: 13px;
  color: var(--text-dark);
  white-space: nowrap;
}
.topbar-greeting strong, .w-greeting strong {
  color: var(--text-dark);
  font-weight: 700;
}

.topbar-avatar, .w-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green-fresh);
  border: 2px solid var(--green-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.btn-logout, .w-btn-logout {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--green-pale);
  border: 1px solid var(--green-border);
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-logout:hover, .w-btn-logout:hover {
  background: var(--green-light); border-color: var(--green-fresh); color: var(--text-dark);
}
.btn-logout svg, .w-btn-logout svg {
  width: 14px; height: 14px;
  color: var(--green-mid);
}

/* ── CONTENT CONTAINER ────────────────────────────── */
.content, .w-content {
  flex: 1;
  padding: 2rem 1.75rem;
  position: relative;
}

.content-inner {
  position: relative;
  z-index: 1;
}

/* ── PAGE HEADERS ──────────────────────────────────── */
.page-header, .w-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title, .w-page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.page-sub, .w-page-sub {
  font-size: 13.5px;
  color: var(--text-soft);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.auto-refresh-tag {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--green-hint);
  background: white;
  border: 1px solid var(--green-border);
  padding: 6px 12px;
  border-radius: 20px;
}
.auto-refresh-tag span {
  width: 6px; height: 6px;
  background: var(--green-fresh);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.btn-refresh {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: var(--green-mid);
  color: #f0fbea;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background 0.18s, transform 0.12s;
}
.btn-refresh:hover { background: #2f580d; transform: translateY(-1px); }
.btn-refresh:active { transform: scale(0.97); }
.btn-refresh svg { width: 15px; height: 15px; }

.btn-action-sec {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px;
  background: #ffffff; border: 1px solid var(--green-border);
  color: var(--green-mid); font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 4px rgba(26,61,43,0.04); transition: background 0.15s;
}
.btn-action-sec:hover { background: var(--green-pale); }
.btn-action-sec svg { width: 14px; height: 14px; }

/* ── CARDS & PANELS ────────────────────────────────── */
.card, .w-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--green-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.75rem;
  animation: fadeUp 0.5s ease both;
}

.card-header, .w-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--green-border);
}

.card-title-row, .w-card-title-row {
  display: flex; align-items: center; gap: 10px;
}

.card-icon, .w-card-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center;
}
.card-icon svg, .w-card-icon svg { width: 17px; height: 17px; }
.card-icon.amber, .w-card-icon.amber { background: var(--amber-bg); border-color: #f0c278; }
.card-icon.blue, .w-card-icon.blue { background: #e8f0fe; border-color: #b0ccfd; }

.card-title, .w-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.card-body {
  padding: 1.5rem;
}

.view-all, .w-view-all {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-mid);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--green-border);
  background: var(--green-light);
  transition: background 0.15s;
}
.view-all:hover, .w-view-all:hover { background: #d4e9c4; }

/* ── FORM ELEMENTS ─────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full-width {
  grid-column: span 2;
}

label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dark);
}
label .required {
  color: #ef4444;
  margin-left: 2px;
}

input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--green-border);
  background: #ffffff;
  color: var(--text-dark);
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green-fresh);
  box-shadow: 0 0 0 3px rgba(82,145,58,0.15);
}
input::placeholder, textarea::placeholder {
  color: var(--green-hint);
  opacity: 0.7;
}

.radio-mode-group {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 0.5rem;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
}
.radio-label input[type="radio"] {
  accent-color: var(--green-mid);
  width: 15px;
  height: 15px;
}

.hint-text {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: -6px;
  line-height: 1.4;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.checkbox-wrapper input {
  width: 14px;
  height: 14px;
  accent-color: var(--color-blue);
}

.color-slider {
  width: 100%;
  height: 6px;
  background: var(--color-blue);
  border-radius: 4px;
  -webkit-appearance: none;
  outline: none;
  margin-top: 4px;
}
.color-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-blue);
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-submit {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 24px; border-radius: 10px; border: none;
  background: var(--green-mid); color: #f0fbea;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13.5px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-btn);
  transition: background 0.18s, transform 0.12s;
}
.btn-submit:hover { background: #2f580d; transform: translateY(-1px); }
.btn-submit svg { width: 15px; height: 15px; }

.btn-filter {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: 10px; border: none;
  background: var(--green-mid); color: white;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; width: 100%; max-width: 160px;
  align-self: flex-end; margin-left: auto;
}
.btn-filter:hover { background: #2f580d; }

.btn-action {
  padding: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn-action.cancel { background: #cbd5e1; color: #475569; }
.btn-action.save { background: #16a34a; color: white; box-shadow: 0 4px 12px rgba(22,163,74,0.2); }

/* ── TABLES ────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead th {
  background: var(--green-pale);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--green-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #f0f6ea;
  transition: background 0.12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--green-pale); }

tbody td {
  padding: 12px 14px;
  color: var(--text-dark);
  vertical-align: middle;
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}
.empty-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem;
}
.empty-icon svg { width: 22px; height: 22px; }

/* ── STATUS INDICATORS & BADGES ────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge.active { background: var(--green-light); color: var(--green-mid); }
.badge.pending { background: var(--amber-bg); color: var(--amber-icon); }
.badge.done { background: #e8f5e9; color: #2e7d32; }

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.pill-badge.success { background: var(--status-success-bg); color: var(--status-success); }
.pill-badge.warning { background: var(--status-warning-bg); color: var(--status-warning); }
.pill-badge.danger { background: var(--status-danger-bg); color: var(--status-danger); }

.connected-tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  color: var(--green-fresh);
  padding: 0.5rem 1.5rem 1rem;
  font-weight: 500;
}
.connected-tag span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-fresh);
  animation: pulse 2s infinite;
}

/* ── ALERT BOXES ───────────────────────────────────── */
.alert-info-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: #f0f7ff; border: 1px solid #cce3ff;
  padding: 12px 14px; border-radius: 10px; color: #1e40af;
  font-size: 12.5px; line-height: 1.4; grid-column: span 2;
}
.alert-info-box svg { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }

.alert-success-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: #ecfdf5; border: 1px solid #a7f3d0;
  padding: 12px 14px; border-radius: 10px; color: #065f46;
  font-size: 12.5px; line-height: 1.4;
}
.alert-success-box svg { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.alert-success-box strong { font-weight: 600; color: var(--green-mid); display: block; margin-bottom: 2px;}

/* ── VIEW TOGGLE (Web vs Mobile Simulator) ─────────── */
.view-toggle {
  position: fixed;
  top: 12px; right: 16px;
  z-index: 9999;
  display: flex;
  background: var(--green-deep);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toggle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-btn svg { width: 14px; height: 14px; }
.toggle-btn.active { background: var(--green-mid); color: #fff; }

/* ── STATS & PLOT CARDS ────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--green-border);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.18s, box-shadow 0.18s;
  animation: fadeUp 0.5s ease both;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 56px rgba(26,61,43,0.16); }

.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-soft); font-weight: 500; margin-bottom: 4px; }
.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.bookings { background: #e8f0fe; }
.stat-icon.tractors { background: var(--green-light); }
.stat-icon.users { background: #f3e8ff; }
.stat-icon.completed { background: #fef9c3; }

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 1.75rem;
}

.chart-map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Donut Chart Component */
.donut-wrap {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
}
.legend-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Map Dashboard Widget */
.map-placeholder {
  margin: 1rem 1.5rem 1.5rem;
  border-radius: 12px;
  background: #e8f0e4;
  border: 1px solid var(--green-border);
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 13px;
  position: relative;
  overflow: hidden;
}
.map-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 48%, #cde3bc 48%, #cde3bc 52%, transparent 52%),
    linear-gradient(90deg, transparent 30%, #cde3bc 30%, #cde3bc 33%, transparent 33%),
    linear-gradient(90deg, transparent 65%, #cde3bc 65%, #cde3bc 68%, transparent 68%),
    linear-gradient(transparent 70%, #cde3bc 70%, #cde3bc 73%, transparent 73%);
  opacity: 0.6;
}

.map-pin {
  width: 36px; height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--green-mid);
  border: 3px solid #fff;
  box-shadow: 0 3px 12px rgba(59,109,17,0.4);
  position: relative;
  z-index: 1;
}
.map-label { position: relative; z-index: 1; font-weight: 600; color: var(--text-dark); }
.map-sublabel { position: relative; z-index: 1; font-size: 11.5px; color: var(--text-soft); }

.map-cta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-mid);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--green-border);
  background: var(--green-light);
  transition: background 0.15s;
}
.map-cta:hover { background: #d4e9c4; }
.map-cta svg { width: 13px; height: 13px; }

/* ── PORTAL LANDING / LOGIN PAGE ───────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 38px; height: 38px;
  background: var(--green-light);
  border-radius: 10px;
  border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center;
}
.brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.4px;
}
.brand-name span { color: var(--green-mid); }

.topbar-tag {
  font-size: 12px;
  color: var(--green-hint);
  background: white;
  border: 1px solid var(--green-border);
  padding: 5px 14px;
  border-radius: 20px;
}

.wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1360px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.left-panel {
  text-align: left;
  width: 100%;
  padding: 0 1rem;
}
.left-panel .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--green-mid);
  background: var(--green-light);
  border: 1px solid var(--green-border);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.left-panel h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 46px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}
.left-panel h1 span { color: var(--green-mid); }
.left-panel .subtitle {
  font-size: 16px;
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 800px;
}

.right-panel {
  width: 100%;
}

.roles {
  display: flex;
  flex-direction: row;
  gap: 24px;
  margin-bottom: 2.5rem;
  width: 100%;
}

.role-card {
  flex: 1;
  position: relative;
  border-radius: 16px;
  border: 1.5px solid var(--green-border);
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  background: var(--card-bg);
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  gap: 20px;
  user-select: none;
}
.role-card:hover {
  background: var(--green-pale);
  border-color: #a8ce8a;
  transform: translateY(-3px);
}

.role-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--green-border);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.role-check svg { width: 11px; height: 11px; opacity: 0; transition: opacity 0.15s; }

.role-card.selected-admin { border-color: var(--green-mid); background: #f6fbf2; box-shadow: 0 0 0 4px rgba(59,109,17,0.08); }
.role-card.selected-admin .role-check { background: var(--green-mid); border-color: var(--green-mid); }
.role-card.selected-admin .role-check svg { opacity: 1; }

.role-card.selected-staff { border-color: var(--amber-icon); background: #fffcf5; box-shadow: 0 0 0 4px rgba(133,79,11,0.08); }
.role-card.selected-staff .role-check { background: var(--amber-icon); border-color: var(--amber-icon); }
.role-card.selected-staff .role-check svg { opacity: 1; }

.role-card.selected-auxilliary { border-color: var(--color-blue); background: #f8fbff; box-shadow: 0 0 0 4px rgba(37,99,235,0.08); }
.role-card.selected-auxilliary .role-check { background: var(--color-blue); border-color: var(--color-blue); }
.role-card.selected-auxilliary .role-check svg { opacity: 1; }

.role-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.role-icon.admin { background: var(--green-light); }
.role-icon.staff { background: var(--amber-bg); }
.role-icon.auxilliary { background: #e8f0fe; }
.role-icon svg { width: 26px; height: 26px; }

.role-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 24px;
}
.role-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 3px;
}
.role-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.3;
}

.divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 1.75rem;
}
.divider-line { flex: 1; height: 1px; background: var(--green-border); }
.divider-text { font-size: 11px; color: var(--green-hint); text-transform: uppercase; letter-spacing: 1px; }

.btn-login {
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  border: none;
  background: var(--green-mid);
  color: #f0fbea;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: var(--shadow-btn);
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
}
.btn-login:hover { background: #2f580d; box-shadow: 0 6px 22px rgba(59,109,17,0.38); transform: translateY(-1px); }
.btn-login:active { transform: scale(0.98); }
.btn-login svg { width: 18px; height: 18px; }
.btn-login.staff-mode { background: var(--amber-icon); box-shadow: 0 4px 14px rgba(133,79,11,0.28); }
.btn-login.staff-mode:hover { background: #6b3e09; box-shadow: 0 6px 22px rgba(133,79,11,0.38); }
.btn-login.auxilliary-mode { background: var(--color-blue); box-shadow: 0 4px 14px rgba(37,99,235,0.28); }
.btn-login.auxilliary-mode:hover { background: #1d4ed8; box-shadow: 0 6px 22px rgba(37,99,235,0.38); }
.btn-login.loading { opacity: 0.7; pointer-events: none; }

.card-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 12.5px;
  color: var(--green-hint);
}
.card-footer a { color: var(--green-mid); text-decoration: none; }
.card-footer a:hover { text-decoration: underline; }

/* ── GEOFENCING / DYNAMIC MAP WORKSPACE ────────────── */
.workspace-split {
  flex: 1;
  display: grid;
  grid-template-columns: 460px 1fr;
  min-height: 0;
}

.control-panel {
  background: #ffffff;
  border-right: 1px solid var(--green-border);
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 6px 0 24px rgba(26,61,43,0.02);
}

.panel-header { display: flex; flex-direction: column; gap: 4px; }
.panel-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 24px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.5px; }
.panel-sub { font-size: 14px; color: var(--text-soft); }

.toolbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool-btn {
  border: none; border-radius: 8px; padding: 11px 6px; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600; color: #ffffff; cursor: pointer; text-align: center;
  transition: filter 0.15s;
}
.tool-btn:hover { filter: brightness(0.9); }
.tool-btn.blue { background: var(--color-blue); }
.tool-btn.green { background: var(--color-green); }
.tool-btn.red { background: var(--color-red); }
.tool-btn.charcoal { background: var(--color-charcoal); }
.tool-btn.indigo { background: var(--color-indigo); }
.tool-btn.purple { background: var(--color-purple); }

.instruction-card {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 14px;
  font-size: 12.5px; color: #1e3a8a; line-height: 1.5;
}
.instruction-card strong { color: #1e40af; font-weight: 700; display: block; margin-bottom: 6px; }
.instruction-card ul { list-style-position: inside; margin-top: 4px; }
.instruction-card li { margin-bottom: 3px; }

.settings-inline-row { display: flex; align-items: center; justify-content: space-between; }

.action-footer { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; margin-top: 0.5rem; }
.btn-action { padding: 12px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 600; border-radius: 8px; border: none; cursor: pointer; text-align: center; }

/* SVG Map Canvas */
.map-workspace { position: relative; background: #e2e8f0; width: 100%; height: 100%; overflow: hidden; }
.map-canvas-layer { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.map-grid-mesh { fill: none; stroke: rgba(26,61,43,0.04); stroke-width: 1; }
.map-highway-under { fill: none; stroke: #cbd5e1; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.map-highway-over { fill: none; stroke: #ffffff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }

.geofence-polygon { fill: rgba(37, 99, 235, 0.12); stroke: var(--color-blue); stroke-width: 2.5; stroke-dasharray: 5 3; }
.geofence-vertex-node { fill: var(--color-blue); stroke: #ffffff; stroke-width: 2; }

.map-hud-navigation { position: absolute; top: 24px; right: 24px; display: flex; flex-direction: column; gap: 4px; }
.hud-nav-btn { width: 36px; height: 36px; background: #ffffff; border: 1px solid #cbd5e1; font-size: 20px; font-weight: 700; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-dark); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.map-coordinates-badge { position: absolute; bottom: 24px; left: 24px; background: rgba(26, 61, 43, 0.95); border: 1px solid rgba(255,255,255,0.1); padding: 8px 14px; border-radius: 8px; color: #ffffff; font-size: 11.5px; font-family: monospace; letter-spacing: 0.5px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* ── GEOFENCE MANAGEMENT / TELEMETRY VIEWS ─────────── */
.page-header-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; }

.btn-create {
  background: #10b981; color: white; border: none; padding: 12px 22px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 600;
  border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(16,185,129,0.25); transition: background 0.15s;
}
.btn-create:hover { background: #059669; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.summary-card {
  background: var(--card-bg); border: 1px solid var(--green-border);
  border-radius: 16px; padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-card);
}
.summary-icon-box {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.summary-icon-box.blue { background: #e8f0fe; color: #1a73e8; }
.summary-icon-box.red { background: #fce8e6; color: #c5221f; }
.summary-icon-box.green { background: #e6f4ea; color: #137333; }
.summary-icon-box.yellow { background: #fef7e0; color: #b06000; }

.summary-info { display: flex; flex-direction: column; }
.summary-label { font-size: 12px; font-weight: 600; color: #718096; }
.summary-value { font-size: 24px; font-weight: 700; color: var(--text-dark); margin-top: 2px; }

.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }

.card-header-clean { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.75rem; border-bottom: 1px solid #f0f6ea; background: var(--green-pale); }
.card-header-clean h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 10px; }
.card-header-clean svg { width: 18px; height: 18px; color: var(--green-mid); }

.header-actions { display: flex; gap: 14px; font-size: 12px; font-weight: 600; }
.action-link { color: #4a5568; text-decoration: none; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.action-link.danger { color: #ef4444; }

.protection-entry {
  border: 1px solid #e2e8f0; border-radius: 14px; padding: 1.25rem; margin-bottom: 1.25rem;
  background: #ffffff; display: flex; flex-direction: column; gap: 12px;
}
.protection-entry:last-child { margin-bottom: 0; }
.entry-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }

.status-line { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed #f0f6ea; }
.status-line:last-of-type { border-bottom: none; }
.status-label { color: #4a5568; font-weight: 500; }

.btn-track-action {
  align-self: flex-start; background: #e2e8f0; color: #4a5568; border: none; padding: 8px 16px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12.5px; font-weight: 600; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; gap: 6px; margin-top: 4px; transition: background 0.1s;
}
.btn-track-action:hover { background: #cbd5e1; }

.violation-entry {
  border: 1px solid #e2e8f0; border-radius: 14px; padding: 1.5rem; margin-bottom: 1.25rem; background: #ffffff;
}
.violation-entry:last-child { margin-bottom: 0; }

.violation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; font-size: 13px; margin-top: 12px; margin-bottom: 16px; }
.v-label { color: #718096; font-weight: 500; }
.v-value { color: var(--text-dark); font-weight: 600; text-align: right; }
.v-value.type-tag { background: #ffe4e6; color: #e11d48; padding: 2px 8px; border-radius: 4px; font-size: 11px; width: fit-content; margin-left: auto; text-transform: uppercase; }
.v-value.type-tag.exit { background: #e0f2fe; color: #0284c7; }
.v-value.severity-tag { background: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: 4px; font-size: 11px; width: fit-content; margin-left: auto; text-transform: uppercase; }
.v-value.severity-tag.low { background: #f0fdf4; color: #16a34a; }

.btn-check-violation {
  width: 100%; background: #e2e8f0; color: #1a2e10; border: none; padding: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.1s;
}
.btn-check-violation:hover { background: #cbd5e1; }

.zone-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid #f0f6ea; }
.zone-item:last-child { border-bottom: none; padding-bottom: 0; }
.zone-meta { display: flex; flex-direction: column; gap: 4px; }
.zone-name { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.zone-details { font-size: 13px; color: #718096; }
.zone-details span { background: #e6f4ea; color: #137333; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 6px; }

.zone-actions { display: flex; gap: 12px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #e2e8f0; background: #ffffff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all 0.1s; }
.icon-btn:hover { background: var(--green-pale); border-color: var(--green-border); }
.icon-btn.delete:hover { background: #fff5f5; border-color: #feb2b2; color: #c53030; }

/* ── TRACTOR TELEMETRY & LIVE TRACKING MAP ─────────── */
.legend-card { padding: 18px 24px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.legend-indicators { display: flex; gap: 24px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: #4a5568; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.avail { background: var(--status-avail); }
.dot.use { background: var(--status-use); }
.dot.maint { background: var(--status-maint); }
.dot.unavail { background: var(--status-unavail); }

.map-action-row { display: flex; gap: 10px; }
.btn-map-mode {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px;
  font-size: 13px; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; border: 1px solid var(--green-border);
  border-radius: 10px; background: #ffffff; color: var(--text-dark); cursor: pointer; transition: all 0.15s ease;
}
.btn-map-mode:hover { background: var(--green-pale); border-color: var(--green-fresh); }
.btn-map-mode.active { background: #2563eb; color: #ffffff; border-color: #2563eb; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
.btn-map-mode.danger { background: #ea580c; color: #ffffff; border-color: #ea580c; box-shadow: 0 4px 12px rgba(234,88,12,0.25); }

.desktop-grid { display: grid; grid-template-columns: 1fr 420px; gap: 2rem; align-items: start; }

.map-container {
  height: 640px; background: #e5e7eb; border-radius: 20px; border: 1px solid var(--green-border);
  position: relative; overflow: hidden; box-shadow: var(--shadow-card);
}
.mock-map-bg { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.map-zoom-controls { position: absolute; top: 20px; left: 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; }
.zoom-btn { width: 32px; height: 32px; background: #fff; border: 1px solid #e2e8f0; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #333; transition: background 0.1s; }
.zoom-btn:hover { background: #f8fafc; }

.metrics-panel { display: flex; flex-direction: column; gap: 2rem; }

.metric-table { width: 100%; border-collapse: collapse; }
.metric-table td { padding: 12px 0; font-size: 14px; color: #4a5568; font-weight: 500; border-bottom: 1px dashed #eef4e8; }
.metric-table tr:last-child td { border-bottom: none; }
.metric-value { text-align: right; font-weight: 700; font-size: 16px; color: var(--text-dark); }
.metric-value.danger { color: #ef4444; }
.metric-value.warning { color: #f59e0b; }
.metric-value.success { color: #10b981; }

.device-list { display: flex; flex-direction: column; gap: 12px; margin-top: 1rem; }
.device-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; background: #ffffff; border: 1px solid #e2e8f0;
  border-radius: 12px; transition: border-color 0.15s;
}
.device-row:hover { border-color: var(--green-hint); }
.device-meta { display: flex; align-items: center; gap: 12px; }
.device-indicator { width: 10px; height: 10px; border-radius: 50%; background: var(--status-unavail); }
.device-title { font-size: 14px; font-weight: 700; color: var(--text-dark); }
.device-sub { font-size: 12px; color: #718096; margin-top: 2px; }

.device-telemetry { text-align: right; display: flex; flex-direction: column; gap: 3px; margin-left: auto; margin-right: 12px; }
.device-percentage { font-size: 12px; font-weight: 600; color: #4a5568; }
.device-timestamp { font-size: 11px; color: #a0aec0; }

.btn-details {
  padding: 6px 14px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 600;
  color: white; background: #2563eb; border: none; border-radius: 8px; cursor: pointer; transition: background 0.1s;
}
.btn-details:hover { background: #1d4ed8; }

/* ── FACULTY DASHBOARD & EVALUATION / FEEDBACK ────── */
.w-page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green-mid); background: var(--green-light);
  border: 1px solid var(--green-border);
  padding: 5px 12px; border-radius: 20px;
  align-self: center;
}
.w-page-badge svg { width: 10px; height: 10px; }

/* Available Tractors Dashboard view */
.w-tractors-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; padding: 1.25rem 1.5rem;
}
.w-tractor-card {
  border: 1.5px solid var(--green-border); border-radius: 14px;
  padding: 1.1rem 1.2rem;
  display: flex; align-items: center; gap: 14px;
  background: var(--green-pale);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  cursor: pointer;
}
.w-tractor-card:hover {
  transform: translateY(-2px);
  border-color: var(--green-mid);
  box-shadow: 0 6px 20px rgba(59,109,17,0.12);
}
.w-tractor-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--green-light); border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.w-tractor-icon svg { width: 22px; height: 22px; }
.w-tractor-name { font-size: 13.5px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.w-tractor-model { font-size: 11.5px; color: var(--text-soft); margin-bottom: 4px; }
.w-tractor-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
}
.w-tractor-badge.available { background: var(--green-light); color: var(--green-mid); }
.w-tractor-badge span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Tractor header indicator */
.tractor-card {
  background: var(--card-bg); border-radius: 18px;
  border: 1px solid var(--green-border);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.5rem;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 1.75rem;
  animation: fadeUp 0.4s ease both;
}
.tractor-card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--green-light); border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tractor-card-icon svg { width: 22px; height: 22px; }
.tractor-card-info { flex: 1; }
.tractor-card-label { font-size: 11px; font-weight: 500; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px; }
.tractor-card-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.4px; }
.tractor-card-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.tractor-date { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-soft); background: var(--green-pale); border: 1px solid var(--green-border); padding: 6px 12px; border-radius: 8px; }
.tractor-date svg { width: 14px; height: 14px; }

.btn-switch { display: flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 9px; border: 1.5px solid var(--green-border); background: var(--card-bg); color: var(--text-dark); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-switch:hover { border-color: var(--green-mid); background: var(--green-pale); }
.btn-switch svg { width: 13px; height: 13px; }

.sections-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.section-full { margin-bottom: 16px; }

/* Evaluation Component cards */
.eval-card {
  background: var(--card-bg); border-radius: 18px;
  border: 1px solid var(--green-border);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.5rem;
  animation: fadeUp 0.45s ease both;
}
.eval-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 1.1rem; }
.eval-card-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.eval-card-icon svg { width: 20px; height: 20px; }
.eci-green { background: var(--green-light); }
.eci-blue { background: #e8f0fe; }
.eci-yellow { background: #fef9c3; }
.eci-purple { background: #f3e8ff; }
.eci-red { background: #fee2e2; }
.eci-teal { background: #d1fae5; }
.eval-card-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.eval-card-desc { font-size: 12px; color: var(--text-soft); }

.field-label { font-size: 11.5px; font-weight: 500; color: var(--text-soft); margin-bottom: 7px; }
.field-group { margin-bottom: 1rem; }

.condition-btns { display: flex; gap: 7px; flex-wrap: wrap; }
.cond-btn {
  padding: 5px 14px; border-radius: 20px;
  border: 1.5px solid var(--green-border);
  background: var(--card-bg); color: var(--text-soft);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.cond-btn:hover { border-color: var(--green-mid); color: var(--green-mid); background: var(--green-pale); }
.cond-btn.selected { border-color: var(--green-mid); background: var(--green-light); color: var(--green-mid); font-weight: 600; }
.cond-btn.selected-fair { border-color: #d97706; background: #fef9c3; color: #d97706; font-weight: 600; }
.cond-btn.selected-poor { border-color: #dc2626; background: #fee2e2; color: #dc2626; font-weight: 600; }

.remarks-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--green-border); border-radius: 10px;
  background: var(--green-pale);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12.5px; color: var(--text-dark);
  outline: none; transition: border-color 0.15s, background 0.15s;
  resize: none;
}
.remarks-input::placeholder { color: var(--green-hint); }
.remarks-input:focus { border-color: var(--green-mid); background: #fff; }

.fuel-row { display: flex; gap: 10px; align-items: center; }
.fuel-input-wrap { flex: 1; position: relative; }
.fuel-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--green-border); border-radius: 10px;
  background: var(--green-pale);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12.5px; color: var(--text-dark);
  outline: none; transition: border-color 0.15s;
}
.fuel-input:focus { border-color: var(--green-mid); background: #fff; }
.btn-enter {
  padding: 9px 18px; border-radius: 10px; border: none;
  background: var(--green-mid); color: #f0fbea;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12.5px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-btn); transition: background 0.15s;
  white-space: nowrap;
}
.btn-enter:hover { background: #2f580d; }

.others-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1rem; }
.checkbox-group { display: flex; gap: 7px; flex-wrap: wrap; }
.check-btn {
  padding: 5px 12px; border-radius: 20px;
  border: 1.5px solid var(--green-border);
  background: var(--card-bg); color: var(--text-soft);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.check-btn:hover { border-color: var(--green-mid); color: var(--green-mid); background: var(--green-pale); }
.check-btn.checked { border-color: var(--green-mid); background: var(--green-light); color: var(--green-mid); font-weight: 600; }

textarea.remarks-textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--green-border); border-radius: 10px;
  background: var(--green-pale);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12.5px; color: var(--text-dark);
  outline: none; transition: border-color 0.15s; resize: vertical; min-height: 80px;
}
textarea.remarks-textarea::placeholder { color: var(--green-hint); }
textarea.remarks-textarea:focus { border-color: var(--green-mid); background: #fff; }

.w-form-bar {
  position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
  background: var(--card-bg); border-top: 1px solid var(--green-border);
  padding: 1rem 1.75rem;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  z-index: 40; box-shadow: 0 -4px 20px rgba(26,61,43,0.08);
  transition: left 0.25s ease;
}
.w-form-bar.expanded { left: 64px; }

.btn-clear {
  padding: 12px 28px; border-radius: 12px;
  border: 1.5px solid var(--green-border);
  background: var(--card-bg); color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-clear:hover { border-color: var(--green-mid); background: var(--green-pale); }

/* ── MOBILE EMULATOR PHONE FRAME ───────────────────── */
#mobile-view {
  display: none;
  background: var(--page-bg);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
}

.m-phone {
  max-width: 390px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--page-bg);
  position: relative;
}

.m-phone .bg-dots {
  max-width: 390px; left: auto; right: auto; margin: 0 auto; width: 100%;
}

.m-topbar {
  background: var(--green-deep);
  padding: 0 14px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.m-topbar-left { display: flex; align-items: center; gap: 10px; }
.m-menu-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8); cursor: pointer;
}
.m-menu-btn svg { width: 20px; height: 20px; }
.m-brand { display: flex; align-items: center; gap: 7px; }
.m-brand-icon {
  width: 27px; height: 27px; border-radius: 7px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
}
.m-brand-icon svg { width: 14px; height: 14px; }
.m-brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 800; color: #fff;
}
.m-brand-name em { color: #7dcc5a; font-style: normal; }

.m-topbar-right { display: flex; align-items: center; gap: 8px; }
.m-icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.75); cursor: pointer; position: relative;
}
.m-icon-btn svg { width: 18px; height: 18px; }
.m-notif-dot {
  position: absolute; top: 5px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444; border: 1.5px solid var(--green-deep);
}
.m-avatar {
  width: 29px; height: 29px; border-radius: 50%;
  background: var(--green-fresh); border: 2px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
}

.m-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.m-drawer-overlay.open { opacity: 1; pointer-events: all; }

.m-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 250px;
  background: var(--green-deep); z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.25,0.46,0.45,0.94);
}
.m-drawer.open { transform: translateX(0); }
.m-drawer-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; height: 52px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.m-drawer-brand-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 800; color: #fff; }
.m-drawer-brand-name em { color: #7dcc5a; font-style: normal; }

.m-d-sec { font-size: 10px; font-weight: 500; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255,255,255,0.3); padding: 1rem 18px 0.3rem; }
.m-d-nav { flex: 1; overflow-y: auto; padding: 0.3rem 0; }
.m-d-nav::-webkit-scrollbar { width: 0; }
.m-d-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 18px; color: rgba(255,255,255,0.55);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s;
}
.m-d-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.m-d-item.active { background: rgba(59,109,17,0.3); color: #fff; border-left: 3px solid var(--green-fresh); }
.m-d-item.active .m-d-icon { color: #7dcc5a; }
.m-d-icon { width: 29px; height: 29px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.m-d-icon svg { width: 15px; height: 15px; }
.m-d-footer { padding: 1rem 18px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 11px; color: rgba(255,255,255,0.25); }

.m-content { flex: 1; padding: 16px 14px 100px; }
.m-page-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.5px; }
.m-page-sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; margin-bottom: 14px; }

.m-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.m-stat-card {
  background: var(--card-bg); border-radius: 14px;
  border: 1px solid var(--green-border); padding: 14px;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  animation: fadeUp 0.45s ease both;
}
.m-stat-info { flex: 1; min-width: 0; }
.m-stat-label { font-size: 11px; color: var(--text-soft); font-weight: 500; margin-bottom: 3px; line-height: 1.2; }
.m-stat-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 28px; font-weight: 800; color: var(--text-dark); letter-spacing: -1px; line-height: 1; }
.m-stat-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.m-stat-icon svg { width: 20px; height: 20px; }

.m-card {
  background: var(--card-bg); border-radius: 14px;
  border: 1px solid var(--green-border);
  box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: 12px;
  animation: fadeUp 0.45s 0.22s ease both;
}
.m-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--green-border);
}
.m-card-title-row { display: flex; align-items: center; gap: 8px; }
.m-card-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--green-light); border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center;
}
.m-card-icon svg { width: 15px; height: 15px; }
.m-card-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13.5px; font-weight: 700; color: var(--text-dark); }

.m-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.m-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 500px; }
.m-table thead th {
  background: var(--green-pale); color: var(--text-soft);
  font-weight: 600; font-size: 10px; letter-spacing: 0.4px;
  text-transform: uppercase; padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--green-border); white-space: nowrap;
}
.m-table tbody tr { border-bottom: 1px solid #f0f6ea; }
.m-table tbody tr:last-child { border-bottom: none; }
.m-table tbody td { padding: 9px 10px; color: var(--text-dark); vertical-align: middle; }

.m-empty { padding: 2rem 1rem; text-align: center; color: var(--text-soft); font-size: 12px; }
.m-empty-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--green-light); border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 0.5rem;
}
.m-empty-icon svg { width: 18px; height: 18px; }

.m-tractors-wrap { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.m-tractor-card {
  border: 1.5px solid var(--green-border); border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  background: var(--green-pale);
  transition: border-color 0.18s;
}
.m-tractor-card:hover { border-color: var(--green-mid); }
.m-tractor-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--green-light); border: 1px solid var(--green-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.m-tractor-icon svg { width: 19px; height: 19px; }
.m-tractor-name { font-size: 13px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.m-tractor-id { font-size: 11px; color: var(--text-soft); margin-bottom: 4px; }
.m-tractor-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  background: var(--green-light); color: var(--green-mid);
}
.m-tractor-badge span { width: 5px; height: 5px; border-radius: 50%; background: var(--green-mid); animation: pulse 2s infinite; }

.m-bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 390px;
  background: var(--green-deep);
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 0 14px; z-index: 50;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.m-nav-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; color: rgba(255,255,255,0.4);
  font-size: 10px; font-weight: 500; transition: color 0.15s;
  padding: 0 10px; min-width: 52px;
}
.m-nav-tab svg { width: 20px; height: 20px; }
.m-nav-tab.active { color: #7dcc5a; }

.m-form-bar { position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%); width: 100%; max-width: 390px; background: var(--card-bg); border-top: 1px solid var(--green-border); padding: 10px 14px; display: flex; gap: 10px; z-index: 45; box-shadow: 0 -4px 20px rgba(26,61,43,0.08); }
.m-btn-clear { flex: 1; padding: 11px; border-radius: 10px; border: 1.5px solid var(--green-border); background: var(--card-bg); color: var(--text-dark); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; }
.m-btn-submit { flex: 2; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px; border-radius: 10px; border: none; background: var(--green-mid); color: #f0fbea; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-btn); }
.m-btn-submit svg { width: 14px; height: 14px; }

/* ── ANIMATIONS ────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin {
  animation: spin 0.8s linear infinite;
}

/* ── RESPONSIVE ADAPTATIONS ────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
  .chart-map-grid { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }
  .alert-info-box { grid-column: span 1; }
  .filter-row { grid-template-columns: 1fr !important; }
  .btn-filter { max-width: 100%; }
}

@media (max-width: 900px) {
  .sections-grid { grid-template-columns: 1fr; }
  .others-grid { grid-template-columns: 1fr; }
  .roles { flex-direction: column; gap: 14px; }
  .card { padding: 2.5rem 1.5rem; }
  .left-panel h1 { font-size: 36px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 200px; }
  .content { padding: 1.25rem 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page-title { font-size: 22px; }
  .topbar-greeting { display: none; }
  .sidebar, .w-sidebar { display: none; }
  .layout, .w-layout { margin-left: 0 !important; }
  .page-header, .w-page-header { flex-direction: column; align-items: flex-start; }
  .btn-action-sec { margin-top: 0.5rem; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 26px; }
  .bottom-grid { grid-template-columns: 1fr; }
  .chart-map-grid { grid-template-columns: 1fr; }
}

/* Compact dashboard shell matching the current admin reference UI */
.sidebar, .w-sidebar {
  width: var(--sidebar-w);
}

.sidebar-brand, .w-sidebar-brand {
  justify-content: center;
  padding: 0;
}

.sidebar-brand-name, .w-brand-name,
.nav-label, .w-nav-label,
.sidebar-section-label, .w-sec-label,
.sidebar-footer, .w-sidebar-footer {
  display: none;
}

.sidebar-nav, .w-nav {
  padding-top: 1.25rem;
}

.nav-item, .w-nav-item {
  width: 100%;
  height: 65px;
  justify-content: center;
  padding: 0;
  gap: 0;
}

.nav-item.active, .w-nav-item.active {
  border-left: 0;
  padding-left: 0;
  background: rgba(59,109,17,0.38);
}

.nav-icon, .w-nav-icon {
  width: 40px;
  height: 40px;
}

.nav-icon svg, .w-nav-icon svg {
  width: 20px;
  height: 20px;
}

.layout, .w-layout {
  margin-left: var(--sidebar-w);
}

.layout.expanded, .w-layout.expanded {
  margin-left: var(--sidebar-w);
}

.sidebar.collapsed, .w-sidebar.collapsed {
  width: var(--sidebar-w);
}

.topbar, .w-topbar {
  height: var(--topbar-h);
  padding: 0 30px 0 34px;
}

.collapse-btn, .w-collapse-btn {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}

.collapse-btn svg, .w-collapse-btn svg {
  width: 22px;
  height: 22px;
}

.topbar-right, .w-topbar-right {
  gap: 18px;
}

.topbar-bell, .w-bell {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}

.topbar-bell svg, .w-bell svg {
  width: 20px;
  height: 20px;
}

.topbar-avatar, .w-avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.btn-logout, .w-btn-logout {
  min-height: 40px;
  padding: 9px 18px;
  font-size: 14px;
}

.btn-logout svg, .w-btn-logout svg {
  width: 16px;
  height: 16px;
}

/* USTP public portal login shell */
body.portal-login {
  --ustp-navy: #0A1931;
  --ustp-gold: #F4B41A;
  --ustp-gold-hover: #DDA012;
  --ustp-light-bg: #F8FAFC;
  --agri-green: #2E7D32;
  --agri-green-light: #E8F5E9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--ustp-light-bg);
  color: #1e293b;
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow-x: hidden;
}

@media (min-width: 981px) {
  body.portal-login {
    height: 100vh;
    overflow-y: hidden;
  }
}

@media (min-width: 981px) and (max-height: 640px) {
  body.portal-login {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
}

body.portal-login .bg-pattern {
  background-image:
    linear-gradient(120deg, rgba(244, 180, 26, 0.12), transparent 38%),
    radial-gradient(circle at 16px 16px, rgba(10, 25, 49, 0.08) 1px, transparent 1px);
  background-size: auto, 34px 34px;
  opacity: 1;
}

.institution-ribbon {
  position: relative;
  z-index: 5;
  background: var(--ustp-navy);
  color: #ffffff;
  border-bottom: 1px solid rgba(244, 180, 26, 0.35);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ribbon-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ribbon-inner span:last-child {
  color: var(--ustp-gold);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.portal-header .brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-header .brand-icon {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  color: var(--agri-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-header .brand-icon svg,
.portal-header .brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.portal-header .brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ustp-navy);
  line-height: 1;
}

.portal-header .brand-name span {
  color: var(--agri-green);
}

.brand-line {
  margin-top: 2px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  color: #64748b;
  text-transform: uppercase;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.portal-nav a {
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: color 0.18s;
}

.portal-nav a:hover {
  color: var(--ustp-navy);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border-bottom: 2px solid var(--ustp-gold);
  background: var(--ustp-navy);
  color: #ffffff;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 800;
  transition: background 0.18s, transform 0.18s;
}

.header-cta:hover {
  background: #172a48;
  transform: translateY(-1px);
}

.header-cta svg {
  width: 15px;
  height: 15px;
  color: var(--ustp-gold);
}

body.portal-login .wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(8px, 1.6vh, 20px) 24px clamp(6px, 1.2vh, 16px);
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: clamp(24px, 3.5vw, 48px);
  align-items: center;
}

body.portal-login .wrapper::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 24px;
  width: min(46vw, 580px);
  height: 82%;
  background:
    linear-gradient(135deg, rgba(244, 180, 26, 0.84), rgba(244, 180, 26, 0) 60%),
    var(--ustp-navy);
  transform: skewX(-10deg);
  transform-origin: top right;
  opacity: 0.08;
  pointer-events: none;
}

body.portal-login .left-panel {
  padding: 0;
}

body.portal-login .left-panel .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(244, 180, 26, 0.32);
  background: rgba(244, 180, 26, 0.12);
  color: var(--ustp-gold);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.portal-login .left-panel h1 {
  max-width: 580px;
  margin: 0;
  color: var(--ustp-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(26px, 2.7vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

body.portal-login .left-panel h1 span {
  color: var(--agri-green);
}

body.portal-login .left-panel .subtitle {
  max-width: 500px;
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.portal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin-top: 16px;
}

.portal-metrics div {
  min-height: auto;
  padding: 9px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.portal-metrics strong,
.portal-metrics span {
  display: block;
}

.portal-metrics strong {
  color: var(--ustp-navy);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.portal-metrics span {
  margin-top: 3px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
}

body.portal-login .right-panel {
  width: 100%;
}

body.portal-login .portal-card {
  margin: 0;
  padding: clamp(16px, 2vh, 22px) 24px;
  overflow: visible;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 45px rgba(10, 25, 49, 0.09);
}

body.portal-login .card-kicker {
  color: var(--agri-green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

body.portal-login .card-title {
  margin-top: 4px;
  color: var(--ustp-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

body.portal-login .card-sub {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.security-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  font-size: 10px;
  font-weight: 700;
}

.security-strip span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  animation: pulse 2s infinite;
}

body.portal-login .roles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0 16px;
}

body.portal-login .role-card {
  min-height: auto;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  gap: 14px;
  box-shadow: none;
}

body.portal-login .role-card:hover {
  border-color: rgba(244, 180, 26, 0.75);
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(10, 25, 49, 0.06);
}

body.portal-login .role-card.selected-admin,
body.portal-login .role-card.selected-staff,
body.portal-login .role-card.selected-auxilliary {
  border-color: var(--ustp-gold);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(244, 180, 26, 0.16), 0 12px 28px rgba(10, 25, 49, 0.08);
}

body.portal-login .role-card.selected-staff {
  border-color: var(--agri-green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.14), 0 12px 28px rgba(10, 25, 49, 0.08);
}

body.portal-login .role-card.selected-auxilliary {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 12px 28px rgba(10, 25, 49, 0.08);
}

body.portal-login .role-check {
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-color: #cbd5e1;
}

body.portal-login .role-card.selected-admin .role-check {
  border-color: var(--ustp-gold);
  background: var(--ustp-gold);
}

body.portal-login .role-card.selected-staff .role-check {
  border-color: var(--agri-green);
  background: var(--agri-green);
}

body.portal-login .role-card.selected-auxilliary .role-check {
  border-color: #2563eb;
  background: #2563eb;
}

body.portal-login .role-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--ustp-navy);
}

body.portal-login .role-name {
  color: var(--ustp-navy);
  font-size: 14.5px;
  font-weight: 800;
}

body.portal-login .role-desc {
  margin-top: 2px;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
}

body.portal-login .divider {
  margin-bottom: 16px;
}

body.portal-login .divider-line {
  background: #e2e8f0;
}

body.portal-login .divider-text {
  color: #94a3b8;
  font-weight: 800;
}

body.portal-login .btn-login {
  min-height: 40px;
  border-radius: 9px;
  background: var(--ustp-gold);
  color: var(--ustp-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(244, 180, 26, 0.22);
}

body.portal-login .btn-login:hover {
  background: var(--ustp-gold-hover);
  box-shadow: 0 12px 28px rgba(244, 180, 26, 0.3);
}

body.portal-login .btn-login.staff-mode {
  background: var(--agri-green);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(46, 125, 50, 0.22);
}

body.portal-login .btn-login.staff-mode:hover {
  background: #256b29;
}

body.portal-login .btn-login.auxilliary-mode {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

body.portal-login .btn-login.auxilliary-mode:hover {
  background: #1d4ed8;
}

body.portal-login .card-footer {
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
}

body.portal-login .card-footer a {
  color: var(--agri-green);
  font-weight: 800;
}

.portal-footer {
  position: relative;
  z-index: 2;
  padding: 8px 24px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 10.5px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .portal-nav {
    display: none;
  }

  body.portal-login .wrapper {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 24px;
  }

  body.portal-login .wrapper::before {
    display: none;
  }
}

@media (max-width: 640px) {
  .ribbon-inner,
  .portal-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .ribbon-inner span:last-child,
  .header-cta {
    display: none;
  }

  .portal-header {
    height: 48px;
    padding: 0 16px;
  }

  .portal-header .brand-icon {
    width: 28px;
    height: 28px;
  }

  .portal-header .brand-name {
    font-size: 18px;
  }

  body.portal-login .wrapper {
    padding: 20px 14px 20px;
  }

  body.portal-login .left-panel h1 {
    font-size: 28px;
  }

  .portal-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.portal-login .portal-card {
    padding: 18px 16px;
  }

  body.portal-login .role-card {
    align-items: flex-start;
    min-height: 0;
  }
}

/* USTP themed admin dashboard */
body.admin-dashboard {
  --ustp-navy: #0A1931;
  --ustp-gold: #F4B41A;
  --ustp-gold-hover: #DDA012;
  --ustp-light-bg: #F8FAFC;
  --agri-green: #2E7D32;
  --agri-green-light: #E8F5E9;
  --green-deep: var(--ustp-navy);
  --green-mid: var(--agri-green);
  --green-fresh: #43A047;
  --green-light: var(--agri-green-light);
  --green-pale: #F8FAFC;
  --green-border: #E2E8F0;
  --green-text: #64748B;
  --green-hint: #94A3B8;
  --amber-icon: #B77905;
  --amber-bg: #FFF7E0;
  --text-dark: var(--ustp-navy);
  --text-soft: #64748B;
  --page-bg: var(--ustp-light-bg);
  --card-bg: #FFFFFF;
  --shadow-card: 0 16px 44px rgba(10, 25, 49, 0.08), 0 1px 2px rgba(10, 25, 49, 0.04);
  --shadow-btn: 0 12px 28px rgba(46, 125, 50, 0.2);
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--ustp-light-bg);
  color: #1e293b;
}

body.admin-dashboard .bg-pattern {
  background-image:
    linear-gradient(120deg, rgba(244, 180, 26, 0.1), transparent 32%),
    radial-gradient(circle at 16px 16px, rgba(10, 25, 49, 0.07) 1px, transparent 1px);
  background-size: auto, 34px 34px;
  opacity: 1;
}

body.admin-dashboard .sidebar {
  background: var(--ustp-navy);
  border-right: 1px solid rgba(244, 180, 26, 0.22);
  box-shadow: 8px 0 28px rgba(10, 25, 49, 0.18);
}

body.admin-dashboard .sidebar-brand {
  border-bottom-color: rgba(244, 180, 26, 0.18);
}

body.admin-dashboard .sidebar-brand-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(244, 180, 26, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ustp-gold);
}

body.admin-dashboard .sidebar-brand-icon svg {
  width: 30px;
  height: 30px;
}

body.admin-dashboard .sidebar-brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #ffffff;
}

body.admin-dashboard .sidebar-brand-name span {
  color: var(--ustp-gold);
}

body.admin-dashboard .nav-item {
  color: rgba(255, 255, 255, 0.58);
}

body.admin-dashboard .nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

body.admin-dashboard .nav-item.active {
  color: #ffffff !important;
  background: rgba(59, 109, 17, 0.35) !important;
  border-left: 3px solid var(--green-fresh, #3B6D11) !important;
}

body.admin-dashboard .nav-item.active::before {
  content: none !important;
  display: none !important;
}

body.admin-dashboard .nav-item.active .nav-icon {
  color: #7dcc5a !important;
}

body.admin-dashboard .nav-item:hover .nav-icon {
  color: #9ee67c !important;
}

body.admin-dashboard .layout {
  background: transparent;
}

body.admin-dashboard .topbar {
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  padding: 0 16px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 2px 10px rgba(10, 25, 49, 0.05) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 950 !important;
}

body.admin-dashboard .collapse-btn {
  background: var(--ustp-navy);
  color: #ffffff;
  border-bottom: 2px solid var(--ustp-gold);
}

body.admin-dashboard .collapse-btn:hover {
  background: #172a48;
}

body.admin-dashboard .topbar-bell {
  background: #fff7e0;
  border-color: rgba(244, 180, 26, 0.45);
  color: var(--ustp-navy);
}

body.admin-dashboard .topbar-bell .badge {
  background: var(--ustp-gold);
  border-color: #ffffff;
}

body.admin-dashboard .topbar-greeting {
  color: #64748b;
  font-weight: 600;
}

body.admin-dashboard .topbar-greeting strong {
  color: var(--ustp-navy);
  font-weight: 800;
}

body.admin-dashboard .topbar-avatar {
  background: var(--agri-green);
  border-color: rgba(46, 125, 50, 0.25);
}

body.admin-dashboard .btn-logout {
  min-height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ustp-navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}

body.admin-dashboard .btn-logout:hover {
  border-color: rgba(244, 180, 26, 0.7);
  background: #fffaf0;
}

body.admin-dashboard .content {
  padding: 2.1rem 2rem;
}

body.admin-dashboard .page-header {
  align-items: center;
  padding: 24px 26px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(244, 180, 26, 0.12), rgba(244, 180, 26, 0) 46%),
    #ffffff;
  box-shadow: var(--shadow-card);
}

body.admin-dashboard .page-kicker {
  margin-bottom: 8px;
  color: var(--agri-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.admin-dashboard .page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ustp-navy);
  font-size: 34px;
  letter-spacing: -0.04em;
}

body.admin-dashboard .page-sub {
  max-width: 680px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

body.admin-dashboard .auto-refresh-tag {
  border-color: #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
}

body.admin-dashboard .auto-refresh-tag span {
  background: #22c55e;
}

body.admin-dashboard .stat-card,
body.admin-dashboard .card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

body.admin-dashboard .stat-card {
  min-height: 126px;
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
}

body.admin-dashboard .stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ustp-gold), var(--agri-green));
}

body.admin-dashboard .stat-card:hover {
  box-shadow: 0 20px 50px rgba(10, 25, 49, 0.12);
}

body.admin-dashboard .stat-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.admin-dashboard .stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ustp-navy);
  font-size: 36px;
  letter-spacing: -0.04em;
}

body.admin-dashboard .stat-icon {
  background: var(--ustp-navy) !important;
  color: var(--ustp-gold);
}

body.admin-dashboard .stat-icon svg {
  stroke: currentColor;
}

body.admin-dashboard .card-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

body.admin-dashboard .card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ustp-navy);
  font-size: 15px;
  font-weight: 800;
}

body.admin-dashboard .card-icon {
  border-color: rgba(244, 180, 26, 0.35);
  background: #fff7e0;
  color: var(--ustp-navy);
}

body.admin-dashboard .card-icon svg {
  stroke: currentColor;
}

body.admin-dashboard .view-all,
body.admin-dashboard .map-cta {
  border-color: rgba(244, 180, 26, 0.45);
  border-radius: 10px;
  background: #fff7e0;
  color: var(--ustp-navy);
  font-weight: 800;
}

body.admin-dashboard .view-all:hover,
body.admin-dashboard .map-cta:hover {
  background: var(--ustp-gold);
  color: var(--ustp-navy);
}

body.admin-dashboard thead th {
  background: #f8fafc;
  color: #64748b;
  border-bottom-color: #e2e8f0;
  font-weight: 800;
}

body.admin-dashboard tbody tr {
  border-bottom-color: #eef2f7;
}

body.admin-dashboard tbody tr:hover {
  background: #fffaf0;
}

body.admin-dashboard .empty-state {
  color: #64748b;
  font-weight: 700;
}

body.admin-dashboard .empty-icon {
  border-color: rgba(244, 180, 26, 0.45);
  background: #fff7e0;
}

body.admin-dashboard .empty-icon svg {
  stroke: var(--ustp-navy);
}

body.admin-dashboard .donut-wrap text:first-of-type {
  fill: var(--ustp-navy);
}

body.admin-dashboard .donut-wrap text:last-of-type {
  fill: #64748b;
}

body.admin-dashboard .donut-legend {
  padding: 0 1rem 0.25rem;
}

body.admin-dashboard .legend-item {
  color: #64748b;
  font-weight: 700;
}

body.admin-dashboard .map-placeholder {
  border-color: #cbd5e1;
  background:
    linear-gradient(135deg, rgba(10, 25, 49, 0.08), rgba(244, 180, 26, 0.12)),
    #e8f5e9;
}

body.admin-dashboard .map-placeholder::before {
  background:
    linear-gradient(transparent 48%, rgba(10, 25, 49, 0.1) 48%, rgba(10, 25, 49, 0.1) 52%, transparent 52%),
    linear-gradient(90deg, transparent 30%, rgba(10, 25, 49, 0.1) 30%, rgba(10, 25, 49, 0.1) 33%, transparent 33%),
    linear-gradient(90deg, transparent 65%, rgba(244, 180, 26, 0.22) 65%, rgba(244, 180, 26, 0.22) 68%, transparent 68%),
    linear-gradient(transparent 70%, rgba(244, 180, 26, 0.22) 70%, rgba(244, 180, 26, 0.22) 73%, transparent 73%);
}

body.admin-dashboard .map-pin {
  background: var(--ustp-gold);
  box-shadow: 0 8px 20px rgba(10, 25, 49, 0.18);
}

body.admin-dashboard .map-label {
  color: var(--ustp-navy);
  font-weight: 800;
}

body.admin-dashboard .map-sublabel {
  color: #64748b;
  font-weight: 700;
}

body.admin-dashboard .connected-tag {
  margin: -0.25rem 1.5rem 1.5rem;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
}

body.admin-dashboard .connected-tag span {
  background: #22c55e;
}

@media (max-width: 768px) {
  body.admin-dashboard .content {
    padding: 1.25rem 1rem;
  }

  body.admin-dashboard .page-header {
    padding: 20px;
  }

  body.admin-dashboard .page-title {
    font-size: 28px;
  }
}
