:root {
    --blue: #029ed5;
    --blue-dark: #0482c4;
    --gold: #d59b2d;
    --green: #1f8a45;
    --red: #e31f35;
    --ink: #111827;
    --muted: #667085;
    --soft: #f4f7fb;
    --line: rgba(2, 158, 213, .18);
    --shadow: 0 20px 60px rgba(4, 130, 196, .16);
    --radius: 8px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--soft);
    color: var(--ink);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    background: var(--blue-dark);
    color: white;
    padding: 22px;
    overflow-y: auto;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 950;
    margin-bottom: 26px;
}
.admin-brand img { width: 50px; height: 50px; object-fit: contain; background: white; border-radius: var(--radius); padding: 3px; }
.admin-sidebar nav { display: grid; gap: 6px; }
.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,.86);
    font-weight: 750;
}
.admin-sidebar nav a:hover { background: rgba(255,255,255,.1); color: var(--gold); }
.admin-sidebar nav a.active { background: rgba(255,255,255,.16); color: white; box-shadow: inset 3px 0 0 var(--gold); }
.admin-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.admin-icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-main { margin-left: 270px; min-height: 100vh; padding: 24px; }
.admin-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.admin-topbar div { margin-right: auto; }
.admin-topbar span { display: block; color: var(--muted); font-size: 13px; }
.admin-topbar strong { color: var(--blue-dark); }
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: var(--radius);
    background: var(--blue);
    color: white;
    padding: 0 16px;
    font-weight: 850;
    cursor: pointer;
}
.admin-btn.gold { background: var(--gold); color: white; }
.admin-btn.ghost { background: white; color: var(--blue); border: 1px solid var(--line); }
.admin-btn.full { width: 100%; }
.admin-hero {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    color: white;
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.admin-hero.compact { padding: 26px 30px; }
.admin-hero h1 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 52px); line-height: 1; }
.admin-hero p { margin: 0; color: rgba(255,255,255,.82); max-width: 720px; }
.stat-grid, .quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-grid article, .admin-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,31,92,.06);
}
.stat-grid article { padding: 22px; }
.stat-grid span { color: var(--muted); font-weight: 800; }
.stat-grid strong { display: block; font-size: 38px; color: var(--blue); }
.admin-panel { padding: 24px; margin-bottom: 24px; }
.admin-panel h2 { margin: 0 0 18px; color: var(--blue-dark); }
.quick-grid { grid-template-columns: repeat(3, 1fr); margin: 0; }
.quick-grid a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-weight: 850;
    color: var(--blue);
    background: var(--soft);
}
.quick-grid .admin-icon { width: 24px; height: 24px; color: var(--blue-dark); }
.quick-grid a:hover { border-color: var(--blue); background: #eaf7fc; }
.admin-compact .admin-main { padding: 18px; }
.admin-compact th, .admin-compact td { padding-top: 10px; padding-bottom: 10px; }
.admin-compact .admin-sidebar nav a { padding-top: 8px; padding-bottom: 8px; }
.admin-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 18px;
}
.admin-form.two { grid-template-columns: repeat(2, 1fr); }
label { display: grid; gap: 6px; font-weight: 800; color: var(--blue-dark); }
input, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    font: inherit;
    background: white;
}
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    font: inherit;
    background: white;
}
.form-field {
    min-width: 0;
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #dbe8f4;
    border-radius: var(--radius);
    background: #fbfdff;
}
.form-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2, 158, 213, .1); }
.form-label { color: #31536f; font-size: 13px; line-height: 1.25; }
.form-field input, .form-field select, .form-field textarea { border-color: #cad9e8; background: white; }
.form-field-wide, .form-media-field { grid-column: 1 / -1; }
.form-field-wide { align-items: start; }
.form-field-wide textarea { min-height: 105px; resize: vertical; }
.form-media-field { grid-template-columns: 128px minmax(0, 1fr); align-items: start; padding: 12px; }
.form-media-control { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: center; }
.upload-preview-shell { width: 170px; height: 112px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #9bbbd4; border-radius: var(--radius); background: #eef6fc; color: var(--muted); font-size: 12px; }
.upload-preview-shell > * { grid-area: 1 / 1; }
.upload-preview { width: 100%; height: 100%; object-fit: cover; }
.upload-input-wrap { min-width: 0; }
.upload-input-wrap input { padding: 9px; }
.upload-input-wrap small { display: block; margin-top: 7px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--blue-dark); font-size: 13px; text-transform: uppercase; }
.mini {
    border: 0;
    border-radius: 6px;
    padding: 8px 10px;
    font-weight: 800;
    margin-right: 6px;
}
.mini.danger { background: #fee4e2; color: var(--red); }
.alert { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px; background: #fff3cd; color: #7a4d00; }
.alert.success { display: flex; align-items: center; gap: 9px; background: #dcfce7; color: #166534; }
.alert.success span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #16a34a; color: white; font-weight: 950; }
.alert.error { background: #fee4e2; color: #9f1239; }
.admin-form label small { color: var(--muted); font-size: 12px; font-weight: 600; }
.admin-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.admin-page-heading h1 { margin: 0 0 5px; color: var(--blue-dark); font-size: 30px; line-height: 1.15; }
.admin-page-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; gap: 10px; }
.content-list-panel { padding: 0; overflow: hidden; }
.list-toolbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.list-toolbar span { color: var(--muted); }
.bulk-controls { display: flex; align-items: center; gap: 10px; }
.bulk-controls select { width: 210px; }
.media-table th, .media-table td { vertical-align: middle; }
.media-table td > strong { display: block; color: var(--ink); }
.color-swatch { width: 14px; height: 14px; display: inline-block; margin-right: 8px; border: 1px solid rgba(0,0,0,.12); border-radius: 50%; vertical-align: -1px; }
.media-table td > small { display: block; margin-top: 4px; color: var(--muted); }
.check-cell { width: 46px; text-align: center; }
.check-cell input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.table-thumbnail { width: 86px; height: 58px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.table-thumbnail.portrait, .no-thumbnail.portrait { width: 58px; height: 58px; border-radius: 50%; }
.no-thumbnail { width: 86px; height: 58px; display: grid; place-items: center; border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 11px; text-align: center; }
.table-group-row th { padding: 12px 18px; background: #eef7fc; color: var(--blue-dark); font-size: 12px; letter-spacing: 0; }
.row-actions { white-space: nowrap; }
.mini.edit { background: #e0f2fe; color: var(--blue-dark); }
.empty-row { padding: 42px !important; color: var(--muted); text-align: center !important; }
.admin-modal { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 30px 90px rgba(0, 28, 77, .28); }
.admin-modal::backdrop { background: rgba(7, 20, 42, .7); backdrop-filter: blur(4px); }
.modal-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; color: white; background: var(--blue-dark); }
.modal-heading span { display: block; margin-bottom: 3px; color: rgba(255,255,255,.7); font-size: 12px; text-transform: uppercase; }
.modal-heading h2 { margin: 0; font-size: 22px; }
.modal-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: white; font-size: 26px; cursor: pointer; }
.modal-form { padding: 24px; }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.modal-save-state { grid-column: 1 / -1; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 11px; align-items: center; padding: 12px 14px; border: 1px solid #b7d9ef; border-radius: var(--radius); background: #f2f9fd; }
.modal-save-state > span { width: 34px; height: 34px; border: 4px solid #d8edf9; border-top-color: var(--blue); border-radius: 50%; animation: feedback-spin .8s linear infinite; }
.modal-save-state strong, .modal-save-state small { display: block; }
.modal-save-state strong { color: var(--blue-dark); }
.modal-save-state small { margin-top: 2px; color: var(--muted); }
.modal-save-state i { position: relative; display: block; height: 4px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: #dceaf4; }
.modal-save-state i::after { content: ""; position: absolute; inset: 0 auto 0 -45%; width: 45%; background: var(--blue); animation: feedback-progress 1.1s ease-in-out infinite; }
.save-feedback {
    position: fixed;
    z-index: 30;
    right: 24px;
    bottom: 24px;
    width: min(390px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 16px;
    border: 1px solid #b7d9ef;
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 18px 55px rgba(0, 45, 92, .24);
}
.save-feedback[hidden] { display: none; }
.save-feedback-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 4px solid #d8edf9; border-top-color: var(--blue); color: white; animation: feedback-spin .8s linear infinite; }
.save-feedback strong, .save-feedback small { display: block; }
.save-feedback strong { color: var(--blue-dark); }
.save-feedback small { margin-top: 3px; color: var(--muted); }
.save-progress { position: relative; display: block; height: 4px; margin-top: 10px; overflow: hidden; border-radius: 4px; background: #dceaf4; }
.save-progress::after { content: ""; position: absolute; inset: 0 auto 0 -45%; width: 45%; background: var(--blue); animation: feedback-progress 1.1s ease-in-out infinite; }
.save-feedback.is-success { border-color: #a7e0b8; }
.save-feedback.is-success .save-feedback-icon { border: 0; background: #16a34a; font-size: 24px; font-weight: 950; animation: none; }
.save-feedback.is-success strong { color: #166534; }
.save-feedback.is-success .save-progress { background: #dcfce7; }
.save-feedback.is-success .save-progress::after { inset: 0; width: 100%; background: #22c55e; animation: none; }
@keyframes feedback-spin { to { transform: rotate(360deg); } }
@keyframes feedback-progress { 50% { left: 55%; } 100% { left: 115%; } }
.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}
.login-card {
    width: min(420px, 92vw);
    background: white;
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow);
}
.login-card img { width: 120px; margin: 0 auto 18px; }
.login-card h1 { text-align: center; margin: 0; color: var(--blue-dark); }
.login-card p { text-align: center; color: var(--muted); }
.badge-page-heading { margin-bottom: 18px; }
.badge-workspace { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.badge-members-panel { position: sticky; top: 20px; padding: 0; overflow: hidden; }
.badge-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.badge-panel-heading h2 { margin: 0 0 3px; font-size: 19px; }
.badge-panel-heading small { color: var(--muted); }
.badge-panel-heading > span { color: var(--blue-dark); font-size: 13px; font-weight: 850; }
.badge-search { padding: 14px 16px; border-bottom: 1px solid var(--line); background: #f8fbfe; }
.badge-search span { font-size: 12px; }
.badge-member-list { max-height: 560px; overflow-y: auto; padding: 8px; }
.badge-member-option { display: grid; grid-template-columns: 20px 48px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; }
.badge-member-option:hover { background: #f1f8fc; }
.badge-member-option:has(input:checked) { border-color: #9dcfe8; background: #eaf7fc; }
.badge-member-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.badge-member-option img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: white; border: 1px solid var(--line); }
.badge-member-option strong, .badge-member-option small, .badge-member-option em { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-member-option strong { color: var(--ink); font-size: 13px; }
.badge-member-option small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.badge-member-option em { margin-top: 3px; color: var(--blue-dark); font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.badge-selection-message { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.badge-studio { min-width: 0; }
.badge-toolbar { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(340px, 1.3fr); gap: 24px; padding: 18px 20px; }
.badge-toolbar > div > strong { display: block; margin-bottom: 9px; color: var(--blue-dark); font-size: 13px; }
.badge-mode-control { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f8fb; }
.badge-mode-control button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.badge-mode-control button.active { background: var(--blue-dark); color: white; }
.badge-toolbar form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.badge-toolbar form label { min-width: 0; }
.badge-toolbar form label span { font-size: 12px; }
.badge-toolbar form input { padding: 8px; }
.badge-preview-panel { padding: 0 0 24px; overflow: hidden; }
.badge-preview-stage { min-height: 590px; display: grid; place-items: center; padding: 30px; background-color: #eef4f8; background-image: linear-gradient(#dce7ee 1px, transparent 1px), linear-gradient(90deg, #dce7ee 1px, transparent 1px); background-size: 20px 20px; }
.badge-print-sheet { display: none; }
.badge-card {
    position: relative;
    isolation: isolate;
    width: 320px;
    height: 510px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 8px;
    background: white;
    border: 7px solid var(--blue-dark);
    text-align: center;
    box-shadow: var(--shadow);
    color: var(--ink);
    background-position: center;
    background-size: cover;
}
.badge-card.has-background { background-image: var(--badge-background); }
.badge-card::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.93) 42%, rgba(255,255,255,.88)); }
.badge-card:not(.has-background)::before { background: linear-gradient(155deg, #eaf8fd 0 22%, white 22% 82%, #e31f35 82%); }
.badge-top { min-height: 65px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--blue-dark); }
.badge-top img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; background: white; }
.badge-top strong, .badge-top small { display: block; text-align: left; }
.badge-top strong { font-size: 18px; font-weight: 950; }
.badge-top small { margin-top: 2px; color: #31536f; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.badge-photo { width: 154px; height: 154px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; margin: 18px auto 13px; border: 5px solid var(--gold); background: white; }
.badge-identity { min-height: 120px; padding: 12px 10px; border-radius: 6px; background: rgba(255,255,255,.86); }
.badge-identity h2 { margin: 0; color: var(--blue-dark); font-size: 25px; line-height: 1.08; }
.badge-identity p { margin: 8px 0 5px; color: var(--red); font-size: 13px; font-weight: 900; line-height: 1.25; }
.badge-identity span { color: var(--green); font-size: 12px; font-weight: 850; }
.badge-footer { min-height: 47px; margin: auto -20px -20px; padding: 12px 14px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(4, 130, 196, .96); color: white; }
.badge-footer strong { font-size: 11px; }
.badge-footer small { font-size: 10px; font-weight: 800; }
.settings-heading { margin-bottom: 14px; }
.settings-tabs { display: flex; gap: 8px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.settings-tabs a { min-height: 42px; display: inline-flex; align-items: center; gap: 9px; padding: 0 16px; border-radius: 6px; color: var(--muted); font-weight: 850; }
.settings-tabs a:hover { background: #f1f8fc; color: var(--blue-dark); }
.settings-tabs a.active { background: var(--blue-dark); color: white; }
.settings-panel { padding: 0; overflow: hidden; }
.settings-section-heading { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.settings-section-heading h2 { margin: 0 0 4px; font-size: 21px; }
.settings-section-heading p { margin: 0; color: var(--muted); }
.settings-section-heading > span { color: var(--blue-dark); font-weight: 850; }
.user-access-table td > strong, .user-access-table td > small { display: block; }
.user-access-table td > small { margin-top: 3px; color: var(--muted); }
.role-badge, .status-dot { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.role-badge.super, .role-badge.super_admin { background: #eaf2ff; color: #164ca2; }
.role-badge.administrator { background: #fff3d6; color: #8a5b00; }
.role-badge.user { background: #eef7f0; color: #236a38; }
.status-dot::before { content: ""; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.status-dot.active { background: #dcfce7; color: #15803d; }
.status-dot.inactive { background: #f2f4f7; color: #667085; }
.permission-summary { max-width: 360px; color: #526174; font-size: 12px; }
.locked-account { color: var(--muted); font-size: 12px; }
.inline-form { display: inline; }
.user-form { padding: 22px; }
.user-modal { overflow-x: hidden; }
.user-form-grid, .settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.user-form-grid .wide, .settings-form .wide { grid-column: 1 / -1; }
.user-form label, .settings-form label { margin: 0; }
.user-form label small { color: var(--muted); font-size: 11px; font-weight: 650; }
.permissions-fieldset { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.permissions-fieldset legend { padding: 0 7px; color: var(--blue-dark); font-weight: 900; }
.permissions-fieldset > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.permissions-fieldset label { margin: 0; cursor: pointer; }
.permissions-fieldset label > input { position: absolute; opacity: 0; pointer-events: none; }
.permissions-fieldset label > span { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #d9e6ef; border-radius: 6px; background: #fbfdff; color: #516071; font-size: 12px; }
.permissions-fieldset label > input:checked + span { border-color: #7fc6e4; background: #eaf7fc; color: var(--blue-dark); }
.permissions-fieldset label > input:disabled + span { opacity: .7; }
.active-user-toggle, .settings-toggle { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 10px; margin: 12px 0 18px !important; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fbfd; }
.active-user-toggle input, .settings-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.settings-form { padding: 22px; }
.settings-form label > span { color: #31536f; font-size: 13px; }
.settings-form input[type="color"] { height: 52px; padding: 5px; cursor: pointer; }
.settings-toggle { align-items: start; }
.settings-toggle strong, .settings-toggle small { display: block; }
.settings-toggle small { margin-top: 3px; color: var(--muted); font-weight: 600; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 6px; }
.input-with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.input-with-unit input { border: 0; }
.input-with-unit small { padding: 0 13px; color: var(--muted); }
.security-note { display: grid; grid-template-columns: 44px 1fr; gap: 13px; align-items: center; padding: 16px; border: 1px solid #a7e0b8; border-radius: var(--radius); background: #eefbf2; color: #166534; }
.security-note > .admin-icon { width: 36px; height: 36px; }
.security-note p { margin: 3px 0 0; color: #39724b; }
@media (max-width: 980px) {
    .admin-sidebar { position: static; width: auto; }
    .admin-main { margin-left: 0; }
    .stat-grid, .quick-grid, .admin-form, .badge-workspace { grid-template-columns: 1fr; }
    .badge-members-panel { position: static; }
    .permissions-fieldset > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .admin-main { padding: 16px; }
    .admin-page-heading, .list-toolbar { align-items: stretch; flex-direction: column; }
    .admin-page-heading .admin-btn, .heading-actions { width: 100%; }
    .heading-actions { flex-direction: column; }
    .bulk-controls { width: 100%; }
    .bulk-controls select { width: 100%; }
    .modal-form { grid-template-columns: 1fr; }
    .form-field, .form-media-field { grid-template-columns: 1fr; gap: 7px; }
    .form-media-control { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
    .upload-preview-shell { width: 120px; height: 96px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .admin-btn { width: 100%; }
    .save-feedback { right: 16px; bottom: 16px; }
    .badge-toolbar, .badge-toolbar form { grid-template-columns: 1fr; }
    .badge-toolbar form .admin-btn { width: 100%; }
    .badge-preview-stage { min-height: 540px; padding: 16px; }
    .badge-card { width: 290px; height: 462px; padding: 17px; }
    .badge-photo { width: 132px; height: 132px; margin-top: 13px; }
    .badge-identity h2 { font-size: 22px; }
    .badge-footer { margin: auto -17px -17px; }
    .settings-tabs { overflow-x: auto; }
    .settings-tabs a { flex: 0 0 auto; }
    .user-form-grid, .settings-form, .permissions-fieldset > div { grid-template-columns: 1fr; }
    .user-form-grid .wide, .settings-form .wide { grid-column: auto; }
    .settings-section-heading { align-items: flex-start; flex-direction: column; }
}
@media print {
    @page { size: A4 portrait; margin: 10mm; }
    html, body { width: 210mm; min-height: 297mm; background: white; }
    body { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .admin-sidebar, .admin-topbar, .admin-hero, .no-print { display: none !important; }
    .admin-main { width: auto; min-height: 0; margin: 0; padding: 0; }
    .badge-print-sheet { width: 190mm; min-height: 277mm; display: grid; align-content: center; justify-content: center; grid-template-columns: 54mm; gap: 10mm; }
    .badge-print-sheet[data-mode="4"] { grid-template-columns: repeat(2, 54mm); grid-template-rows: repeat(2, 86mm); column-gap: 18mm; row-gap: 12mm; }
    .badge-card { width: 54mm; height: 86mm; padding: 3mm; border-width: 1.2mm; border-radius: 1.5mm; box-shadow: none; }
    .badge-top { min-height: 11mm; gap: 1.5mm; }
    .badge-top img { width: 9mm; height: 9mm; }
    .badge-top strong { font-size: 10pt; }
    .badge-top small { font-size: 5pt; }
    .badge-photo { width: 25mm; height: 25mm; margin: 2.8mm auto 2mm; border-width: 1mm; }
    .badge-identity { min-height: 20mm; padding: 1.8mm 1.2mm; border-radius: 1mm; }
    .badge-identity h2 { font-size: 13pt; }
    .badge-identity p { margin: 1.5mm 0 .8mm; font-size: 7pt; }
    .badge-identity span { font-size: 6.5pt; }
    .badge-footer { min-height: 8mm; margin: auto -3mm -3mm; padding: 2mm 2.2mm 1.6mm; }
    .badge-footer strong { font-size: 5.5pt; }
    .badge-footer small { font-size: 5pt; }
}
