/* ═══════════════════════════════════════════════════
   ASIAINFO — Admin Portal Design System
   Light, warm HireMe-style theme: paper-white surfaces
   with an amber→red accent gradient. Standalone sheet so
   the portal never depends on the marketing CSS.
═══════════════════════════════════════════════════ */

/* ── Tokens (light HireMe-style palette) ── */
:root {
    --amber: #f59e0b;
    --brand: #ea580c;
    --brand-deep: #dc2626;
    --gold: #b45309;
    --green: #047857;
    --red: #b91c1c;

    --bg: #faf6f0;
    --bg-2: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: #f5eee3;
    --border: #eae1d3;
    --border-c: rgba(234, 88, 12, 0.4);

    --tx: #1c1917;
    --tx-2: #57534e;
    --tx-3: #a29a8f;

    --grad: linear-gradient(135deg, #f59e0b 0%, #ea580c 55%, #dc2626 100%);
    --grad-r: linear-gradient(135deg, #dc2626 0%, #ea580c 45%, #f59e0b 100%);

    --shadow: 0 18px 50px rgba(122, 78, 24, 0.1);
    --shadow-lg: 0 30px 80px rgba(122, 78, 24, 0.14);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;

    --r: 14px;
    --r-lg: 22px;

    --ease: cubic-bezier(.25, .46, .45, .94);
    --sidebar-w: 250px;
}

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.admin-body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--tx);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.admin-body img {
    display: block;
    max-width: 100%;
}

.admin-body a {
    text-decoration: none;
    color: inherit;
}

/* ═══════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════ */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(245, 158, 11, 0.12), transparent),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(220, 38, 38, 0.09), transparent),
        var(--bg);
}

.login-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .22;
    pointer-events: none;
}

.login-glow-1 {
    top: -140px;
    left: -100px;
    background: var(--amber);
}

.login-glow-2 {
    bottom: -160px;
    right: -80px;
    background: var(--brand-deep);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 40px 36px 30px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    font-size: .95rem;
    margin-bottom: 26px;
    color: var(--tx);
}

.logo-mark {
    width: 30px;
    height: 30px;
    color: var(--brand);
    display: grid;
    place-items: center;
}

.logo-mark svg {
    width: 100%;
    height: 100%;
}

.login-title {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.login-sub {
    color: var(--tx-2);
    font-size: .9rem;
    margin: 6px 0 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-back {
    display: inline-block;
    margin-top: 22px;
    font-size: .82rem;
    color: var(--tx-3);
    transition: color .2s var(--ease);
}

.login-back:hover {
    color: var(--brand);
}

/* ── Form fields (shared) ── */
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label,
.field-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--tx-2);
    letter-spacing: .02em;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--tx);
    font-family: inherit;
    font-size: .92rem;
    padding: 11px 14px;
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.field textarea,
.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--border-c);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a29a8f' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.field input::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--tx-3);
}

.field-error {
    color: var(--red);
    font-size: .8rem;
}

.field-hint {
    color: var(--tx-3);
    font-size: .78rem;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .85rem;
    color: var(--tx-2);
    cursor: pointer;
}

.check-row input {
    accent-color: var(--brand);
    width: 15px;
    height: 15px;
}

/* ── Alerts ── */
.alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: .86rem;
    margin-bottom: 16px;
    border: 1px solid;
}

.alert-success {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.25);
    color: var(--green);
}

.alert-error {
    background: rgba(220, 38, 38, 0.07);
    border-color: rgba(220, 38, 38, 0.25);
    color: var(--red);
}

.alert-info {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.35);
    color: var(--gold);
}

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn-admin,
.btn-glow-admin,
.btn-ghost-admin,
.btn-danger-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: 11px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
    white-space: nowrap;
}

.btn-admin:active,
.btn-glow-admin:active,
.btn-ghost-admin:active,
.btn-danger-admin:active {
    transform: scale(.97);
}

.btn-glow-admin {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.28);
}

.btn-glow-admin:hover {
    box-shadow: 0 8px 28px rgba(234, 88, 12, 0.38);
    transform: translateY(-1px);
}

.btn-admin {
    background: #fff;
    border-color: rgba(234, 88, 12, 0.45);
    color: var(--brand);
}

.btn-admin:hover {
    background: rgba(234, 88, 12, 0.07);
    border-color: var(--brand);
}

.btn-ghost-admin {
    background: #fff;
    border-color: var(--border);
    color: var(--tx-2);
}

.btn-ghost-admin:hover {
    border-color: var(--border-c);
    color: var(--tx);
}

.btn-danger-admin {
    background: #fff;
    border-color: rgba(220, 38, 38, 0.35);
    color: var(--red);
}

.btn-danger-admin:hover {
    background: rgba(220, 38, 38, 0.07);
    border-color: var(--red);
}

.btn-sm {
    font-size: .78rem;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 8px;
}

.btn-xs {
    font-size: .74rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 7px;
    gap: 5px;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--tx-2);
    cursor: pointer;
    font-size: .85rem;
    transition: all .2s var(--ease);
}

.btn-icon:hover:not(:disabled) {
    border-color: var(--border-c);
    color: var(--brand);
}

.btn-icon:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.btn-icon.danger:hover:not(:disabled) {
    border-color: rgba(220, 38, 38, 0.4);
    color: var(--red);
}

.btn-icon.active {
    background: rgba(234, 88, 12, 0.09);
    border-color: var(--border-c);
    color: var(--brand);
}

/* ═══════════════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════════════ */
.admin-shell {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 50% 30% at 110% -5%, rgba(245, 158, 11, 0.07), transparent),
        radial-gradient(ellipse 40% 30% at -10% 40%, rgba(220, 38, 38, 0.04), transparent),
        var(--bg);
}

/* ── Sidebar ── */
.admin-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #fffdf8;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px 18px;
    font-weight: 800;
    letter-spacing: .16em;
    font-size: .92rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo-mark {
    width: 28px;
    height: 28px;
}

.sidebar-brand small {
    display: block;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .34em;
    color: var(--brand);
}

.sidebar-section {
    padding: 18px 12px 6px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--tx-3);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--tx-2);
    font-size: .88rem;
    font-weight: 500;
    transition: all .18s var(--ease);
    border: 1px solid transparent;
}

.sidebar-link .sl-ico {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    opacity: .8;
}

.sidebar-link:hover {
    background: var(--bg-glass);
    color: var(--tx);
}

.sidebar-link.active {
    background: rgba(234, 88, 12, 0.08);
    border-color: rgba(234, 88, 12, 0.28);
    color: var(--brand);
}

.sidebar-badge {
    margin-left: auto;
    background: var(--grad);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 99px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: .78rem;
    color: var(--tx-3);
}

.sidebar-footer a {
    color: var(--tx-2);
}

.sidebar-footer a:hover {
    color: var(--brand);
}

/* ── Main column ── */
.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 253, 248, 0.85);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-title {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user {
    font-size: .82rem;
    color: var(--tx-2);
    padding-right: 6px;
}

.burger-admin {
    display: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    color: var(--tx);
    cursor: pointer;
    font-size: 1rem;
}

.admin-content {
    padding: 26px 28px 60px;
    max-width: 1240px;
    width: 100%;
}

/* ── Page head ── */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.page-title .grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-sub {
    color: var(--tx-2);
    font-size: .9rem;
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 22px;
    box-shadow: 0 2px 10px rgba(122, 78, 24, 0.05);
}

.card + .card {
    margin-top: 18px;
}

.card-title {
    font-size: 1.02rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.card-sub {
    color: var(--tx-3);
    font-size: .82rem;
    margin-bottom: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.stat-tile:hover {
    border-color: var(--border-c);
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.1);
}

.stat-tile .st-num {
    font-size: 1.7rem;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.stat-tile .st-lab {
    font-size: .8rem;
    color: var(--tx-2);
}

.stat-tile .st-meta {
    font-size: .74rem;
    color: var(--tx-3);
}

/* ═══════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════ */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--bg-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    min-width: 640px;
}

.data-table th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--tx-3);
    font-weight: 700;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-glass);
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(122, 90, 40, 0.08);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background .15s var(--ease);
}

.data-table tbody tr:hover {
    background: #fdf9f2;
}

.cell-main {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--tx);
}

.acc-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(28, 25, 23, .08);
}

.cell-sub {
    font-size: .78rem;
    color: var(--tx-3);
}

.cell-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}

.row-thumb {
    width: 54px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.row-emoji {
    width: 54px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    background: var(--bg-glass);
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.drag-hint {
    color: var(--tx-3);
    font-size: .74rem;
}

/* ── Chips & badges ── */
.chip {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--tx-2);
    margin: 2px 3px 2px 0;
    white-space: nowrap;
}

.chip-cyan {
    border-color: rgba(14, 116, 144, 0.3);
    background: rgba(6, 182, 212, 0.08);
    color: #0e7490;
}

.chip-violet {
    border-color: rgba(109, 40, 217, 0.3);
    background: rgba(139, 92, 246, 0.08);
    color: #6d28d9;
}

.chip-gold {
    border-color: rgba(217, 119, 6, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold);
}

.badge-on,
.badge-off {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
}

.badge-on {
    background: rgba(5, 150, 105, 0.08);
    color: var(--green);
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.badge-off {
    background: rgba(220, 38, 38, 0.07);
    color: var(--red);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-unread {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(234, 88, 12, 0.4);
    color: var(--gold);
}

.stars {
    color: var(--amber);
    letter-spacing: 2px;
    font-size: .85rem;
}

/* ═══════════════════════════════════════════════════
   FORMS & SETTINGS
═══════════════════════════════════════════════════ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.switch-row input[type="checkbox"] {
    appearance: none;
    width: 40px;
    height: 22px;
    border-radius: 99px;
    background: #eee7da;
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: background .2s var(--ease), border-color .2s var(--ease);
    flex-shrink: 0;
}

.switch-row input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(122, 78, 24, 0.35);
    transition: all .2s var(--ease);
}

.switch-row input[type="checkbox"]:checked {
    background: var(--grad);
    border-color: transparent;
}

.switch-row input[type="checkbox"]:checked::after {
    left: 20px;
    background: #fff;
}

.switch-label {
    font-size: .86rem;
    color: var(--tx-2);
}

/* ── Settings tabs ── */
.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tab-btn {
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: var(--tx-2);
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 99px;
    cursor: pointer;
    transition: all .2s var(--ease);
}

.tab-btn:hover {
    color: var(--brand);
    border-color: var(--border-c);
}

.tab-btn.active {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.25);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ── Media picker ── */
.picker-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.picker-preview {
    width: 92px;
    height: 62px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    object-fit: cover;
    background: var(--bg-glass);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(41, 26, 10, 0.4);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-2);
    border: 1px solid rgba(234, 88, 12, 0.25);
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 780px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    font-size: 1rem;
    font-weight: 800;
}

.modal-close {
    background: none;
    border: none;
    color: var(--tx-2);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--brand);
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.media-item {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s var(--ease);
    text-align: center;
}

.media-item:hover {
    border-color: var(--border-c);
}

.media-item.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.media-item img {
    width: 100%;
    height: 86px;
    object-fit: cover;
}

.media-item .mi-name {
    font-size: .68rem;
    color: var(--tx-3);
    padding: 6px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Media library cards ── */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.library-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.library-card:hover {
    border-color: var(--border-c);
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.1);
}

.library-card .lc-img {
    height: 130px;
    background: var(--bg-glass);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.library-card .lc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-card .lc-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.library-card .lc-name {
    font-size: .84rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-card .lc-meta {
    font-size: .72rem;
    color: var(--tx-3);
}

.library-card .lc-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* ── Upload dropzone ── */
.upload-box {
    border: 2px dashed rgba(234, 88, 12, 0.4);
    border-radius: var(--r);
    background: rgba(245, 158, 11, 0.05);
    padding: 26px;
    text-align: center;
    color: var(--tx-2);
    font-size: .88rem;
    transition: background .2s var(--ease);
}

.upload-box.dragover {
    background: rgba(245, 158, 11, 0.12);
}

.upload-box input[type="file"] {
    display: none;
}

/* ═══════════════════════════════════════════════════
   MESSAGES INBOX
═══════════════════════════════════════════════════ */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.filter-bar .form-input,
.filter-bar .form-select {
    width: auto;
    min-width: 180px;
}

.msg-row.unread .cell-main {
    color: var(--brand);
}

.msg-row.unread td:first-child {
    box-shadow: inset 3px 0 0 var(--brand);
}

.msg-detail {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: .88rem;
    color: var(--tx-2);
    white-space: pre-wrap;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════
   MISC
═══════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--tx-3);
    font-size: .9rem;
}

.empty-state .es-ico {
    font-size: 2rem;
    margin-bottom: 8px;
}

.inline-form {
    display: inline;
}

.pagination {
    display: flex;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 7px 13px;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--tx-2);
    background: #fff;
}

.pagination .current,
.pagination a:hover {
    border-color: var(--border-c);
    color: var(--brand);
}

.pagination .current {
    background: rgba(234, 88, 12, 0.08);
}

.pagination .disabled span {
    opacity: .4;
}

.toast-zone {
    position: fixed;
    bottom: 22px;
    right: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.toast {
    background: #fff;
    border: 1px solid rgba(5, 150, 105, 0.35);
    color: var(--green);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: .86rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: toast-in .3s var(--ease);
}

.toast.toast-error {
    border-color: rgba(220, 38, 38, 0.35);
    color: var(--red);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.icon-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-choice label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 12px 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: .66rem;
    color: var(--tx-3);
    background: #fff;
    transition: all .2s var(--ease);
}

.icon-choice label:hover {
    border-color: var(--border-c);
}

.icon-choice input {
    display: none;
}

.icon-choice input:checked + .ic-box + .ic-lab {
    color: var(--brand);
}

.icon-choice label:has(input:checked) {
    border-color: var(--brand);
    background: rgba(234, 88, 12, 0.07);
}

.icon-choice .ic-box {
    color: var(--tx-2);
}

.icon-choice label:has(input:checked) .ic-box {
    color: var(--brand);
}

details.acc {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fdf9f2;
    margin-bottom: 10px;
}

details.acc summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 700;
    font-size: .88rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

details.acc summary::-webkit-details-marker {
    display: none;
}

details.acc summary::after {
    content: '+';
    margin-left: auto;
    color: var(--tx-3);
    font-size: 1.1rem;
}

details.acc[open] summary::after {
    content: '–';
}

details.acc .acc-body {
    padding: 4px 16px 16px;
    color: var(--tx-2);
    font-size: .88rem;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 860px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-105%);
        transition: transform .28s var(--ease);
        box-shadow: 20px 0 60px rgba(122, 78, 24, 0.2);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .burger-admin {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-content {
        padding: 20px 16px 50px;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .topbar-user {
        display: none;
    }
}
