:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #11192e;
  --bg-tertiary: #19233f;
  --bg-glass: rgba(17, 25, 46, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background: rgba(14, 165, 233, 0.15); color: var(--info); }

.layout-container {
  display: flex;
  flex: 1;
}

nav.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease-in-out;
}

.nav-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

main.content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 1400px;
}

.panel-section {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-section.active {
  display: flex;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-tertiary);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-warning { background: var(--warning); color: #1e1e1e; }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-muted);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(40%);
}

.disabled-tooltip {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
  font-style: italic;
}

.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.alert-info {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

input[type="text"], select, textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-left: 2px solid var(--border-color);
  padding-left: 1.5rem;
  margin-left: 0.5rem;
}

.timeline-item {
  position: relative;
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.9rem;
  top: 1.2rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

@media (max-width: 900px) {
  .layout-container { flex-direction: column; }
  nav.sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
  main.content { padding: 1rem; }
}
