/* ===== NEUMORPHISM DASHBOARD — SIM Automator ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #e0e5ec;
  --shadow-dark: #a3b1c6;
  --shadow-light: #ffffff;
  --accent: #4f46e5;
  --accent2: #06b6d4;
  --text: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 18px;
  --radius-sm: 10px;
  --sidebar-w: 220px;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== NEU HELPERS ===== */
.neu {
  background: var(--bg);
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  border-radius: var(--radius);
}
.neu-inset {
  background: var(--bg);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
  border-radius: var(--radius-sm);
}
.neu-sm {
  background: var(--bg);
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
  border-radius: var(--radius-sm);
}
.neu-btn {
  background: var(--bg);
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  padding: 10px 20px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.neu-btn:hover {
  box-shadow: 7px 7px 14px var(--shadow-dark), -7px -7px 14px var(--shadow-light);
}
.neu-btn:active {
  box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}
.neu-btn.primary {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #fff;
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}
.neu-btn.primary:hover {
  background: linear-gradient(135deg, #4338ca, var(--accent));
}
.neu-btn.success {
  background: linear-gradient(135deg, var(--success), #34d399);
  color: #fff;
}
.neu-btn.danger {
  background: linear-gradient(135deg, var(--danger), #f87171);
  color: #fff;
}
.neu-btn.warning {
  background: linear-gradient(135deg, var(--warning), #fbbf24);
  color: #fff;
}
.neu-btn.info {
  background: linear-gradient(135deg, var(--accent2), #38bdf8);
  color: #fff;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg);
  box-shadow: 8px 0 20px var(--shadow-dark);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 100;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  margin-bottom: 24px;
}
.sidebar-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 8px var(--shadow-dark), -2px -2px 6px var(--shadow-light);
  font-size: 1.3rem;
  color: #fff;
}
.sidebar-logo span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.sidebar-logo small {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
}
.nav-section-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 4px 8px 8px;
  margin-top: 12px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}
.nav-link:hover {
  background: var(--bg);
  box-shadow: 3px 3px 7px var(--shadow-dark), -3px -3px 7px var(--shadow-light);
  color: var(--text);
}
.nav-link.active {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #fff;
  box-shadow: 4px 4px 10px rgba(79,70,229,0.4), -2px -2px 6px var(--shadow-light);
}
.nav-link.active .nav-icon { color: #fff; }
.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(163,177,198,0.3);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.user-info .name { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.user-info .role { font-size: 0.65rem; color: var(--text-muted); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px 32px;
}
.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.page-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== STAT CARDS ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 6px 0;
  line-height: 1;
}
.stat-card .sub {
  font-size: 0.7rem;
  color: var(--text-light);
}
.stat-card .icon-bg {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* ===== CARD ===== */
.card {
  padding: 24px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title i {
  color: var(--accent);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: none;
  outline: none;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.2s;
}
.form-control:focus {
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light), 0 0 0 2px rgba(79,70,229,0.3);
}
.form-control::placeholder { color: var(--text-light); }
select.form-control {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  cursor: pointer;
  transition: 0.3s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-light);
  top: 4px;
  left: 4px;
  transition: 0.3s;
  box-shadow: 2px 2px 4px var(--shadow-dark);
}
.toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background: var(--accent);
}

/* ===== TABLE ===== */
.neu-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}
.neu-table thead th {
  padding: 10px 14px;
  background: var(--bg);
  box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}
.neu-table thead th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.neu-table thead th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.neu-table tbody tr:hover td { background: rgba(79,70,229,0.04); }
.neu-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(163,177,198,0.2);
  color: var(--text);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-success { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.badge-danger { background: rgba(239,68,68,0.12); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-info { background: rgba(6,182,212,0.12); color: var(--accent2); border: 1px solid rgba(6,182,212,0.25); }
.badge-purple { background: rgba(79,70,229,0.12); color: var(--accent); border: 1px solid rgba(79,70,229,0.25); }

/* ===== LOGS ===== */
.log-box {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-height: 220px;
  overflow-y: auto;
}
.log-box .log-ok { color: var(--success); }
.log-box .log-err { color: var(--danger); }
.log-box .log-info { color: var(--accent2); }
.log-box .log-warn { color: var(--warning); }

/* ===== GRID UTILS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ===== PHOTO UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--shadow-dark);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  background: var(--bg);
  box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover {
  border-color: var(--accent);
}
.upload-zone img {
  max-width: 160px;
  max-height: 160px;
  border-radius: 12px;
  margin: 0 auto;
  display: block;
  box-shadow: 4px 4px 10px var(--shadow-dark);
}

/* ===== STATUS INDICATOR ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.on { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.off { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.status-dot.busy { background: var(--warning); box-shadow: 0 0 6px var(--warning); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 400px;
  padding: 40px;
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}
.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  margin: 0 auto 20px;
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
}
.login-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 4px;
}
.login-card p.sub {
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--danger);
  margin-bottom: 16px;
  text-align: center;
}
.login-secure {
  text-align: center;
  margin-top: 16px;
  font-size: 0.7rem;
  color: var(--text-light);
}

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(163,177,198,0.4);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  width: 400px;
  padding: 32px;
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--shadow-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .nav-link span, .nav-section-label, .user-info { display: none; }
  .main-content { margin-left: 60px; padding: 20px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
