/* Padu admin — shared look for every admin page (loaded instead of the public site's style.css). */
:root {
  --pa-red: #d32f2f;
  --pa-red-dark: #b71c1c;
  --pa-ink: #1f2328;
  --pa-muted: #6b7280;
  --pa-line: #e5e7eb;
  --pa-soft: #f1f2f4;
  --pa-bg: #f4f6f9;
  --pa-side: #161616;
  --pa-green: #15803d;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--pa-bg); }
body { margin: 0; font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--pa-ink); }
h1, h2, h3, h4, h5, h6 { font-family: inherit; color: var(--pa-ink); }
a { color: var(--pa-red); }
a:hover { color: var(--pa-red-dark); }

/* ---------- Shell ---------- */
.pa-shell { display: flex; min-height: 100vh; }
.pa-side { width: 232px; flex-shrink: 0; background: var(--pa-side); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
/* The logo is designed for white, so it sits on a white strip at the top of the dark sidebar.
   64px strip, logo 30px tall (official proportions), left edge lined up with the nav icons. */
.pa-brand { display: flex; flex-shrink: 0; align-items: center; gap: 10px; height: 64px; padding: 0 22px; background: #fff; border-bottom: 2px solid var(--pa-red); margin-bottom: 10px; text-decoration: none; }
.pa-brand img { display: block; height: 30px; width: auto; }
.pa-brand span { font-size: 12px; font-weight: 500; color: var(--pa-muted); padding-left: 10px; border-left: 1px solid var(--pa-line); line-height: 18px; }
.pa-nav { flex: 1; padding: 4px 12px; }
.pa-nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f737a; margin: 18px 10px 6px; }
.pa-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin-bottom: 2px; border-radius: 7px; color: #b8bbc0; text-decoration: none; font-size: 14px; font-weight: 500; }
.pa-nav a i { width: 18px; text-align: center; font-size: 14px; }
.pa-nav a:hover { background: #242424; color: #fff; }
.pa-nav a.active { background: var(--pa-red); color: #fff; }
.pa-side-foot { flex-shrink: 0; padding: 12px; border-top: 1px solid #262626; }
.pa-side-foot a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; color: #b8bbc0; text-decoration: none; font-weight: 500; }
.pa-side-foot a:hover { background: #242424; color: #fff; }
.pa-side-close { display: none; position: absolute; top: 20px; right: 12px; background: none; border: 0; color: var(--pa-ink); font-size: 18px; }

.pa-main { flex: 1; min-width: 0; padding: 28px 32px 40px; }
.pa-topbar { display: none; }
.pa-overlay { display: none; }

/* ---------- Page head ---------- */
.pa-crumbs { font-size: 12px; color: var(--pa-muted); margin-bottom: 4px; }
.pa-crumbs a { color: var(--pa-muted); text-decoration: none; }
.pa-crumbs a:hover { color: var(--pa-red); }
.pa-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.pa-head h1 { font-size: 24px; font-weight: 700; margin: 0; }
.pa-head p { margin: 4px 0 0; color: var(--pa-muted); }
.pa-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.pa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--pa-line); background: #fff; color: var(--pa-ink); text-decoration: none; font: 500 13px Inter, system-ui, sans-serif; white-space: nowrap; cursor: pointer; line-height: 1.4; }
.pa-btn:hover { border-color: #c9ccd1; color: var(--pa-ink); background: #fff; }
.pa-btn.red { background: var(--pa-red); border-color: var(--pa-red); color: #fff; }
.pa-btn.red:hover { background: var(--pa-red-dark); border-color: var(--pa-red-dark); color: #fff; }
.pa-btn.danger { color: #b91c1c; }
.pa-btn.danger:hover { background: #fdecec; border-color: #f3b7b7; color: #b91c1c; }
.pa-btn.lg { padding: 10px 18px; font-size: 14px; }
.pa-btn.icon { width: 32px; height: 32px; padding: 0; }
.pa-btn:disabled { opacity: .55; cursor: not-allowed; }
.pa-inline { display: inline; margin: 0; }

/* ---------- Flash ---------- */
.pa-flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; border: 1px solid; font-size: 14px; }
.pa-flash i { margin-top: 2px; }
.pa-flash.success { background: #effaf3; border-color: #bfe5cc; color: #14532d; }
.pa-flash.error { background: #fdecec; border-color: #f3b7b7; color: #7f1d1d; }

/* ---------- Cards / lists ---------- */
.pa-card { background: #fff; border: 1px solid var(--pa-line); border-radius: 10px; min-width: 0; margin-bottom: 18px; }
.pa-card > h2, .pa-card-head { font-size: 15px; font-weight: 600; margin: 0; padding: 15px 18px; border-bottom: 1px solid var(--pa-line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pa-card-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.pa-card > h2 a, .pa-card-head a.link { font-size: 12px; color: var(--pa-red); font-weight: 600; text-decoration: none; }
.pa-card-body { padding: 18px; }
.pa-card-foot { padding: 10px 18px; font-size: 12px; color: var(--pa-muted); border-top: 1px solid var(--pa-soft); }
.pa-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.pa-grid > .pa-card { margin-bottom: 18px; }
.pa-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--pa-soft); }
.pa-row:last-child { border-bottom: 0; }
.pa-row .main { flex: 1; min-width: 0; }
.pa-row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-row .s { color: var(--pa-muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-empty { padding: 30px 18px; text-align: center; color: var(--pa-muted); font-size: 13px; }
.pa-muted { color: var(--pa-muted); }
.pa-small { font-size: 12px; }
.pa-age { font-size: 12px; color: var(--pa-muted); white-space: nowrap; }
.pa-age.old { color: var(--pa-red); font-weight: 600; }

/* ---------- KPI cards ---------- */
.pa-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.pa-kpis.four { grid-template-columns: repeat(4, 1fr); }
.pa-kpi { background: #fff; border: 1px solid var(--pa-line); border-radius: 10px; padding: 16px 18px; }
.pa-kpi.alert { border-left: 3px solid var(--pa-red); }
.pa-kpi .l { color: var(--pa-muted); font-size: 12px; font-weight: 500; display: flex; gap: 7px; align-items: center; }
.pa-kpi .v { font-size: 28px; font-weight: 700; margin-top: 6px; line-height: 1.2; }
.pa-kpi .d { font-size: 12px; color: var(--pa-muted); margin-top: 2px; }

/* ---------- Pills / chips ---------- */
.pa-pill { display: inline-block; text-align: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pa-pill.fixed { min-width: 62px; }
.pa-pill.crit { background: #fde8e8; color: #b91c1c; }
.pa-pill.high { background: #fff4e0; color: #b45309; }
.pa-pill.med { background: #e8f0fe; color: #1d4ed8; }
.pa-pill.low, .pa-pill.grey { background: var(--pa-soft); color: #4b5563; }
.pa-pill.green { background: #e7f6ec; color: var(--pa-green); }
.pa-pill.red { background: #fde8e8; color: #b91c1c; }
.pa-pill.amber { background: #fff4e0; color: #b45309; }
.pa-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pa-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.pa-status.open::before { background: var(--pa-red); }
.pa-status.progress::before { background: #f59e0b; }
.pa-status.closed::before { background: var(--pa-green); }
.pa-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--pa-line); }
.pa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--pa-line); border-radius: 999px; font-size: 13px; color: var(--pa-ink); text-decoration: none; background: #fff; cursor: pointer; font-family: inherit; }
.pa-chip b { font-weight: 700; }
.pa-chip i { width: 8px; height: 8px; border-radius: 50%; }
.pa-chip:hover { border-color: #c9ccd1; color: var(--pa-ink); }
.pa-chip.on { border-color: var(--pa-ink); background: var(--pa-ink); color: #fff; }

/* ---------- Progress bar / chart ---------- */
.pa-bar { width: 160px; height: 6px; background: #eceef1; border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.pa-bar span { display: block; height: 100%; background: var(--pa-red); }
/* Created vs closed chart. Colours checked with the dataviz validator (red + blue pass all six checks;
   the old light pink failed contrast and read as grey). Counts are printed on the bars. */
.pa-chart { display: flex; height: 190px; padding: 22px 18px 10px; }
.pa-day { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pa-day .bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; padding: 0 3px; border-bottom: 1px solid var(--pa-line); }
.pa-day .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 0; }
.pa-day .col em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--pa-ink); text-align: center; line-height: 1; margin-bottom: 3px; }
.pa-day .col span { display: block; border-radius: 4px 4px 0 0; }
.pa-day .c, .pa-chart-sum i.c { background: var(--pa-red); }
.pa-day .x, .pa-chart-sum i.x { background: #2a78d6; }
.pa-day small { display: block; height: 14px; margin-top: 6px; font-size: 11px; color: var(--pa-muted); text-align: center; white-space: nowrap; }
.pa-day:hover .bars { background: var(--pa-soft); }
.pa-chart-sum { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--pa-muted); }
.pa-chart-sum b { color: var(--pa-ink); }
.pa-chart-sum i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 6px; }

/* ---------- Tables ---------- */
.pa-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pa-search { position: relative; min-width: 240px; }
.pa-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--pa-muted); font-size: 12px; }
.pa-search input { width: 100%; padding: 7px 12px 7px 30px; border: 1px solid var(--pa-line); border-radius: 6px; font: 13px Inter, system-ui, sans-serif; }
.pa-search input:focus { outline: 2px solid #f3c5c5; border-color: var(--pa-red); }
.pa-table-wrap { overflow-x: auto; }
.pa-table { width: 100%; border-collapse: collapse; }
.pa-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--pa-muted); padding: 10px 14px; border-bottom: 1px solid var(--pa-line); white-space: nowrap; background: #fafbfc; }
.pa-table th.sort { cursor: pointer; user-select: none; }
.pa-table th.sort:hover { color: var(--pa-ink); }
.pa-table td { padding: 12px 14px; border-bottom: 1px solid var(--pa-soft); vertical-align: middle; font-size: 13px; }
.pa-table tr:last-child td { border-bottom: 0; }
.pa-table tbody tr:hover td { background: #fcfcfd; }
.pa-table .t { font-weight: 600; }
.pa-table .s { color: var(--pa-muted); font-size: 12px; margin-top: 2px; }
.pa-table .clip { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-table .right { text-align: right; }
.pa-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pa-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--pa-line); background: var(--pa-soft); }

/* ---------- Forms ---------- */
.pa-form { max-width: 760px; }
.pa-field { margin-bottom: 18px; }
.pa-field label, .pa-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--pa-ink); }
.pa-field label small, .pa-label small { font-weight: 400; color: var(--pa-muted); }
.pa-hint { font-size: 12px; color: var(--pa-muted); margin-top: 5px; }
.pa-main .form-control, .pa-main .form-select { border-color: var(--pa-line); border-radius: 6px; font-size: 14px; padding: 9px 12px; color: var(--pa-ink); }
.pa-main .form-control:focus, .pa-main .form-select:focus { border-color: var(--pa-red); box-shadow: 0 0 0 3px rgba(211, 47, 47, .12); }
.pa-main .form-control:disabled, .pa-main .form-select:disabled { background: var(--pa-soft); color: var(--pa-muted); }
.pa-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.pa-form-foot { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--pa-line); margin-top: 6px; }
.pa-readonly { padding: 12px 14px; background: #fafbfc; border: 1px solid var(--pa-line); border-radius: 6px; white-space: pre-wrap; line-height: 1.55; }

/* ---------- Detail list ---------- */
.pa-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; margin: 0; }
.pa-details dt { font-size: 12px; font-weight: 500; color: var(--pa-muted); margin-bottom: 2px; }
.pa-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pa-media { display: flex; flex-wrap: wrap; gap: 10px; }
.pa-media img, .pa-media video { height: 150px; max-width: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--pa-line); background: #000; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .pa-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
  .pa-grid { grid-template-columns: 1fr; }
  .pa-side { position: fixed; left: -260px; top: 0; z-index: 1001; transition: left .25s ease; width: 240px; }
  .pa-side.open { left: 0; }
  .pa-side-close { display: block; }
  .pa-overlay.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1000; }
  .pa-topbar { display: flex; align-items: center; gap: 12px; height: 56px; background: #fff; color: var(--pa-ink); padding: 0 16px; border-bottom: 2px solid var(--pa-red); position: sticky; top: 0; z-index: 900; }
  .pa-topbar button { background: none; border: 0; color: var(--pa-ink); font-size: 18px; padding: 0 4px; }
  .pa-topbar img { height: 28px; width: auto; }
  .pa-shell { display: block; }
  .pa-main { padding: 20px 16px 32px; }
}
@media (max-width: 576px) {
  .pa-kpis, .pa-kpis.four { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pa-kpi { padding: 12px 14px; }
  .pa-kpi .v { font-size: 22px; }
  .pa-head h1 { font-size: 21px; }
  .pa-row { flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; }
  .pa-row .main { flex-basis: calc(100% - 90px); }
  .pa-bar { width: 100px; }
  .pa-actions { width: 100%; }
  .pa-search { min-width: 0; width: 100%; }
  .pa-form-grid, .pa-details { grid-template-columns: 1fr; }
}
