/* Small toolbar layout for search + button */
.fwo-coupons-toolbar .fwc-toolbar-row{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content: space-between;
}

.fwo-coupons-toolbar .fwc-btn{
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
}

.fwo-coupons-toolbar .fwc-btn-primary{
  background: var(--main);
  color: #fff;
  border: 0;
}

@media (max-width: 640px){
  .fwo-coupons-toolbar .fwc-toolbar-row{
    flex-direction: column;
    align-items: stretch;
  }
}

/* Coupons table column sizing */
.fwo-coupons .fwo-table th:nth-child(1),
.fwo-coupons .fwo-table td:nth-child(1){ width: 90px !important; text-align:center !important; }

.fwo-coupons .fwo-table th:nth-child(2),
.fwo-coupons .fwo-table td:nth-child(2){ width: 325px !important; max-width: 325px !important; text-align:center !important; text-transform: uppercase; font-size: 14px; background: var(--main); color: white; }

.fwo-coupons .fwo-table th:nth-child(3),
.fwo-coupons .fwo-table td:nth-child(3){ width: 130px !important; text-align:center !important;}

.fwo-coupons .fwo-table th:nth-child(4),
.fwo-coupons .fwo-table td:nth-child(4){ width: 170px !important; text-align:center !important; }

.fwo-coupons .fwo-table th:nth-child(5),
.fwo-coupons .fwo-table td:nth-child(5){ width: auto !important; font-size:15px!important; line-height: 1.3; }

/* Copy button */
.fwo-coupons .fwc-copy {
background: transparent;
border: 1px solid var(--main);
border-radius: 3px;
padding: 6px 10px;
cursor: pointer;
line-height: 1;
color: var(--main);
text-transform: uppercase;
font-weight: 600;
}

/* Modal header */
.fwc-modal-head{
  padding:18px 22px 10px;
  border-bottom:1px solid rgba(0,0,0,0.08);
}

.fwc-modal-head h2 {
margin: 0;
font-size: 15px!important;
font-weight: 601!important;
text-transform: uppercase;
letter-spacing: 0.5px!important;
color: var(--main);
}

.fwc-modal-sub {
margin-top: -13px;
opacity: 1;
font-size: 14px;
font-weight: 700;
color: gray;
text-transform: capitalize;
}

/* Form layout inside modal */
.fwc-form{
  padding:18px 22px 22px;
}

.fwc-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px 18px;
}

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

.fwc-field label{
  font-size:13px;
  text-transform:uppercase;
  font-weight:700;
  opacity:.8;
}

.fwc-field input,
.fwc-field select,
.fwc-field textarea{
  padding:10px 12px !important;
  border-radius:3px;
  border:1px solid rgba(0,0,0,0.18);
  font-size:15px;
  width: 100%;
  box-sizing: border-box;
  height: 37px;
color: black!important;
font-weight: 400;
}
}

.fwc-description textarea{
  min-height: 120px !important;
  height: 120px !important;
  resize: vertical;
  line-height: 1.4;
  white-space: pre-wrap;
}

.fwc-field-full{
  grid-column:1 / -1;
}

.fwc-readonly{
  padding:10px 12px;
  border-radius:6px;
  background:rgba(0,0,0,0.04);
  border:1px solid rgba(0,0,0,0.08);
  font-weight:700;
}

.fwc-check{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:15px;
  font-weight:600;
  text-transform:none;
}

.fwc-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:16px;
}

.fwc-form-msg{
  margin-top:12px;
  font-size:14px;
  font-weight:600;
  opacity:.9;
}

.fwc-form-msg.is-error{
  color:#b00020;
}

@media (max-width: 780px){
  .fwc-grid{
    grid-template-columns:1fr;
  }
}

/* Modal */
#fwc-modal{
  display:none !important;
  position:fixed !important;
  inset:0 !important;
  z-index:999999 !important;
  pointer-events:none !important;
}
#fwc-modal.is-open{
  pointer-events:auto !important;
}

#fwc-modal.is-open{
  display:block !important;
}

#fwc-modal .fwo-modal-backdrop{
  position:fixed !important;
  inset:0 !important;
  z-index:999999 !important;
  background:rgba(15, 23, 42, 0.56) !important;
}

#fwc-modal .fwo-modal-panel{
  position:fixed !important;
  top:50% !important;
  left:50% !important;
  transform:translate(-50%, -50%) !important;
  width:min(760px, calc(100vw - 32px)) !important;
  max-height:calc(100vh - 40px) !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  background:#fff !important;
  border-radius:18px !important;
  box-shadow:0 24px 64px rgba(15, 23, 42, 0.25) !important;
  z-index:1000002 !important;
}

#fwc-modal .fwo-modal-close{
  position:absolute !important;
  top:14px !important;
  right:14px !important;
  width:38px !important;
  height:38px !important;
  border:0 !important;
  border-radius:999px !important;
  background:white !important;
  font-size:24px !important;
  line-height:1 !important;
  cursor:pointer !important;
}

#fwc-modal #fwc-modal-body{
  padding:24px !important;
}

body.fwc-modal-open{
  overflow:hidden !important;
}

.fwc-success-wrap{
  padding: 6px 0 4px;
}

.fwc-success-msg{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--main);
  text-align:center;
}

.fwc-success-code-row{
  display: block;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
  text-align: center;
}

.fwc-success-code{
  flex: 1 1 260px;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  background: rgba(236, 243, 255, 1)!important;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-word;
  height: 100px;
align-content: center;
text-transform: uppercase;
width: 50%;
margin: 0px auto 25px;
}

/* Section headings for the two coupon tables */
#page-container .fwc-section-title {
margin: 0 0 10px;
font-size: 16px;
font-weight: 700;
text-transform: uppercase;
color: var(--main)!important;
letter-spacing: 0.5px;
}

.fwc-table-section{
  margin-top: 22px;
}

/* Highlighted table wrapper */
.fwc-highlighted-wrap{
  margin-bottom: 28px;
}

/* Unique selectors for highlighted table styling */
.fwo-coupons .fwo-table.fwc-highlighted-table{
  border: 2px solid rgba(0,0,0,0.08);
}

.fwo-coupons .fwo-table.fwc-highlighted-table thead th{
  /* customize this later if you want */
}

.fwo-coupons .fwo-table-wrap.fwc-highlighted-table-wrap{
  /* customize wrapper later if you want */
}

.fwo-coupons .fwc-highlighted-tbody tr{
  /* customize highlighted rows later if you want */
}

.fwo-coupons .fwo-table tbody tr:nth-child(even){
background: rgba(0, 90, 200, 0.06);
}

#page-container .fwo-table th {
text-align: center!important;
font-size: 16px;
background: #fafafa;
color: #555!important;
text-transform: capitalize;
border: 1px solid rgb(212, 212, 212);
}

.entry-content tr td{
border: 1px solid rgb(212, 212, 212);
font-size: 16px;
font-weight: 500;
}

#page-container .fwo-coupons .fwc-highlighted-table td:nth-child(2) {
background: var(--secondary)!important;
}

.fwo-search {
padding: 10px 12px;
font-size: 14px;
max-width: 420px;
border: 1px solid rgb(186, 185, 185);
margin-bottom: 15px;
border-radius: 5px;
width: 100%;
}

.fwc-check-row {
  margin-top: 0 !important;
  padding-top: 2px;
  padding-bottom: 2px;
}

/* Checkbox in the 2-col grid — no label above, so no top padding offset needed */
.fwc-check-col {
  display: flex !important;
  align-items: start;
}

.fwc-field-hint {
    margin: -5px 0 0 37px;
    font-size: 12px;
    color: #888;
    line-height: 1.3;
    font-weight: 600;
}

.fwc-btn-primary{
background: var(--main);
color: #fff;
border: 0;
padding: 10px 16px;
border-radius: 6px;
cursor: pointer;
font-weight: 600;
text-transform: uppercase;
font-size: 13px;
}

.cancel-btn{
text-transform: uppercase;
font-weight: 600;
padding: 10px 16px;
font-size: 13px;
border: 2px solid rgb(186, 186, 186);
border-radius: 4px;
}

.trash-btn{
text-transform: uppercase;
font-weight: 600;
padding: 10px 16px;
font-size: 13px;
border: 2px solid rgb(186, 186, 186);
border-radius: 4px;
background:#c10018!important;
color:white!important;
}

.fwc-check input[type="checkbox"]{
  width: 20px;
  height: 20px;
  min-width: 20px;
  accent-color: var(--main);
  cursor: pointer;
}

.fwo-pagination button {
padding: 8px 12px;
background: var(--main);
border: 0px!important;
border-radius: 3px;
font-size: 13px;
color: white;
text-transform: uppercase;
font-weight: 600;
}

.fwo-pagination {
text-transform: uppercase;
font-size: 14px;
font-weight: 500;
color: gray;
text-align: right;
}

.fwc-page {
margin: 0px 5px;
}

.fwc-field textarea{
min-height: 120px!important;
width: 100%!important;
}

.fwc-select-row,
.fwc-select-all{
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.fwc-toolbar-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}


.fwc-pagination-controls{
  display: flex;
  align-items: center;
  gap: 10px;
}

.fwc-delete-selected:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

/* Required field asterisk */
.fwc-required {
  color: #c10018;
  margin-left: 2px;
  font-weight: 700;
}

/* Spinner */
@keyframes fwc-spin {
  to { transform: rotate(360deg); }
}

.fwc-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--main);
  border-radius: 50%;
  animation: fwc-spin 0.7s linear infinite;
  vertical-align: middle;
}

.fwc-loading {
  text-align: center !important;
  padding: 18px 0 !important;
}

.fwc-loading-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0;
}

/* ── Mobile responsive table ── */
@media (max-width: 640px) {

  /* Hide table headers */
  .fwo-coupons .fwo-table thead {
    display: none !important;
  }

  /* Force table/tbody/tr/td to break out of table layout */
  .fwo-coupons .fwo-table,
  .fwo-coupons .fwo-table tbody {
    display: block !important;
  }

  /* Each coupon row becomes a card */
  .fwo-coupons .fwo-table tbody tr.fwc-row {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 4px;
    padding: 10px 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 2px;
  }

  /* Reset all td widths/padding from desktop styles */
  .fwo-coupons .fwo-table tbody tr.fwc-row td {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    border: none !important;
    font-size: inherit !important;
  }

  /* Col 1: Copy button — row 1, left */
  .fwo-coupons .fwo-table tbody tr.fwc-row td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  /* Col 2: Coupon code — row 1, center (stretches) */
  .fwo-coupons .fwo-table tbody tr.fwc-row td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    text-align: left !important;
    background: var(--main) !important;
    color: white !important;
    font-size: 13px !important;
    padding: 4px 8px !important;
    border-radius: 3px;
  }

  /* Col 3: Amount — row 2, left-center */
  .fwo-coupons .fwo-table tbody tr.fwc-row td:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 2;
    align-self: center;
    text-align: left !important;
    font-size: 13px !important;
    color: #444;
    padding-left: 2px !important;
  }

  /* Col 4: Discount type — row 2, right of amount */
  .fwo-coupons .fwo-table tbody tr.fwc-row td:nth-child(4) {
    grid-column: 2 / 4;
    grid-row: 2;
    align-self: center;
    text-align: left !important;
    font-size: 13px !important;
    color: #666;
  }

  /* Col 5: Description — hidden on mobile */
  .fwo-coupons .fwo-table tbody tr.fwc-row td:nth-child(5) {
    display: none !important;
  }

  /* Col 6: Checkbox — row 1, far right */
  .fwo-coupons .fwo-table tbody tr.fwc-row td:nth-child(6) {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  /* Loading/empty rows stay full-width */
  .fwo-coupons .fwo-table tbody tr:not(.fwc-row) {
    display: table-row !important;
  }

  .fwo-coupons .fwo-table tbody tr:not(.fwc-row) td {
    display: table-cell !important;
  }

  /* Toolbar: stack search + button */
  .fwo-coupons-toolbar .fwc-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
}