/* TERMES CONSOLE — Termite Vermilion Theme & Glassmorphic Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

:root {
  --bg: #0a0c10;
  --bg-card: rgba(22, 27, 34, 0.6);
  --bg-input: #0d1117;
  --border: rgba(249, 51, 24, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --primary: #f93318;
  --primary-glow: rgba(249, 51, 24, 0.35);
  --primary-hover: #ff482b;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --font-family: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(249, 51, 24, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
  color: var(--text);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand img {
  height: 38px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.brand-badge {
  background: rgba(249, 51, 24, 0.15);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-bar input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  width: 220px;
}

.auth-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 12px var(--primary-glow);
}

.btn-create-black {
  background: var(--primary) !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

.btn-create-black:hover {
  background: var(--primary-hover) !important;
  box-shadow: 0 0 14px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}

.btn-icon:hover {
  border-color: var(--primary);
  background: rgba(249, 51, 24, 0.15);
}

/* Layout */
.app-container {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 240px;
  background: rgba(13, 17, 23, 0.5);
  border-right: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(249, 51, 24, 0.12);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1300px;
  margin: 0 auto;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Cards & Tables */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: rgba(249, 51, 24, 0.15); color: var(--primary); border: 1px solid var(--border); }
.badge-gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #11151c;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  margin: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #ffffff;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: var(--font-family);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: rgba(17, 21, 28, 0.95);
  border: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.hidden { display: none !important; }
