* { box-sizing: border-box; }
:root {
    --bg: #f3f6fa;
    --panel: #fff;
    --text: #1d2735;
    --muted: #667085;
    --primary: #125dc4;
    --primary-dark: #0d4797;
    --danger: #c73535;
    --border: #dce3ec;
    --shadow: 0 10px 30px rgba(19, 36, 61, .08);
}
html, body { margin: 0; min-height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Noto Sans Bengali", "Segoe UI", Arial, sans-serif;
}
a { color: inherit; }
.admin-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 64px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #10233f;
    color: #fff;
    box-shadow: 0 3px 14px rgba(0,0,0,.12);
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
}
.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #10233f;
    font-weight: 800;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions a { text-decoration: none; opacity: .9; }
.admin-shell {
    width: min(1480px, calc(100% - 32px));
    margin: 24px auto 48px;
}
.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}
h1, h2, h3 { margin: 0; }
h1 { font-size: 25px; }
.subtext { color: var(--muted); margin-top: 5px; }
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.card-padding { padding: 22px; }
.btn {
    appearance: none;
    border: 0;
    border-radius: 9px;
    min-height: 40px;
    padding: 9px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--primary);
    color: #fff;
    font: 600 14px/1.2 inherit;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #eef3f9; color: #24354a; }
.btn.danger { background: var(--danger); }
.btn.sm { min-height: 34px; padding: 7px 11px; font-size: 13px; }
.alert {
    padding: 12px 14px;
    border-radius: 9px;
    margin-bottom: 16px;
}
.alert.success { background: #e9f8ee; color: #16703a; }
.alert.error { background: #fff0f0; color: #9e2727; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: #516071; font-size: 13px; background: #f8fafc; }
td.actions { display: flex; gap: 7px; }
.empty-state { padding: 42px; text-align: center; color: var(--muted); }
.editor-grid {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(520px, 760px);
    gap: 20px;
    align-items: start;
}
.editor-form-card { overflow: hidden; }
.editor-toolbar {
    position: sticky;
    top: 64px;
    z-index: 20;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 9px;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(8px);
}
.editor-toolbar .left, .editor-toolbar .right { display: flex; gap: 8px; align-items: center; }
.form-sections { padding: 16px; }
.form-section {
    border: 1px solid var(--border);
    border-radius: 11px;
    margin-bottom: 13px;
    overflow: hidden;
}
.form-section > summary {
    cursor: pointer;
    padding: 13px 15px;
    font-weight: 700;
    background: #f8fafc;
}
.form-section[open] > summary { border-bottom: 1px solid var(--border); }
.section-body { padding: 15px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #344357;
}
input[type=text], input[type=password], input[type=number], input[type=url], input[type=email], textarea, select {
    width: 100%;
    border: 1px solid #cfd8e4;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 9px 10px;
    font: 14px/1.35 inherit;
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: #5e98e3;
    box-shadow: 0 0 0 3px rgba(18,93,196,.11);
}
textarea { min-height: 86px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.preview-card {
    position: sticky;
    top: 84px;
    padding: 12px;
    background: #dfe5ed;
}
.preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.preview-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,.16);
}
.preview-stage iframe {
    position: absolute;
    left: 0;
    top: 0;
    width: 210mm;
    height: 297mm;
    border: 0;
    transform-origin: top left;
    background: #fff;
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #10233f, #1c4d88);
}
.login-card {
    width: min(430px, 100%);
    padding: 28px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
}
.login-card h1 { margin-bottom: 6px; }
.login-card form { margin-top: 22px; }
.login-card .form-field { margin-bottom: 14px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.install-card {
    width: min(780px, calc(100% - 30px));
    margin: 40px auto;
    padding: 24px;
}
.code {
    background: #101828;
    color: #f4f7fb;
    border-radius: 8px;
    padding: 12px;
    overflow: auto;
    font-family: Consolas, monospace;
    font-size: 13px;
}
.image-preview {
    display: flex;
    gap: 12px;
    align-items: center;
}
.image-preview img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border: 1px solid var(--border);
    background: #fff;
}
@media (max-width: 1180px) {
    .editor-grid { grid-template-columns: 1fr; }
    .preview-card { position: static; }
}
@media (max-width: 700px) {
    .admin-header { padding: 0 14px; }
    .admin-shell { width: min(100% - 18px, 1480px); }
    .page-title-row { align-items: flex-start; flex-direction: column; }
    .form-grid, .form-grid.three { grid-template-columns: 1fr; }
    .editor-toolbar { top: 64px; flex-wrap: wrap; }
}

.admin-missing-photo {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d10b0b;
    background: #fff;
    border: 1px solid #222;
    box-shadow: 2px 2px 0 #222;
    font: 700 20px/1 Arial, sans-serif;
}

.remove-image-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    color: #8b1e1e;
    font-size: 13px;
}


/* Premium global font-weight control in the Advanced Design section */
.font-weight-panel {
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid #c9d7e8;
    border-radius: 12px;
    background: linear-gradient(145deg, #f8fbff, #eef5ff);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.font-weight-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 15px;
}
.font-weight-title-row strong {
    display: block;
    font-size: 15px;
    color: #172b4d;
}
.font-weight-badge {
    flex: 0 0 auto;
    min-width: 112px;
    padding: 8px 11px;
    border: 1px solid #a9c3e6;
    border-radius: 999px;
    background: #fff;
    color: #164d91;
    font-weight: 800;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(36, 92, 160, .10);
}
.font-weight-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 16px;
    align-items: end;
}
.font-weight-slider-wrap input[type=range] {
    width: 100%;
    accent-color: #1769d2;
    cursor: pointer;
}
.font-weight-scale {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 5px;
    color: #6b778c;
    font-size: 11px;
}
.font-weight-number-wrap label { margin-bottom: 6px; }
.font-weight-number-wrap input { text-align: center; font-weight: 700; }
.font-weight-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}
.font-weight-presets button {
    border: 1px solid #b9c9dc;
    border-radius: 7px;
    padding: 7px 10px;
    background: #fff;
    color: #29415f;
    font: 600 12px/1.2 inherit;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.font-weight-presets button:hover {
    border-color: #4d8bd8;
    transform: translateY(-1px);
}
.font-weight-presets button.is-active {
    border-color: #1769d2;
    background: #1769d2;
    color: #fff;
}
.font-weight-sample {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px dashed #9eb7d5;
    border-radius: 9px;
    background: rgba(255,255,255,.85);
    color: #0c1728;
    font-size: 18px;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
}
.font-weight-description {
    margin-top: 7px;
    color: #245487;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
@media (max-width: 700px) {
    .font-weight-title-row { flex-direction: column; }
    .font-weight-controls { grid-template-columns: 1fr; }
    .font-weight-badge { min-width: 0; }
    .font-weight-scale { font-size: 10px; }
}
