* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
}

/* Login */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: #fff;
  padding: 48px 40px;
  border-radius: 12px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-box h1 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  background: #667eea;
  color: #fff;
}

.btn-primary:hover {
  background: #5a6fd6;
}

.btn-outline {
  background: transparent;
  color: #667eea;
  border: 1px solid #667eea;
}

/* Header */
.header {
  background: #fff;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-left h1 {
  font-size: 20px;
  display: inline;
}

.header-sub {
  font-size: 13px;
  color: #6b7280;
  margin-left: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

/* Dashboard */
.dashboard {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  padding: 20px 24px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid #d1d5db;
}

.stat-online { border-left-color: #10b981; }
.stat-charging { border-left-color: #f59e0b; }
.stat-faulted { border-left-color: #ef4444; }
.stat-active { border-left-color: #667eea; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 24px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid #f3f4f6;
}

.card-body {
  padding: 0;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: #f9fafb;
  padding: 12px 24px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e5e7eb;
}

.table td {
  padding: 14px 24px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}

.table tr:hover td {
  background: #f9fafb;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-available { background: #d1fae5; color: #065f46; }
.badge-online { background: #d1fae5; color: #065f46; }
.badge-charging { background: #fef3c7; color: #92400e; }
.badge-preparing { background: #dbeafe; color: #1e40af; }
.badge-faulted, .badge-groundfailure { background: #fee2e2; color: #991b1b; }
.badge-offline, .badge-unknown { background: #e5e7eb; color: #374151; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-completed { background: #e0e7ff; color: #3730a3; }
.badge-suspendedev, .badge-suspendedevse { background: #fef3c7; color: #92400e; }

/* Empty state */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* Navigation */
.nav {
  background: #fff;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
}
.nav-link {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-link:hover { color: #667eea; }
.nav-link.active { color: #667eea; border-bottom-color: #667eea; font-weight: 600; }

/* Layout helpers */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; }

.scroll { max-height: 360px; overflow-y: auto; }
.hint { padding: 12px 24px; color: #6b7280; font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.small { font-size: 12px; }

/* Buttons (extra variants) */
.btn { background: #eef2ff; color: #3730a3; }
.btn:hover { background: #e0e7ff; }
.btn-primary { width: auto; }
.btn-warn { background: #fee2e2; color: #991b1b; }
.btn-warn:hover { background: #fecaca; }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Alerts */
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Command grid */
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}
.cmd {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  background: #fafbfc;
}
.cmd label { font-size: 13px; font-weight: 600; color: #374151; }
.cmd input, .cmd select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}

/* Forms in cards */
.form-stack { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #374151; }
.form-stack input, .form-stack select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-weight: 400; }
.form-stack .checkbox { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 24px; }
.form-inline input, .form-inline select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }

/* Key-value table */
.table.kv th { text-transform: none; width: 40%; background: #fff; color: #374151; }

/* Online/offline dot */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.dot-on { background: #10b981; }
.dot-off { background: #cbd5e1; }

/* Direction tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag-in { background: #dbeafe; color: #1e40af; }
.tag-out { background: #fef3c7; color: #92400e; }

/* Filters */
.filters { float: right; font-size: 13px; font-weight: 400; }
.filters a { margin-left: 12px; color: #6b7280; text-decoration: none; }
.filters a.active { color: #667eea; font-weight: 600; }
.filters-form { float: right; display: inline-flex; gap: 8px; }
.filters-form select { padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }

/* More status badges */
.badge-finishing { background: #dbeafe; color: #1e40af; }
.badge-reserved { background: #ede9fe; color: #5b21b6; }
.badge-unavailable { background: #e5e7eb; color: #374151; }
.badge-accepted, .badge-sent, .badge-enabled { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-failed, .badge-rejected, .badge-timedout, .badge-disabled { background: #fee2e2; color: #991b1b; }
.badge-cancelled, .badge-used, .badge-expired { background: #e5e7eb; color: #374151; }
