/* Shared UI quality layer. Loaded after page-local styles so the visual rules stay
   consistent across login, registration, workspace and standalone project views. */
:root {
  --ui-navy: #102a43;
  --ui-navy-deep: #0b2036;
  --ui-blue: #1769d8;
  --ui-blue-dark: #1259b6;
  --ui-ink: #172b4d;
  --ui-muted: #64748b;
  --ui-line: #dfe6ef;
  --ui-surface: #ffffff;
  --ui-bg: #f4f7fb;
  --ui-focus: rgba(23,105,216,.18);
  --ui-shadow: 0 12px 32px rgba(16,42,67,.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--ui-bg); }
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--ui-blue); }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; }

/* Login and installer registration */
body:has(> .layout) { background: var(--ui-navy); }
body > .layout {
  width: min(100%, 560px);
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(3,19,37,.28);
}
body > .layout .auth-header {
  min-height: 74px;
  padding: 0 28px;
  background: #fbfcfe;
}
body > .layout .auth-header h2 { color: var(--ui-ink); font-size: 21px; letter-spacing: -.2px; }
body > .layout .auth-header { justify-content: space-between; gap: 16px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.language-picker select { min-height: 34px; padding: 0 28px 0 10px; border: 1px solid #cfd9e7; border-radius: 7px; background: #fff; color: #304562; font: inherit; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body > .layout .form { padding: 25px 28px 28px; gap: 18px 20px; }
body > .layout .form label { color: #3d506b; font-size: 13px; font-weight: 650; }
body > .layout .form input {
  min-height: 44px;
  border-color: #cfd9e7;
  border-radius: 9px;
  color: var(--ui-ink);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
body > .layout .form input:hover { border-color: #aebfd4; }
body > .layout .form input:focus { border-color: #5e9bea; box-shadow: 0 0 0 4px var(--ui-focus); }
body > .layout .form input::placeholder { color: #93a4b9; }
body > .layout .primary, body > .layout .secondary { min-height: 44px; border-radius: 9px; }
body > .layout .primary { background: var(--ui-blue); box-shadow: 0 5px 12px rgba(23,105,216,.22); }
body > .layout .primary:hover { background: var(--ui-blue-dark); }
body > .layout .secondary:hover { border-color: #9db9dc; background: #f7faff; }
body > .layout .message { border-radius: 9px; }

/* Shared workspace surfaces */
body:not(:has(> .layout)) { background: linear-gradient(135deg, #f8fafc 0%, #f2f6fb 100%); }
.app { min-height: 100dvh; }
aside { box-shadow: 4px 0 18px rgba(8,28,50,.12); }
.brand { user-select: none; }
nav button { min-height: 42px; }
nav button:focus-visible { outline-color: rgba(255,255,255,.45); }
.topbar { position: sticky; top: 0; z-index: 7; }
.content { width: 100%; }
.headline h1 { letter-spacing: -.45px; }
.headline p { color: #687991; }
.primary, .secondary { min-height: 40px; transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .16s; }
.primary:active, .secondary:active { transform: translateY(1px); }
.secondary { color: #304562; }
.card, .stat, .priority-panel { overflow: hidden; }
.cardhead { background: linear-gradient(180deg, #fff 0%, #fcfdff 100%); }
table { font-variant-numeric: tabular-nums; }
th { white-space: nowrap; }
td { color: #304562; }
tbody tr:focus-within { background: #f5f9ff; }
.caseid { letter-spacing: .1px; }
.tag { line-height: 1.35; }
.notice { line-height: 1.6; }
.info > div { transition: border-color .16s, box-shadow .16s; }
.info > div:hover { border-color: #c9d9eb; box-shadow: 0 3px 10px rgba(24,65,109,.05); }
.form input, .form select, .form textarea, .filters input, .filters select, .modalbody textarea {
  min-height: 42px;
  color: var(--ui-ink);
}
.form select, .filters select { cursor: pointer; }
input[type="checkbox"] {
  width: 18px; height: 18px; margin: 0;
  appearance: none; vertical-align: -4px;
  border: 1.5px solid #9fb1c7; border-radius: 5px; background: #fff;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
input[type="checkbox"]:checked { border-color: var(--ui-blue); background: var(--ui-blue); box-shadow: inset 0 0 0 3px #fff; }
input[type="checkbox"]:hover { border-color: var(--ui-blue); }
.upload { transition: border-color .16s, background .16s, box-shadow .16s; }
.upload:focus-within { border-color: #73a8e7; box-shadow: 0 0 0 3px var(--ui-focus); }
.filechip { border: 1px solid rgba(8,127,73,.08); }
.modal { backdrop-filter: blur(3px); }
.modalbox { max-width: 680px; border: 1px solid #e6ebf3; }
.modalbox header h2 { color: var(--ui-ink); }
.close { width: 36px; height: 36px; border-radius: 8px; }
.close:hover { color: #223f65; background: #f0f4f9; }
.toast { max-width: min(460px, calc(100vw - 28px)); line-height: 1.45; }

/* Standalone project page */
body > .bar { box-shadow: 0 1px 8px rgba(16,42,67,.06); }
body > .bar a { font-weight: 650; text-decoration: none; }
body > .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
body > .wrap { width: min(100%, 1100px); }
body > .wrap .card { box-shadow: var(--ui-shadow); border-radius: 14px; }
body > .wrap .grid div { border: 1px solid #e7edf5; background: #fbfdff; }
body > .wrap th { background: #f7f9fc; color: #64748b; font-weight: 650; }
body > .wrap .file { min-height: 38px; display: inline-flex; align-items: center; border-radius: 8px; }

@media (max-width: 700px) {
  body > .layout { width: min(100%, 560px); border-radius: 14px; }
  body > .layout .auth-header { min-height: 66px; padding: 0 20px; }
  body > .layout .auth-header h2 { font-size: 19px; }
  .header-actions { gap: 10px; }
  .language-picker select { min-height: 32px; padding-left: 8px; }
  body > .layout .form { padding: 21px 20px 22px; gap: 15px; }
  body > .layout .form input { min-height: 46px; font-size: 16px; }
  body > .layout .actions { grid-column: 1 / -1; }
  body > .layout .primary, body > .layout .secondary { min-height: 46px; }
  .content { padding-bottom: 32px; }
  .headline h1 { font-size: 21px; }
  .cardhead { gap: 10px; }
  .cardhead h2 { font-size: 16px; }
  .modalbox { border-color: #dce5f0; }
  body > .wrap { margin-top: 18px; }
  body > .wrap .card { padding: 16px; }
  body > .wrap .grid { grid-template-columns: 1fr; }
  body > .wrap table { min-width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
