:root {
  --accent: #62BB46;
  --bg: #F3F3F3;
  --card: #ffffff;
  --muted: #8a8a90;
  --text: #1b1b1b;
  --dim: rgba(0,0,0,.10);
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial
}

body {
  min-height: 100vh;
  overflow: auto;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#appShell {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

#appShell.hidden { display: none; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap
}

h1 {
  font-size: 18px;
  margin: 0
}

h2 {
  margin: 8px 0 4px;
  font-size: 22px;
}

.login-card {
  width: min(460px, 100%);
  margin: clamp(32px, 12vh, 110px) auto 0;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .1);
}

.login-card .cfg {
  display: grid;
  grid-template-columns: 1fr;
  margin: 18px 0 0;
}

.login-copy {
  margin: 0;
  color: var(--muted);
}

.muted {
  color: var(--muted)
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #242429;
  min-height: 96px
}

.k {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em
}

.v {
  font-size: 28px;
  font-weight: 800;
  margin-top: 6px
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
  flex-wrap: wrap
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  border: 1px solid #242429;
  font-size: 12px
}

.bar {
  height: 8px;
  background: #2a2a2f;
  border-radius: 999px;
  overflow: hidden
}

.bar>div {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .6s ease
}

button {
  background: var(--accent);
  color: #09100f;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer
}

button:hover {
  filter: brightness(1.1)
}

button.secondary {
  background: #fff;
  border: 1px solid #242429;
  color: var(--text);
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
  filter: none;
}

button {
  transition: transform .06s ease, filter .15s ease;
}

button:active,
button.clicked {
  transform: translateY(1px);
}

input,
select,
textarea {
  border-radius: 10px;
  border: 1px solid #242429;
  background: var(--card);
  color: var(--text);
  padding: 8px 10px
}

.footer {
  margin-top: auto;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px
}

.cfg {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px
}

.err {
  color: #ff9393;
  font-size: 12px;
  margin-left: 8px
}

.ok {
  color: #62BB46
}

.sep {
  height: 1px;
  background: #242429;
  margin: 12px 0
}

.hidden {
  display: none
}

.right {
  display: flex;
  gap: 8px;
  align-items: center
}

.mini {
  font-size: 12px;
  color: var(--muted)
}

.app-title,
.module-nav,
.intrastat-heading,
.intrastat-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.environment-badge {
  border-radius: 999px;
  background: #ffcf40;
  color: #241b00;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 5px 9px;
}

.is-staging .top {
  border-top: 5px solid #ffcf40;
  padding-top: 10px;
}

.export-hub {
  width: 100%;
  margin: clamp(24px, 8vh, 80px) auto 0;
}

.hub-heading {
  text-align: center;
  margin-bottom: 24px;
}

.hub-heading p,
.intrastat-heading p {
  margin: 0;
  color: var(--muted);
}

.export-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.export-card {
  min-height: 220px;
  border: 1px solid #242429;
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  padding: 28px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, .07);
  transition: transform .15s ease, box-shadow .15s ease;
}

.export-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
}

.export-card strong { font-size: 24px; }
.export-card > span:last-child { color: var(--muted); font-size: 15px; }
.export-card-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  font-weight: 900;
}

.module-nav {
  justify-content: space-between;
  margin-bottom: 12px;
}

.module-nav a { color: var(--text); }
.intrastat-shell { display: grid; gap: 12px; }
.intrastat-shell.hidden { display: none; }
.intrastat-heading { justify-content: space-between; }
.intrastat-heading h2 { margin-top: 4px; }
.intrastat-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.intrastat-company-control .brand-switch { color: var(--text); }
.intrastat-controls .intrastat-test-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #242429;
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.intrastat-test-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  border: 1px solid #242429;
  border-radius: 12px;
  background: var(--card);
  padding: 12px;
  display: grid;
  gap: 5px;
}

.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 20px; }
.stat-error strong { color: #b42318; }
.stat-warning strong { color: #9a6700; }
.intrastat-results { min-width: 0; }
.intrastat-table-scroll { overflow: auto; max-height: 44vh; }
.intrastat-table-scroll table { min-width: 1450px; }
.intrastat-table-scroll th { position: sticky; top: 0; background: #fff; z-index: 1; }
.row-error { background: #fff1f0; }
.row-warning { background: #fff9e8; }
.row-ok { background: #f0faed; }
.status-cell { white-space: nowrap; font-weight: 700; }
.issue-trigger {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 50%;
  font-weight: 900;
  line-height: 1;
}
.issue-trigger-error { background: #b42318; border-color: #b42318; color: #fff; }
.issue-trigger-warning { background: #f5b700; border-color: #9a6700; color: #202020; }
.odoo-document-cell { text-align: center; }
.odoo-document-link,
.odoo-document-link:hover,
.odoo-document-link:focus { display: inline-block; font-size: 19px; text-decoration: none !important; line-height: 1; }
.empty-cell { text-align: center; color: var(--muted); padding: 28px; }

.intrastat-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 12px;
}

.issues-list { max-height: 280px; overflow: auto; margin-top: 10px; }
.issue { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--dim); }
.issue strong { flex: 0 0 100px; font-size: 11px; }
.issue-error strong { color: #b42318; }
.issue-warning strong { color: #9a6700; }
.diagnostics summary { cursor: pointer; font-weight: 700; }
.diagnostics pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; font-size: 11px; }

@media (max-width: 900px) {
  .export-cards,
  .intrastat-bottom-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px
}

th,
td {
  border-bottom: 1px solid #242429;
  padding: 6px 8px;
  text-align: left;
  font-size: 13px
}

.t-right {
  text-align: right
}

.doc-number-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.doc-kind-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .045em;
  white-space: nowrap;
}

.doc-kind-badge--invoice {
  color: #4f5451;
  background: #eef0ef;
  border-color: #d5d9d7;
}

.doc-kind-badge--refund {
  color: #9d291f;
  background: #fff0ee;
  border-color: #efb9b3;
}

.doc-export-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid #7db98d;
  border-radius: 999px;
  color: #185c2c;
  background: #e9f8ed;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .035em;
  white-space: nowrap;
}

.pill {
  background: var(--card);
  border-radius: 999px;
  border: 1px solid #242429;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text)
}

.sign {
  opacity: .85
}

#exportStatus a,
#exportStatus a:visited {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

#exportStatus a:hover {
  text-decoration: underline;
  filter: brightness(1.05);
}

.card > .row .right{ gap:8px; }      
.card > .row{ align-items:center; } 
.card > .row + table{ margin-top:10px; }

/* vizuálna odozva kliknutia */
button.clicked {
  transform: translateY(1px);
}

button {
  transition: transform .06s ease, filter .15s ease;
}

/* vnorený scroll len pre zoznam faktúr */
.table-scroll {
  height: 420px;
  min-height: 260px;
  overflow: auto;
  border-top: 1px solid #242429;
}

.export-actions {
  margin-bottom: 10px;
}

.selection-toolbar {
  padding: 4px 6px 12px;
}

.empty-state {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.empty-state-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, white);
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.empty-state.hidden,
.table-stats.hidden {
  display: none;
}

.table-scroll table {
  margin-top: 0
}

/* aby sa medzera nezdvojovala */

/* sticky head v rámci vnoreného scrollu */
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}
#tbl thead th[data-sort]{user-select:none;cursor:pointer}
#tbl thead th[data-sort]:hover{text-decoration:underline}

body.brand-h {
  --accent: #62BB46;
}

body.brand-g {
  --accent: #ff8a00;
}

.brand-switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid #242429;
  border-radius: 999px;
  padding: 4px;
}

.brand-switch-label {
  font-size: 12px;
  color: var(--muted);
  padding-left: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.brand-switch {
  display: flex;
  gap: 4px;
}

.brand-option {
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  opacity: .6;
}

.brand-option:hover {
  filter: none;
  opacity: 1;
  background: rgba(0,0,0,.05);
}

.brand-option.active {
  background: var(--accent);
  color: #09100f;
  opacity: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
}

.table-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}

.stat-pill {
  background: var(--card);
  color: var(--text);
  border: 1px solid #242429;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.stat-pill strong {
  font-size: 13px;
}

.stat-pill.accent {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

@media (max-width: 640px) {
  .brand-switch-wrap {
    width: 100%;
    justify-content: space-between;
    border-radius: 16px;
  }

  .brand-switch {
    flex: 1;
  }

  .brand-option {
    flex: 1;
    justify-content: center;
  }
}
