:root {
  /* Premium Color Palette (HSL) */
  --primary-h: 210;
  --primary-s: 100%;
  --primary-l: 50%;
  --color-primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --color-primary-light: hsl(var(--primary-h), var(--primary-s), 95%);
  --color-primary-dark: hsl(var(--primary-h), var(--primary-s), 40%);

  --bg-h: 210;
  --bg-s: 20%;
  --bg-l: 98%;
  --color-bg: hsl(var(--bg-h), var(--bg-s), var(--bg-l));

  --surface-h: 0;
  --surface-s: 0%;
  --surface-l: 100%;
  --color-surface: hsl(var(--surface-h), var(--surface-s), var(--surface-l));

  --text-main: hsl(215, 25%, 15%);
  --text-muted: hsl(215, 15%, 45%);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

  /* Dimensions & Spacing */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--color-bg);
  color: var(--text-main);
  background-image:
    radial-gradient(at 0% 0%, hsla(210, 100%, 96%, 1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(190, 100%, 94%, 1) 0px, transparent 50%);
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  margin-top: 0;
  letter-spacing: -0.02em;
}

/* Header */
header {
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.brand {
  font-size: 1.5rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Auth Container */
.auth-container {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Cards & Glass */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-size: 0.95rem;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px hsla(var(--primary-h), 100%, 50%, 0.3);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 16px hsla(var(--primary-h), 100%, 50%, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

/* Inputs */
input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: white;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

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

th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #f1f5f9;
}

td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Typography Helpers */
.text-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Print Styles */
@media print {
  /* Hide non-printable elements */
  header,
  footer,
  .no-print,
  .btn,
  .admin-nav,
  .auth-container,
  .modal-overlay,
  .card .btn

  /* Hide buttons inside cards if any remain */
    {
    display: none !important;
  }

  /* Reset body and layout for print */
  body,
  .app-shell,
  main,
  #root {
    display: block !important;
    /* Critical for page breaks */
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    color: black !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  /* Ensure the report container takes full width and breaks correctly */
  .report-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 2cm !important;
    /* Standard print margin */
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    background: white !important;
    min-height: 90vh;
    /* Force it to take up space */
    position: relative;
  }

  /* Remove default card styling for print */
  .card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}