/* Dark Modern Glassmorphism Theme for Agrobot Web */
:root {
  --bg-dark: #0b0f17;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary-emerald: #10b981;
  --primary-emerald-glow: rgba(16, 185, 129, 0.25);
  --primary-cyan: #06b6d4;
  --primary-purple: #8b5cf6;
  --warning-yellow: #f59e0b;
  --danger-red: #ef4444;
  --radius-lg: 16px;
  --radius-md: 10px;
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: 270px;
  background: rgba(11, 15, 23, 0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 500;
  box-sizing: border-box;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.brand-logo {
  font-size: 2rem;
  background: rgba(16, 185, 129, 0.15);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-emerald);
}

.brand-text h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-text h2 span {
  color: var(--primary-emerald);
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 4px;
  margin-bottom: 10px;
}

/* Custom Sleek Scrollbar for Nav Menu */
.nav-menu::-webkit-scrollbar {
  width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
  background: var(--primary-emerald);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%);
  color: var(--primary-emerald);
  border-left: 3px solid var(--primary-emerald);
}

.server-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-indicator.online {
  background: var(--primary-emerald);
  box-shadow: 0 0 10px var(--primary-emerald);
}

.status-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.status-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  margin-left: 270px;
  flex: 1;
  padding: 32px;
  max-width: calc(100vw - 270px);
  min-width: 0;
  transition: all 0.3s ease;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Sidebar Toggle & Close Buttons */
.btn-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-sidebar-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--primary-emerald);
  border-color: var(--primary-emerald);
}

.btn-sidebar-close {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.2s ease;
}

.btn-sidebar-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger-red);
  color: var(--danger-red);
}

/* Sidebar Backdrop Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 14, 0.7);
  backdrop-filter: blur(4px);
  z-index: 450;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.header-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.time-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--primary-cyan);
}

/* Cards & Layout */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--primary-emerald); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); border: 1px solid var(--primary-cyan); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); border: 1px solid var(--primary-purple); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--warning-yellow); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.content-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.card-margin {
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Tabs Toggle */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tables */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.table-container::-webkit-scrollbar {
  height: 6px;
}

.table-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  padding: 12px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Form Styling */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.span-full {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-control {
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 10px var(--primary-emerald-glow);
}

.form-inline {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-cyan);
  color: #000;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.btn-emerald {
  background: var(--primary-emerald);
  color: #000;
}

.btn-emerald:hover {
  opacity: 0.9;
  box-shadow: 0 0 12px var(--primary-emerald-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  vertical-align: middle;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-emerald);
  border: 1px solid var(--primary-emerald);
}

/* IFRS COA Account Badges */
.badge-coa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: clamp(0.72rem, 0.85vw, 0.78rem);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.badge-coa:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}

.badge-coa .coa-icon {
  font-size: 0.88rem;
  line-height: 1;
}

.badge-coa .coa-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-coa .coa-sep {
  opacity: 0.5;
  font-size: 0.7rem;
}

.badge-coa .coa-name {
  font-weight: 500;
  opacity: 0.95;
}

/* Interactive Web Console Terminal */
.console-wrapper {
  background: #06090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 520px;
  font-family: var(--font-mono);
}

.console-header {
  background: rgba(18, 24, 38, 0.9);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.console-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: flex-start;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}

.log-entry {
  line-height: 1.5;
  word-break: break-all;
}

.log-entry.sys { color: var(--primary-cyan); }
.log-entry.cmd { color: var(--primary-emerald); }
.log-entry.res { color: var(--text-main); }
.log-entry.err { color: var(--danger-red); }

.console-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(18, 24, 38, 0.9);
  border-top: 1px solid var(--border-color);
}

.console-input-bar .prompt {
  color: var(--primary-emerald);
  font-weight: 600;
}

.console-input-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
}

.console-mini-output {
  margin-top: 14px;
  background: #06090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-height: 80px;
  max-height: 150px;
  overflow-y: auto;
}

/* Stok Grid */
.stok-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.stok-card {
  background: rgba(11, 15, 23, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.stok-card h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stok-card span {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-emerald);
}

/* User Status Bar in Sidebar */
.user-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-emerald);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-char {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal Overlay & Auth Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 14, 0.88);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-card {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: none;
  animation: modalSlideUp 0.3s ease;
}

/* Custom Scrollbar for Auth Card */
.auth-card::-webkit-scrollbar {
  width: 6px;
}
.auth-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.auth-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.auth-card::-webkit-scrollbar-thumb:hover {
  background: var(--primary-emerald);
}

.auth-card.active {
  display: block;
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 8px;
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary-cyan);
  text-decoration: none;
  font-weight: 600;
}

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

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger-red);
  border-color: var(--danger-red);
}

/* ====================================================
   LEADERBOARD STYLES
   ==================================================== */
.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 992px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
}

.leaderboard-period-filter {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 4px;
  gap: 4px;
}

.btn-period {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-period:hover {
  color: var(--text-main);
}

.btn-period.active {
  background: var(--primary-emerald);
  color: #0b0f17;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  align-items: end;
}

.podium-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.podium-card:hover {
  transform: translateY(-3px);
}

.podium-card.rank-1 {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.16) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.15);
  order: 2;
  padding: 22px 10px;
}

.podium-card.rank-2 {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.14) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(148, 163, 184, 0.4);
  order: 1;
}

.podium-card.rank-3 {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.14) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(217, 119, 6, 0.4);
  order: 3;
}

.podium-medal {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.podium-card.rank-1 .podium-medal {
  font-size: 2.3rem;
}

.podium-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.podium-score {
  font-size: 1.15rem;
  font-weight: 800;
}

.podium-card.rank-1 .podium-score {
  color: #fbbf24;
}

.podium-card.rank-2 .podium-score {
  color: #cbd5e1;
}

.podium-card.rank-3 .podium-score {
  color: #f59e0b;
}

.podium-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rank-badge-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}

.rank-badge-cell.gold {
  background: #fbbf24;
  color: #000;
}

.rank-badge-cell.silver {
  background: #94a3b8;
  color: #000;
}

.rank-badge-cell.bronze {
  background: #d97706;
  color: #fff;
}

.rank-badge-cell.default {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* ====================================================
   FINANCIAL DASHBOARD STYLES
   ==================================================== */
#btn-export-finance:hover {
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.profit-positive {
  color: #34d399;
  font-weight: 700;
}

.profit-negative {
  color: #f87171;
  font-weight: 700;
}

/* ====================================================
   FLEET & TELEMETRY STYLES
   ==================================================== */
.fleet-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.fleet-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.fleet-progress-fill.green {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.fleet-progress-fill.yellow {
  background: linear-gradient(90deg, #d97706, #fbbf24);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}

.fleet-progress-fill.red {
  background: linear-gradient(90deg, #dc2626, #ef4444);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

/* ====================================================
   RESPONSIVE & MOBILE-FRIENDLY STYLES
   ==================================================== */

/* Tablet & Smaller Desktop Screens (<= 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .btn-sidebar-toggle {
    display: flex;
  }

  .btn-sidebar-close {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 24px 20px;
  }

  .content-grid-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .main-content {
    padding: 16px 14px;
  }

  .top-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
  }

  .header-left {
    width: 100%;
    justify-content: flex-start;
  }

  .header-title h1 {
    font-size: 1.4rem;
  }

  .header-title p {
    font-size: 0.8rem;
  }

  .header-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }

  .time-badge {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .btn-refresh {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Grid Layouts Stacked on Mobile */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 16px;
  }

  .card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-header .header-controls,
  .card-header div {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Mobile Tables - Horizontal Scroll with Card Feel */
  .table-container {
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Stok Grid on Mobile */
  .stok-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Filter Controls Mobile Wrap */
  .filter-bar,
  .action-bar,
  div[style*="display: flex; gap:"] {
    flex-wrap: wrap !important;
  }

  /* Modal Form Fullscreen Friendly */
  .auth-card {
    padding: 20px 16px;
    max-width: 95vw;
    border-radius: var(--radius-md);
  }
}

/* -------------------------------------------------- */
/* Panel Edit Manual & Backdate Status Gaji Styles    */
/* -------------------------------------------------- */
#card-panel-backdate {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(6, 182, 212, 0.2);
}

#card-panel-backdate.active {
  display: flex !important;
  flex-direction: column;
}

.backdate-row {
  transition: background-color 0.15s ease;
}

.backdate-row:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.backdate-input-date,
.backdate-input-notes {
  background: rgba(15, 23, 42, 0.8) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.backdate-input-date:focus,
.backdate-input-notes:focus {
  border-color: var(--primary-cyan) !important;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2) !important;
  outline: none;
}

.btn-save-row {
  transition: all 0.2s ease;
}

.btn-save-row:hover {
  background: var(--primary-emerald) !important;
  color: #fff !important;
}

/* ==================================================== */
/* FINANCIAL PERFORMANCE & ANALYTICS RESPONSIVE STYLES */
/* ==================================================== */

.finance-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.65);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.finance-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.finance-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 5 Core Metric Cards */
.finance-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 1280px) {
  .finance-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .finance-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .finance-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.finance-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.finance-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.finance-metric-card .stat-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.finance-metric-card .stat-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.finance-metric-card .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.finance-metric-card .stat-value {
  font-size: clamp(0.92rem, 1.15vw, 1.25rem);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
  line-height: 1.2;
}

.finance-metric-card small {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* 5 Units Grid: Ladang, Baju, Supermarket, Kendaraan, Bet & Wallet */
.finance-units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

@media (max-width: 600px) {
  .finance-units-grid {
    grid-template-columns: 1fr;
  }
}

.finance-unit-card {
  background: rgba(15, 23, 42, 0.65);
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.finance-unit-card:hover {
  transform: translateY(-2px);
}

.finance-unit-card .unit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 6px;
}

.finance-unit-card .unit-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-unit-card .unit-rows {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.finance-unit-card .unit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.finance-unit-card .unit-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-unit-card .unit-row strong {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.78rem;
}

.finance-unit-card .unit-footer {
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.finance-unit-card .unit-footer span {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
}

.finance-unit-card .unit-footer strong {
  font-size: clamp(1rem, 1.18vw, 1.25rem);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* Revenue & Expense Grids */
.finance-revenue-grid,
.finance-expense-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.finance-revenue-card,
.finance-expense-card {
  background: rgba(15, 23, 42, 0.6);
  padding: 12px 14px;
  border-radius: 10px;
  min-width: 0;
}

.finance-revenue-card strong,
.finance-expense-card strong {
  font-size: clamp(1.05rem, 1.2vw, 1.25rem);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================================
   TABLE PAGINATION COMPONENT
   =================================================== */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-info strong {
  color: var(--text-main);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary-emerald);
  color: var(--primary-emerald);
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.pagination-page-indicator {
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(11, 15, 23, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pagination-page-indicator strong {
  color: var(--primary-emerald);
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.pagination-jump-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pagination-jump-input {
  width: 54px;
  height: 32px;
  text-align: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  outline: none;
  transition: all 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
}

.pagination-jump-input:focus {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  background: rgba(15, 23, 42, 1);
}

.pagination-jump-btn {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--primary-emerald);
  color: var(--primary-emerald);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pagination-jump-btn:hover {
  background: var(--primary-emerald);
  color: #000;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .pagination-container {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .pagination-info {
    justify-content: center;
  }
  .pagination-controls {
    justify-content: center;
  }
  .pagination-jump {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 4px;
    justify-content: center;
  }
}

/* ==================================================== */
/* MINI GAME: AGRO LUCKY SPIN STYLING                   */
/* ==================================================== */
.pointer-tick {
  animation: pointerBounce 0.12s ease-in-out;
}

@keyframes pointerBounce {
  0% { transform: translateX(-50%) rotate(0deg); }
  50% { transform: translateX(-50%) rotate(-18deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

#btn-spin-wheel:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
  box-shadow: none;
}

#btn-spin-wheel:not(:disabled):hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.7);
}

.spin-winner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.spin-winner-row:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(4px);
}

/* ==================================================== */
/* MINI GAME: DUEL TANAM KILAT & AGRO WALLET STYLING     */
/* ==================================================== */

.btn-bet-nominal {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-bet-nominal:hover {
  border-color: #fbbf24;
  color: #fbbf24;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.2);
}

.btn-bet-nominal.active {
  background: linear-gradient(135deg, #d97706, #fbbf24);
  color: #0b0f17;
  border-color: #fef08a;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.55), 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px) scale(1.04);
}

.btn-quick-deposit.active {
  background: var(--primary-emerald);
  color: #0b0f17;
  border-color: var(--primary-emerald);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.bet-runner-card {
  position: relative;
  overflow: hidden;
  user-select: none;
}

.bet-runner-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.bet-runner-card.active#card-runner-1,
.bet-runner-card.active#card-runner-a {
  border-color: #ef4444 !important;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.22) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.5) !important;
  transform: translateY(-4px) scale(1.03);
}

.bet-runner-card.active#card-runner-2,
.bet-runner-card.active#card-runner-b {
  border-color: #3b82f6 !important;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.22) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.5) !important;
  transform: translateY(-4px) scale(1.03);
}

.bet-runner-card.active#card-runner-3 {
  border-color: #10b981 !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.22) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.5) !important;
  transform: translateY(-4px) scale(1.03);
}

.bet-runner-card.active#card-runner-4 {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.22) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.5) !important;
  transform: translateY(-4px) scale(1.03);
}

.bet-runner-card.active#card-runner-5 {
  border-color: #8b5cf6 !important;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.22) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.5) !important;
  transform: translateY(-4px) scale(1.03);
}

#deposit-dropzone.dragover,
#deposit-dropzone:focus-within {
  border-color: #34d399 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
}

#btn-play-betting-duel:hover:not(:disabled) {
  transform: scale(1.03);
  box-shadow: 0 6px 30px rgba(16, 185, 129, 0.65);
}

#btn-play-betting-duel:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
  box-shadow: none;
}

.race-bounce {
  animation: runnerBounce 0.25s infinite alternate ease-in-out;
}

@keyframes runnerBounce {
  0% { transform: translateY(-50%) rotate(0deg) scale(1); }
  100% { transform: translateY(-65%) rotate(10deg) scale(1.08); }
}

.bet-winner-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.bet-winner-feed-item:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(4px);
}

.wallet-modal-card {
  display: block !important;
  position: relative;
  background: rgba(18, 24, 38, 0.96);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.modal-overlay.active#modal-voucher-winner {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
}


