/* Admin panel styles */
:root { --primary: #f26522; --ink: #2b2b2b; --muted: #777; --bg: #f4f5f7; --line: #e2e4e8; --bh: #c8102e; --sa: #006c35; }
* { box-sizing: border-box; }
body.admin { margin: 0; font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .center { text-align: center; }
.sidebar { width: 230px; background: #1f2430; color: #cfd3dc; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; margin-bottom: 20px; }
.sidebar-brand img { height: 40px; background: #fff; border-radius: 8px; padding: 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { color: #cfd3dc; padding: 9px 12px; border-radius: 8px; font-weight: 600; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar hr { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 10px 0; }
.logout { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.admin-main { flex: 1; padding: 24px 28px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.panel.narrow { max-width: 520px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px; border-top: 5px solid var(--primary); border: 1px solid var(--line); }
.stat-card.site-bh { border-top: 5px solid var(--bh); } .stat-card.site-sa { border-top: 5px solid var(--sa); }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stat-row strong { font-size: 1.2rem; }
.stat-card .btn { margin-top: 12px; }
.panel.site-bh h2 { color: var(--bh); } .panel.site-sa h2 { color: var(--sa); }

.btn { display: inline-flex; align-items: center; gap: .3em; padding: .45em 1.1em; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { border-color: #bbb; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-sm { padding: .25em .7em; font-size: .85rem; }
.btn-lg { padding: .7em 1.8em; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { color: #b3261e; border-color: #f0b8b4; }
.btn-ok { background: #e6f6ea; color: #1e7a3c; border-color: #bfe5c9; }
.btn-muted { background: #eee; color: #777; }
.chips { display: flex; gap: 6px; }
.chip { padding: .25em .9em; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-trash.active { background: #b3261e; border-color: #b3261e; }
.tag { display: inline-block; padding: .1em .6em; border-radius: 6px; font-size: .8rem; font-weight: 700; color: #fff; background: #888; }
.tag-bh { background: var(--bh); } .tag-sa { background: var(--sa); } .tag-both { background: #555; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .93rem; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.table th { background: #f7f8fa; font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.row-off td { opacity: .55; }
.thumb { height: 56px; width: 44px; object-fit: cover; border-radius: 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: inline; }
.inline-form { display: inline; }
.status { padding: .2em .5em; border-radius: 6px; font-weight: 700; width: auto; }
.status-new { background: #fff3cd; } .status-contacted { background: #dbeafe; } .status-confirmed { background: #dcfce7; } .status-cancelled { background: #fee2e2; }

.form { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.field span { font-size: .88rem; color: #444; }
input, select, textarea { font: inherit; padding: .5em .8em; border: 1px solid #cfd3da; border-radius: 8px; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
input[dir="ltr"] { text-align: right; direction: ltr; }
td[dir="ltr"], dd[dir="ltr"], span[dir="ltr"] { text-align: right; unicode-bidi: isolate; }
label.inline { display: flex; align-items: center; gap: 6px; font-weight: 500; }
label.inline input { width: auto; }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.fieldset legend { font-weight: 700; padding: 0 8px; }
.match-row { display: grid; grid-template-columns: 170px 1fr auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.preview { max-height: 160px; width: auto; border-radius: 8px; margin: 6px 0; }
.form-actions { display: flex; justify-content: flex-end; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: center; }
.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.alert ul { margin: 0; padding-inline-start: 18px; }
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #a7e3b8; }
.alert-error { background: #fee2e2; color: #7f1d1d; border: 1px solid #f5b5b5; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 600; } .facts dd { margin: 0; }
.pagination { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .2em .7em; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.login-box { margin: 8vh auto; width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login-logo { height: 90px; width: auto; align-self: center; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 900px) {
  body.admin { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .two-col { grid-template-columns: 1fr; }
  .match-row { grid-template-columns: 1fr 1fr; }
  .table { display: block; overflow-x: auto; }
}
