/* =========================================================
   GAR – COMPONENTS (shared)
   cards, tabs, buttons, tables, badges, notices, stepper,
   delivery cards, actions, wallet boxes
   ========================================================= */

/* ---------- TABS ---------- */
.gar-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 18px;
}
.gar-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--gar-text);
    background: rgba(255, 255, 255, 0.9);
    line-height: 1;
    box-shadow: var(--gar-shadow-sm);
}
.gar-tab:hover {
    background: var(--gar-soft-hover);
    border-color: rgba(0, 0, 0, 0.16);
}
.gar-tab.is-active {
    font-weight: 800;
    background: #fff;
    border-color: rgba(0, 0, 0, 0.16);
}

/* ---------- CARDS ---------- */
.gar-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--gar-radius-lg);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--gar-shadow-sm);
}
.gar-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.gar-card__title {
    margin: 0 0 6px;
    font-size: 20px;
    letter-spacing: -0.01em;
}
.gar-card__muted {
    margin: 0;
    color: var(--gar-muted);
    font-size: 14px;
    opacity: 0.8;
}

/* checkbox alignment inside cards */
.gar-card input[type='checkbox'] {
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    vertical-align: middle;
}

/* ---------- BUTTONS – ONE SYSTEM ---------- */
/* Scope to GAR APP only (avoid theme-wide collisions) */
.gar-app .gar-btn,
.gar-app input[type='submit'],
.gar-app .button,
.gar-app a.button,
.gar-app .wp-element-button,
.gar-app .woocommerce a.button,
.gar-app .woocommerce button.button,
.gar-app .woocommerce input.button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);

    background: var(--gar-primary);
    color: #fff;

    font: inherit;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;

    transition: background 0.18s ease, border-color 0.18s ease, transform 0.05s ease,
        box-shadow 0.18s ease;
    box-shadow: var(--gar-shadow-sm);
}

.gar-app .gar-btn:hover,
.gar-app input[type='submit']:hover,
.gar-app .button:hover,
.gar-app a.button:hover,
.gar-app .wp-element-button:hover,
.gar-app .woocommerce a.button:hover,
.gar-app .woocommerce button.button:hover,
.gar-app .woocommerce input.button:hover {
    background: var(--gar-primary-hover);
    border-color: rgba(0, 0, 0, 0.25);
    box-shadow: var(--gar-shadow-md);
}

.gar-app .gar-btn:active,
.gar-app input[type='submit']:active {
    transform: translateY(1px);
}


/* ---------- HELP BUTTON (icon) ---------- */
.gar-help{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  color: var(--gar-primary);
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}



/* Secondary */
.gar-btn--secondary {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--gar-text) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: var(--gar-shadow-sm);
}
.gar-btn--secondary:hover {
    background: var(--gar-soft-hover) !important;
    color: var(--gar-text) !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
}

/* ---------- TABLES ---------- */
.gar-table-wrap {
    position: relative;
    overflow: auto;
    margin-top: 12px;

    /* tylko delikatna linia u góry, bez bocznych ramek */
    border-radius: 0;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}


.gar-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}
.gar-table th,
.gar-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}
.gar-table thead th {
    background: #f9fafb;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.65);
}
.gar-empty {
    padding: 18px;
    text-align: center;
    opacity: 0.75;
}

/* ---------- WALLET / BOX ---------- */
.gar-wallet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 12px;
    margin-top: 12px;
}
.gar-box {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}
.gar-box__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 900;
}
.gar-box__muted {
    margin: 0 0 10px;
    color: var(--gar-muted);
    font-size: 13px;
}
.gar-metric__label {
    font-size: 12px;
    opacity: 0.7;
}
.gar-metric__value {
    font-size: 26px;
    font-weight: 900;
    margin-top: 2px;
}


/* ---------- ACTIONS COLUMN + DROPDOWN (DESKTOP TABLE) ---------- */

/* komórka tabeli z akcjami */
.gar-table td.gar-actions {
  display: table-cell;
  vertical-align: middle;
  text-align: right;
  white-space: nowrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* wrapper wewnątrz komórki */
.gar-actions-wrap {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* wrapper dla dropdownu */
.gar-actions-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
}

/* icon button (opcjonalnie, jeśli gdzieś użyjesz) */
.gar-btn--icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  justify-content: center;
}



/* gdy menu jest otwarte – nie przycinamy absolutnych dzieci */
.gar-table-wrap.is-actions-open {
  overflow: visible !important;
}

/* panel dropdown */
.gar-actions-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  padding: 6px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  z-index: 99999;
  display: none;
}

.gar-actions-menu.is-open .gar-actions-dropdown {
  display: block;
}

/* upewnij się, że dropdown jest nad kartą */
.gar-card {
  position: relative;
  z-index: 1;
}

.gar-actions-menu.is-open {
  z-index: 50;
}

/* pozycje w dropdownie */
.gar-actions-dropdown-item,
.gar-actions-dropdown-item[type="submit"] {
  display: flex;
  width: 100%;
  padding: 10px 12px !important;
  border-radius: 10px;
  border: 0 !important;
  background: transparent !important;
  font-size: 13px;
  font-weight: 700 !important;
  color: var(--gar-text) !important;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  box-shadow: none !important;
}

.gar-actions-dropdown-item:hover {
  background: #f3f4f6 !important;
  color: var(--gar-text) !important;
}

/* danger */
.gar-actions-dropdown-item--danger {
  color: var(--gar-danger) !important;
  margin-top: 4px;
  padding-top: 10px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.gar-actions-dropdown-item--danger:hover {
  background: #fee2e2 !important;
}







/* ---------- NOTICE / MISC ---------- */
.gar-notice {
    padding: 12px;
    border-radius: var(--gar-radius-lg);
    border: 1px solid rgba(47, 95, 191, 0.22);
    margin: 12px 0;
    background: rgba(47, 95, 191, 0.06);
    box-shadow: var(--gar-shadow-sm);
}
.gar-notice strong {
    font-weight: 900;
}

.gar-notice--error {
    background: rgba(255, 0, 0, 0.05);
    border-color: rgba(255, 0, 0, 0.18);
}

.gar-empty-box {
    padding: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-top: 12px;
}

/* ---------- SECTIONS (optional wrappers) ---------- */
.gar-section {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--gar-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--gar-shadow-sm);
}
.gar-section__title {
    font-size: 14px;
    font-weight: 900;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.gar-section__sub {
    margin: 0 0 12px;
    font-size: 13px;
    opacity: 0.75;
}

.gar-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 18px 0;
}

/* ---------- STEPPER ---------- */
.gar-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;

    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--gar-shadow-sm);
    margin: 14px 0 18px;
}
.gar-stepper__label {
    font-weight: 900;
    opacity: 0.8;
    margin-right: 6px;
}
.gar-stepper__step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(243, 244, 246, 0.6);
    cursor: default;
    user-select: none;
}
.gar-stepper__step.is-active {
    background: rgba(47, 95, 191, 0.1);
    border-color: rgba(47, 95, 191, 0.25);
}
.gar-stepper__num {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 900;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.gar-stepper__step.is-active .gar-stepper__num {
    background: var(--gar-primary);
    border-color: rgba(0, 0, 0, 0.1);
    color: #fff;
}
.gar-stepper__text {
    font-weight: 800;
    opacity: 0.9;
}

/* Wizard actions (desktop default) */
.gar-wizard-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* ---------- DELIVERY CARDS (only checked gets blue) ---------- */
.gar-delivery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.gar-delivery-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.gar-delivery-card--alt {
    background: #fff !important;
}

.gar-delivery-card:has(input:checked) {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
}

.gar-delivery-card input {
    margin-top: 3px;
    flex: 0 0 auto;
    accent-color: var(--gar-primary);
}
.gar-delivery-card__body strong {
    display: block;
    font-weight: 900;
    letter-spacing: 0.2px;
}
.gar-delivery-card__body .gar-hint {
    margin-top: 6px;
    display: block;
}

/* =========================================================
   GAR – HARD OVERRIDE for wizard buttons (fix FOUC / theme override)
   ========================================================= */

/* PRIMARY (Next / Submit) */
.gar-app .gar-form .gar-wizard-actions .gar-btn:not(.gar-btn--secondary),
.gar-app .gar-form .gar-wizard-actions button.gar-btn:not(.gar-btn--secondary){
    background: var(--gar-primary) !important;
    color: #fff !important;
    border: 1px solid transparent !important;
    box-shadow: var(--gar-shadow-sm) !important;
}
.gar-app .gar-form .gar-wizard-actions .gar-btn:not(.gar-btn--secondary):hover{
    background: var(--gar-primary-hover) !important;
}

/* SECONDARY (Back) */
.gar-app .gar-form .gar-wizard-actions .gar-btn--secondary,
.gar-app .gar-form .gar-wizard-actions button.gar-btn--secondary{
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--gar-text) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: var(--gar-shadow-sm) !important;
}
.gar-app .gar-form .gar-wizard-actions .gar-btn--secondary:hover{
    background: var(--gar-soft-hover) !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
}

/* =========================================================
   DESKTOP FIX: Step 1 – Next button always on the right
   ========================================================= */
@media (min-width: 769px) {
    .gar-wizard-actions {
        justify-content: flex-end;
    }

    /* jeśli kiedyś Back się pojawi – wraca normalny układ */
    .gar-wizard-actions #gar_prev_step {
        margin-right: auto;
    }
}

/* ---------- REVIEW FORM: INSTRUCTIONS CHECKLIST ---------- */
.gar-instructions-box {
    border: 2px solid #fecdd3;
    background: #fff7ed;
    border-radius: 14px;
    padding: 14px;
}

.gar-instructions-box--ok {
    border-color: #86efac;
    background: #ecfdf5;
}

.gar-instructions-box--ok .gar-instructions-warning {
    display: none !important;
}

.gar-instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.gar-instruction-item:hover {
    border-color: rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.gar-instruction-check {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #2563eb;
    cursor: pointer;
}

.gar-instruction-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.gar-instruction-check:checked + .gar-instruction-text {
    opacity: 0.85;
    text-decoration: line-through;
}

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

/* ---------- Campaign form normal modal shared: INSTRUCTIONS CHECKLIST ---------- */

.gar-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
  }

  .gar-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
  }

  .gar-modal__panel {
    position: relative;
    max-width: 560px;
    margin: 10vh auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    overflow: hidden;
  }

  .gar-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
  }

  .gar-modal__title {
    font-weight: 800;
    font-size: 18px;
    color: #111827;
  }

  .gar-modal__sub {
    margin-top: 4px;
    color: rgba(17, 24, 39, .72);
    font-size: 13px
  }

  .gar-modal__x {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: rgba(17, 24, 39, .7);
    padding: 0 4px;
  }

  .gar-modal__body {
    padding: 16px 18px;
  }

  .gar-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid rgba(0, 0, 0, .08);
  }

  /* ---------- TABLE COLUMN ALIGN HELPERS ---------- */
.gar-table .gar-col-center{
  text-align: center;
}

/* Ghost (neutral) */
.gar-app .gar-btn--ghost{
  background: rgba(255,255,255,.92) !important;
  color: var(--gar-text) !important;
  border-color: rgba(0,0,0,.12) !important;
  box-shadow: var(--gar-shadow-sm);
}
.gar-app .gar-btn--ghost:hover{
  background: var(--gar-soft-hover) !important;
  color: var(--gar-text) !important;
  border-color: rgba(0,0,0,.18) !important;
}

/* Primary outline */
.gar-app .gar-btn--primary-outline{
  background: #fff !important;
  color: var(--gar-primary) !important;
  border-color: rgba(47,95,191,.35) !important;
}
.gar-app .gar-btn--primary-outline:hover{
  background: rgba(47,95,191,.06) !important;
  border-color: rgba(47,95,191,.45) !important;
}

/* Danger */
.gar-app .gar-btn--danger{
  background: var(--gar-danger) !important;
  color: #fff !important;
  border-color: var(--gar-danger) !important;
}
.gar-app .gar-btn--danger:hover{
  background: var(--gar-danger-hover) !important;
  border-color: var(--gar-danger-hover) !important;
}

.gar-app .gar-btn--primary{
  background: var(--gar-primary) !important;
  color:#fff !important;
  border-color: transparent !important;
}
.gar-app .gar-btn--primary:hover{
  background: var(--gar-primary-hover) !important;
}

.gar-app .gar-btn--sm{
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}

/* ===== FIX: tester dashboard buttons outside .gar-app ===== */

.gar-wrap .gar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    line-height: 1; /* całe „pill” jest jednym boxem */
}

.gar-wrap a.gar-btn {
    text-decoration: none;
}

/* Jeśli motyw dorzuca pseudo-element nad przyciskiem,
   wyłączamy mu przechwytywanie kliknięć. */
.gar-wrap a.gar-btn::before,
.gar-wrap a.gar-btn::after {
    pointer-events: none !important;
}



/* DESKTOP SAFETY: hide mobile campaign cards */
@media (min-width: 769px) {
  .gar-company-dashboard .gar-campaign-list.gar-only-mobile {
    display: none !important;
  }
}