@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-success: var(--success);
  --color-success-foreground: var(--success-foreground);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-info: var(--info);
  --color-info-foreground: var(--info-foreground);
  --color-critical: var(--critical);
  --color-critical-foreground: var(--critical-foreground);
  --color-neutral: var(--neutral);
  --color-neutral-foreground: var(--neutral-foreground);
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
  --success: oklch(0.62 0.16 152);
  --success-foreground: oklch(0.985 0 0);
  --warning: oklch(0.76 0.15 82);
  --warning-foreground: oklch(0.22 0.02 80);
  --info: oklch(0.61 0.16 252);
  --info-foreground: oklch(0.985 0 0);
  --critical: oklch(0.62 0.21 27);
  --critical-foreground: oklch(0.985 0 0);
  --neutral: oklch(0.58 0 0);
  --neutral-foreground: oklch(0.985 0 0);
  --avatar-0: oklch(0.85 0.08 240);
  --avatar-1: oklch(0.88 0.1 340);
  --avatar-2: oklch(0.85 0.07 180);
  --avatar-3: oklch(0.9 0.09 40);
  --avatar-4: oklch(0.87 0.08 300);
  --avatar-5: oklch(0.85 0.08 150);
  --avatar-6: oklch(0.87 0.08 200);
  --avatar-7: oklch(0.88 0.09 10);
  --avatar-8: oklch(0.92 0.08 80);
  --avatar-9: oklch(0.86 0.09 270);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 15%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
  --success: oklch(0.72 0.16 152);
  --success-foreground: oklch(0.18 0.02 152);
  --warning: oklch(0.8 0.15 82);
  --warning-foreground: oklch(0.22 0.02 80);
  --info: oklch(0.76 0.14 252);
  --info-foreground: oklch(0.18 0.03 252);
  --critical: oklch(0.74 0.17 27);
  --critical-foreground: oklch(0.2 0.03 27);
  --neutral: oklch(0.72 0 0);
  --neutral-foreground: oklch(0.16 0 0);
  --avatar-0: oklch(0.35 0.12 240);
  --avatar-1: oklch(0.38 0.14 340);
  --avatar-2: oklch(0.35 0.11 180);
  --avatar-3: oklch(0.38 0.13 40);
  --avatar-4: oklch(0.36 0.12 300);
  --avatar-5: oklch(0.35 0.11 150);
  --avatar-6: oklch(0.37 0.12 200);
  --avatar-7: oklch(0.38 0.14 10);
  --avatar-8: oklch(0.4 0.11 80);
  --avatar-9: oklch(0.36 0.13 270);
}

a,
button {
  cursor: pointer;
}

input {
  cursor: text;
}

a[aria-disabled="true"],
button[aria-disabled="true"],
button:disabled,
input[aria-disabled="true"],
input:disabled {
  cursor: not-allowed;
}

input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"] {
  position: relative;
}

.dark ::-webkit-calendar-picker-indicator {
  filter: invert(1);
  position: absolute;
  right: 0.75rem;
}

/* Hide numeric input spinners for a cleaner UI */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
  }
}

/* Ensure Office iframe previews fill the document viewer container. */
#react-doc-viewer {
  min-height: 0;
}

#proxy-renderer {
  flex: 1;
  min-height: 0;
}

#msdoc-renderer {
  height: 100%;
  min-height: 0;
}

#msdoc-iframe {
  display: block;
  height: 100%;
  width: 100%;
}

@media print {
  header,
  nav,
  aside,
  .no-print,
  button,
  .ra-notification,
  .ra-sidebar {
    display: none !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
  }

  /* Ensure background colors are printed */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Card styling for print */
  .card {
    border: none !important;
    box-shadow: none !important;
  }

  body {
    background-color: white !important;
  }

  /* Force vertical layout for details (remove horizontal gaps) */
  .flex.gap-8 {
    display: block !important;
  }

  .mt-2.mb-2 {
    margin: 0 !important;
  }
}
/* Force Light Mode for PDF Export */
.pdf-export,
.pdf-export * {
  --background: oklch(1 0 0) !important;
  --foreground: oklch(0.145 0 0) !important;
  --card: oklch(1 0 0) !important;
  --card-foreground: oklch(0.145 0 0) !important;
  --primary: oklch(0.205 0 0) !important;
  --primary-foreground: oklch(0.985 0 0) !important;
  --muted: oklch(0.97 0 0) !important;
  --muted-foreground: oklch(0.556 0 0) !important;
  --accent: oklch(0.97 0 0) !important;
  --accent-foreground: oklch(0.205 0 0) !important;
  --border: oklch(0.922 0 0) !important;
  --input: oklch(0.922 0 0) !important;
  --ring: oklch(0.708 0 0) !important;
  color: oklch(0.145 0 0) !important;
  border-color: oklch(0.922 0 0) !important;
}

.pdf-export {
  background-color: white !important;
}
