/* Joomla 5–inspired admin (static prototype) */
:root {
  --j-bg: #f0f0f0;
  --j-side: #212529;
  --j-side-hover: #2c3034;
  --j-top: #fff;
  --j-accent: #132f53;
  --j-link: #2a69b8;
  --j-border: #dfe3e7;
  --j-ok: #457d54;
  --j-warn: #c28b00;
  --j-danger: #c52827;
  --j-radius: 4px;
  --j-font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--j-font);
  background: var(--j-bg);
  color: #212529;
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--j-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #1a2332 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.04'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 6px;
  padding: 32px 28px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.login-card__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.login-card__mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #5091cd, #1b4d7a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}
.login-card h1 { margin: 0; font-size: 22px; color: var(--j-accent); }
.login-card p { margin: 6px 0 18px; color: #6c757d; font-size: 13px; }
.login-card label { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
}
.login-card button {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: 0;
  border-radius: var(--j-radius);
  background: var(--j-link);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.login-card button:hover { background: #1f5a9e; }
.login-note { margin-top: 14px; font-size: 12px; color: #6c757d; }

/* —— App shell —— */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.side {
  background: var(--j-side);
  color: #dee2e6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #16191c;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-weight: 700;
  letter-spacing: .02em;
}
.side__brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5091cd, #1b4d7a);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #fff;
  font-weight: 800;
}
.side__brand small {
  display: block;
  font-weight: 400;
  opacity: .65;
  margin-top: 2px;
  font-size: 11px;
}
.side .group {
  margin-top: 16px;
  padding: 0 16px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .45;
  font-weight: 700;
}
.side nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ced4da;
  padding: 9px 16px;
  border-left: 3px solid transparent;
  font-size: 13.5px;
  text-decoration: none;
}
.side nav a .ico {
  width: 18px;
  text-align: center;
  opacity: .75;
  font-size: 14px;
}
.side nav a:hover {
  background: var(--j-side-hover);
  color: #fff;
  text-decoration: none;
}
.side nav a.is-active {
  background: var(--j-side-hover);
  color: #fff;
  border-left-color: #0d6efd;
}
.side__foot {
  margin-top: auto;
  padding: 14px 16px;
  font-size: 11px;
  opacity: .45;
  border-top: 1px solid rgba(255,255,255,.06);
}

.workspace { display: flex; flex-direction: column; min-width: 0; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--j-top);
  border-bottom: 1px solid var(--j-border);
  min-height: 52px;
}
.top__title { font-weight: 600; color: #495057; font-size: 14px; }
.top__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6c757d;
  font-size: 13px;
}
.top__meta .btn { margin-left: 4px; }

.main { padding: 18px 20px 40px; flex: 1; }
.alert {
  background: #e7f1ff;
  border: 1px solid #b6d4fe;
  color: #084298;
  padding: 10px 14px;
  border-radius: var(--j-radius);
  margin-bottom: 14px;
  font-size: 13px;
}
.panel {
  background: #fff;
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
  padding: 18px 20px 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.panel h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--j-accent);
  font-weight: 600;
}
.panel > p { margin: 0 0 14px; color: #6c757d; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
  background: #fff;
  color: #212529;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: #e9ecef; text-decoration: none; }
.btn-primary {
  background: var(--j-link);
  border-color: var(--j-link);
  color: #fff;
}
.btn-primary:hover { background: #1f5a9e; color: #fff; }
.btn-success { background: var(--j-ok); border-color: var(--j-ok); color: #fff; }
.btn-success:hover { filter: brightness(.95); color: #fff; }
.btn-danger { background: #fff; border-color: #f1aeb5; color: var(--j-danger); }
.btn-sm { padding: 4px 9px; font-size: 12px; }

.quick-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.quick-icon {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 16px 10px;
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
  background: #fff;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.quick-icon:hover {
  border-color: var(--j-link);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(42,105,184,.12);
}
.quick-icon__glyph {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #e7f1ff;
  color: var(--j-link);
}
.quick-icon span { font-size: 13px; font-weight: 600; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid var(--j-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}
th {
  background: #f8f9fa;
  font-weight: 700;
  color: #495057;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
tr:hover td { background: #f8fafc; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d1e7dd;
  color: #0f5132;
  font-size: 11px;
  font-weight: 700;
}
.badge-warn { background: #fff3cd; color: #664d03; }
.badge-off { background: #e2e3e5; color: #41464b; }

.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 6px 0 6px 16px; padding: 0 0 0 12px; border-left: 1px solid var(--j-border); }
.tree li { margin: 4px 0; }
.cat-toggle {
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: var(--j-accent);
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
}
.cat-toggle::before { content: "▾ "; color: var(--j-link); }
.cat-toggle[aria-expanded="false"]::before { content: "▸ "; }

.editor-form { display: grid; gap: 12px; max-width: 900px; }
.editor-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.editor-form input,
.editor-form select,
.editor-form textarea {
  padding: 9px 11px;
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
  background: #fff;
}
.editor-form .form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.editor-form .form-row > label {
  min-width: 0;
}
.editor-form .form-row select,
.editor-form .form-row input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .editor-form .form-row {
    grid-template-columns: 1fr;
  }
}
.editor-form .check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}
.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--j-border);
  margin-bottom: 14px;
}
.editor-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  color: #6c757d;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.editor-tabs button.is-active {
  color: var(--j-link);
  border-bottom-color: var(--j-link);
}
.editor-pane[hidden] { display: none !important; }
.drawer {
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
  padding: 8px 12px;
  background: #f8f9fa;
}
.drawer summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.inline-search {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
}
.inline-search input {
  padding: 6px 10px;
  border: 1px solid var(--j-border);
  border-radius: var(--j-radius);
  min-width: 180px;
}
.muted { opacity: .65; font-weight: 400; font-size: .92em; }
.statusline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  background: #fff;
  border-top: 1px solid var(--j-border);
  color: #6c757d;
  font-size: 12px;
}
.view[hidden] { display: none !important; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { min-height: auto; }
}


/* admin form gap fix */
.editor-form .form-row {
  gap: 16px !important;
}
.editor-form select {
  min-width: 0;
  width: 100%;
}
