/* =========================================
   BASE — design tokens (:root), reset, default look of form fields, scrollbars
   Loaded first on every page (resources/views/partials/styles.blade.php)
   ========================================= */

:root {
  --primary: #1E6FD9;
  --primary-dark: #1558b0;
  --primary-light: #EBF3FF;
  --primary-lighter: #F5F9FF;
  --accent: #00B4D8;
  --accent-light: #E0F7FD;
  --success: #22c55e;
  --success-light: #DCFCE7;
  --warning: #f59e0b;
  --warning-light: #FEF3C7;
  --danger: #ef4444;
  --danger-light: #FEE2E2;
  --purple: #8b5cf6;
  --purple-light: #EDE9FE;

  --bg: #F0F4FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFB;
  --border: #E2E8F3;
  --border-color: #E2E8F3;
  --border-focus: #1E6FD9;
  --text-primary: #0F1B2E;
  --text-secondary: #5A6B82;
  --text-muted: #9BAAB8;

  --sidebar-width: 240px;
  --sidebar-collapsed: 68px;
  --topbar-height: 64px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(15,27,46,0.06), 0 1px 2px rgba(15,27,46,0.04);
  --shadow: 0 4px 16px rgba(15,27,46,0.08), 0 1px 4px rgba(15,27,46,0.05);
  --shadow-lg: 0 12px 40px rgba(15,27,46,0.14), 0 4px 12px rgba(15,27,46,0.06);
  --shadow-blue: 0 4px 20px rgba(30,111,217,0.25);

  --transition: all 0.2s ease;
  --transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid #e5e7eb; }

html {
  font-size: 14px; scroll-behavior: smooth;
  line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4;
  font-family: Figtree, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: Figtree, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  line-height: inherit;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================================
   BASE ELEMENTS
   Plain elements are unstyled here and every look comes from a class.
   ========================================= */
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
small { font-size: 80%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sub { bottom: -0.25em; }
sup { top: -0.5em; }
abbr:where([title]) { text-decoration: underline dotted; }
code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; font-size: 1em; }
hr { height: 0; color: inherit; border-top-width: 1px; }
ol, ul, menu { list-style: none; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
img, svg, video, canvas, audio, iframe, embed, object { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
[hidden]:where(:not([hidden="until-found"])) { display: none; }
summary { display: list-item; }
progress { vertical-align: baseline; }

button, input, optgroup, select, textarea {
  font-family: inherit; font-feature-settings: inherit; font-variation-settings: inherit;
  font-size: 100%; font-weight: inherit; line-height: inherit; letter-spacing: inherit; color: inherit;
}
button, select { text-transform: none; }
button, input:where([type='button'], [type='reset'], [type='submit']) { -webkit-appearance: button; background-color: transparent; background-image: none; }
button, [role="button"] { cursor: pointer; }
:disabled { cursor: default; }
::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; }
:-moz-focusring { outline: auto; }
:-moz-ui-invalid { box-shadow: none; }

/* Text fields, selects, checkboxes and radios share one look; .form-input etc. below build on it */
[type='text'], input:where(:not([type])), [type='email'], [type='url'], [type='password'], [type='number'], [type='date'],
[type='datetime-local'], [type='month'], [type='search'], [type='tel'], [type='time'], [type='week'], [multiple], textarea, select {
  appearance: none; background-color: #fff;
  border-color: #6b7280; border-width: 1px; border-radius: 0;
  padding: 0.5rem 0.75rem; font-size: 1rem; line-height: 1.5rem;
}
[type='text']:focus, input:where(:not([type])):focus, [type='email']:focus, [type='url']:focus, [type='password']:focus,
[type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus,
[type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {
  outline: 2px solid transparent; outline-offset: 2px;
  border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb;
}
[type='search'] { -webkit-appearance: textfield; appearance: textfield; outline-offset: -2px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #6b7280; opacity: 1; }
::-webkit-datetime-edit-fields-wrapper { padding: 0; }
::-webkit-date-and-time-value { min-height: 1.5em; text-align: inherit; }
::-webkit-datetime-edit { display: inline-flex; }
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field,
::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { padding-top: 0; padding-bottom: 0; }
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em;
  padding-right: 2.5rem; print-color-adjust: exact;
}
[multiple], [size]:where(select:not([size="1"])) {
  background-image: initial; background-position: initial; background-repeat: unset; background-size: initial;
  padding-right: 0.75rem; print-color-adjust: unset;
}
[type='checkbox'], [type='radio'] {
  appearance: none; padding: 0; print-color-adjust: exact;
  display: inline-block; vertical-align: middle; background-origin: border-box; user-select: none; flex-shrink: 0;
  height: 1rem; width: 1rem; color: #2563eb; background-color: #fff;
  border-color: #6b7280; border-width: 1px;
}
[type='checkbox'] { border-radius: 0; }
[type='radio'] { border-radius: 100%; }
[type='checkbox']:focus, [type='radio']:focus {
  outline: 2px solid transparent; outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;
}
[type='checkbox']:checked, [type='radio']:checked, [type='checkbox']:indeterminate {
  border-color: transparent; background-color: currentColor;
  background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
}
[type='checkbox']:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e"); }
[type='radio']:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); }
[type='checkbox']:indeterminate { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e"); }
[type='checkbox']:checked:hover, [type='checkbox']:checked:focus, [type='radio']:checked:hover, [type='radio']:checked:focus,
[type='checkbox']:indeterminate:hover, [type='checkbox']:indeterminate:focus { border-color: transparent; background-color: currentColor; }
[type='file'] { background: unset; border-color: inherit; border-width: 0; border-radius: 0; padding: 0; font-size: unset; line-height: inherit; }
[type='file']:focus { outline: 1px solid ButtonText; outline: 1px auto -webkit-focus-ring-color; }
.form-input, .form-select, .form-textarea { appearance: none; }
