/* Tools base */
.tool-container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 6.5rem 0 3rem; /* ruimte onder fixed site header */
}

.tool-header {
  margin: 0 0 1.25rem;
}

.tool-title {
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

.tool-subtitle {
  margin: .5rem 0 0;
  opacity: .78;
}

.tool-panel {
  padding: 1.25rem;
  border-radius: 18px;
  background: var(--color-bg-panel, rgba(255,255,255,0.55));
  border: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 1rem;
}

:root[data-theme="dark"] .tool-panel {
  background: rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.10);
}

.tool-panel-compact {
  padding: 1rem;
}

.tool-section-title {
  margin: 0 0 .75rem;
  font-size: 1rem;
  opacity: .85;
}

.tool-grid {
  display: grid;
  gap: 1rem;
}

.tool-grid-2 {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 860px) {
  .tool-grid-2 { grid-template-columns: 1fr; }
}

.tool-field {}

.tool-label {
  display: block;
  font-size: .9rem;
  margin: 0 0 .4rem;
  opacity: .85;
}

.tool-hint {
  margin-top: .4rem;
  font-size: .82rem;
  opacity: .65;
}

.tool-input {
  width: 100%;
  height: 44px;
  padding: 0 .9rem;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1.6px solid rgba(0,0,0,0.16);
  background: var(--color-bg-secondary, rgba(255,255,255,0.65));
  color: inherit;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.03);
}

:root[data-theme="dark"] .tool-input {
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.22);
}

.tool-input::placeholder {
  opacity: .75;
}

.tool-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

/* Date picker icon should match theme */
input[type="date"] { color-scheme: light dark; }
/* Chrome/Edge: calendar icon color is inconsistent; make it readable per theme.
   Light: indicator is often white -> invert to dark.
   Dark: indicator is often light already -> no invert.
*/
:root:not([data-theme="dark"]) input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: .85;
}
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0);
  opacity: .85;
}

.tool-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Subtle template download link (SEPA tool) */
.tool-template-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  opacity: .85;
  cursor: pointer;
  user-select: none;
}
.tool-template-link svg { width: 18px; height: 18px; }
.tool-template-link:hover { opacity: 1; color: var(--color-accent); }
.tool-template-link:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 4px; border-radius: 10px; }

/* Mobiel: upload/dropzone netjes onder elkaar */
@media (max-width: 520px) {
  .tool-file {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .tool-file .btn {
    width: 100%;
    justify-content: center;
  }
  .tool-file__name {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }
}

.tool-btn {
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.55);
  color: inherit;
  cursor: pointer;
}

:root[data-theme="dark"] .tool-btn {
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.14);
}

.tool-btn-primary {
  border-color: rgba(0,0,0,0.10);
  background: var(--color-accent);
  color: #fff;
}

.tool-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.tool-status {
  margin-top: .9rem;
  font-size: .9rem;
  opacity: .9;
}

.tool-status-info {}
.tool-status-success { opacity: 1; }
.tool-status-warn { opacity: 1; }
.tool-status-error { opacity: 1; }

/* ========== TOOL PAGE (brepp stijl) ========== */
.tool-page {
  padding-bottom: 2.5rem;
}

.tool-section {
  margin-top: 1rem;
}

.tool-section.hidden {
  display: none;
}

.tool-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0 .65rem;
}

.tool-h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tool-subtle,
.tool-muted {
  opacity: .72;
  font-size: .92rem;
}

.tool-list {
  margin: 0;
  padding-left: 1.05rem;
}

/* Label/waarde blok (label iets dikker dan value) */
.tool-kv {
  display: grid;
  gap: .55rem;
}

.tool-kv-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: .9rem;
  align-items: baseline;
}

@media (max-width: 640px) {
  .tool-kv-row {
    grid-template-columns: 1fr;
    gap: .2rem;
  }
}

.tool-kv-label {
  font-weight: 600;
  opacity: .85;
}

.tool-kv-value {
  font-weight: 400;
}

/* Overzicht split */
.tool-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tool-split-stacked {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .tool-split {
    grid-template-columns: 1fr;
  }
}

.tool-card-title {
  margin: 0 0 .65rem;
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-accent);
  opacity: 1;
}

/* Secondary actieknoppen (match met brepp glass look) */
.tool-btn-secondary {
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.55);
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.tool-btn-secondary:hover {
  transform: translateY(-1px);
}

:root[data-theme="dark"] .tool-btn-secondary {
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.14);
}

.tool-btn-secondary:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* CTA blok onderaan tool */
.tool-cta {
  margin-top: 1.4rem;
}

.tool-cta-inner {
  padding: 1.25rem;
  border-radius: 18px;
  background: var(--color-bg-panel, rgba(255,255,255,0.55));
  border: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .tool-cta-inner {
  background: rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.10);
}

.tool-result {
  margin-top: .25rem;
}

.tool-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .tool-cards { grid-template-columns: 1fr; }
}

.tool-card {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.45);
}

:root[data-theme="dark"] .tool-card {
  background: rgba(0,0,0,0.20);
  border-color: rgba(255,255,255,0.12);
}

.tool-card-title {
  font-size: .95rem;
  margin: 0 0 .75rem;
  color: var(--color-accent);
  opacity: 1;
}

.tool-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: .75rem;
  padding: .35rem 0;
}

@media (max-width: 520px) {
  .tool-row { grid-template-columns: 1fr; }
}

.tool-row-label {
  opacity: .65;
  font-size: .9rem;
}

.tool-row-value {
  font-size: .95rem;
}

.tool-pre {
  margin: 0;
  padding: .75rem;
  border-radius: 12px;
  overflow: auto;
  background: rgba(0,0,0,0.06);
}

:root[data-theme="dark"] .tool-pre {
  background: rgba(255,255,255,0.06);
}

/* FIX: .tool-row wordt op de tool-page gebruikt voor input+button.
   In jouw tools.css is .tool-row nu een label/value grid (160px/1fr),
   daardoor gaat de Check-knop raar staan. Deze override fixe dat. */

.tool-panel .tool-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0;
  width: 100%;
}

/* KvK-check input + button: beter op mobiel */
@media (max-width: 520px) {
  .tool-panel .tool-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: .6rem !important;
  }

  /* Tools met meerdere velden per rij (zoals SEPA): zorg dat alle children 100% breed zijn */
  .tool-panel .tool-row > div,
  .tool-panel .tool-row > span {
    width: 100% !important;
    flex: 1 1 auto !important;
  }

  .tool-panel .tool-row .tool-input {
    width: 100%;
  }

  .tool-panel .tool-row .btn {
    width: 100%;
    justify-content: center;
  }
}

.tool-panel .tool-row .tool-input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

/* Mobiel: inputveld (KvK-nummer) net zo hoog als select/button en nooit buiten het panel */
.tool-panel .tool-row input.tool-input:not([type="date"]) {
  height: auto;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 16px; /* voorkomt iOS zoom + geeft “volwassen” control-hoogte */
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
}

/* Date input: keep native calendar affordance */
.tool-panel .tool-row input.tool-input[type="date"]{
  -webkit-appearance: auto;
  appearance: auto;
}

.tool-panel .tool-select{
  min-height: 48px;
  font-size: 16px;
}

.tool-panel .tool-row .tool-container .btn,
.tool-panel .tool-row .tool-btn {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  white-space: nowrap;
}

/* KvK-check: bron/licentie (CC BY 4.0) */
.tool-attribution {
  margin-top: 10px;
  line-height: 1.4;
  font-size: 0.9rem;
}


.tool-attribution a {
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ========================================================
   Tools UI polish (consistent cards, spacing, tables)
   ======================================================== */

.tool-panel,
.tool-card{
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--ui-shadow-sm);
}

.tool-panel{ padding: 1.35rem; }

.tool-actions .tool-container .btn,
.tool-actions button{
  border-radius: var(--radius-md);
}

.tool-grid{
  gap: 1rem;
}

.kvk-grid{
  gap: .65rem .9rem;
}

.kvk-item{
  padding: .55rem .7rem;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
}

.kvk-item .label{
  font-weight: 700;
  opacity: .85;
}

.kvk-item .value{
  opacity: .92;
}

/* Tables */
.tool-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-lg);
}

.tool-table th, .tool-table td{
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--ui-border);
}

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





/* ---- KvK tool: metrics + badges (left aligned, strict) ---- */
.tool-metric{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.tool-metric__value{
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.tool-badge{
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  font-size: .78rem;
  line-height: 1.2;
  white-space: nowrap;
  opacity: .95;
}

.tool-badge.good{
  background: rgba(34, 197, 94, .10);
  border-color: rgba(34, 197, 94, .25);
}

.tool-badge.warn{
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .28);
}

.tool-badge.bad{
  background: rgba(239, 68, 68, .10);
  border-color: rgba(239, 68, 68, .25);
}

button.is-disabled{
  cursor: not-allowed;
  opacity: .7;
}

button.is-disabled,
button:disabled{
  filter: grayscale(25%);
}

/* KvK-check: primary button duidelijk disabled */
.tool-panel .btn.primary:disabled{
  background: rgba(0,0,0,0.18) !important;
  border-color: rgba(0,0,0,0.18) !important;
  color: rgba(255,255,255,0.9) !important;
}

:root[data-theme="dark"] .tool-panel .btn.primary:disabled{
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.85) !important;
}

/* Gebruiksteller (KvK-check) */
.tool-usage{
  margin-top: .35rem;
}

.tool-usage__pill{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  background: rgba(255,255,255,0.45);
  font-size: .85rem;
  line-height: 1.2;
  opacity: .9;
}

:root[data-theme="dark"] .tool-usage__pill{
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.14);
}

#kvkUsageCount{
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* CTA list */
.tool-cta-list{
  margin: .9rem 0 1.1rem;
  padding-left: 1.1rem;
}

.tool-cta-list li{
  margin: .35rem 0;
}

.tool-spacer{ height: 1rem; }


/* keep badge snug */
.tool-metric .tool-badge { margin-left: 0; }



/* Tool mode selector (KvK-check) */
.tool-mode {
  display: flex;
  gap: .65rem;
  align-items: center;
  margin: .65rem 0 .35rem;
}

.tool-mode-label {
  white-space: nowrap;
}

.tool-select {
  max-width: 220px;
  padding-right: 2.25rem;
}
