/* Shared look for redesigned admin pages (adm- prefix). */
.adm{ --adm-primary:#1d7fc4; --adm-border:#e5e7eb; --adm-muted:#6b7280; padding-top:32px; padding-bottom:56px; }

/* theme/css/style.css hides every checkbox and draws a fake one on the label. */
.adm .form-switch{ display:inline-flex; align-items:center; gap:8px; min-height:0; padding-left:0; }
.adm .form-switch .form-check-input{ float:none; width:2.25em; height:1.25em; margin:0 !important; opacity:1; cursor:pointer; }
.adm .form-switch .form-check-label{ padding-left:0; white-space:nowrap; cursor:pointer; }
.adm .form-switch .form-check-label::before,
.adm .form-switch .form-check-label::after{ content:none !important; display:none !important; }
.adm-head{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.adm-head h2{ margin:0; font-size:22px; font-weight:700; color:#111827; }
.adm-head p{ margin:2px 0 0; color:var(--adm-muted); font-size:14px; }
.adm-card{ background:#fff; border:1px solid var(--adm-border); border-radius:14px; box-shadow:0 1px 2px rgba(16,24,40,.04); }
.adm-card + .adm-card{ margin-top:20px; }
.adm-card__head{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:16px 20px; border-bottom:1px solid var(--adm-border); }
.adm-card__head h3{ margin:0; font-size:17px; font-weight:700; color:#111827; }
.adm-card__head h3 i{ margin-right:8px; color:var(--adm-primary); }
.adm-card__body{ padding:20px; }
.adm-empty{ padding:40px; text-align:center; color:var(--adm-muted); }

.adm-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:9px 18px; border:1px solid transparent; border-radius:10px; font-size:15px; font-weight:600; line-height:1.3; text-decoration:none; cursor:pointer; transition:filter .15s, background .15s; }
.adm-btn--primary{ background:var(--adm-primary); color:#fff; }
.adm-btn--primary:hover{ filter:brightness(1.08); color:#fff; }
.adm-btn--ghost{ background:#fff; border-color:var(--adm-border); color:#374151; }
.adm-btn--ghost:hover{ background:#f3f4f6; color:#111827; }
.adm-btn--danger{ background:#fff; border-color:#fecaca; color:#b91c1c; }
.adm-btn--danger:hover{ background:#fef2f2; color:#991b1b; }
.adm-btn--sm{ padding:6px 12px; font-size:13px; border-radius:8px; }

.adm-field label{ display:block; margin-bottom:6px; color:#374151; font-size:14px; font-weight:600; }
.adm-field .form-control{ height:44px; border-radius:10px; }
.adm-hint{ margin-top:6px; color:var(--adm-muted); font-size:12px; }

.adm-badge{ display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; }
.adm-badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.adm-badge--on{ background:#ecfdf3; color:#027a48; }
.adm-badge--off{ background:#fef3f2; color:#b42318; }
.adm-badge--main{ background:#eff8ff; color:#175cd3; }
.adm-badge--main::before{ display:none; }

.adm-savebar{ position:sticky; bottom:0; z-index:5; display:flex; justify-content:flex-end; gap:10px; margin-top:20px; padding:14px 20px; border:1px solid var(--adm-border); border-radius:14px; background:rgba(255,255,255,.95); box-shadow:0 -6px 20px rgba(16,24,40,.06); backdrop-filter:blur(6px); }

/* Admin users list */
.adm-table{ width:100%; margin:0; border-collapse:collapse; }
.adm-table th{ padding:12px 20px; border-bottom:1px solid var(--adm-border); background:#f9fafb; color:var(--adm-muted); font-size:13px; font-weight:600; text-align:left; }
.adm-table td{ padding:14px 20px; border-bottom:1px solid var(--adm-border); vertical-align:middle; }
.adm-table tr:last-child td{ border-bottom:0; }
.adm-table tbody tr:hover{ background:#f9fafb; }
.adm-user{ display:flex; align-items:center; gap:12px; }
.adm-avatar{ width:40px; height:40px; flex:none; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg,#34a9f2,#1d7fc4); color:#fff; font-weight:700; }
.adm-user__name{ color:#111827; font-weight:600; }
.adm-user__sub{ color:var(--adm-muted); font-size:13px; }
.adm-actions{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }

/* Admin user form */
.adm-pass{ position:relative; }
.adm-pass .form-control{ padding-right:44px; }
.adm-pass button{ position:absolute; top:50%; right:6px; width:34px; height:34px; transform:translateY(-50%); border:0; border-radius:8px; background:transparent; color:var(--adm-muted); }
.adm-pass button:hover{ background:#f3f4f6; }
.adm-login{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:16px 18px; border:1px solid #bfdbfe; border-radius:12px; background:#eff6ff; }
.adm-login strong{ display:block; color:#1e3a8a; }
.adm-login span{ color:#1e40af; font-size:13px; }
.adm-login .form-switch .form-check-input{ width:3em; height:1.5em; }
.adm-section-title{ margin:24px 0 10px; color:#374151; font-size:14px; font-weight:700; }
.adm-perm-table{ width:100%; border:1px solid var(--adm-border); border-radius:12px; border-collapse:separate; border-spacing:0; overflow:hidden; }
.adm-perm-table th, .adm-perm-table td{ padding:10px 14px; border-bottom:1px solid var(--adm-border); }
.adm-perm-table th{ background:#f9fafb; color:var(--adm-muted); font-size:13px; font-weight:600; }
.adm-perm-table tr:last-child td{ border-bottom:0; }
.adm-perm-table td:not(:first-child), .adm-perm-table th:not(:first-child){ width:15%; text-align:center; }
.adm-perm-table .form-switch{ display:inline-flex; justify-content:center; padding-left:0; }
.adm-perm-table .form-switch .form-check-input{ float:none; margin-left:0; }
.adm-perm-table .form-check-label{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.adm-modules{ display:grid; grid-template-columns:repeat(auto-fill, minmax(240px,1fr)); gap:12px; }
.adm-module{ display:flex; align-items:flex-start; gap:12px; padding:14px; border:1px solid var(--adm-border); border-radius:12px; cursor:pointer; transition:border-color .15s, background .15s; }
.adm-module:hover{ border-color:#93c5fd; }
.adm-module:has(input:checked){ border-color:var(--adm-primary); background:#f0f7fd; }
.adm-module__icon{ width:36px; height:36px; flex:none; display:grid; place-items:center; border-radius:10px; background:#eef6fe; color:var(--adm-primary); }
.adm-module__text{ flex:1; min-width:0; }
.adm-module__text strong{ display:block; color:#111827; font-size:14px; }
.adm-module__text small{ color:var(--adm-muted); font-size:12px; }
.adm-module .form-check-input{ margin-top:6px; }

/* Home layout manager */
.adm-tabs{ display:flex; gap:8px; margin-bottom:20px; padding:6px; overflow-x:auto; border:1px solid var(--adm-border); border-radius:14px; background:#fff; }
.adm-tab{ display:flex; align-items:center; gap:8px; flex:1 0 auto; padding:10px 16px; border-radius:10px; color:#374151; font-weight:600; white-space:nowrap; text-decoration:none; }
.adm-tab:hover{ background:#f3f4f6; color:#111827; }
.adm-tab.is-active{ background:var(--adm-primary); color:#fff; }
.adm-tab__count{ min-width:22px; padding:1px 7px; border-radius:999px; background:rgba(0,0,0,.08); font-size:12px; text-align:center; }
.adm-tab.is-active .adm-tab__count{ background:rgba(255,255,255,.25); }
.adm-upload{ display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:16px; }
.adm-drop{ display:flex; align-items:center; gap:16px; min-height:96px; padding:16px; border:2px dashed #cbd5e1; border-radius:12px; background:#f9fafb; cursor:pointer; transition:border-color .15s, background .15s; }
.adm-drop:hover, .adm-drop.is-over{ border-color:var(--adm-primary); background:#eef6fe; }
.adm-drop input[type=file]{ position:absolute; width:1px; height:1px; opacity:0; }
.adm-drop__preview{ width:120px; height:64px; flex:none; display:grid; place-items:center; border-radius:8px; background:#e5e7eb center/cover no-repeat; color:#9ca3af; font-size:22px; }
.adm-drop__text strong{ display:block; color:#111827; }
.adm-drop__text span{ color:var(--adm-muted); font-size:13px; }
.adm-upload__link{ grid-column:1 / -1; }
.adm-media-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(320px,1fr)); gap:16px; }
.adm-media-grid--narrow{ grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); }
.adm-media{ display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--adm-border); border-radius:12px; background:#fff; }
.adm-media__img{ position:relative; display:grid; place-items:center; aspect-ratio:16 / 8; background:#f3f4f6; }
.adm-media-grid--narrow .adm-media__img{ aspect-ratio:3 / 4; }
.adm-media__img img{ width:100%; height:100%; object-fit:contain; }
.adm-media__order{ position:absolute; top:10px; left:10px; padding:2px 10px; border-radius:999px; background:rgba(17,24,39,.75); color:#fff; font-size:12px; font-weight:700; }
.adm-media__form{ display:flex; flex-direction:column; gap:10px; padding:14px; }
.adm-media__fields{ display:grid; grid-template-columns:88px minmax(0,1fr); gap:10px; }
.adm-media__fields--sort-only{ grid-template-columns:88px; }
.adm-media__fields label{ display:block; margin-bottom:4px; color:var(--adm-muted); font-size:12px; font-weight:600; }
.adm-media__fields .form-control{ height:38px; border-radius:8px; font-size:14px; }
.adm-media__actions{ display:flex; justify-content:space-between; gap:8px; }

@media (max-width: 768px){
    .adm-table thead{ display:none; }
    .adm-table tr{ display:block; padding:14px 16px; border-bottom:1px solid var(--adm-border); }
    .adm-table td{ display:block; padding:4px 0; border:0; }
    .adm-actions{ justify-content:flex-start; margin-top:8px; }
    .adm-perm-table th:not(:first-child), .adm-perm-table td:not(:first-child){ width:auto; }
    .adm-upload{ grid-template-columns:1fr; }
    .adm-media-grid{ grid-template-columns:1fr; }
}
