/* =========================================
   GLOBAL CSS VARIABLES & RESET
   ========================================= */

:root {
  /* Main Colors */
  --primary: #2c2f78;
  --primary-dark: #14163f;
  --accent: #fbb040;
  
  /* Light Mode Backgrounds */
  --bg-body: #f3f4f8;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-card: #ffffff;
  --bg-section-alt: #e6f0ff;
  --bg-input: #f2f3f7;
  
  /* Text Colors */
  --text-main: #222222;
  --text-muted: #555555;
  --text-nav: #555555;
  
  /* Status Colors */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  /* Visual Effects */
  --border-color: #e2e2ec;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-header: 0 1px 6px rgba(0, 0, 0, 0.06);
  
  /* Shapes */
  --white: #ffffff;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;

  /* Footer Bar Colors */
  --footer-bar-bg: #000000;
  --footer-bar-text: #d0d2e8;
}

/* =========================================
   DARK MODE OVERRIDES
   ========================================= */
body.dark-mode {
  --bg-body: #121218;
  --bg-header: rgba(18, 18, 24, 0.95);
  --bg-card: #1e1e26;
  --bg-section-alt: #1a1a22;
  --bg-input: #2c2c3a;
  
  --text-main: #f0f0f0;
  --text-muted: #b0b0b0;
  --text-nav: #cccccc;
  
  --border-color: #333340;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-header: 0 1px 6px rgba(0, 0, 0, 0.3);
  
  --footer-bar-bg: #1a1a1a;
}

/* =========================================
   GLOBAL RESET
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* =========================================
   CONTAINER
   ========================================= */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================================
   SCROLL REVEAL ANIMATION
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(44, 47, 120, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(44, 47, 120, 0.05);
}

body.dark-mode .btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(251, 176, 64, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* =========================================
   FORM ELEMENTS
   ========================================= */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

body.dark-mode .form-input:focus {
  border-color: var(--accent);
}

.form-select {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-main);
  cursor: pointer;
}

/* =========================================
   TABLE STYLES
   ========================================= */
.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  text-align: left;
  padding: 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  vertical-align: middle;
}

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

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

body.dark-mode tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* =========================================
   BADGES
   ========================================= */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge.closed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* =========================================
   CARD STYLES
   ========================================= */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glass);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .container {
    padding: 0 20px;
  }
}

@media (max-width: 600px) {
  .card {
    padding: 18px;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}