/* ============================================
   COLOR SYSTEM
   ============================================ */
:root {
  --color-primary: #1565C0;
  --color-primary-dark: #0D47A1;
  --color-primary-light: #E3F2FD;
  --color-accent-red: #E53935;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;
}

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--color-gray-50);
  color: var(--color-gray-900);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  background: linear-gradient(180deg, #1E3A5F 0%, #0F2744 100%);
}

.nav-item {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  border-left-color: #60A5FA;
}

.nav-item.active .nav-icon {
  color: #60A5FA;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-gray-200);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ============================================
   TABLE
   ============================================ */
.table-row {
  transition: all 0.15s ease;
}

.table-row:hover {
  background-color: var(--color-gray-50);
}

/* Action buttons in table */
.action-btn {
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  color: var(--color-gray-500);
}

.action-btn:hover {
  background-color: var(--color-gray-100);
  color: var(--color-primary);
}

.action-btn i {
  width: 1.125rem;
  height: 1.125rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  box-shadow: 0 2px 4px rgba(21, 101, 192, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(21, 101, 192, 0.4);
}

.btn-secondary {
  background: white;
  border: 1.5px solid var(--color-gray-300);
  transition: all 0.2s ease;
}

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

.btn-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge-danger {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-info {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--color-gray-200);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ============================================
   EXPANDABLE
   ============================================ */
.chevron {
  transition: transform 0.2s ease;
}

.chevron.rotated {
  transform: rotate(180deg);
}

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  transform: scale(0.95) translateY(10px);
  transition: all 0.2s ease;
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

/* ============================================
   CHART
   ============================================ */
.chart-bar {
  transition: all 0.15s ease;
  cursor: pointer;
}

.chart-bar:hover {
  filter: brightness(1.1);
}

.chart-bar .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-gray-900);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.chart-bar .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-gray-900);
}

.chart-bar:hover .tooltip {
  opacity: 1;
}

/* ============================================
   CHANNEL TOGGLE
   ============================================ */
.channel-btn {
  transition: all 0.2s ease;
}

.channel-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(21, 101, 192, 0.3);
}

/* ============================================
   TEMPLATE SEGMENTS
   ============================================ */
.template-segment {
  background: transparent;
  border: none;
  cursor: pointer;
}

.template-segment.active {
  background: white;
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.template-segment:not(.active):hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  ring: 2px;
  ring-color: rgba(21, 101, 192, 0.2);
  border-color: var(--color-primary);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}
