:root {
  --afx-red: #F30002;
  --afx-red-dark: #C20002;
  --afx-black: #0A0B0D;
  --afx-card-bg: #121418;
  --afx-card-border: #22262E;
  --afx-border: #1E222A;
  --afx-text-main: #F1F3F5;
  --afx-text-muted: #8C96A5;
  --afx-accent: #38BDF8;
  --afx-success: #10B981;
  --afx-warning: #F59E0B;
  --afx-purple: #8B5CF6;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--afx-black);
  color: var(--afx-text-main);
  font-family: var(--font-sans);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* Header */
.header {
  height: 60px;
  background-color: var(--afx-card-bg);
  border-bottom: 1px solid var(--afx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.brand-badge {
  background: rgba(243, 0, 2, 0.15);
  color: var(--afx-red);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(243, 0, 2, 0.3);
}

.header-search {
  position: relative;
  width: 380px;
}

.header-search input {
  width: 100%;
  background: var(--afx-black);
  border: 1px solid var(--afx-border);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  color: white;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.header-search input:focus {
  border-color: var(--afx-accent);
}

.header-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--afx-text-muted);
}

.user-strip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--afx-red), var(--afx-purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-signout {
  background: transparent;
  border: 1px solid var(--afx-border);
  color: var(--afx-text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.btn-signout:hover {
  border-color: var(--afx-red);
  color: var(--afx-red);
}

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

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--afx-card-bg);
  border-right: 1px solid var(--afx-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--afx-text-muted);
  margin: 16px 8px 8px 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--afx-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: white;
}

.nav-item.active {
  background: rgba(243, 0, 2, 0.12);
  color: var(--afx-text-main);
  font-weight: 600;
  border-left: 3px solid var(--afx-red);
}

.nav-badge {
  margin-left: auto;
  background: var(--afx-border);
  color: white;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Main Workspace */
.main-content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  background-color: var(--afx-black);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--afx-text-muted);
  margin-top: 4px;
}

/* Grids & Cards */
.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--afx-card-bg);
  border: 1px solid var(--afx-card-border);
  border-radius: 12px;
  padding: 20px;
}

.card-title {
  font-size: 0.8rem;
  color: var(--afx-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 8px 0 4px 0;
}

.card-subtext {
  font-size: 0.75rem;
  color: var(--afx-text-muted);
}

/* Workspace Launcher Strip */
.workspace-launcher {
  background: var(--afx-card-bg);
  border: 1px solid var(--afx-card-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.launcher-items {
  display: flex;
  gap: 12px;
}

.launcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--afx-black);
  border: 1px solid var(--afx-border);
  color: var(--afx-text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s;
}

.launcher-btn:hover {
  border-color: var(--afx-accent);
  transform: translateY(-1px);
}

/* Audio Player */
.audio-card {
  background: linear-gradient(135deg, rgba(243,0,2,0.08), rgba(139,92,246,0.08));
  border: 1px solid rgba(243,0,2,0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audio-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Tables */
.table-container {
  background: var(--afx-card-bg);
  border: 1px solid var(--afx-card-border);
  border-radius: 12px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th {
  background: rgba(0,0,0,0.3);
  color: var(--afx-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.6px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--afx-border);
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--afx-border);
}

tr:last-child td {
  border-bottom: none;
}

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

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--afx-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--afx-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-onleave {
  background: rgba(56, 189, 248, 0.15);
  color: var(--afx-accent);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-ended {
  background: rgba(243, 0, 2, 0.15);
  color: var(--afx-red);
  border: 1px solid rgba(243, 0, 2, 0.3);
}

/* Buttons */
.btn-primary {
  background: var(--afx-red);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--afx-red-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--afx-border);
  color: var(--afx-text-main);
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-secondary:hover {
  border-color: var(--afx-text-muted);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--afx-card-bg);
  border: 1px solid var(--afx-card-border);
  border-radius: 16px;
  width: 520px;
  max-width: 90%;
  padding: 24px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.75rem;
  color: var(--afx-text-muted);
  font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
  background: var(--afx-black);
  border: 1px solid var(--afx-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: white;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--afx-accent);
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
