/* ── Base styles (normalize + global resets) ───────────────────────────────── */
/* NOTE: theme + component CSS are loaded directly via index.html <link> tags  */

/* ── modern-normalize inline ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.15; -webkit-text-size-adjust: 100%; tab-size: 4; }
body { margin: 0; font-family: system-ui, sans-serif; }
hr { height: 0; color: inherit; }
abbr[title] { text-decoration: underline dotted; }
b, strong { font-weight: bolder; }
code, kbd, samp, pre { font-family: ui-monospace, monospace; font-size: 1em; }
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; }
table { text-indent: 0; border-color: inherit; }
button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; }
button, select { text-transform: none; }
button, [type="button"], [type="reset"], [type="submit"] { -webkit-appearance: button; }
::-moz-focus-inner { border-style: none; padding: 0; }
:-moz-focusring { outline: 1px dotted ButtonText; }
:-moz-ui-invalid { box-shadow: none; }
legend { padding: 0; }
progress { vertical-align: baseline; }
::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; }
[type="search"] { -webkit-appearance: textfield; outline-offset: -2px; }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; }
summary { display: list-item; }

html {
  font-family: var(--font-family, "Roboto Flex", system-ui, sans-serif);
  font-size: 16px;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, figure, p, ol, ul { margin: 0; }
ol[role="list"], ul[role="list"] { list-style: none; padding-inline: 0; }
h1, h2, h3, h4, h5 { font-size: inherit; font-weight: inherit; }
img { display: block; max-inline-size: 100%; }

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-app, #f3f4f6);
}

.login-card {
  background: var(--bg-card, #fff);
  border-radius: var(--radius-lg, 0.5rem);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.07));
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.login-logo .material-symbols-outlined {
  font-size: 2rem;
  color: var(--primary, #3b82f6);
}

.login-logo__name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  letter-spacing: -0.02em;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md, 0.375rem);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-error, #dc2626);
}

.login-error .material-symbols-outlined { font-size: 1rem; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.login-field__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-label, #4b5563);
}

.login-field__input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: var(--radius-md, 0.375rem);
  background: var(--bg-input, #fff);
  color: var(--text-primary, #111827);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.login-field__input:focus {
  outline: none;
  border-color: var(--border-focus, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.login-btn {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md, 0.375rem);
  background: var(--primary, #3b82f6);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.25rem;
}

.login-btn:hover { background: var(--primary-hover, #2563eb); }

.login-dev-hint {
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 0.75rem;
  text-align: center;
}

.login-dev-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: 1px dashed var(--border, #d1d5db);
  border-radius: var(--radius-md, 0.375rem);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.login-dev-btn:hover {
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
}

.login-dev-btn .material-symbols-outlined { font-size: 1rem; }

/* ── Home page ─────────────────────────────────────────────────────────────── */
.home-page {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.home-hero__icon {
  font-size: 2.5rem;
  color: var(--primary, #3b82f6);
}

.home-hero__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0;
}

.home-hero__sub {
  font-size: 1rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.home-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 1.5rem 1rem;
  border-radius: var(--radius-lg, 0.5rem);
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.10));
}

.home-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.12));
  filter: brightness(1.07);
}

.home-tile__icon { font-size: 2rem; }
.home-tile__label { text-align: center; line-height: 1.3; }

/* Colour variants */
.tile--blue   { background: #3b82f6; }
.tile--green  { background: #10b981; }
.tile--orange { background: #f59e0b; }
.tile--purple { background: #8b5cf6; }
.tile--teal   { background: #14b8a6; }
.tile--red    { background: #ef4444; }


tfoot {
  background-color: #4a524a;
  color: #fff;
  font-weight: 700;
}

td:first-child {
  min-width: 150px;
  max-width: 300px;
  word-wrap: break-word;
}

td:last-child {
  word-break: break-word;
}

th, td {
  padding: 12px;
  text-align: left;
  border: 1px solid #ddd;
}

@media (max-width: 768px) {
  th, td {
    font-size: 0.8rem;
    padding: 8px;
  }
}

h1, h2, h3, h4, h5, figure, p, ol, ul {
  margin: 0;
}

ol[role="list"], ul[role="list"] {
  list-style: none;
  padding-inline: 0;
}

h1, h2, h3, h4, h5 {
  font-size: inherit;
  font-weight: inherit;
}

img {
  display: block;
  max-inline-size: 100%;
}

body {
  background-color: var(--background-color);
  color: var(--secondary-color);
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Roboto Flex", sans-serif;
}

.main {
  display: flex;
}

.contents {
  margin-left: calc(var(--sidebar-width, 20vw) + 5px);
  padding: var(--spacing-lg);
  flex-grow: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  align-content: flex-start;
  transition: margin-left 0.3s ease;
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-label, #4b5563);
}

[class*="col-"] {
  flex-grow: 1;
  min-height: 0;
  margin: var(--spacing-sm);
}

.col-12 { width: 100%; flex-grow: 12; }
.col-11 { width: 89%; flex-grow: 11; }
.col-10 { width: 82%; flex-grow: 10; }
.col-9  { width: 73%; flex-grow: 9; }
.col-8  { width: 64%; flex-grow: 8; }
.col-7  { width: 56%; flex-grow: 7; }
.col-6  { width: 47%; flex-grow: 6; }
.col-5  { width: 39%; flex-grow: 5; }
.col-4  { width: 31%; flex-grow: 4; }
.col-3  { width: 22%; flex-grow: 3; }
.col-2  { width: 13%; flex-grow: 2; }
.col-1  { width: 6%;  flex-grow: 1; }

.page-container {
  padding: var(--spacing-lg);
  max-width: 1280px;
  margin: 0 auto;
}

.page_title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
}

.form-fields {
  display: flex;
  flex-wrap: wrap;
  margin: calc(-1 * var(--spacing-md));
  background-color: #fff;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  padding: var(--spacing-lg);
  animation: fadeIn 0.3s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Dynamic Form */
.dynamic-form { width: 100%; }
.dynamic-form__error { display: flex; align-items: center; gap: 8px; color: var(--error-color); padding: var(--spacing-md); }
.dynamic-form__separator { display: flex; align-items: center; width: 100%; margin: var(--spacing-sm) 0; }
.separator-line { display: flex; align-items: center; width: 100%; border-top: 2px solid #D92831; padding-top: 6px; }
.separator-label { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: #D92831; text-transform: uppercase; letter-spacing: 0.05em; }

/* Buttons — defined in app_shell.css; no overrides here */
