/* IELTSFever CBT Pro (standalone) - admin panel styles */

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: #f1f5f9; color: #0f172a; font-size: 14px; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
code.icbt-code { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 2px 6px; font-size: 12px; }

/* Layout */
.icbt-admin { display: flex; min-height: 100vh; }
.icbt-sidebar { width: 220px; flex-shrink: 0; background: #0f172a; color: #e2e8f0; display: flex; flex-direction: column; }
.icbt-brand { padding: 18px 16px; font-weight: 700; font-size: 15px; border-bottom: 1px solid #1e293b; color: #fff; }
.icbt-sidebar nav { flex: 1; padding: 10px 0; }
.icbt-sidebar nav a { display: block; padding: 9px 16px; color: #cbd5e1; font-size: 13px; }
.icbt-sidebar nav a:hover { background: #1e293b; color: #fff; text-decoration: none; }
.icbt-sidebar nav a.active { background: #1d4ed8; color: #fff; }
.icbt-sidebar-foot { padding: 12px 16px; border-top: 1px solid #1e293b; }
.icbt-sidebar-foot a { display: block; color: #94a3b8; font-size: 12px; padding: 4px 0; }
.icbt-main { flex: 1; padding: 24px 32px 60px; max-width: 1200px; }
.icbt-main h1 { font-size: 22px; margin: 0 0 18px; }
.icbt-main h2 { font-size: 16px; margin: 26px 0 10px; }

/* Notices */
.icbt-notice { border-radius: 6px; padding: 10px 14px; margin: 0 0 16px; }
.icbt-notice-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.icbt-notice-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* KPI cards */
.icbt-cards-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.icbt-kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px 20px; min-width: 150px; display: flex; flex-direction: column; }
.icbt-kpi-num { font-size: 22px; font-weight: 700; }
.icbt-kpi-label { color: #64748b; font-size: 12px; margin-top: 4px; }

/* Tables */
.icbt-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.icbt-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; background: #f8fafc; padding: 9px 12px; border-bottom: 1px solid #e2e8f0; }
.icbt-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.icbt-table tr:last-child td { border-bottom: 0; }
.icbt-actions { white-space: nowrap; }
.icbt-actions > * { margin-right: 6px; }

/* Badges */
.icbt-badge { display: inline-block; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 2px 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.icbt-badge-published { background: #dcfce7; color: #15803d; }
.icbt-badge-draft { background: #f1f5f9; color: #475569; }

/* Panels, forms */
.icbt-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 18px 20px; margin-bottom: 18px; }
.icbt-panel h2 { margin-top: 0; }
.icbt-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.icbt-inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.icbt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.icbt-grid-top { align-items: start; }
@media (max-width: 900px) { .icbt-grid-2 { grid-template-columns: 1fr; } .icbt-admin { flex-direction: column; } .icbt-sidebar { width: auto; } }

.icbt-field { margin-bottom: 12px; }
.icbt-field label, form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
	padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; font-family: inherit; background: #fff;
}
input.regular-text { width: 100%; max-width: 420px; }
input.small-text { width: 80px; }
textarea.large-text, input.large-text { width: 100%; }
textarea { resize: vertical; }

/* Buttons */
.button { display: inline-block; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 14px; font-size: 13px; cursor: pointer; color: #0f172a; text-decoration: none; }
.button:hover { background: #f8fafc; text-decoration: none; }
.button-primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.button-primary:hover { background: #1e40af; }
.button-link { background: none; border: 0; padding: 0; color: #1d4ed8; cursor: pointer; font-size: 13px; }
.button-link:hover { text-decoration: underline; }
.icbt-danger { color: #b91c1c; }
.icbt-danger-btn { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.icbt-ok { color: #15803d; font-weight: 600; }
.icbt-muted { color: #64748b; }
.icbt-small { font-size: 12px; }
.description { color: #64748b; font-size: 12px; }
ul.icbt-plain-list { list-style: none; padding: 0; margin: 12px 0 0; }
ul.icbt-plain-list li { padding: 6px 0; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }

/* Test editor (admin.js) */
.icbt-section { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 14px; background: #fff; }
.icbt-section-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; border-radius: 8px 8px 0 0; }
.icbt-section-body { padding: 14px; }
.icbt-head-actions button { margin-left: 10px; }
.icbt-questions { margin: 8px 0; }
.icbt-question { border: 1px solid #e2e8f0; border-radius: 6px; padding: 12px; margin-bottom: 10px; background: #fcfcfd; }
.icbt-q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.icbt-q-row { display: flex; gap: 14px; flex-wrap: wrap; }
.icbt-q-row .icbt-field { flex: 1; min-width: 180px; }
.icbt-option-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.icbt-opt-label { width: 60px; }
.icbt-opt-text { flex: 1; }

/* Analytics chart */
.icbt-chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 6px 0; }
.icbt-bar-wrap { flex: 1; display: flex; align-items: flex-end; height: 120px; min-width: 4px; }
.icbt-bar { width: 100%; min-height: 2px; background: #1d4ed8; border-radius: 2px 2px 0 0; }

/* Login page */
.icbt-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.icbt-login-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 32px; width: 340px; }
.icbt-login-card h1 { margin: 0 0 4px; font-size: 20px; }
.icbt-login-card form { margin-top: 16px; }
.icbt-login-card label { margin-top: 12px; }
.icbt-login-card input { width: 100%; }
.icbt-login-card .button { width: 100%; margin-top: 18px; padding: 9px; }

/* Ads & Code + SEO pages */
.icbt-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.icbt-seo-test { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.icbt-seo-test h3 { margin: 0 0 8px; font-size: 14px; }
.icbt-seo-test h3 .icbt-muted { font-weight: normal; font-size: 12px; }

.icbt-template-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icbt-help-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; color: #334155; }
.icbt-help-box p { margin: 4px 0 0; }

.icbt-image-preview {
        margin-top: 10px;
        display: flex;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
}
.icbt-image-preview img {
        max-width: 100%;
        width: 150px;
        height: 90px;
        object-fit: cover;
        border: 1px solid #dbe4f0;
        border-radius: 8px;
        background: #f8fafc;
}
.icbt-image-preview-small img {
        width: 120px;
        height: 68px;
}
.icbt-sub-label {
        display: block;
        margin-top: 12px;
        font-size: 12px;
        color: #475569;
        font-weight: 700;
}


/* Rich passage editor */
.icbt-rich-field label { margin-bottom: 7px; }
.icbt-rich-toolbar {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-wrap: wrap;
        padding: 7px;
        border: 1px solid #cbd5e1;
        border-bottom: 0;
        border-radius: 8px 8px 0 0;
        background: #f8fafc;
}
.icbt-rich-format {
        min-width: 130px;
        padding: 6px 8px;
        border-radius: 4px;
}
.icbt-rich-btn,
.icbt-rich-emoji {
        border: 0;
        background: transparent;
        color: #334155;
        min-width: 30px;
        min-height: 30px;
        border-radius: 5px;
        font-weight: 700;
        cursor: pointer;
        padding: 5px 8px;
}
.icbt-rich-btn:hover,
.icbt-rich-emoji:hover { background: #e2e8f0; }
.icbt-rich-editor {
        min-height: 220px;
        max-height: 520px;
        overflow: auto;
        border: 1px solid #cbd5e1;
        border-radius: 0 0 8px 8px;
        background: #fff;
        padding: 14px 16px;
        line-height: 1.65;
        outline: none;
}
.icbt-rich-editor:focus { border-color: #1d4ed8; box-shadow: 0 0 0 2px rgba(29,78,216,.12); }
.icbt-rich-editor p { margin: 0 0 12px; }
.icbt-rich-editor img { max-width: 100%; height: auto; display: block; margin: 10px 0; border-radius: 8px; }
.icbt-rich-editor table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.icbt-rich-editor td,
.icbt-rich-editor th { border: 1px solid #dbe4f0; padding: 8px 10px; }
.icbt-rich-status { color: #047857; font-size: 12px; margin-left: 6px; }
.icbt-rich-emojis { position: relative; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.icbt-rich-emojis .icbt-rich-emoji { display: none; font-size: 18px; }
.icbt-rich-emojis-open .icbt-rich-emoji { display: inline-block; }
