:root {
  --bg: #07110d;
  --bg2: #0b1812;
  --card: #10231a;
  --card2: #142a1f;
  --line: rgba(190, 255, 102, 0.14);
  --accent: #c8ff5a;
  --accent-hover: #d7ff85;
  --accent-dark: #10170c;
  --text: #f5f8f1;
  --muted: #aab7ad;
  --white: #ffffff;
  --danger: #ff5252;
  --success: #4caf50;
  --warning: #ffb74d;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

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

.container {
  width: min(1140px, 92%);
  margin: auto;
}

/* Header & Nav */
.header {
  height: 70px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(7, 17, 13, 0.92);
  backdrop-filter: blur(12px);
  z-index: 50;
}

.logo {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}
.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-danger {
  background: rgba(255, 82, 82, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 82, 82, 0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
}

/* Cards & Layout */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.badge-accent { background: rgba(200, 255, 90, 0.15); color: var(--accent); border: 1px solid var(--line); }
.badge-success { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.badge-warning { background: rgba(255, 183, 77, 0.2); color: #ffb74d; }
.badge-danger { background: rgba(255, 82, 82, 0.2); color: #e57373; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd8cf;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  background: #09140f;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 255, 90, 0.15);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(190, 255, 102, 0.06);
  font-size: 14px;
}
tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* Bottom Nav for Mobile / PWA */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #081510;
  border-top: 1px solid var(--line);
  z-index: 40;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  text-align: center;
}
.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  gap: 4px;
  height: 100%;
}
.mobile-nav a.active {
  color: var(--accent);
  font-weight: bold;
}
.mobile-nav svg {
  width: 20px;
  height: 20px;
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: #142a1f;
  border: 1px solid var(--line);
  color: var(--white);
  font-size: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 820px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .header .nav-links { display: none; }
  .mobile-nav { display: grid; }
  body { padding-bottom: 74px; }
}
