:root {
  color-scheme: light;
  font-family: 'Open Sans', Arial, sans-serif;
  --primary: #0f4d92;
  --primary-dark: #0a3b70;
  --accent: #23a36d;
  --surface: #ffffff;
  --border: #d7e1ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #edf2f8;
  color: #1e2e47;
}

.app-footer {
  text-align: center;
  padding: 0.9rem 1rem 1.2rem;
  color: #4f6381;
  font-size: 0.92rem;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 12px;
  border-top: 4px solid var(--primary);
  box-shadow: 0 6px 20px rgb(0 0 0 / 9%);
  padding: 1rem;
}

.container {
  max-width: 1240px;
  margin: 0 auto 2rem;
  padding: 1rem;
}

.top-strip {
  background: #12395f;
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 108px;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-text strong {
  font-size: 1.35rem;
}
.brand-text span {
  font-size: 1rem;
  opacity: 0.95;
}

.header-logo {
  height: 92px;
  width: auto;
  border-radius: 6px;
}

.top-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

#session-user { display: none; }

.main-nav {
  background: var(--primary);
  padding: 0.45rem 1rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.92rem;
}

.main-nav a.active,
.main-nav a:hover {
  background: rgb(255 255 255 / 16%);
}

.hero {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.card {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgb(23 40 72 / 9%);
  padding: 1rem;
  margin-bottom: 1rem;
  border-top: 3px solid #dbe7f7;
}

.subtitle,
.subtitle-dark,
.field-note,
.hint {
  margin: 0;
}

.subtitle { color: #dce9ff; }
.subtitle-dark,
.field-note,
.hint { color: #4f6381; }

.error-msg { color: #b41616; min-height: 1.2rem; }

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.quick-card {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  color: #1d3a64;
  background: #f7fbff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tile-card {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  padding: 0.7rem;
}

.quick-tile-image {
  width: 100%;
  max-width: 240px;
  height: auto;
  object-fit: contain;
}

.tile-card strong {
  font-size: 1.05rem;
  color: #173f73;
}
.tile-card span {
  font-size: 0.95rem;
  color: #284d83;
}

.quick-card:hover { border-color: var(--primary); }

.quick-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.grid-form,
.grid-3 {
  display: grid;
  gap: 0.7rem;
}

.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.single-col { grid-template-columns: 1fr; }
.grid-form > label { align-self: center; }
.grid-form > button { width: 100%; }

label { font-weight: 600; }

input,
select,
textarea,
button {
  font-size: 0.95rem;
  padding: 0.6rem;
  border-radius: 8px;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  width: 100%;
  background: #fbfdff;
}

button {
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:hover { background: var(--primary-dark); }
.button-secondary { background: var(--accent); }
.button-secondary:hover { background: #1c885c; }
.button-like {
  display: inline-block;
  text-decoration: none;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
}
.button-like:hover { background: var(--primary-dark); color: #fff; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.mini-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.mini-btn.danger {
  background: #ba1b1b;
}

.mini-btn.danger:hover {
  background: #991010;
}

.list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.35rem;
}

.table-wrap { overflow-x: auto; margin-bottom: 1rem; }

table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { border: 1px solid #dce4f0; padding: 0.45rem; text-align: left; vertical-align: top; }
th { background: #f0f5fd; color: #233755; }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

@media (max-width: 900px) {
  .grid-form,
  .grid-3,
  .quick-links { grid-template-columns: 1fr; }
}

@media print {
  .top-strip,
  .main-nav,
  .button-row,
  #logout-btn,
  #print-report-btn,
  form { display: none !important; }

  body { background: #fff; }
  .container { max-width: 100%; margin: 0; padding: 0; }
  .card, .hero { box-shadow: none; border: 1px solid #ddd; color: #000; background: #fff; }
}
