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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
}

/* Login */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: #1a1d27;
  border: 1px solid #2d3148;
  border-radius: 12px;
  padding: 40px;
  width: 360px;
}
.login-box h1 { font-size: 1.5rem; margin-bottom: 8px; color: #7c85ff; }
.login-box p { color: #888; margin-bottom: 28px; font-size: 0.9rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.8rem; color: #aaa; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 14px;
  background: #0f1117; border: 1px solid #2d3148;
  border-radius: 8px; color: #e2e8f0; font-size: 0.95rem;
}
.field input:focus { outline: none; border-color: #7c85ff; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 0.9rem; font-weight: 500;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #7c85ff; color: #fff; }
.btn-success { background: #22c55e; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-warn { background: #f59e0b; color: #fff; }
.btn-secondary { background: #2d3148; color: #e2e8f0; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: #1a1d27;
  border-right: 1px solid #2d3148;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
}
.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #2d3148;
}
.sidebar-logo h2 { color: #7c85ff; font-size: 1.1rem; }
.sidebar-logo span { font-size: 0.75rem; color: #666; }

.nav { padding: 12px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer;
  color: #888; font-size: 0.9rem; transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: #e2e8f0; background: rgba(124,133,255,0.05); }
.nav-item.active { color: #7c85ff; background: rgba(124,133,255,0.08); border-left-color: #7c85ff; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid #2d3148;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-user span { font-size: 0.85rem; color: #aaa; }

.main { margin-left: 220px; flex: 1; padding: 32px; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; }
.page-header p { color: #888; font-size: 0.9rem; margin-top: 4px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 28px; }

.card {
  background: #1a1d27; border: 1px solid #2d3148; border-radius: 12px; padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-sub { font-size: 0.78rem; color: #888; margin-top: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 500;
}
.badge-green { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-red { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-blue { background: rgba(124,133,255,0.15); color: #7c85ff; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #f59e0b; }

.card-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.meta-row { display: flex; justify-content: space-between; font-size: 0.82rem; }
.meta-label { color: #666; }
.meta-value { color: #ccc; }

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Table */
.table-wrap { background: #1a1d27; border: 1px solid #2d3148; border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; text-align: left; font-size: 0.78rem; color: #666; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #2d3148; }
td { padding: 12px 16px; font-size: 0.875rem; border-bottom: 1px solid #1e2130; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(124,133,255,0.03); }
.td-mono { font-family: monospace; font-size: 0.8rem; color: #aaa; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #1a1d27; border: 1px solid #2d3148; border-radius: 12px;
  padding: 28px; width: 480px; max-width: 95vw;
}
.modal h3 { font-size: 1.1rem; margin-bottom: 20px; }
.modal .field { margin-bottom: 14px; }

/* Logs */
.log-box {
  background: #0a0c12; border: 1px solid #2d3148; border-radius: 8px;
  padding: 16px; font-family: monospace; font-size: 0.78rem; color: #a8b3cf;
  max-height: 400px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 8px; font-size: 0.875rem; font-weight: 500;
  animation: slideIn 0.2s ease;
}
.toast-success { background: #16a34a; color: #fff; }
.toast-error { background: #dc2626; color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Editor */
.claude-editor { width: 100%; height: 320px; background: #0a0c12; border: 1px solid #2d3148; border-radius: 8px; padding: 12px; color: #e2e8f0; font-family: monospace; font-size: 0.82rem; resize: vertical; }
.claude-editor:focus { outline: none; border-color: #7c85ff; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.tab { padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 0.875rem; color: #888; transition: all 0.15s; }
.tab.active { background: rgba(124,133,255,0.12); color: #7c85ff; }
.tab:hover:not(.active) { color: #ccc; }

.hidden { display: none !important; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { background: #1a1d27; border: 1px solid #2d3148; border-radius: 10px; padding: 16px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: #7c85ff; }
.stat-label { font-size: 0.78rem; color: #666; margin-top: 4px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar h2 { font-size: 1.1rem; font-weight: 600; }
