/* 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.85);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

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

.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: 8px;
  flex: 1;
}

.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;
}

.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);
}

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

.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;
}

.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;
}

.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: 500;
  border-bottom: 1px solid var(--border-color);
}

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

.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 {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

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

/* 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;
}

.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);
}


