/* ==========================================================
   admin.css - admin panel (login pages + dashboard layout)
   Also used by the public contact form for buttons / fields / alerts.
   Colours come from the variables in style.css.
   ========================================================== */
:root { --sb-w: 264px; --topbar-h: 64px; --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08); --shadow-md: 0 8px 24px rgba(16, 24, 40, .1); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted-color); margin: 0; }
.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 20px;
    border: 2px solid var(--primary-color); border-radius: 10px;
    background: var(--primary-color); color: var(--white);
    font-family: var(--font-heading); font-size: .9rem; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(0, 77, 38, .25); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: var(--white); color: var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: var(--white); border-color: var(--primary-color); }
.btn-danger { background: #d92d20; border-color: #d92d20; }
.btn-danger:hover { background: #b42318; border-color: #b42318; box-shadow: 0 4px 12px rgba(180, 35, 24, .25); }
.btn-ghost-danger { background: var(--white); color: #b42318; border-color: #fecdca; }
.btn-ghost-danger:hover { background: #d92d20; border-color: #d92d20; color: var(--white); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .8rem; border-width: 1.5px; border-radius: 8px; gap: 6px; }
.btn-block { width: 100%; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 2px; }

.icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 0; border-radius: 10px;
    background: transparent; color: var(--muted-color); cursor: pointer; text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary-color); }
.icon-btn .dot {
    position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: #d92d20; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
    box-shadow: 0 0 0 2px var(--white);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; color: var(--text-color); }
.field label small, .field > small { font-weight: 400; color: var(--muted-color); }
.field > small { display: block; margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], input[type=file], select, textarea {
    width: 100%; padding: 11px 14px; min-height: 46px;
    border: 1.5px solid #d0d5dd; border-radius: 10px;
    background: var(--white); color: var(--text-color); font: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(0, 102, 51, .14); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 50px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--muted-color); cursor: pointer; }
.pw-toggle:hover { color: var(--primary-color); background: var(--primary-light); }
.pw-toggle .icon + .icon { display: none; }
.pw-toggle.showing .icon:first-child { display: none; }
.pw-toggle.showing .icon + .icon { display: inline-block; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-family: var(--font-heading); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400 !important; margin: 8px 0 0 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary-color); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
form.inline { display: inline; }
.field-inline select { max-width: 260px; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; border-radius: 10px; font-size: .93rem; line-height: 1.5; }
.alert > .icon { margin-top: 2px; }
.alert-text { flex: 1; }
.alert-error   { background: #fef3f2; border-color: #fecdca; color: #912018; }
.alert-success { background: #ecfdf3; border-color: #abefc6; color: #05603a; }
.alert-close { display: inline-flex; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: inherit; opacity: .7; cursor: pointer; }
.alert-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }

/* ==========================================================
   Login / signup / reset pages
   ========================================================== */
.auth-body { min-height: 100vh; background: var(--light-bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-art { display: none; }

.auth-card { align-self: center; justify-self: center; width: calc(100% - 32px); max-width: 440px; margin: 24px 0; padding: 32px 26px; background: var(--white); border-radius: 16px; border-top: 5px solid var(--secondary-color); box-shadow: var(--shadow-md); }
.auth-logo { display: block; text-align: center; margin-bottom: 14px; }
.auth-logo img { height: 60px; width: auto; }
.auth-card h1 { margin: 0 0 6px; text-align: center; font-family: var(--font-heading); font-size: 1.6rem; color: var(--primary-color); }
.auth-sub { margin: 0 0 22px; text-align: center; color: var(--muted-color); font-size: .95rem; }
.auth-forgot { margin: -6px 0 16px; text-align: right; font-size: .9rem; }
.auth-alt { margin: 22px 0 0; text-align: center; font-size: .92rem; color: var(--muted-color); }
.auth-card a:not(.btn):not(.auth-logo) { color: var(--primary-color); font-weight: 600; }

@media (min-width: 900px) {
    .auth-shell { grid-template-columns: 1.05fr 1fr; }
    .auth-card { margin: 0; padding: 40px; max-width: 460px; border: 0; box-shadow: none; background: transparent; }
    .auth-shell { background: var(--white); }
    .auth-art {
        position: relative; display: flex; align-items: center; overflow: hidden; padding: 48px;
        background: linear-gradient(140deg, var(--primary-dark), var(--primary-color)); color: var(--white);
    }
    .auth-art-pattern { position: absolute; inset: 0; width: 100%; height: 100%; }
    .auth-art-body { position: relative; max-width: 420px; }
    .auth-art-icon { display: inline-flex; align-items: center; justify-content: center; width: 68px; height: 68px; margin-bottom: 22px; border-radius: 18px; background: rgba(255, 255, 255, .14); color: var(--secondary-color); }
    .auth-art h2 { margin: 0 0 12px; font-family: var(--font-heading); font-size: 2rem; line-height: 1.15; }
    .auth-art p { margin: 0 0 24px; opacity: .9; line-height: 1.7; }
    .auth-art ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
    .auth-art li { display: flex; align-items: center; gap: 12px; }
    .auth-art li .icon { color: var(--secondary-color); }
}

/* ==========================================================
   Dashboard layout: collapsible sidebar + top bar
   ========================================================== */
.admin-body { min-height: 100vh; background: #f4f7f5; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sb-w);
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, #00552b 0%, var(--primary-dark) 100%); color: #dbeae2;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
}
.sidebar.open { transform: none; visibility: visible; transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar-brand img { height: 42px; width: auto; padding: 4px 8px; background: var(--white); border-radius: 8px; }
.sidebar-brand span { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; color: var(--white); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
.nav-heading { margin: 18px 10px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; margin-bottom: 2px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 500; transition: background var(--transition), color var(--transition); }
.sidebar a .icon { color: rgba(255, 255, 255, .7); transition: color var(--transition); }
.sidebar a:hover { background: rgba(255, 255, 255, .09); color: var(--white); }
.sidebar a:hover .icon { color: var(--secondary-color); }
.sidebar a.active { position: relative; background: rgba(255, 255, 255, .14); color: var(--white); font-weight: 600; }
.sidebar a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--secondary-color); }
.sidebar a.active .icon { color: var(--secondary-color); }
.sidebar a:focus-visible { outline-color: var(--secondary-color); outline-offset: -2px; }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 11px; background: var(--secondary-color); color: #1f2937; font-style: normal; font-size: .72rem; font-weight: 700; text-align: center; }
.sidebar-foot { padding: 10px 12px 14px; border-top: 1px solid rgba(255, 255, 255, .1); }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 24, 40, .55); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

.admin-main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; transition: margin-left .25s ease; }

/* top bar */
.admin-topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px; padding: 0 16px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}
.page-heading { flex: 1; min-width: 0; }
.page-heading h1 { margin: 0; font-family: var(--font-heading); font-size: 1.15rem; line-height: 1.2; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { display: none; margin: 2px 0 0; font-size: .78rem; color: var(--muted-color); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--primary-color); text-decoration: underline; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 4px; border-radius: 10px; cursor: pointer; list-style: none; color: var(--muted-color); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--primary-light); }
.user-menu[open] summary .icon:last-child { transform: rotate(180deg); }
.user-name { display: none; font-weight: 600; font-size: .9rem; color: var(--text-color); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary-color); color: var(--white); font-family: var(--font-heading); font-size: .8rem; font-weight: 700; }
.avatar-lg { width: 44px; height: 44px; font-size: 1rem; flex-shrink: 0; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 270px; padding: 8px; background: var(--white); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-md); }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.menu-head div { display: flex; flex-direction: column; min-width: 0; }
.menu-head strong { overflow: hidden; text-overflow: ellipsis; }
.menu-head small { color: var(--muted-color); overflow: hidden; text-overflow: ellipsis; }
.menu-head small.role { color: var(--primary-color); font-weight: 600; }
.user-menu .menu a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border-radius: 8px; color: var(--text-color); text-decoration: none; }
.user-menu .menu a:hover { background: var(--primary-light); color: var(--primary-color); }

.admin-content { flex: 1; width: 100%; max-width: 1240px; padding: 20px 16px 32px; }
.admin-footer { padding: 16px; text-align: center; font-size: .82rem; color: var(--muted-color); }

@media (min-width: 640px)  { .crumbs { display: block; } .user-name { display: inline; } .admin-topbar { padding: 0 24px; } .admin-content { padding: 26px 24px 40px; } }
@media (min-width: 992px) {
    /* desktop: sidebar is docked; the top-bar button slides it away (state saved in the browser) */
    .sidebar { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; box-shadow: none; }
    .admin-main { margin-left: var(--sb-w); }
    html.sb-hidden .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
    html.sb-hidden .admin-main { margin-left: 0; }
    .sidebar-backdrop { display: none; }
    .admin-content { padding: 30px 36px 48px; }
}

/* ---------- Panels ---------- */
.panel { padding: 22px; background: var(--white); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: var(--shadow-sm); }
.panel > h2, .panel-head h2 { margin: 0 0 14px; font-family: var(--font-heading); font-size: 1.05rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-head a { font-size: .85rem; font-weight: 600; color: var(--primary-color); text-decoration: none; }
.panel-head a:hover { text-decoration: underline; }
.form-panel { max-width: 820px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; padding: 26px 12px; text-align: center; color: var(--muted-color); }
.empty .icon { color: #c5ccd6; }

/* ---------- Dashboard ---------- */
.hero-banner {
    position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    padding: 26px 24px; margin-bottom: 20px; border-radius: 16px; color: var(--white);
    background: linear-gradient(120deg, var(--primary-dark), var(--primary-color));
}
.hero-banner svg.bg { position: absolute; right: -40px; top: -40px; width: 320px; height: 320px; opacity: .12; pointer-events: none; }
.hero-banner h2 { position: relative; margin: 0 0 4px; font-family: var(--font-heading); font-size: clamp(1.3rem, 3vw, 1.75rem); }
.hero-banner p { position: relative; margin: 0; opacity: .88; }
.hero-banner .quick { position: relative; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-banner .btn { background: var(--secondary-color); border-color: var(--secondary-color); color: #1f2937; }
.hero-banner .btn:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); box-shadow: none; }
.hero-banner .btn-outline { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .55); }
.hero-banner .btn-outline:hover { background: rgba(255, 255, 255, .14); border-color: var(--white); color: var(--white); }

.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--white); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: var(--shadow-sm); color: var(--text-color); text-decoration: none; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; background: var(--tone-bg, var(--primary-light)); color: var(--tone, var(--primary-color)); }
.tone-green  { --tone: #067647; --tone-bg: #dcfae6; }
.tone-amber  { --tone: #b54708; --tone-bg: #fef0c7; }
.tone-blue   { --tone: #175cd3; --tone-bg: #d1e9ff; }
.tone-rose   { --tone: #c11574; --tone-bg: #fce7f6; }
.stat-text { display: flex; flex-direction: column; min-width: 0; }
.stat-num { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted-color); font-size: .82rem; }

.dash-grid { display: grid; gap: 16px; }
.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font-main); fill: var(--muted-color); font-size: 11px; }
.chart .bar { fill: var(--primary-color); transition: fill var(--transition); }
.chart .bar:hover { fill: var(--secondary-color); }
.chart .bar-empty { fill: #e4e7ec; }
.chart .grid-line { stroke: #eaecf0; stroke-width: 1; }
.chart .val { fill: var(--text-color); font-weight: 700; }
.chart-note { margin: 8px 0 0; font-size: .82rem; color: var(--muted-color); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-color); }
.list li:last-child { border-bottom: 0; }
.list .li-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--primary-light); color: var(--primary-color); }
.list a { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--text-color); text-decoration: none; }
.list a strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list a:hover strong { color: var(--primary-color); }
.list a.unread strong::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--secondary-color); }
.list span.sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-color); font-size: .85rem; }
.list time { flex-shrink: 0; color: var(--muted-color); font-size: .78rem; }

@media (min-width: 992px) {
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid .wide { grid-column: 1 / -1; }
}

/* ---------- Toolbar, tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search { position: relative; display: flex; gap: 8px; flex: 1; max-width: 460px; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #98a2b3; pointer-events: none; }
.search input { padding-left: 40px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--white); border: 1px solid var(--border-color); border-radius: 12px; }
.tabs a { padding: 7px 16px; border-radius: 9px; color: var(--muted-color); text-decoration: none; font-weight: 600; font-size: .88rem; }
.tabs a:hover { color: var(--primary-color); }
.tabs a.active { background: var(--primary-color); color: var(--white); }
.table-wrap { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 16px; background: #f9fafb; border-bottom: 1px solid var(--border-color); color: var(--muted-color); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.row-unread { background: #fffcf0; }
.thumb { width: 64px; height: 46px; object-fit: cover; border-radius: 8px; display: block; }
.thumb-empty { display: flex; align-items: center; justify-content: center; background: #f2f4f7; color: #98a2b3; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-block; padding: 3px 11px; border-radius: 12px; font-size: .74rem; font-weight: 700; background: #f2f4f7; color: #344054; }
.tag-published, .tag-active { background: #dcfae6; color: #067647; }
.tag-draft, .tag-pending, .tag-new { background: #fef0c7; color: #b54708; }
.tag-disabled { background: #fee4e2; color: #b42318; }

/* phones: table rows become cards */
@media (max-width: 720px) {
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 10px 14px; border-bottom: 1px solid var(--border-color); }
    .table tbody tr:last-child { border-bottom: 0; }
    .table td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
    .table td::before { content: attr(data-label); flex-shrink: 0; font-weight: 600; text-align: left; color: var(--muted-color); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
    .table td.actions { justify-content: flex-end; }
}

/* ---------- Gallery, previews ---------- */
.gallery-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.gallery-item { margin: 0; overflow: hidden; background: var(--white); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition); }
.gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gallery-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-item figcaption { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.gallery-item figcaption span { color: var(--muted-color); font-size: .88rem; }
.gallery-item time { color: var(--muted-color); font-size: .78rem; }
.gallery-item .actions { margin-top: 8px; }
.current-image { margin-bottom: 10px; }
.current-image img, .preview { display: block; max-width: 260px; max-height: 180px; border-radius: 10px; border: 1px solid var(--border-color); }
.preview { margin-top: 10px; }
.preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview-grid img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); }

/* ---------- Messages ---------- */
.message h2 { margin-bottom: 14px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 18px; }
.meta dt { font-weight: 600; color: var(--muted-color); }
.meta dd { margin: 0; }
.message-body { padding: 18px; margin-bottom: 20px; background: #f9fafb; border: 1px solid var(--border-color); border-radius: 10px; line-height: 1.75; overflow-wrap: anywhere; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.pagination a { min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--border-color); border-radius: 10px; background: var(--white); color: var(--text-color); text-decoration: none; }
.pagination a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pagination a.current { background: var(--primary-color); border-color: var(--primary-color); color: var(--white); }

@media (prefers-reduced-motion: reduce) {
    .sidebar, .admin-main, .sidebar-backdrop { transition: none !important; }
}
.icon.flip { transform: scaleX(-1); }

/* ---------- Team member form + list ---------- */
.member-form { display: grid; gap: 24px; max-width: 980px; }
.member-photo label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .9rem; }
.member-photo label small { font-weight: 400; color: var(--muted-color); }
.member-photo > small { display: block; margin-top: 8px; color: var(--muted-color); }
.photo-frame { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 240px; aspect-ratio: 4 / 5; margin-bottom: 12px; overflow: hidden; border: 2px dashed #d0d5dd; border-radius: 14px; background: #f9fafb; }
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; border: 0; border-radius: 0; max-width: none; max-height: none; }
.photo-frame img[hidden] { display: none; }
.photo-empty { color: #c5ccd6; }
.member-photo input[type=file] { max-width: 240px; }
@media (min-width: 820px) { .member-form { grid-template-columns: 260px 1fr; } }

.avatar-thumb { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; }
.avatar-empty { background: #f2f4f7; color: #98a2b3; }
.btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ---------- Drag & drop upload box + ranking row ---------- */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px; text-align: center; cursor: pointer; border: 2px dashed #cbd5e1; border-radius: 12px; background: #f9fafb; transition: border-color var(--transition), background var(--transition); }
.dropzone:hover, .dropzone.dragging, .dropzone:focus-within { border-color: var(--primary-color); background: var(--primary-light); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.dropzone .icon { color: var(--primary-color); }
.dropzone strong { font-size: .92rem; overflow-wrap: anywhere; }
.dropzone small { color: var(--muted-color); }
.member-photo .dropzone { max-width: 260px; }
.field-row { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.rank-help { margin: -8px 0 18px; font-size: .85rem; color: var(--muted-color); }
.current-file { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .9rem; } .current-file a { color: var(--primary-color); font-weight: 600; }
