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

:root {
  /* Color System - Light Mode */
  --bg-primary: #f8fafc;
  /* Soft Slate 50 */
  --bg-secondary: #ffffff;
  /* White background for Sidebar */
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --border-color: rgba(0, 0, 0, 0.06);
  /* Thin gray border */
  --border-hover: rgba(16, 185, 129, 0.25);
  /* Accent border on hover */

  --primary: #10b981;
  /* Emerald 500 */
  --primary-hover: #059669;
  /* Emerald 600 */
  --primary-glow: rgba(16, 185, 129, 0.15);

  --accent: #047857;
  /* Darker emerald for text contrast */
  --accent-blue: #2563eb;
  --accent-yellow: #d97706;
  --accent-red: #dc2626;

  --text-primary: #0f172a;
  /* Slate 900 */
  --text-secondary: #475569;
  /* Slate 600 */
  --text-muted: #64748b;
  /* Slate 500 */

  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'Inter', sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 0 15px rgba(16, 185, 129, 0.03);
}

html {
  font-size: 88%;
  /* Mengompresi seluruh ukuran layout (rem) secara global */
}

/* Reset & Scrollbar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.3);
}

/* Layout Structure */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 240px;
  /* Dikurangi dari 280px agar lebih ringkas */
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 2rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: var(--transition-normal);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  padding: 0;
  height: 90px;
}

.brand-logo-img {
  width: 75px;
  height: 75px;
  object-fit: contain;
  box-shadow: none;
  background: transparent;
  border: none;
  padding: 0;
  transform: scale(1.25);
  /* Zoom in */
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.15);
  box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.02);
}

.nav-link.active svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 3px var(--primary-glow));
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.5rem 0 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  padding: 1.75rem 2.25rem;
  transition: var(--transition-normal);
}

/* Top Header Bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.header-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Badges */
.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

.status-badge.live {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.status-badge.demo {
  color: var(--accent-yellow);
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.status-badge.live .status-dot {
  animation: pulse-green 2s infinite;
}

.status-badge.demo .status-dot {
  animation: pulse-yellow 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
  }
}

/* Glassmorphism Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--transition-fast);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card-hover);
}

.card:hover::before {
  background: linear-gradient(to right, var(--primary), var(--accent));
}

.card-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.card-header-icon.blue {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.12);
}

.card-header-icon.yellow {
  color: var(--accent-yellow);
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.12);
}

.card-header-icon.red {
  color: var(--accent-red);
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.12);
}

.card-header-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.card-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Visualization Panel */
.visual-panel {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-tab {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.btn-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

/* Right Panel: Quick Info / Recent Updates */
.feed-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.feed-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  max-height: 270px;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.01);
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: var(--transition-fast);
}

.feed-item:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.04);
}

.feed-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.feed-item-info {
  flex: 1;
  min-width: 0;
}

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

.feed-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feed-item-val {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  text-align: right;
  flex-shrink: 0;
}

/* Page Section Management */
.page-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Premium Forms Layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.form-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-header {
  margin-bottom: 0.5rem;
}

.form-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.form-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.form-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
  background: #ffffff;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 2.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
  filter: brightness(1.05);
}

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

.btn-primary svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
}

/* Premium Table View */
.table-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.table-search-wrapper {
  position: relative;
  width: 320px;
}

.table-search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.table-search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

.table-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

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

.dashboard-table th {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.dashboard-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.dashboard-table tr:hover td {
  background-color: rgba(0, 0, 0, 0.015);
}

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

/* Table Badges and Buttons */
.land-id {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

.land-location {
  font-weight: 700;
  color: var(--text-primary);
}

.salinity-level-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.salinity-level-badge.low {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.salinity-level-badge.medium {
  background: rgba(217, 119, 6, 0.1);
  color: var(--accent-yellow);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.salinity-level-badge.high {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.reduction-badge {
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.reduction-badge.negative {
  color: var(--accent-red);
}

.table-action-btn {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--accent);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.table-action-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.table-action-btn.edit-btn:hover {
  background: var(--accent-blue) !important;
  color: #ffffff !important;
  border-color: var(--accent-blue) !important;
}

.table-action-btn.delete-btn:hover {
  background: var(--accent-red) !important;
  color: #ffffff !important;
  border-color: var(--accent-red) !important;
}

.table-action-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* Settings & Configuration Cards */
.settings-card {
  max-width: 650px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.settings-card[style*="background: rgba(255, 255, 255, 0.01);"] {
  background: #f1f5f9 !important;
  border: 1px solid var(--border-color);
}

/* Alert Notification Banner */
.alert-banner {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.alert-banner.info {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.15);
  color: var(--text-primary);
}

.alert-banner.info svg {
  color: var(--accent-blue);
}

.alert-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--accent);
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  /* Semi transparent slate modal overlay */
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  /* Mengatur modal dimulai dari atas agar tidak terpotong */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  overflow-y: auto;
  /* Aktifkan scroll vertikal jika konten melebihi tinggi layar */
  padding: 3rem 1rem;
  /* Jarak aman atas dan bawah agar modal tidak mentok */
}

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

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 600px;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  position: relative;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

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

.modal-close-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 2rem;
  color: var(--text-primary);
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.modal-container div[style*="background: rgba(255, 255, 255, 0.02);"] {
  background: rgba(0, 0, 0, 0.015) !important;
  border: 1px solid var(--border-color) !important;
}

.modal-container div[style*="border: 1px solid rgba(255, 255, 255, 0.05);"] {
  border: 1px solid var(--border-color) !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1001;
}

.toast {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateX(120%);
  animation: slideIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error {
  border-left-color: var(--accent-red);
}

.toast.warning {
  border-left-color: var(--accent-yellow);
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes slideIn {
  to {
    transform: translateX(0);
  }
}

/* Responsive Styling */
@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .visual-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 80px;
    padding: 2rem 0.5rem;
    align-items: center;
  }

  .brand-name {
    display: none;
  }

  .brand {
    padding-left: 0;
    justify-content: center;
  }

  .nav-link {
    justify-content: center;
    padding: 1rem;
    border-radius: 12px;
  }

  .nav-link span {
    display: none;
  }

  .main-content {
    margin-left: 80px;
    padding: 2rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== LOGIN PAGE ===== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('img/hero-agri.png') center/cover no-repeat;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loginFadeIn 0.5s ease;
}

.login-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.login-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 28px;
  padding: 3rem 2.5rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: loginCardSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 500;
}

.login-field {
  margin-bottom: 1.25rem;
}

.login-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.login-overlay .form-input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.login-overlay .form-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.login-overlay .form-input:focus {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
  background: rgba(255, 255, 255, 0.18);
}

.login-overlay .input-icon {
  stroke: rgba(255, 255, 255, 0.5);
}

.login-error {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fca5a5;
  animation: shakeError 0.4s ease;
}

.login-error.show {
  display: flex;
}

@keyframes shakeError {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.login-btn {
  margin-top: 0.5rem;
}

.login-footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 1.75rem;
  font-weight: 500;
}

/* Logout Button in Sidebar */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(220, 38, 38, 0.04);
  border: 1px solid rgba(220, 38, 38, 0.1);
  border-radius: 12px;
  color: var(--accent-red);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
}

/* Responsive Styling */
@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .visual-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 80px;
    padding: 2rem 0.5rem;
    align-items: center;
  }

  .brand-name {
    display: none;
  }

  .brand {
    padding-left: 0;
    justify-content: center;
    margin-bottom: 2rem;
  }

  .brand-logo-img {
    width: 44px;
    height: 44px;
    padding: 0;
    box-shadow: none;
    background: transparent;
    border: none;
    transform: scale(1.1);
    /* perkecil logo saat sidebar mengecil */
  }

  .nav-link {
    justify-content: center;
    padding: 1rem;
    border-radius: 12px;
  }

  .nav-link span {
    display: none;
  }

  .main-content {
    margin-left: 80px;
    padding: 2rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .logout-btn span {
    display: none;
  }
}

@media (max-width: 640px) {
  .sidebar {
    display: none;
    /* Hide for true mobile */
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .table-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .table-search-wrapper {
    width: 100%;
  }

  .login-card {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
}

/* Spinner Animation for Loading Indicators */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}