/* Peticare CMS */
:root {
  /* Farben wie in der PVO-Zentrale (pvo.peticare.com, admin_header.php) */
  --bg: #f3f3f4; --card: #fff; --text: #231F20; --muted: #5e5650; --line: #e3dfda; --field-border: #b9b1a8;
  --dark: #231F20; --gold: #c4ad77; --brand: #7a6530; --brand-dark: #4d3f1c; --brand-soft: #faf9f7;
  --warn: #6b5310; --warn-soft: #fff8e6; --err: #a82e2e; --err-soft: #fdecea;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .8rem; }
code { font-size: .9em; background: #ebe7e2; padding: 0 .3em; border-radius: 4px; }
.muted { color: var(--muted); }

/* Kopf und Menü: übernommen aus der PVO-Zentrale, ergänzt um Untermenüs */
.brand-bar { height: 72px; background: var(--dark); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 1000; }
.brand-logo, .brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none !important; }
.badge { background: var(--gold); color: var(--dark); font-weight: 800; letter-spacing: 1px; padding: 6px 10px; font-size: 15px; }
.brand-sub { color: #fff; letter-spacing: 6px; font-size: 15px; }
.brand-right { display: flex; align-items: center; gap: 12px; }
.admin-status { display: flex; align-items: center; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.2); padding: 6px 14px; border-radius: 20px; color: #fff; font-size: 13px; }
.admin-badge { background: var(--gold); color: #1a1a1a; font-weight: 700; padding: 2px 8px; border-radius: 12px; font-size: 11px; margin-left: 8px; text-transform: uppercase; }
.mobile-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.mobile-btn svg { width: 26px; height: 26px; fill: #fff; display: block; }

.nav-bar { background: #fff; border-bottom: 1px solid #dcdad8; box-shadow: 0 2px 5px rgba(0,0,0,.04); position: sticky; top: 75px; z-index: 999; }
.nav-menu { max-width: 1700px; margin: 0 auto; padding: 0 15px; display: flex; flex-wrap: wrap; list-style: none; }
.nav-menu ul { list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-item > a, .nav-item > span, .nav-logout button { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px; color: #4a4542; font: inherit; font-size: 14px; font-weight: 600; border: 0; border-bottom: 3px solid transparent; background: none; text-decoration: none; white-space: nowrap; transition: all .2s ease; }
.nav-item > a:hover { color: #1a1a1a; background: #faf9f7; text-decoration: none; }
.nav-item.active > a { color: #1a1a1a; border-bottom-color: var(--gold); background: #fbf9f4; }
.nav-item.soon > span { color: #b5aea7; cursor: default; }
.nav-item.has-sub > a::after { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .6; }
.nav-right { margin-left: auto; border-left: 1px solid #e6e3df; }
.nav-logout form { margin: 0; }
.nav-logout button { color: var(--err); cursor: pointer; }
.nav-logout button:hover { color: #fff; background: #c83232; border-bottom-color: #c83232; }
.nav-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #c83232; color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 16px; }
.nav-count.nav-count-orange { background: #e65100; }
.nav-count.nav-count-blau { background: #1565c0; }

/* Untermenü: klappt beim Draufzeigen (oder per Tastatur) auf */
.nav-item .sub { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid #dcdad8; border-top: 3px solid var(--gold); border-radius: 0 0 6px 6px; box-shadow: 0 8px 20px rgba(0,0,0,.08); padding: 6px 0; z-index: 1001; }
.nav-item.has-sub:hover .sub, .nav-item.has-sub:focus-within .sub { display: block; }
.sub a { display: block; padding: 9px 16px; color: #4a4542; font-weight: 600; white-space: nowrap; text-decoration: none; }
.sub li.soon span { display: block; padding: 9px 16px; color: #b5aea7; font-weight: 600; white-space: nowrap; cursor: default; }
.sub a:hover { background: #faf9f7; color: #1a1a1a; text-decoration: none; }
.sub li.active a { color: #1a1a1a; box-shadow: inset 3px 0 0 var(--gold); background: #fbf9f4; }

.footer { height: 40px; background: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: var(--text); flex-shrink: 0; width: 100%; }

.card .brand.big { display: flex; margin: -1.2rem -1.2rem 1.4rem; padding: 14px 1.2rem; background: var(--dark); border-bottom: 3px solid var(--gold); border-radius: var(--radius) var(--radius) 0 0; }

.content-wrap { max-width: 1700px; width: 100%; margin: 0 auto; padding: 30px 20px; flex: 1 0 auto; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.head form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem; overflow-x: auto; }
.card.flush { padding: 0; }
.card.narrow { width: 100%; max-width: 420px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; margin: 1.2rem 0; }
.cols .card { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.tile { display: flex; flex-direction: column; gap: .2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--text); }
a.tile:hover { border-color: var(--gold); text-decoration: none; }
.tile .label { color: #8a817a; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tile .value { font-size: 26px; font-weight: 800; line-height: 1.3; margin-top: 4px; }
.tile .value.small { font-size: 26px; }
.tile .sub { color: var(--muted); font-size: .9rem; }
.tile.alert { border-color: var(--err); background: var(--err-soft); }
.tile.off { opacity: .55; }
.modules .label { color: var(--text); text-transform: none; font-size: 1rem; letter-spacing: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: #4a4542; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; background: #faf9f7; }
tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fbf8f1; }
.num { text-align: right; white-space: nowrap; }
.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.late { color: var(--err); font-weight: 600; }
tr.inactive td { opacity: .5; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.addr { margin: 0 0 .5rem; }

.tag { display: inline-block; margin-left: .4rem; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; font-weight: 700; background: #f5ecd5; color: #5a4510; }
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: #ebe7e2; color: #3d3734; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-ready { background: #fff1d6; color: #7a4d00; }
.st-in_progress { background: #e3eefc; color: #164c8f; }
.st-waiting { background: #efedea; color: #5e5650; }
.st-fba { background: #ece8f6; color: #4b3b8a; }
.st-canceled { background: #efedea; color: #5e5650; text-decoration: line-through; }
.st-confirmed, .st-shipped { background: #e1f1e6; color: #17592f; }
.st-error { background: var(--err-soft); color: var(--err); }

label { display: block; margin-bottom: .9rem; font-weight: 700; font-size: 13px; color: #3d3734; }
input, select { display: block; width: 100%; height: 40px; margin-top: 5px; padding: 0 .75rem; font: inherit; font-size: 14px; font-weight: 400; color: var(--text); background: #fff; border: 1px solid var(--field-border); border-radius: 6px; }
input::placeholder { color: #8a817a; }
input:hover, select:hover { border-color: #8f867d; }
input[readonly] { background: #faf9f7; }
input:focus, select:focus { outline: none; border-color: #a8904f; box-shadow: 0 0 0 3px rgba(196,173,119,.35); }
.btn { display: inline-block; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 700; color: #fff; background: var(--dark); border: 0; border-radius: 4px; cursor: pointer; }
.btn:hover { background: #3d3734; }
.btn.ghost { background: #f3f1ee; color: var(--text); border: 1px solid #dcd7d1; }
.btn.ghost:hover { background: #ebe7e2; }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
form.inline { display: flex; gap: .4rem; margin: 0; }
form.inline input { margin: 0; min-width: 150px; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; margin: 0; }
.filters input { min-width: 220px; }
.pager { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.2rem; }

.msg { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; background: #e6f2ea; color: #1e6b3a; }
.msg.err { background: var(--err-soft); color: var(--err); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 850px) {
  .admin-status .admin-name { display: none; }
  .admin-badge { margin-left: 0; }
}
@media (max-width: 650px) {
  .mobile-btn { display: block; }
  .brand-bar { padding: 0 16px; }
  .nav-bar { display: none; position: static; }
  .nav-bar.is-open { display: block; }
  .nav-menu { flex-direction: column; padding: 0; }
  .nav-right { margin-left: 0; border-left: 0; border-top: 1px solid #e6e3df; }
  .nav-item > a, .nav-item > span, .nav-logout button { height: 50px; width: 100%; border-bottom: 0; border-left: 4px solid transparent; }
  .nav-item.active > a { border-left-color: var(--gold); }
  .nav-item.has-sub > a::after { display: none; }
  .nav-item .sub, .nav-item.has-sub:hover .sub { display: block; position: static; box-shadow: none; border: 0; border-radius: 0; padding: 0 0 6px 20px; min-width: 0; }
  .content-wrap { padding: 16px 16px 40px; }
  .filters input, .filters select { width: 100%; }
}

/* Zugangsdaten */
.soon-exp { color: #9a4a00; font-weight: 600; }
.ok { color: #1e6b3a; font-weight: 600; }

/* ---- Bausteine: Symbol-Knöpfe, Status, Dialoge ------------------------------------- */
.ic { width: 18px; height: 18px; flex-shrink: 0; display: block; }
.btn { display: inline-flex; align-items: center; gap: 8px; }
.btn .ic { width: 16px; height: 16px; }
.btn.danger { background: #b3261e; }
.btn.danger:hover { background: #8e1f19; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 .8rem; }
.section-head h2 { margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h3 { margin: 0; }

.actions-col { width: 1%; white-space: nowrap; text-align: right; }
.icon-group { display: inline-flex; gap: 4px; justify-content: flex-end; }
.icon-group form { margin: 0; display: inline-flex; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid #dcd7d1; border-radius: 6px; background: #fff; color: #4a4542; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.icon-btn:hover { background: #fbf9f4; border-color: var(--gold); color: #1a1a1a; }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.icon-btn.danger:hover { background: #fdecea; border-color: #e0a19d; color: var(--err); }
.icon-btn.is-done { background: #e6f2ea; border-color: #9fcdb0; color: #1e6b3a; }
.icon-btn .ic { width: 16px; height: 16px; }
/* Tooltip */
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); right: 0; background: var(--dark); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 20; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ok { background: #e6f2ea; color: #1e6b3a; }
.status.warn { background: #fff4dc; color: #8a5a00; }
.status.err { background: #fdecea; color: var(--err); }
.status.off { background: #efedea; color: #6b625c; }
.role { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12.5px; font-weight: 600; background: #f3f1ee; color: #4a4542; }
.role.admin { background: #f5ecd5; color: #6b5310; }

.secret { display: flex; align-items: center; gap: 6px; }
.secret input { margin: 0; width: auto; min-width: 260px; flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; padding: .4rem .6rem; background: #fbf9f4; }
.masked { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: #4a4542; letter-spacing: .5px; }
.empty-state { padding: 2rem 1.2rem; text-align: center; color: var(--muted); }

dialog.modal { border: 0; padding: 0; border-radius: 10px; width: 480px; max-width: calc(100vw - 32px); box-shadow: 0 16px 36px rgba(0,0,0,.28); color: var(--text); }
dialog.modal::backdrop { background: rgba(18,16,14,.7); backdrop-filter: blur(4px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px 12px; border-bottom: 1px solid #edebe8; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-x { border: 0; background: none; color: #8c827d; cursor: pointer; padding: 4px; border-radius: 4px; }
.modal-x:hover { color: #1a1a1a; background: #f3f1ee; }
.modal-body { padding: 18px 24px 4px; }
.modal-body p { margin: 0 0 1rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }
.field-hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Filterleiste: beschriftete Felder in einem Raster */
.filter-bar { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)) auto; gap: 12px; align-items: end; padding: 16px 18px; margin-bottom: 14px; }
.filter-bar label { margin: 0; }
.filter-bar .filter-actions { display: flex; gap: 8px; align-items: center; }
.filter-bar .btn { height: 40px; }
.search { position: relative; display: block; margin-top: 5px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #6b625c; width: 16px; height: 16px; pointer-events: none; }
.filter-bar .search input { margin-top: 0; padding-left: 38px; }
.reset-link { font-size: 13px; font-weight: 600; color: #5e5650; white-space: nowrap; }
.reset-link:hover { color: var(--text); }
.result-info { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 8px; font-size: 13px; color: var(--muted); }
.order-id { white-space: nowrap; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
tr.row-link:hover .order-id { color: var(--brand); text-decoration: underline; }
@media (max-width: 980px) { .filter-bar { grid-template-columns: 1fr 1fr; } .filter-bar .search-field { grid-column: 1 / -1; } }
@media (max-width: 520px) { .filter-bar { grid-template-columns: 1fr; } }
tr.row-link { cursor: pointer; }
tr.row-link td.actions-col .ic { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }
.pager { align-items: center; }

/* Breite Tabellen auf kleinen Bildschirmen seitlich scrollbar statt gequetscht */
.card.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) { .card.flush table { min-width: 680px; } td, th { white-space: nowrap; } }

/* Bestellübersicht: Schnellansichten, Zellen mit zweiter Zeile, Adressvergleich */
.tiles.quick { margin-bottom: 14px; }
.tile.active { border-color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); background: #fffdf8; }
.tile.warn { border-color: #e2c27a; background: var(--warn-soft); }
.filter-bar.wide { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.filter-bar.wide .search-field { grid-column: auto; }
.filter-bar.wide .filter-actions { justify-content: flex-start; }
@media (max-width: 980px) { .filter-bar.wide { grid-template-columns: 1fr 1fr; } .filter-bar.wide .search-field, .filter-bar.wide .filter-actions { grid-column: 1 / -1; justify-content: flex-start; } }
@media (max-width: 520px) { .filter-bar.wide { grid-template-columns: 1fr; } }
.cell-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cell-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cell-tags .tag { margin-left: 0; }
.ch { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; font-weight: 700; }
.ch-fbm { background: #fff1d6; color: #7a4d00; }
.ch-fba { background: #ece8f6; color: #4b3b8a; }
.nowrap { white-space: nowrap; }
table.orders td { vertical-align: top; }
table.orders .items { max-width: 220px; }
table.orders .sku-list { color: var(--muted); font-size: 12.5px; }
.warn-text { color: var(--warn); }
.addr-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .addr-compare { grid-template-columns: 1fr; } }
.addr-box { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; background: #faf9f7; }
.addr-box.clean { background: #fff; border-color: #d9cfb6; }
.addr-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #8a817a; margin-bottom: 8px; }
.addr-box .addr { line-height: 1.65; margin: 0; }
.info-line { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: #1e6b3a; font-size: 13px; }
.info-line .ic { width: 16px; height: 16px; }
.addr-extra { margin-top: 12px; }
@media (max-width: 650px) { .tiles.quick { grid-template-columns: 1fr 1fr; gap: 10px; } .tiles.quick .tile { padding: .8rem .9rem; } .tiles.quick .value { font-size: 22px; } }
