/**
 * Elimu ERP Design System: tokens and base component styles
 * Prefix: eerp-
 *
 * The school's own colours (Elimu ERP > Settings > School look) are added after this
 * file as an inline :root block that overrides the --eerp-brand* defaults below.
 * Every derived shade (hover, soft tint, readable text) is computed from those two colours.
 */

:root {
  /* School colours: defaults are navy and gold. */
  --eerp-brand: #0B1F4B;
  --eerp-brand-hover: #2D3E64;
  --eerp-brand-soft: #EBEDF1;
  --eerp-on-brand: #FFFFFF;
  --eerp-brand-accent: #C8A02A;
  --eerp-brand-accent-hover: #B08D25;
  --eerp-brand-accent-soft: #F7F1DF;
  --eerp-on-brand-accent: #0F172A;

  /* Older token names keep working and now follow the school's main colour. */
  --eerp-primary: var(--eerp-brand);
  --eerp-primary-hover: var(--eerp-brand-hover);

  /* Legacy teal accent, kept only so existing uses do not change. Use --eerp-brand-accent for the school accent. */
  --eerp-accent: #0d9488;
  --eerp-accent-hover: #0f766e;

  /* Meaning colours, the same for every school. */
  --eerp-success: #16a34a;
  --eerp-warning: #d97706;
  --eerp-danger: #dc2626;

  /* Attendance status colours, the same for every school. */
  --eerp-status-present: #2E8B57;
  --eerp-status-present-soft: #E5F3EB;
  --eerp-status-present-text: #1F6B41;
  --eerp-status-absent: #C0392B;
  --eerp-status-absent-soft: #FBE9E7;
  --eerp-status-absent-text: #A32D2D;
  --eerp-status-late: #D9922B;
  --eerp-status-late-soft: #FBF0DC;
  --eerp-status-late-text: #8A5A12;
  --eerp-status-excused: #3B7DD8;
  --eerp-status-excused-soft: #E5EEFA;
  --eerp-status-excused-text: #285AA3;

  /* Surfaces, text and borders. */
  --eerp-page-bg: #F4F6FA;
  --eerp-surface: #ffffff;
  --eerp-border: #E3E7EF;
  --eerp-text: #1B2440;
  --eerp-text-muted: #5A6480;
  --eerp-neutral-50: #f8fafc;
  --eerp-neutral-100: #f1f5f9;
  --eerp-neutral-200: #e2e8f0;
  --eerp-neutral-300: #cbd5e1;
  --eerp-neutral-600: #475569;
  --eerp-neutral-700: #334155;
  --eerp-neutral-900: #0f172a;

  /* Shape. */
  --eerp-radius-sm: 4px;
  --eerp-radius: 8px;
  --eerp-radius-lg: 12px;

  /* Type: plain system fonts for body text, a system serif for headings (no font files to download). */
  --eerp-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --eerp-font-display: Georgia, 'Times New Roman', Times, serif;

  /* Depth: soft and restrained. */
  --eerp-shadow-sm: 0 1px 2px 0 rgba(11, 31, 75, 0.06);
  --eerp-shadow: 0 4px 12px -2px rgba(11, 31, 75, 0.10), 0 2px 4px -2px rgba(11, 31, 75, 0.06);
  --eerp-shadow-lg: 0 12px 24px -6px rgba(11, 31, 75, 0.14), 0 4px 8px -4px rgba(11, 31, 75, 0.08);
}

/* Base wrapper */
.eerp-wrap {
  font-family: var(--eerp-font-body);
  color: var(--eerp-neutral-900);
  margin: 20px 20px 20px 0;
  max-width: 1200px;
}

.eerp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--eerp-border);
}

.eerp-header h1 {
  font-family: var(--eerp-font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--eerp-brand);
  margin: 0;
}

/* Small gold label above a heading, and a serif heading helper. */
.eerp-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--eerp-brand-accent-hover);
  margin-bottom: 4px;
}

.eerp-serif {
  font-family: var(--eerp-font-display);
  font-weight: 500;
  color: var(--eerp-brand);
}

/* Cards */
.eerp-card {
  background: var(--eerp-surface);
  border: 1px solid var(--eerp-border);
  border-radius: var(--eerp-radius-lg);
  box-shadow: var(--eerp-shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}

.eerp-card-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--eerp-neutral-100);
}

.eerp-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--eerp-neutral-900);
  margin: 0;
}

/* Badges */
.eerp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.eerp-badge-primary,
.eerp-badge-brand {
  background-color: var(--eerp-brand-soft);
  color: var(--eerp-brand);
}

.eerp-badge-accent {
  background-color: var(--eerp-brand-accent-soft);
  color: #6B5310;
}

.eerp-badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.eerp-badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.eerp-badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Buttons. Every state is set explicitly so a theme's own button hover and focus colours cannot override it. */
.eerp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--eerp-radius);
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.eerp-button:focus-visible {
  outline: 2px solid var(--eerp-brand-accent);
  outline-offset: 2px;
}

.eerp-button.eerp-button-primary,
.eerp-button.eerp-button-primary:hover,
.eerp-button.eerp-button-primary:focus,
.eerp-button.eerp-button-primary:active {
  color: var(--eerp-on-brand) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.eerp-button.eerp-button-primary {
  background-color: var(--eerp-brand) !important;
}
.eerp-button.eerp-button-primary:hover,
.eerp-button.eerp-button-primary:focus,
.eerp-button.eerp-button-primary:active {
  background-color: var(--eerp-brand-hover) !important;
}

.eerp-button.eerp-button-secondary,
.eerp-button.eerp-button-secondary:hover,
.eerp-button.eerp-button-secondary:focus,
.eerp-button.eerp-button-secondary:active {
  color: var(--eerp-brand) !important;
  border-color: var(--eerp-neutral-300) !important;
  box-shadow: none !important;
}
.eerp-button.eerp-button-secondary {
  background-color: #ffffff !important;
}
.eerp-button.eerp-button-secondary:hover,
.eerp-button.eerp-button-secondary:focus,
.eerp-button.eerp-button-secondary:active {
  background-color: var(--eerp-brand-soft) !important;
}

.eerp-button.eerp-button-accent,
.eerp-button.eerp-button-accent:hover,
.eerp-button.eerp-button-accent:focus,
.eerp-button.eerp-button-accent:active {
  color: var(--eerp-on-brand-accent) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.eerp-button.eerp-button-accent {
  background-color: var(--eerp-brand-accent) !important;
}
.eerp-button.eerp-button-accent:hover,
.eerp-button.eerp-button-accent:focus,
.eerp-button.eerp-button-accent:active {
  background-color: var(--eerp-brand-accent-hover) !important;
}

/* Form controls */
.eerp-form-group {
  margin-bottom: 16px;
}

.eerp-form-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--eerp-neutral-700);
}

.eerp-form-input,
.eerp-form-select,
.eerp-form-textarea {
  width: 100%;
  max-width: 480px;
  padding: 9px 12px;
  border: 1px solid var(--eerp-neutral-300);
  border-radius: var(--eerp-radius);
  background-color: #ffffff;
  font-size: 14px;
  color: var(--eerp-neutral-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.eerp-form-input:focus,
.eerp-form-select:focus,
.eerp-form-textarea:focus {
  outline: none;
  border-color: var(--eerp-brand);
  box-shadow: 0 0 0 2px var(--eerp-brand-soft);
}

/* Tables */
.eerp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.eerp-table th {
  background-color: var(--eerp-neutral-50);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--eerp-text-muted);
  border-bottom: 1px solid var(--eerp-border);
}

.eerp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--eerp-neutral-100);
  color: var(--eerp-neutral-700);
}

.eerp-table tr:hover td {
  background-color: var(--eerp-brand-soft);
}
