.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.table-wrap{ width:100%; overflow:auto; }

.table{
  width:100%;
  border-collapse: collapse;
  min-width: 520px;
}

.table thead th{
  text-align:left;
  font-size: 12px;
  color: rgba(255,255,255,.65);
  font-weight: 600;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.table tbody td{
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: middle;
  font-size: 14px;
}

.table tbody tr:hover td{
  background: rgba(255,255,255,.03);
}

.col-small{ width: 90px; }
.col-date{ width: 140px; }
.col-slug{ width: 220px; }

.muted{ color: rgba(255,255,255,.65); }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
  "Liberation Mono", "Courier New", monospace;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.15);
}

.pill.on{
  background: rgba(46, 204, 113, .15);
  border-color: rgba(46, 204, 113, .35);
}

.pill.scheduled{
  background: rgba(46, 204, 113, .08);
  border-color: rgba(46, 204, 113, .22);
}

.pill.draft{
  background: rgba(202,166,75,0.16);
  border-color: rgba(202,166,75,0.45);
}

.pill.off{
  background: rgba(231, 76, 60, .14);
  border-color: rgba(231, 76, 60, .35);
}

.pill.closed{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
}

.btn{
  cursor:pointer;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  text-decoration:none;
  user-select:none;
}

.btn:hover{ background: rgba(255,255,255,.10); }
.btn:disabled{ opacity:.6; cursor:not-allowed; }

.btn.primary{
  background: rgba(202,166,75,0.18);
  border-color: rgba(202,166,75,0.45);
}

.btn.primary:hover{
  background: rgba(202,166,75,0.24);
  border-color: rgba(202,166,75,0.70);
}

.form{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}

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

.field label{
  font-size: 12px;
  color: rgba(255,255,255,.75);
  font-weight: 700;
}

.field input,
.field textarea,
.field select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  color: #fff;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus{
  border-color: rgba(202,166,75,0.70);
  box-shadow: 0 0 0 3px rgba(202,166,75,0.15);
}

.field textarea{
  resize: vertical;
  min-height: 54px;
}

.field select{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color-scheme: dark;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.80) 50%),
    linear-gradient(135deg, rgba(255,255,255,.80) 50%, transparent 50%),
    linear-gradient(to right, rgba(255,255,255,.16), rgba(255,255,255,.16));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    calc(100% - 40px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 18px;
  background-repeat: no-repeat;
  padding-right: 48px;
}

.field select option,
.field select optgroup{
  background: #0b0c12;
  color: #fff;
}

.field select option:disabled{
  color: rgba(255,255,255,.45);
}

.select-wrap{
  position: static;
}

.select-wrap::after{
  display:none;
}

.select-wrap select{
  background-color: transparent;
  border-color: inherit;
}

.select-wrap select:hover{
  border-color: rgba(255,255,255,.22);
}

.msg{
  margin-top: 12px;
  min-height: 18px;
  font-size: 13px;
  white-space: pre-line;
}

.msg.ok{ color: rgba(46, 204, 113, .95); }
.msg.err{ color: rgba(231, 76, 60, .95); }

.hint{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
}

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

.small{ font-size: 12px; }

/* Tabs */
.tabs{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin: 6px 0 14px;
}

.tab{
  cursor:pointer;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(243,245,255,0.86);
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
}

.tab:hover{
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
}

.tab.active{
  color: #fff;
  background: rgba(202,166,75,0.16);
  border-color: rgba(202,166,75,0.55);
}

/* Filtros */
.filters{
  display:grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  margin-bottom: 14px;
}

.filters-actions{
  display:flex;
  gap: 10px;
  align-items:flex-end;
  justify-content:flex-end;
  padding-bottom: 2px;
}

@media (max-width: 980px){
  .filters{ grid-template-columns: 1fr 1fr; }
  .filters-actions{
    grid-column: 1 / -1;
    justify-content:flex-start;
  }
}

/* Tabela */
.cartoes-table{ min-width: 920px; }
.col-price{ width: 110px; }
.col-actions{ width: 160px; }

.row-actions{
  display:flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

.row-actions .btn{
  white-space: nowrap;
}

.price-cell{
  white-space: nowrap;
}

@media (max-width: 520px){
  .row-actions{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .row-actions .btn{
    width: 100%;
  }
}

/* Paginação */
.pager{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.pager-actions{
  display:flex;
  gap: 10px;
}

/* MODAL */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 9999;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.open{ display:flex; }

.modal{
  width: min(860px, 96vw);
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10, 12, 16, .92);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow:hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 36px);
}

.modal-small{
  width: min(520px, 96vw);
}

.modal-header{
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(10, 12, 16, .92);
  backdrop-filter: blur(10px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.modal-header h2{
  margin: 0;
  font-size: 22px;
}

.icon-btn{
  cursor:pointer;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.icon-btn:hover{ background: rgba(255,255,255,.10); }

.modal-body{
  padding: 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  padding-top: 8px;
}

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

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

.check-row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 4px;
}

.check-row input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: rgba(202,166,75,0.95);
}

.check-row label{
  font-size: 13px;
  color: rgba(255,255,255,.85);
  font-weight: 700;
}

.field-group{
  display:flex;
  gap: 12px;
  align-items:flex-end;
}

.field-group-products .field-grow{
  flex: 1 1 auto;
  min-width: 260px;
}

.field-grow{
  flex: 1 1 auto;
}

.field-auto{
  flex: 0 0 auto;
  min-width: 160px;
}

@media (max-width: 900px){
  .field-group-products{
    flex-direction: column;
    align-items: stretch;
  }

  .field-group-products .field-auto{
    min-width: 0;
  }

  .field-group-products .btn{
    width: 100%;
  }
}

@media (max-width: 720px){
  .field-group{
    flex-direction: column;
    align-items: stretch;
  }

  .field-auto{
    min-width: 0;
  }
}

.redeem-mode.hidden{ display:none; }

.seg-toggle{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

.seg-item{
  position: relative;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  font-size: 12px;
  color: rgba(243,245,255,0.86);
}

.seg-item input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 0;
  height: 0;
  margin: 0;
}

.seg-item:has(input:checked){
  color: #fff;
  background: rgba(202,166,75,0.16);
  border-color: rgba(202,166,75,0.55);
}

.modal-grid.redeem-grid-2x2{
  grid-template-columns: 1fr 1fr;
}

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

.field input:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* Storage badge */
.storage-pill{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(255,255,255,.92);
}

.storage-pill .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(46, 204, 113, .95);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, .18);
}

.storage-pill.warn .dot{
  background: rgba(231, 76, 60, .95);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, .18);
}

.header-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions .storage-pill{
  margin-right: auto;
}

@media (max-width: 560px){
  .panel-header{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-actions{
    width: 100%;
    justify-content: flex-end;
  }

  .header-actions .storage-pill{
    flex: 1 1 100%;
    margin-right: 0;
  }
}

.img-preview-wrap{
  margin-top: 10px;
  display:none;
}

.img-preview-wrap.on{ display:block; }

.img-preview{
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
}

/* Upload bonito */
.file-input{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip: rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.file-row{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
}

.file-btn{
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}

.file-btn:hover{
  background: rgba(255,255,255,.12);
}

.file-btn .icon{
  font-size: 14px;
  opacity: .9;
}

.file-name{
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: rgba(255,255,255,.78);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Color picker */
.color-row{
  display:flex;
  align-items:center;
  gap: 10px;
}

.color-picker{
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper{ padding: 8px; }
.color-picker::-webkit-color-swatch{
  border: none;
  border-radius: 10px;
}