:root {
  /* Palette */
  --bg: #f4f7f9;
  --surface: #ffffff;
  --ink: #17262e;
  --muted: #5b6b75;
  --line: #dee7eb;
  --accent: #0b7285;
  --accent-dark: #095e6e;
  --accent-soft: #e3f3f6;

  --ok-ink: #15803d;
  --ok-bg: #dcfce7;
  --warn-ink: #b45309;
  --warn-bg: #fef3c7;
  --err-ink: #b91c1c;
  --err-bg: #fee2e2;

  /* Type */
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Public Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 38, 46, 0.06), 0 8px 24px rgba(23, 38, 46, 0.05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.material-symbols-rounded {
  font-variation-settings: "opsz" 24, "wght" 400, "FILL" 0, "GRAD" 0;
  font-size: 20px;
  line-height: 1;
}

/* ---------- Brand ---------- */

.brand-mark {
  display: flex;
  align-items: center;
  gap: 1px;
}

.brand-icon {
  font-size: 26px;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-primary:focus-visible,
.icon-btn:focus-visible,
input:focus-visible,
select:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.6; cursor: wait; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  border: none;
  background: none;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
}

.icon-btn:hover { color: var(--ink); }

/* ---------- Fields ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.field-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-icon { color: var(--muted); flex: none; }

.field-control input,
.field-control select, textarea {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 0;
  font: 500 0.95rem var(--font-body);
  color: var(--ink);
}

    .field-control input:focus,
    .field-control select:focus, textarea:focus {
        outline: none;
    }

.field-control input::placeholder { color: #9aabb4; }

.field-file input[type="file"] {
  padding: 10px 0;
  font-size: 0.88rem;
  color: var(--muted);
}
textarea{height:40px;}

.field-file input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font: 600 0.82rem var(--font-body);
  color: var(--ink);
  cursor: pointer;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 12px 0;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font: 600 0.78rem var(--font-body);
  letter-spacing: 0.02em;
}

.badge-ok    { background: var(--ok-bg);   color: var(--ok-ink); }
.badge-warn  { background: var(--warn-bg); color: var(--warn-ink); }
.badge-err   { background: var(--err-bg);  color: var(--err-ink); }
.badge-plain { background: var(--accent-soft); color: var(--accent-dark); }

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-body { background: var(--bg); }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.login-inner {
  width: min(440px, 100%);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-logo { justify-content: center; }

.login-form {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-title { font-size: 1.6rem; font-weight: 700; }

.form-hint { margin: -10px 0 0; color: var(--muted); font-size: 0.9rem; }

/* API response readout (signature element) */

.api-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
  overflow: hidden;
}

.api-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.api-result-title {
  font: 500 0.78rem var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.api-result-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.api-result-grid dt { color: var(--muted); }

.api-result-grid dd { margin: 0; word-break: break-all; }

.api-result-grid pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font: inherit;
}

/* =====================================================
   DASHBOARD PAGE
   ===================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px;
  cursor: pointer;
}

.menu-toggle .material-symbols-rounded { font-size: 24px; }

.menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-logout { color: var(--err-ink); }
.nav-logout:hover { background: var(--err-bg); color: var(--err-ink); }

.app-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
}

/* ---------- Panels (sections) ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-head { margin-bottom: 22px; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
}

.panel-title .material-symbols-rounded {
  color: var(--accent);
  font-size: 24px;
}

.panel-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Forms in panels ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: end;
}

.field-checkbox { justify-content: end; }

.form-actions {
  display: flex;
  align-items: end;
}

/* ---------- Report table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 760px;
}

.report-table th {
  text-align: left;
  font: 600 0.76rem var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f8fbfc;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.report-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.report-table tbody tr:last-child td { border-bottom: none; }

.report-table tbody tr:hover { background: #f8fbfc; }

.cell-mono { font-family: var(--font-mono); font-size: 0.82rem; }

.cell-title { font-weight: 600; }

.cell-msg {
  max-width: 320px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px !important;
}

/* ---------- Footer ---------- */

.app-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 860px) {
  /* Login: form sits at the top of the page, not vertically centered */
  .login-page {
    align-items: flex-start;
    padding: 40px 16px;
  }

  .login-form { padding: 24px 18px; }

  /* --- Dashboard: hamburger + vertical menu --- */

  .menu-toggle { display: inline-flex; }

  .app-header { padding: 12px 16px; flex-wrap: nowrap; }

  .app-nav {
    display: none;             /* hidden until toggled */
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow: visible;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 16px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .app-nav.is-open { display: flex; }

  .nav-link {
    width: 100%;
    padding: 12px 14px;
  }
  .app-main { padding: 16px; gap: 16px; }
  .panel { padding: 20px 16px; }
  .app-footer {
    padding: 14px 16px;
    white-space: normal;   /* allow wrapping to a second line */
    overflow: visible;
    text-overflow: clip;
    line-height: 1.6;
  }
}
.dis{
    display:none;
}
.alert {
    color: var(--err-ink);
    background-color: #fbd8d8;
    border: solid 1px #ca6c6c;
}
.success {
    color: var(--ok-ink);
    background-color: #deffea;
    border: solid 1px #1e9b4c;
}
#resMessage {
    display: block !important;
    box-sizing: unset !important;
    text-align: center;
    padding: 8px;
    margin-top: 15px;
    border-radius: 5px;
}
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
