:root{
  --primary:#2B33A6;
  --primary-700:#1f2580;
  --border:#e5e7eb;
  --muted:#6b7280;
  --bg:#f9fafb;
  --card:#ffffff;
  --shadow: 0 10px 25px rgba(0,0,0,.08);
  --radius:18px;
}
*{box-sizing:border-box}
body{margin:0; font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial; background:var(--bg); color:#111827;}
.admin-wrap{max-width:1600px; margin:0 auto; padding:18px 16px 60px;}
.admin-top{
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  padding:14px 16px; border:1px solid var(--border); border-radius:16px; background:var(--card);
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.admin-brand{font-weight:900; color:var(--primary-700);}
.admin-nav a{margin-left:12px; color:#111827; text-decoration:none; font-weight:700;}
.admin-nav a:hover{color:var(--primary-700);}

.card{
  margin-top:16px; background:var(--card); border:1px solid var(--border);
  border-radius:18px; box-shadow:var(--shadow); padding:16px;
}
.grid{display:grid; gap:16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));}
.grid2{display:grid; gap:10px; grid-template-columns: 140px 1fr; align-items:center;}
.input, select{
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:12px; outline:none; font-size:14px;
}
.btn{
  padding:10px 14px; border-radius:999px; border:1px solid transparent; cursor:pointer;
  background:var(--primary); color:#fff; font-weight:600;
}
.btn:hover{background:var(--primary-700)}
.btn.danger{background:#111827;}
.btn.danger:hover{background:#000;}
.hint{color:var(--muted); font-size:13px;}
.muted{color:var(--muted); font-size:12px;}
.table{margin-top:10px; border-top:1px solid var(--border);}
.row{display:flex; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); align-items:center;}

.flash{margin-top:12px;}
.flash-item{padding:10px 12px; border-radius:12px; margin-top:8px; font-weight:700;}
.flash-item.ok{background:#ecfdf5; border:1px solid #a7f3d0;}
.flash-item.error{background:#fef2f2; border:1px solid #fecaca; color:#b91c1c;}

.matrix-wrap{overflow:auto; border:1px solid var(--border); border-radius:14px; margin:12px 0;}
table.matrix{border-collapse:separate; border-spacing:0; min-width: 900px; width:100%;}
table.matrix th, table.matrix td{border-bottom:1px solid var(--border); padding:10px;}
table.matrix th{position:sticky; top:0; background:#fff; z-index:1; text-align:left; font-size:12px; color:#374151;}
.cell{width:110px; padding:8px 10px; border:1px solid var(--border); border-radius:10px;}
.logo-prev{width:120px; height:120px; border-radius:18px; overflow:hidden; border:1px solid var(--border); background:#fff; display:grid; place-items:center; margin:10px 0;}
.logo-prev img{width:100%; height:100%; object-fit:cover;}


.grid-2{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
@media(max-width:900px){.grid-2{grid-template-columns:1fr;}}


/* === ADMIN UI SPACING & RU-ONLY FIX === */
:root{
  --brand:#2B33A6;
}

/* Increase spacing between controls */
.admin-card, .card, .panel, .box, .section {
  margin-bottom: 18px !important;
}

.admin-list li, .list-group-item, .item-row {
  margin-bottom: 12px !important;
}

/* Buttons */
button, .btn, .button, a.btn {
  margin: 8px 10px 8px 0 !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
}

/* Inputs */
input, select, textarea {
  margin-top: 6px !important;
}

.form-group, .field, .row, .form-row {
  margin-bottom: 16px !important;
}

/* Navbar links */
nav a, .navbar a, .topbar a {
  margin-right: 18px !important;
}

/* Make focus ring blue (remove red/pink leftovers) */
*:focus {
  outline-color: var(--brand) !important;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 0.2rem rgba(43,51,166,.20) !important;
}


/* Wider desktop layout */
@media (min-width: 1400px){
  .admin-wrap{max-width:1800px; padding-left:24px; padding-right:24px;}
}

/* Forms: 2 columns on desktop, 1 column on small screens */
.grid2{grid-template-columns: 200px 1fr;}
@media (max-width: 720px){
  .grid2{grid-template-columns: 1fr;}
}

/* Price matrix should not overflow page */
.matrix-wrap{overflow:auto; border:1px solid var(--border); border-radius:14px; background:#fff;}
.matrix{min-width:980px;}
.matrix th, .matrix td{white-space:nowrap;}

/* Buttons spacing */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px;}
.actions{display:flex; gap:10px; flex-wrap:wrap;}


/* Filters */
.filters{display:flex; flex-wrap:wrap; gap:14px; margin:14px 0 6px;}
.field{display:flex; flex-direction:column; gap:6px; min-width:220px;}
.field label{font-size:12px; color:#374151; font-weight:600;}
.input, .select{padding:10px 12px; border:1px solid var(--border); border-radius:12px; background:#fff; min-height:40px;}
.input:focus, .select:focus{outline:2px solid rgba(43,51,166,.18); border-color:rgba(43,51,166,.35);}

/* Matrix sticky service column */
table.matrix th.sticky-col,
table.matrix td.sticky-col{
  position:sticky;
  left:0;
  background:#fff;
}
table.matrix th.sticky-col{z-index:4;}
table.matrix td.sticky-col{z-index:3;}
table.matrix th.sticky-col::after,
table.matrix td.sticky-col::after{
  content:"";
  position:absolute;
  top:0; right:-1px;
  width:1px; height:100%;
  background:var(--border);
}
