/* Global CSS for ROA Reports */

/* CSS Custom Properties for consistent theming */
:root {
  /* Primary Colors */
  --roa-primary: #2563eb;
  --roa-primary-hover: #1d4ed8;
  --roa-primary-light: #dbeafe;

  /* Success Colors */
  --roa-success: #16a34a;
  --roa-success-light: #dcfce7;

  /* Warning Colors */
  --roa-warning: #ca8a04;
  --roa-warning-light: #fef3c7;

  /* Danger Colors */
  --roa-danger: #dc2626;
  --roa-danger-light: #fee2e2;

  /* Neutral Colors */
  --roa-gray-50: #f9fafb;
  --roa-gray-100: #f3f4f6;
  --roa-gray-200: #e5e7eb;
  --roa-gray-300: #d1d5db;
  --roa-gray-400: #9ca3af;
  --roa-gray-500: #6b7280;
  --roa-gray-600: #4b5563;
  --roa-gray-700: #374151;
  --roa-gray-800: #1f2937;
  --roa-gray-900: #111827;

  /* Spacing */
  --roa-spacing-xs: 0.25rem;
  --roa-spacing-sm: 0.5rem;
  --roa-spacing-md: 1rem;
  --roa-spacing-lg: 1.5rem;
  --roa-spacing-xl: 2rem;
  --roa-spacing-2xl: 3rem;

  /* Border Radius */
  --roa-radius-sm: 0.375rem;
  --roa-radius-md: 0.5rem;
  --roa-radius-lg: 0.75rem;
  --roa-radius-xl: 1rem;

  /* Shadows */
  --roa-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --roa-shadow-md:
    0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --roa-shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --roa-shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --roa-transition-fast: 150ms ease-in-out;
  --roa-transition-normal: 300ms ease-in-out;
  --roa-transition-slow: 500ms ease-in-out;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    sans-serif;
}

body {
  margin: 0;
  background-color: var(--surface-ground, var(--roa-gray-50));
  color: var(--text-color, var(--roa-gray-900));
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */

/* Spacing Utilities */
.m-0 {
  margin: 0;
}
.m-1 {
  margin: var(--roa-spacing-xs);
}
.m-2 {
  margin: var(--roa-spacing-sm);
}
.m-3 {
  margin: var(--roa-spacing-md);
}
.m-4 {
  margin: var(--roa-spacing-lg);
}
.m-5 {
  margin: var(--roa-spacing-xl);
}

.p-0 {
  padding: 0;
}
.p-1 {
  padding: var(--roa-spacing-xs);
}
.p-2 {
  padding: var(--roa-spacing-sm);
}
.p-3 {
  padding: var(--roa-spacing-md);
}
.p-4 {
  padding: var(--roa-spacing-lg);
}
.p-5 {
  padding: var(--roa-spacing-xl);
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: var(--roa-spacing-xs);
}
.mt-2 {
  margin-top: var(--roa-spacing-sm);
}
.mt-3 {
  margin-top: var(--roa-spacing-md);
}
.mt-4 {
  margin-top: var(--roa-spacing-lg);
}
.mt-5 {
  margin-top: var(--roa-spacing-xl);
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: var(--roa-spacing-xs);
}
.mb-2 {
  margin-bottom: var(--roa-spacing-sm);
}
.mb-3 {
  margin-bottom: var(--roa-spacing-md);
}
.mb-4 {
  margin-bottom: var(--roa-spacing-lg);
}
.mb-5 {
  margin-bottom: var(--roa-spacing-xl);
}

/* Text Utilities */
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.font-normal {
  font-weight: 400;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}

.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary-color, var(--roa-primary));
}
.text-success {
  color: var(--green-600, var(--roa-success));
}
.text-warning {
  color: var(--yellow-600, var(--roa-warning));
}
.text-danger {
  color: var(--red-600, var(--roa-danger));
}
.text-muted {
  color: var(--text-color-secondary, var(--roa-gray-500));
}

/* Display Utilities */
.hidden {
  display: none;
}
.block {
  display: block;
}
.inline {
  display: inline;
}
.inline-block {
  display: inline-block;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.grid {
  display: grid;
}

/* Flexbox Utilities */
.flex-row {
  flex-direction: row;
}
.flex-col {
  flex-direction: column;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.items-end {
  align-items: flex-end;
}
.justify-start {
  justify-content: flex-start;
}
.justify-center {
  justify-content: center;
}
.justify-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.justify-around {
  justify-content: space-around;
}

.flex-1 {
  flex: 1 1 0%;
}
.flex-auto {
  flex: 1 1 auto;
}
.flex-none {
  flex: none;
}

.gap-1 {
  gap: var(--roa-spacing-xs);
}
.gap-2 {
  gap: var(--roa-spacing-sm);
}
.gap-3 {
  gap: var(--roa-spacing-md);
}
.gap-4 {
  gap: var(--roa-spacing-lg);
}
.gap-5 {
  gap: var(--roa-spacing-xl);
}

/* Width and Height Utilities */
.w-full {
  width: 100%;
}
.w-auto {
  width: auto;
}
.h-full {
  height: 100%;
}
.h-auto {
  height: auto;
}

/* Border Utilities */
.border {
  border: 1px solid var(--surface-border, var(--roa-gray-200));
}
.border-0 {
  border: 0;
}
.border-t {
  border-top: 1px solid var(--surface-border, var(--roa-gray-200));
}
.border-b {
  border-bottom: 1px solid var(--surface-border, var(--roa-gray-200));
}
.border-l {
  border-left: 1px solid var(--surface-border, var(--roa-gray-200));
}
.border-r {
  border-right: 1px solid var(--surface-border, var(--roa-gray-200));
}

.rounded {
  border-radius: var(--roa-radius-md);
}
.rounded-sm {
  border-radius: var(--roa-radius-sm);
}
.rounded-lg {
  border-radius: var(--roa-radius-lg);
}
.rounded-xl {
  border-radius: var(--roa-radius-xl);
}
.rounded-full {
  border-radius: 9999px;
}

/* Shadow Utilities */
.shadow-sm {
  box-shadow: var(--roa-shadow-sm);
}
.shadow-md {
  box-shadow: var(--roa-shadow-md);
}
.shadow-lg {
  box-shadow: var(--roa-shadow-lg);
}
.shadow-xl {
  box-shadow: var(--roa-shadow-xl);
}
.shadow-none {
  box-shadow: none;
}

/* Background Utilities */
.bg-white {
  background-color: #ffffff;
}
.bg-gray-50 {
  background-color: var(--roa-gray-50);
}
.bg-gray-100 {
  background-color: var(--roa-gray-100);
}
.bg-primary {
  background-color: var(--primary-color, var(--roa-primary));
}
.bg-success {
  background-color: var(--green-100, var(--roa-success-light));
}
.bg-warning {
  background-color: var(--yellow-100, var(--roa-warning-light));
}
.bg-danger {
  background-color: var(--red-100, var(--roa-danger-light));
}

/* Hover Effects */
.hover-lift {
  transition:
    transform var(--roa-transition-fast),
    box-shadow var(--roa-transition-fast);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--roa-shadow-lg);
}

/* Focus States */
.focus-ring:focus {
  outline: 2px solid var(--primary-color, var(--roa-primary));
  outline-offset: 2px;
}

/* Animation Utilities */
.transition-all {
  transition: all var(--roa-transition-normal);
}

.transition-colors {
  transition:
    color var(--roa-transition-normal),
    background-color var(--roa-transition-normal),
    border-color var(--roa-transition-normal);
}

.transition-opacity {
  transition: opacity var(--roa-transition-normal);
}

.transition-transform {
  transition: transform var(--roa-transition-normal);
}

/* Custom ROA Classes */
.roa-card {
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--surface-border, var(--roa-gray-200));
  border-radius: var(--roa-radius-lg);
  box-shadow: var(--roa-shadow-sm);
  padding: var(--roa-spacing-lg);
}

.roa-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--roa-spacing-sm);
  padding: var(--roa-spacing-sm) var(--roa-spacing-lg);
  border: none;
  border-radius: var(--roa-radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
  transition: all var(--roa-transition-fast);
  background-color: var(--primary-color, var(--roa-primary));
  color: white;
}

.roa-button:hover {
  background-color: var(--primary-color-dark, var(--roa-primary-hover));
  transform: translateY(-1px);
  box-shadow: var(--roa-shadow-md);
}

.roa-input {
  width: 100%;
  padding: var(--roa-spacing-sm) var(--roa-spacing-md);
  border: 1px solid var(--surface-border, var(--roa-gray-200));
  border-radius: var(--roa-radius-md);
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition:
    border-color var(--roa-transition-fast),
    box-shadow var(--roa-transition-fast);
}

.roa-input:focus {
  outline: none;
  border-color: var(--primary-color, var(--roa-primary));
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Invoice Status Classes */
.status-paid {
  background-color: var(--green-100, var(--roa-success-light));
  color: var(--green-800, var(--roa-success));
  padding: var(--roa-spacing-xs) var(--roa-spacing-sm);
  border-radius: var(--roa-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-overdue {
  background-color: var(--red-100, var(--roa-danger-light));
  color: var(--red-800, var(--roa-danger));
  padding: var(--roa-spacing-xs) var(--roa-spacing-sm);
  border-radius: var(--roa-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pending {
  background-color: var(--yellow-100, var(--roa-warning-light));
  color: var(--yellow-800, var(--roa-warning));
  padding: var(--roa-spacing-xs) var(--roa-spacing-sm);
  border-radius: var(--roa-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Responsive Design */
@media (max-width: 640px) {
  .sm\:hidden {
    display: none;
  }
  .sm\:block {
    display: block;
  }
  .sm\:flex {
    display: flex;
  }
  .sm\:grid {
    display: grid;
  }

  .sm\:flex-col {
    flex-direction: column;
  }
  .sm\:items-center {
    align-items: center;
  }
  .sm\:justify-center {
    justify-content: center;
  }

  .sm\:text-center {
    text-align: center;
  }
  .sm\:text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .sm\:p-2 {
    padding: var(--roa-spacing-sm);
  }
  .sm\:m-2 {
    margin: var(--roa-spacing-sm);
  }
}

@media (max-width: 768px) {
  .md\:hidden {
    display: none;
  }
  .md\:block {
    display: block;
  }
  .md\:flex {
    display: flex;
  }
  .md\:grid {
    display: grid;
  }

  .md\:flex-col {
    flex-direction: column;
  }
  .md\:items-center {
    align-items: center;
  }
  .md\:justify-center {
    justify-content: center;
  }

  .md\:text-center {
    text-align: center;
  }
  .md\:text-base {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .md\:p-3 {
    padding: var(--roa-spacing-md);
  }
  .md\:m-3 {
    margin: var(--roa-spacing-md);
  }
}

@media (max-width: 1024px) {
  .lg\:hidden {
    display: none;
  }
  .lg\:block {
    display: block;
  }
  .lg\:flex {
    display: flex;
  }
  .lg\:grid {
    display: grid;
  }

  .lg\:flex-row {
    flex-direction: row;
  }
  .lg\:items-start {
    align-items: flex-start;
  }
  .lg\:justify-start {
    justify-content: flex-start;
  }

  .lg\:text-left {
    text-align: left;
  }
  .lg\:text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }

  .lg\:p-4 {
    padding: var(--roa-spacing-lg);
  }
  .lg\:m-4 {
    margin: var(--roa-spacing-lg);
  }
}

/* Print Styles */
@media print {
  .print\:hidden {
    display: none !important;
  }

  .print\:block {
    display: block !important;
  }

  * {
    color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Dark Mode Support (if implemented in the future) */
@media (prefers-color-scheme: dark) {
  .dark\:bg-gray-800 {
    background-color: var(--roa-gray-800);
  }

  .dark\:text-white {
    color: #ffffff;
  }

  .dark\:border-gray-600 {
    border-color: var(--roa-gray-600);
  }
}
