/* ==============================================================================
   NHẪN GIẢ HÀNH KÝ — PREMIUM SAAS SERVER DASHBOARD
   Design Direction: Modern Fintech SaaS Dark Theme (Inspired by Findexa)
   Palette: Charcoal Canvas, Deep Black Sidebars, Electric Blue Accents
============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Surface & Background */
  --bg-canvas: #0b0e14;
  --bg-sidebar: #080a0f;
  --bg-header: #080a0f;
  --bg-card: #131722;
  --bg-card-hover: #171c2a;
  --bg-card-subtle: #0f131c;
  --bg-active-pill: #1c2230;
  --bg-input: #0f131c;
  --bg-modal-overlay: rgba(5, 7, 11, 0.75);

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.2);
  --border-active: #2f68fe;

  /* Typography Colors */
  --text-primary: #ededef;
  --text-secondary: #8e95a5;
  --text-muted: #5a6173;
  --text-inverse: #0b0e14;

  /* Brand & Accents */
  --accent-blue: #2f68fe;
  --accent-blue-hover: #2554d6;
  --accent-blue-active: #1d45b8;
  --accent-blue-subtle: rgba(47, 104, 254, 0.12);
  --accent-blue-glow: rgba(47, 104, 254, 0.25);

  /* Status Colors */
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.12);
  --status-success-border: rgba(16, 185, 129, 0.25);

  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.12);
  --status-danger-border: rgba(239, 68, 68, 0.25);

  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.12);
  --status-warning-border: rgba(245, 158, 11, 0.25);

  --status-info: #38bdf8;
  --status-info-bg: rgba(56, 189, 248, 0.12);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(47, 104, 254, 0.35);

  /* Transitions */
  --trans-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing Scale */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 76px;
  --header-height: 72px;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* App Shell Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-canvas);
}

/* ==============================================================================
   SIDEBAR
============================================================================== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px 16px;
  transition: width var(--trans-normal), min-width var(--trans-normal);
  z-index: 30;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  padding: 24px 12px 20px 12px;
}

/* Brand Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 24px 4px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1d4ed8 0%, #2f68fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(47, 104, 254, 0.35);
}

.brand-info {
  display: flex;
  flex-direction: column;
  transition: opacity var(--trans-fast);
}

.sidebar.collapsed .brand-info {
  display: none;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background-color var(--trans-fast), color var(--trans-fast);
}

.sidebar-collapse-btn:hover {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

/* Navigation Groups */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 0 12px 6px 12px;
  white-space: nowrap;
  transition: opacity var(--trans-fast);
}

.sidebar.collapsed .nav-group-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background-color var(--trans-fast), color var(--trans-fast);
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  overflow: hidden;
}

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

.nav-item.active {
  background-color: var(--bg-active-pill);
  color: #ffffff;
  font-weight: 600;
}

/* Right Electric Blue Strip on Active Item (like Findexa) */
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5px;
  height: 18px;
  background-color: var(--accent-blue);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 8px var(--accent-blue-glow);
}

.sidebar.collapsed .nav-item.active::after {
  right: 2px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  transition: opacity var(--trans-fast);
}

.sidebar.collapsed .nav-label {
  display: none;
}

.nav-badge {
  margin-left: auto;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.sidebar.collapsed .nav-badge {
  display: none;
}

/* Sidebar Bottom Dedicated Card (like Upgrade Pro in Findexa) */
.sidebar-footer-card {
  margin-top: auto;
  padding-top: 16px;
}

.sidebar.collapsed .sidebar-footer-card {
  display: none;
}

.engine-card {
  background: linear-gradient(180deg, #151a24 0%, #10141d 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.engine-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-blue) 50%, transparent 100%);
}

.engine-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.engine-card-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.engine-btn {
  background: #ffffff;
  color: #0b0e14;
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity var(--trans-fast), transform var(--trans-fast);
}

.engine-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.engine-btn:active {
  transform: translateY(0);
}

/* ==============================================================================
   MAIN CONTENT WRAPPER
============================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Top Header Bar */
.top-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 20;
}

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

/* Global Search Bar (with Command+K) */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 320px;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 44px 0 40px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-subtle);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* Header Right Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background-color: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
}

.status-dot.pulsing {
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color var(--trans-fast), color var(--trans-fast), border-color var(--trans-fast);
  position: relative;
}

.header-icon-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.header-icon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--accent-blue);
  box-shadow: 0 0 6px var(--accent-blue);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 4px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--trans-fast);
}

.user-profile-badge:hover {
  background-color: var(--bg-card);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  background-color: #272c3d;
  border: 1px solid var(--border-subtle);
}

.user-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==============================================================================
   CONTENT SCROLLABLE CONTAINER
============================================================================== */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
}

/* View Header */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.view-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 400;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn-primary {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.5;
  background-color: var(--accent-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px var(--accent-blue-glow);
  transition: background-color var(--trans-fast), transform var(--trans-fast);
}

.btn-primary:hover {
  background-color: var(--accent-blue-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  background-color: var(--accent-blue-active);
  transform: translateY(0);
}

.btn-secondary {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.5;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color var(--trans-fast), border-color var(--trans-fast), color var(--trans-fast);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.btn-date-pill {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ==============================================================================
   CARDS & GRIDS
============================================================================== */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Card Base */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.card:hover {
  border-color: var(--border-medium);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-menu-btn {
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--trans-fast), background-color var(--trans-fast);
}

.card-menu-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Top 3 KPI Cards Row */
.kpi-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 20px;
}

.kpi-card {
  min-height: 180px;
  justify-content: space-between;
}

.kpi-metric-wrap {
  margin-bottom: 16px;
}

.kpi-metric-number {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 8px;
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.kpi-badge.positive {
  background-color: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.kpi-badge.negative {
  background-color: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

.kpi-badge.neutral {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.kpi-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.kpi-action-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--trans-fast);
}

.kpi-action-btn.primary {
  background-color: var(--accent-blue);
  color: #ffffff;
}

.kpi-action-btn.primary:hover {
  background-color: var(--accent-blue-hover);
}

.kpi-action-btn.ghost {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.kpi-action-btn.ghost:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Middle Row: Services Cluster (Left) & Real-time Chart (Right) */
.middle-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
}

/* Cluster Services / Wallet-style Cards */
.services-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.service-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: border-color var(--trans-fast);
}

.service-card:hover {
  border-color: var(--border-medium);
}

.service-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.service-flag-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}

.service-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.service-status-pill {
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.service-status-pill.online {
  color: var(--status-success);
}

.service-status-pill.offline {
  color: var(--status-danger);
}

/* Overview Chart Card */
.chart-card {
  min-height: 320px;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-legend-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-bar {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background-color: var(--accent-blue);
}

.chart-select {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  outline: none;
}

/* Interactive SVG Bar Chart */
.chart-container {
  width: 100%;
  height: 240px;
  position: relative;
  margin-top: 12px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-bar-bg {
  fill: #1a202d;
  rx: 6px;
  transition: fill var(--trans-fast);
}

.chart-bar-bg:hover {
  fill: #222a3a;
  cursor: pointer;
}

.chart-bar-active {
  fill: url(#blue-gradient);
  rx: 6px;
  filter: drop-shadow(0 0 10px rgba(47, 104, 254, 0.4));
  cursor: pointer;
}

.chart-axis-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-dasharray: 4 4;
}

/* Chart Tooltip Overlay (matching Findexa screenshot) */
.chart-tooltip {
  position: absolute;
  background-color: #1a202e;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -120%);
  transition: opacity var(--trans-fast), left 120ms ease, top 120ms ease;
  z-index: 10;
  opacity: 0;
}

.chart-tooltip.visible {
  opacity: 1;
}

.tooltip-title {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.tooltip-indicator {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background-color: var(--accent-blue);
}

.tooltip-value {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

/* Bottom Row: Map Regions (Left) & Recent Transactions Table (Right) */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
}

/* Map Regions / Weather Progress Widget */
.regions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.region-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.region-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.region-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.region-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.region-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.region-weather-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--accent-blue-subtle);
  color: #70a1ff;
  border: 1px solid rgba(47, 104, 254, 0.25);
}

.region-progress-bar {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.region-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1d4ed8 0%, var(--accent-blue) 100%);
  border-radius: var(--radius-pill);
  transition: width var(--trans-normal);
}

/* ==============================================================================
   TABLE DESIGN SYSTEM
============================================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

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

.data-table tbody tr {
  transition: background-color var(--trans-fast);
}

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

.cell-activity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-name {
  font-weight: 600;
  color: var(--text-primary);
}

.cell-bold {
  font-weight: 600;
  color: var(--text-primary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status-pill.success {
  background-color: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.status-pill.danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

.status-pill.warning {
  background-color: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}

.status-pill.info {
  background-color: var(--accent-blue-subtle);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

/* ==============================================================================
   SUB-VIEWS / SPECIFIC TABS
============================================================================== */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 180ms ease;
}

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

/* Filter Toolbar */
.toolbar-card {
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.select-filter {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 14px;
  outline: none;
  cursor: pointer;
}

.select-filter:focus {
  border-color: var(--accent-blue);
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.item-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--trans-fast);
}

.item-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.item-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.item-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.item-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-category-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.item-cost {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Weather Controller Grid */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.weather-region-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.weather-select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

/* Log Terminal Viewer */
.log-terminal-wrap {
  background-color: #07090e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
}

.terminal-header {
  padding: 12px 18px;
  background-color: #0c0f17;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-tabs {
  display: flex;
  gap: 8px;
}

.terminal-tab-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--trans-fast);
}

.terminal-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

.terminal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==============================================================================
   MODALS
============================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-modal-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-fast);
}

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

.modal-card {
  min-width: 0;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  width: 90%;
  max-width: 540px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--trans-fast);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  flex-shrink: 0;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-body {
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-footer {
  flex-shrink: 0;
  flex-wrap: wrap;
  padding: 16px 24px;
  background-color: var(--bg-card-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.admin-login-card {
  min-width: 0;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.modal-card .btn-primary > svg, .modal-card .btn-secondary > svg { flex-shrink: 0; }
@media (max-width: 540px) {
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .modal-footer > button { flex: 1 1 100px; min-height: 44px; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  height: 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color var(--trans-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-subtle);
}

/* Quick Coin Chips */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--trans-fast);
}

.chip-btn:hover {
  background-color: var(--accent-blue-subtle);
  border-color: rgba(47, 104, 254, 0.35);
  color: #60a5fa;
}

/* ==============================================================================
   4 EQUIPPED SLOTS CARDS
============================================================================== */
.equipped-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 680px) {
  .equipped-slots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.equipped-slot-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  min-width: 0;
  transition: all var(--trans-fast);
}

.equipped-slot-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.equip-card-inner {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.equip-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.equip-item-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.equip-info-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.equip-slot-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.equip-item-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.equip-item-name.empty {
  color: var(--text-muted);
  font-weight: 500;
  font-style: italic;
}

.enhancement-pill {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

/* ==============================================================================
   INVENTORY SLOTS GRID (16 BAG & 50 STORAGE)
============================================================================== */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 600px) {
  .slots-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.inventory-slot {
  min-height: 80px;
  min-width: 0;
  background: #0f131f;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 5px 3px 4px 3px;
  position: relative;
  cursor: default;
  transition: all 0.16s ease;
  overflow: hidden;
}

.inventory-slot.has-item {
  background: linear-gradient(180deg, #151b2c 0%, #0d111c 100%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.inventory-slot.has-item:hover {
  border-color: #3b82f6;
  background: linear-gradient(180deg, #1d253c 0%, #111726 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.28);
  z-index: 2;
}

.inventory-slot.empty {
  opacity: 0.45;
  background: rgba(14, 18, 28, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  justify-content: center;
}

.inventory-slot.empty:hover {
  opacity: 0.7;
  border-color: rgba(255, 255, 255, 0.15);
}

.inventory-slot.locked {
  opacity: 0.25;
  background: #07090f;
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.slot-empty-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.slot-img-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  flex-shrink: 0;
}

.slot-item-img {
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  transition: transform 0.15s ease;
}

.inventory-slot.has-item:hover .slot-item-img {
  transform: scale(1.1);
}

.slot-item-name {
  font-size: 9.2px;
  font-weight: 600;
  line-height: 1.15;
  color: #f1f5f9;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.slot-count {
  position: absolute;
  top: 3px;
  right: 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 9.5px;
  font-weight: 800;
  color: #fbbf24;
  line-height: 1.3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Item image in catalog & preview */
.catalog-item-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Live Item Preview in Give Modal */
.give-item-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111522;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.give-item-preview-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 110;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: slideInToast 200ms ease;
  min-width: 280px;
}

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

.toast.success {
  border-left: 4px solid var(--status-success);
}

.toast.danger {
  border-left: 4px solid var(--status-danger);
}

.toast.info {
  border-left: 4px solid var(--accent-blue);
}

/* Responsive Rules */
@media (max-width: 1280px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }
  .middle-row, .bottom-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .top-header {
    padding: 0 16px;
  }
  .main-content {
    padding: 16px;
  }
  .weather-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================================================
   DAY & NIGHT CYCLE WIDGET & CONTROLLER STYLES
   ============================================================================== */
.day-night-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.day-night-pill.day {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FCD34D;
}

.day-night-pill.day:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #F59E0B;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.day-night-pill.night {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #C4B5FD;
}

.day-night-pill.night:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: #8B5CF6;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

/* Service Card Status Pill Night Variant */
.service-status-pill.night {
  background: rgba(139, 92, 246, 0.15);
  color: #C4B5FD;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.service-status-pill.night .status-dot {
  background: #A78BFA;
  box-shadow: 0 0 8px #8B5CF6;
}

/* Day & Night Big Controller Card */
.day-night-control-card {
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: linear-gradient(135deg, rgba(19, 23, 34, 0.95), rgba(27, 33, 49, 0.85));
  position: relative;
  overflow: hidden;
}

.day-night-control-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #F59E0B, #2F68FE, #8B5CF6);
  opacity: 0.85;
}

.day-night-current-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.day-night-current-badge.day {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FBBF24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.day-night-current-badge.night {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #C4B5FD;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.day-night-panel-content {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .day-night-panel-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.day-night-visual-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(11, 14, 20, 0.55);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.day-night-art-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.day-night-art-circle.day {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.08) 70%);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.3);
}

.day-night-art-circle.night {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, rgba(139, 92, 246, 0.08) 70%);
  border: 1.5px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.3);
}

.day-night-desc-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-night-big-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.day-night-sub-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.day-night-mode-tag {
  margin-top: 6px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
  border: 1px solid var(--border-subtle);
}

.day-night-controls-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.day-night-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-night-progress-header,
.day-night-progress-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.day-night-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.day-night-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #2F68FE);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.day-night-btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.day-night-action-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.day-night-action-btn:hover {
  transform: translateY(-1px);
}

.day-night-action-btn.btn-day:hover,
.day-night-action-btn.btn-day.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: #F59E0B;
  color: #FCD34D;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
}

.day-night-action-btn.btn-night:hover,
.day-night-action-btn.btn-night.active {
  background: rgba(139, 92, 246, 0.16);
  border-color: #8B5CF6;
  color: #DDD6FE;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.25);
}

.day-night-action-btn.btn-auto:hover,
.day-night-action-btn.btn-auto.active {
  background: rgba(47, 104, 254, 0.16);
  border-color: #2F68FE;
  color: #93C5FD;
  box-shadow: 0 0 14px rgba(47, 104, 254, 0.25);
}

/* =========================================================
   TABLE RESPONSIVE & MOBILE / TABLET DASHBOARD OVERRIDES
   ========================================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.table-responsive .data-table {
  min-width: 760px;
}

@media (max-width: 1024px) {
  #tab-settings div[style*="grid-template-columns: repeat(3"],
  #tab-donations div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  #tab-settings div[style*="grid-template-columns"],
  #tab-donations div[style*="grid-template-columns"],
  #playerDetailModal div[style*="grid-template-columns"],
  #migrateSteamModal div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-card {
    max-width: 100% !important;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px !important;
  }

  .topbar-right .status-pill span:not(.status-dot) {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* =========================================================
   REWARDS MANAGEMENT TAB (#tab-rewards) — LUXURY COMMAND HEADER & COUNTDOWN
   ========================================================= */
.rewards-command-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 24px;
  margin-bottom: 16px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 104, 254, 0.14), transparent 52%),
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.12), transparent 52%),
    linear-gradient(155deg, rgba(20, 25, 38, 0.96), rgba(13, 16, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.rewards-command-copy {
  flex: 1 1 420px;
  min-width: 0;
}

.rewards-kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fde68a;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rewards-kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  flex-shrink: 0;
}

.rewards-command-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rewards-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.rewards-btn-warn {
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.36) !important;
  background: rgba(245, 158, 11, 0.08) !important;
}

.rewards-btn-warn:hover {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
}

.rewards-btn-save {
  background: linear-gradient(135deg, #2F68FE, #1D4ED8) !important;
  box-shadow: 0 8px 22px rgba(47, 104, 254, 0.32);
}

.rewards-alert-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.rewards-weekly-card {
  border-color: rgba(251, 191, 36, 0.32) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(251, 191, 36, 0.08), transparent 48%),
    var(--bg-card) !important;
}

.rewards-weekly-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.rewards-weekly-info {
  flex: 1 1 400px;
  min-width: 0;
}

.rewards-weekly-countdown-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.rewards-countdown-box {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(8, 11, 18, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.36);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rewards-countdown-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #fde68a;
  text-transform: uppercase;
}

.rewards-countdown-cells {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rewards-cd-cell {
  min-width: 46px;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rewards-cd-cell strong {
  font-size: 15px;
  font-weight: 900;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.rewards-cd-cell span {
  font-size: 8.5px;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 2px;
}

.rewards-cd-sep {
  font-size: 14px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.35);
}

.rewards-settle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.42) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  border-radius: 10px !important;
}

.rewards-settle-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(248, 113, 113, 0.68) !important;
}

@media (max-width: 768px) {
  .rewards-command-header {
    padding: 16px;
  }
  .rewards-command-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .rewards-command-actions .rewards-btn-save {
    grid-column: 1 / -1;
  }
  .rewards-weekly-countdown-panel {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .rewards-settle-btn {
    justify-content: center;
  }
}



