/* =====================================================================
   Charlton Admin — WordPress-style dashboard
   ===================================================================== */

:root {
    --wp-bg:        #f0f0f1;
    --wp-menu:      #1d2327;
    --wp-menu-hi:   #2c3338;
    --wp-menu-txt:  #f0f0f1;
    --wp-menu-icon: #a7aaad;
    --wp-blue:      #2271b1;
    --wp-blue-dk:   #135e96;
    --wp-blue-lt:   #72aee6;
    --wp-border:    #c3c4c7;
    --wp-text:      #1d2327;
    --wp-muted:     #646970;
    --wp-green:     #00a32a;
    --wp-red:       #d63638;
    --wp-orange:    #dba617;
    --sidebar-w:    170px;
    --sidebar-fold: 60px;
    --bar-h:        36px;
    --radius:       4px;
}

* { box-sizing: border-box; }

body.admin {
    margin: 0;
    background: var(--wp-bg);
    color: var(--wp-text);
    font: 400 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--wp-blue); text-decoration: none; }
a:hover { color: var(--wp-blue-dk); text-decoration: underline; }
.muted { color: var(--wp-muted); }
.hidden { display: none !important; }
code { background: #f6f7f7; padding: 2px 5px; border-radius: 2px; font-size: 12px; }

/* ---------------------------------------------------------------- Admin bar */
#adminbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--bar-h);
    background: var(--wp-menu);
    color: #c3c4c7;
    display: flex; align-items: center; gap: 2px;
    padding-right: 8px;
}
#adminbar .ab-item {
    display: flex; align-items: center; gap: 6px;
    height: var(--bar-h); padding: 0 10px;
    color: #c3c4c7; font-size: 13px; text-decoration: none;
}
#adminbar .ab-item:hover { background: var(--wp-menu-hi); color: var(--wp-blue-lt); text-decoration: none; }
#adminbar .ab-icon { width: 16px; height: 16px; fill: currentColor; }
.ab-logo { font-weight: 600; }
.ab-mark {
    width: 22px; height: 22px; border-radius: 3px;
    background: linear-gradient(135deg, #7b1e2b, #4a0e1a);
    color: #f0d9a7; font-weight: 700; font-size: 13px;
    display: grid; place-items: center;
}
.ab-name { color: #f0f0f1; }
.ab-right { margin-left: auto; position: relative; }
.ab-account {
    display: flex; align-items: center; gap: 8px;
    height: var(--bar-h); padding: 0 10px; cursor: pointer; font-size: 13px;
}
.ab-account:hover { background: var(--wp-menu-hi); }
.ab-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--wp-blue); color: #fff;
    display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.ab-avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.ab-dropdown {
    position: absolute; top: var(--bar-h); right: 0; min-width: 210px;
    background: #fff; border: 1px solid var(--wp-border);
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
    display: none; flex-direction: column; padding: 6px 0;
}
.ab-account.open .ab-dropdown { display: flex; }
.ab-dd-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #f0f0f1; }
.ab-dd-head strong { display: block; color: var(--wp-text); }
.ab-dd-head span { font-size: 12px; color: var(--wp-muted); }
.ab-dropdown a { padding: 8px 14px; color: var(--wp-blue); font-size: 13px; }
.ab-dropdown a:hover { background: #f6f7f7; text-decoration: none; }
.ab-dropdown a.danger { color: var(--wp-red); border-top: 1px solid #f0f0f1; margin-top: 4px; }

.menu-toggle {
    display: none; width: 44px; height: var(--bar-h);
    background: none; border: 0; cursor: pointer;
    flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.menu-toggle span { display: block; width: 20px; height: 2px; background: #c3c4c7; }

/* ---------------------------------------------------------------- Sidebar */
#adminmenuwrap {
    position: fixed; top: var(--bar-h); bottom: 0; left: 0; z-index: 90;
    width: var(--sidebar-w);
    background: var(--wp-menu);
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    transition: width .15s ease;
}
#adminmenu { list-style: none; margin: 0; padding: 0; flex: 1; }
#adminmenu li.separator { height: 5px; padding: 5px 0; }
#adminmenu li.separator div { height: 1px; background: #3c434a; }
#adminmenu li.menu-section { padding: 14px 12px 5px; }
#adminmenu li.menu-section span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #8b949e; }
body.folded #adminmenu li.menu-section { padding: 6px 8px; }
body.folded #adminmenu li.menu-section span { font-size: 0; height: 1px; background: #3c434a; }
#adminmenu .menu-top > a {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px;
    color: var(--wp-menu-txt); font-size: 13px; line-height: 1.3;
    text-decoration: none; position: relative;
}
#adminmenu .menu-icon { width: 18px; height: 18px; fill: var(--wp-menu-icon); flex: none; }
#adminmenu .menu-top:hover > a { background: var(--wp-menu-hi); color: var(--wp-blue-lt); }
#adminmenu .menu-top:hover .menu-icon { fill: var(--wp-blue-lt); }
#adminmenu .menu-top.current > a { background: var(--wp-blue); color: #fff; font-weight: 600; }
#adminmenu .menu-top.current .menu-icon { fill: #fff; }
#adminmenu .bubble {
    margin-left: auto; background: var(--wp-red); color: #fff;
    border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600;
}

/* Submenu — opened by clicking the parent item, never on hover. */
#adminmenu .submenu {
    list-style: none; margin: 0; padding: 6px 0;
    display: none; background: var(--wp-menu-hi);
}
#adminmenu .menu-top.open > .submenu { display: block; }
#adminmenu .submenu-title { display: none; }

/* Caret showing whether a section is open. */
#adminmenu .menu-top.has-sub > a::after {
    content: ""; margin-left: auto; flex: none;
    width: 0; height: 0;
    border-left: 4px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    opacity: .55;
    transition: transform .15s ease;
}
#adminmenu .menu-top.has-sub.open > a::after { transform: rotate(90deg); opacity: .9; }
#adminmenu .submenu a {
    display: block; padding: 6px 10px 6px 36px;
    color: #c3c4c7; font-size: 13px;
}
#adminmenu .submenu a:hover { color: var(--wp-blue-lt); text-decoration: none; }

#collapse-button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 9px 10px; margin-top: auto;
    background: none; border: 0; border-top: 1px solid #3c434a;
    color: var(--wp-menu-icon); font-size: 13px; line-height: 1.3; cursor: pointer;
}
#collapse-button:hover { color: var(--wp-blue-lt); }
#collapse-button .menu-icon { width: 18px; height: 18px; flex: none; fill: currentColor; transition: transform .15s; }

/* Folded (collapsed) state */
body.folded #adminmenuwrap { width: var(--sidebar-fold); }
body.folded #adminmenu .menu-label,
body.folded #adminmenu .bubble,
body.folded #collapse-button .menu-label { display: none; }
body.folded #collapse-button .menu-icon { transform: rotate(180deg); }
/* Folded: the submenu flies out beside the rail, still only when clicked. */
body.folded #adminmenu .submenu {
    position: absolute; left: var(--sidebar-fold); top: 0;
    min-width: 180px; z-index: 95;
    box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
body.folded #adminmenu .menu-top.open > .submenu { display: block; }
body.folded #adminmenu .menu-top.has-sub > a::after { display: none; }
body.folded #adminmenu .menu-top > a { justify-content: center; padding: 11px 10px; }
body.folded #adminmenu .submenu-title {
    display: block; padding: 8px 12px; color: #fff;
    font-weight: 600; border-bottom: 1px solid #3c434a;
}
body.folded #adminmenu .submenu a { padding-left: 12px; }
body.folded #adminmenu .menu-top { position: relative; }
body.folded #collapse-button { justify-content: center; }
body.folded #wpcontent { margin-left: var(--sidebar-fold); }

.menu-overlay { display: none; }

/* ---------------------------------------------------------------- Layout */
#wpcontent {
    margin-left: var(--sidebar-w);
    padding-top: var(--bar-h);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left .15s ease;
}
#wpbody-content { flex: 1; padding: 10px 20px 40px; }
.wrap { max-width: 1400px; margin: 0 auto; }

#wpfooter {
    padding: 12px 20px; border-top: 1px solid var(--wp-border);
    color: var(--wp-muted); font-size: 12px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
}
#wpfooter p { margin: 0; }

/* ---------------------------------------------------------------- Headings */
.wp-heading-inline {
    display: inline-block; margin: 12px 6px 0 0;
    font-size: 23px; font-weight: 400; line-height: 1.3;
}
.page-title-action {
    display: inline-block; margin-left: 4px; padding: 4px 10px;
    background: #f6f7f7; border: 1px solid var(--wp-blue);
    border-radius: 3px; color: var(--wp-blue);
    font-size: 13px; vertical-align: 3px;
}
.page-title-action:hover { background: var(--wp-blue); color: #fff; text-decoration: none; }
.wp-header-end { visibility: hidden; margin: 6px 0 0; border: 0; }

/* ---------------------------------------------------------------- Notices */
.notice {
    position: relative;
    background: #fff; border-left: 4px solid var(--wp-blue);
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin: 12px 0; padding: 10px 40px 10px 14px;
}
.notice p { margin: 4px 0; }
.notice ul { margin: 6px 0 6px 18px; }
.notice-success { border-left-color: var(--wp-green); }
.notice-error   { border-left-color: var(--wp-red); }
.notice-warning { border-left-color: var(--wp-orange); }
.notice-dismiss {
    position: absolute; top: 6px; right: 6px;
    background: none; border: 0; cursor: pointer;
    font-size: 20px; line-height: 1; color: var(--wp-muted);
}
.notice-dismiss:hover { color: var(--wp-red); }

/* ---------------------------------------------------------------- Buttons */
.button, button.button {
    display: inline-block; padding: 5px 12px;
    background: #f6f7f7; border: 1px solid var(--wp-border);
    border-radius: 3px; color: #2c3338;
    font-size: 13px; line-height: 1.6; cursor: pointer;
    text-decoration: none; white-space: nowrap;
}
.button:hover { background: #f0f0f1; border-color: #8c8f94; color: #1d2327; text-decoration: none; }
.button-primary {
    background: var(--wp-blue); border-color: var(--wp-blue); color: #fff;
}
.button-primary:hover { background: var(--wp-blue-dk); border-color: var(--wp-blue-dk); color: #fff; }
.button-large, .button-hero { padding: 8px 16px; font-size: 14px; }
.button-link {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--wp-blue); font-size: 12px; text-decoration: none;
}
.button-link:hover { text-decoration: underline; }
.button-link.delete, .submitdelete { color: var(--wp-red); }
.submitdelete { font-size: 13px; }

/* ---------------------------------------------------------------- Filters */
.subsubsub {
    list-style: none; margin: 8px 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: 4px;
    font-size: 13px; color: var(--wp-muted);
}
.subsubsub a { color: var(--wp-blue); }
.subsubsub a.current { color: var(--wp-text); font-weight: 600; }
.subsubsub .count { color: var(--wp-muted); }

.search-form {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin: 10px 0; justify-content: flex-end;
}
.search-form input[type="search"] { min-width: 220px; }

/* A single row of filters above a list: search, dropdowns, a date range and the
   buttons. Form controls are width:100% by default (right for stacked forms,
   wrong here), so everything inside a filter bar is put back to auto width and
   given one shared height — otherwise each control claims its own row. */
.filter-bar {
    display: flex; flex-wrap: nowrap; align-items: center;
    gap: 8px; margin: 0 0 14px;
}
.filter-bar input[type="search"], .filter-bar input[type="date"],
.filter-bar input[type="text"], .filter-bar select, .filter-bar .button {
    width: auto; min-height: 32px; box-sizing: border-box;
    font-size: 13px; margin: 0;
}
.filter-bar input[type="search"] { flex: 1 1 220px; min-width: 0; max-width: 380px; }
.filter-bar select { flex: 0 1 auto; min-width: 0; }
.filter-bar .button { flex: 0 0 auto; }
/* The two halves of a date range read as one control. */
.filter-bar .range {
    display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
    font-size: 12px; color: var(--wp-muted); white-space: nowrap;
}
.filter-bar .range input[type="date"] { width: 9.5em; }
.filter-bar .grow { margin-left: auto; white-space: nowrap; font-size: 13px; }

/* Not enough room for one line: wrap in a considered order rather than
   letting each control drop on its own. */
@media (max-width: 1100px) {
    .filter-bar { flex-wrap: wrap; }
    .filter-bar input[type="search"] { flex: 1 1 240px; max-width: none; }
    .filter-bar .grow { margin-left: auto; }
}
@media (max-width: 782px) {
    .filter-bar input[type="search"] { flex: 1 1 100%; }
    .filter-bar select { flex: 1 1 calc(50% - 4px); }
    .filter-bar .range { flex: 1 1 100%; }
    .filter-bar .range input[type="date"] { flex: 1 1 auto; width: auto; min-width: 0; }
    .filter-bar .grow { margin-left: 0; width: 100%; }
}

/* ---------------------------------------------------------------- Inputs */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="date"], input[type="time"],
select, textarea {
    width: 100%; max-width: 100%;
    padding: 6px 8px;
    background: #fff; border: 1px solid #8c8f94; border-radius: var(--radius);
    color: var(--wp-text); font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--wp-blue);
    box-shadow: 0 0 0 1px var(--wp-blue);
}
textarea { resize: vertical; }
select { max-width: 100%; }
.search-form input, .search-form select, .bulkactions select { width: auto; }

label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
.req { color: var(--wp-red); }
.help { margin: 4px 0 0; font-size: 12px; color: var(--wp-muted); font-style: italic; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.check input { width: auto; }

/* ---------------------------------------------------------------- Postbox */
.postbox {
    background: #fff; border: 1px solid var(--wp-border);
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 20px; border-radius: var(--radius);
}
.postbox-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid #f0f0f1;
}
.postbox-header h2 { margin: 0; font-size: 14px; font-weight: 600; }
.postbox-action { font-size: 12px; }
.inside { padding: 14px; }
.postbox-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; background: #f6f7f7;
    border-top: 1px solid var(--wp-border);
    border-radius: 0 0 var(--radius) var(--radius);
}
.postbox-footer .button-primary { margin-left: auto; }

/* ---------------------------------------------------------------- Two-column edit layout */
.post-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.post-body-content, .post-body-side { min-width: 0; }

.fields { display: flex; flex-wrap: wrap; gap: 14px; }
.field { flex: 1 1 100%; min-width: 0; }
.field-half { flex: 1 1 calc(50% - 7px); min-width: 180px; }
.field-sep {
    flex: 1 1 100%; margin: 8px 0 0;
    padding-top: 12px; border-top: 1px solid #f0f0f1;
    font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--wp-muted);
}
.publish-meta { margin: 0; font-size: 12px; color: var(--wp-muted); }

/* Slug field */
.slug-field { display: flex; align-items: stretch; }
.slug-prefix {
    display: flex; align-items: center; padding: 0 8px;
    background: #f6f7f7; border: 1px solid #8c8f94; border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 12px; color: var(--wp-muted);
    max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slug-field input { border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------------------------------------------------------------- Rich text editor */
.editor-wrap { border: 1px solid #8c8f94; border-radius: var(--radius); overflow: hidden; }
.editor-toolbar {
    display: flex; flex-wrap: wrap; gap: 2px;
    padding: 5px; background: #f6f7f7; border-bottom: 1px solid var(--wp-border);
}
.ed-btn {
    min-width: 28px; padding: 3px 7px;
    background: #fff; border: 1px solid var(--wp-border); border-radius: 2px;
    font-size: 12px; cursor: pointer; color: #2c3338;
}
.ed-btn:hover { background: var(--wp-blue); color: #fff; border-color: var(--wp-blue); }
.editor-area {
    min-height: 220px; max-height: 520px; overflow-y: auto;
    padding: 12px; background: #fff; font-size: 14px; line-height: 1.7;
}
.editor-area:focus { outline: none; }
.editor-area p { margin: 0 0 .8em; }
.editor-area blockquote {
    margin: 0 0 .8em; padding-left: 12px;
    border-left: 3px solid var(--wp-border); color: var(--wp-muted);
}

/* ---------------------------------------------------------------- Image field */
.image-preview {
    display: grid; place-items: center;
    min-height: 140px; margin-bottom: 8px;
    background: #f6f7f7; border: 1px dashed var(--wp-border); border-radius: var(--radius);
    overflow: hidden;
}
.image-preview img, .image-preview video { max-width: 100%; max-height: 200px; display: block; }
.image-placeholder { color: var(--wp-muted); font-size: 12px; }
.image-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- List table */
.tablenav {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin: 10px 0;
}
.bulkactions { display: flex; gap: 6px; }
.tablenav-pages { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--wp-muted); }
.pagination-links { display: flex; align-items: center; gap: 3px; }
.page-btn {
    display: grid; place-items: center;
    min-width: 30px; height: 30px; padding: 0 6px;
    background: #f6f7f7; border: 1px solid var(--wp-border); border-radius: 3px;
    color: var(--wp-blue); text-decoration: none;
}
.page-btn:hover { background: var(--wp-blue); color: #fff; }
.page-btn.disabled { color: #a7aaad; background: #f6f7f7; cursor: default; }
.paging-input { padding: 0 6px; }

.wp-list-table {
    width: 100%; border-collapse: collapse;
    background: #fff; border: 1px solid var(--wp-border);
    box-shadow: 0 1px 1px rgba(0,0,0,.04); border-radius: var(--radius);
}
.wp-list-table thead th, .wp-list-table thead td {
    padding: 10px 12px; text-align: left;
    border-bottom: 1px solid var(--wp-border);
    font-size: 13px; font-weight: 600; color: var(--wp-text);
    white-space: nowrap;
}
.wp-list-table tbody td, .wp-list-table tbody th {
    padding: 10px 12px; border-top: 1px solid #f0f0f1;
    vertical-align: middle; font-size: 13px;
}
.wp-list-table.striped tbody tr:nth-child(odd) { background: #f6f7f7; }
.wp-list-table tbody tr:hover { background: #f0f6fc; }
.check-column { width: 32px; padding-right: 0 !important; }
.check-column input { width: auto; }
.col-thumb { width: 52px; }
.row-thumb {
    width: 40px; height: 40px; object-fit: cover;
    border-radius: 3px; background: #f0f0f1; display: block;
}
.row-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    display: grid; place-items: center;
}
.row-avatar.initials { background: var(--wp-blue); color: #fff; font-weight: 600; }
.row-title { font-size: 14px; }
.row-sub { color: var(--wp-muted); font-size: 12px; margin-top: 2px; }
.row-actions {
    visibility: hidden; margin-top: 4px;
    font-size: 12px; color: var(--wp-muted);
}
tr:hover .row-actions { visibility: visible; }
.row-actions .trash a { color: var(--wp-red); }
.row-unread { font-weight: 600; background: #fff !important; box-shadow: inset 3px 0 0 var(--wp-blue); }

.status-pill {
    display: inline-block; padding: 2px 9px; border-radius: 10px;
    font-size: 11px; font-weight: 600; text-decoration: none;
}
.status-published { background: #edfaef; color: #007017; border: 1px solid #b8e6c1; }
.status-draft     { background: #f0f0f1; color: #646970; border: 1px solid #dcdcde; }
.status-pill:hover { text-decoration: none; opacity: .8; }

.badge {
    display: inline-block; padding: 2px 8px;
    background: #f0f6fc; border: 1px solid #c5d9ed; border-radius: 3px;
    font-size: 11px; color: #0a4b78; white-space: nowrap;
}
.star { font-size: 17px; color: #dcdcde; text-decoration: none; }
.star.on { color: var(--wp-orange); }
.star:hover { text-decoration: none; color: var(--wp-orange); }
.stars { color: var(--wp-orange); letter-spacing: 1px; }
.stock { font-weight: 600; }
.stock-ok  { color: var(--wp-green); }
.stock-low { color: var(--wp-orange); }
.stock-out { color: var(--wp-red); }

.empty-state { padding: 36px 16px; text-align: center; color: var(--wp-muted); }
.empty-state p { margin: 0 0 12px; }

/* ---------------------------------------------------------------- Dashboard */
.welcome-panel {
    position: relative; margin: 16px 0;
    padding: 20px; background: #fff;
    border: 1px solid var(--wp-border); border-radius: var(--radius);
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.welcome-panel h2 { margin: 0 0 4px; font-size: 21px; font-weight: 400; }
.about-description { margin: 0 0 16px; color: var(--wp-muted); font-size: 15px; }
.welcome-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.welcome-columns h3 { margin: 0 0 10px; font-size: 14px; }
.welcome-columns ul { margin: 0; padding: 0; list-style: none; }
.welcome-columns li { margin-bottom: 6px; }
.welcome-icon::before { content: "›"; margin-right: 6px; color: var(--wp-muted); }

.stat-tiles {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.stat-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 16px; background: #fff;
    border: 1px solid var(--wp-border); border-radius: var(--radius);
    color: var(--wp-text); text-decoration: none;
    transition: transform .12s, box-shadow .12s;
}
.stat-tile:hover {
    transform: translateY(-2px); text-decoration: none; color: var(--wp-text);
    box-shadow: 0 4px 10px rgba(0,0,0,.08); border-color: var(--wp-blue);
}
.stat-icon { display: block; margin-bottom: 4px; }
.stat-icon .menu-icon { width: 22px; height: 22px; fill: var(--wp-blue); }
.stat-num { font-size: 26px; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--wp-muted); text-transform: uppercase; letter-spacing: .04em; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }

.glance-list { list-style: none; margin: 0; padding: 0; }
.glance-list li { padding: 5px 0; border-bottom: 1px solid #f0f0f1; }
.glance-list li:last-child { border-bottom: 0; }
.glance-list li.warn strong { color: var(--wp-orange); }
.glance-foot { margin: 10px 0 0; font-size: 12px; color: var(--wp-muted); }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid #f0f0f1;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-list li.unread strong::before {
    content: ""; display: inline-block;
    width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
    background: var(--wp-blue);
}
.act-desc { display: block; color: var(--wp-muted); font-size: 12px; margin-top: 2px; }
.act-time { color: var(--wp-muted); font-size: 12px; white-space: nowrap; }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f0f1; }
.event-list li:last-child { border-bottom: 0; }
.ev-date {
    display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: var(--radius);
    background: #f0f6fc; border: 1px solid #c5d9ed; color: #0a4b78;
}
.ev-month { font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.ev-day { font-size: 16px; font-weight: 700; line-height: 1; }
.ev-body { display: flex; flex-direction: column; gap: 2px; }
.ev-body .muted { font-size: 12px; }

.profile-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid #f0f0f1;
}

/* ---------------------------------------------------------------- Tabs */
.nav-tab-wrapper {
    display: flex; flex-wrap: wrap; gap: 2px;
    margin: 16px 0 0; border-bottom: 1px solid var(--wp-border);
}
.nav-tab {
    padding: 8px 14px; margin-bottom: -1px;
    background: #dcdcde; border: 1px solid var(--wp-border); border-bottom: 0;
    border-radius: 3px 3px 0 0;
    color: #50575e; font-size: 14px; text-decoration: none;
}
.nav-tab:hover { background: #f0f0f1; text-decoration: none; }
.nav-tab-active, .nav-tab-active:hover {
    background: #f0f0f1; border-bottom: 1px solid #f0f0f1;
    color: var(--wp-text); font-weight: 600;
}
.nav-tab-wrapper + form .postbox { border-top-left-radius: 0; }

/* ---------------------------------------------------------------- Media */
.upload-form .dropzone {
    padding: 26px; margin-bottom: 12px; text-align: center;
    background: #f6f7f7; border: 2px dashed var(--wp-border); border-radius: var(--radius);
}
.upload-form .dropzone.dragover { border-color: var(--wp-blue); background: #f0f6fc; }
.upload-form .dropzone p { margin: 0 0 8px; }
.upload-form input[type="file"] { width: auto; margin: 0 auto; }

.media-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.media-item {
    background: #fff; border: 1px solid var(--wp-border);
    border-radius: var(--radius); overflow: hidden;
}
.media-thumb {
    position: relative; height: 130px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #f0f0f1;
}
/* The thumb is a fixed box in an auto-height grid row, so a percentage height
   on the image has nothing to resolve against and it renders at natural size —
   which is how a tall logo ended up painted over the filename and the Copy URL
   and Delete links. Bounding it by max-* keeps it inside the box, and
   `contain` shows the whole asset rather than cropping it. */
.media-thumb img, .media-thumb video {
    display: block; width: auto; height: auto;
    max-width: 100%; max-height: 100%; object-fit: contain;
}
.media-badge {
    position: absolute; top: 6px; right: 6px;
    padding: 1px 6px; border-radius: 2px;
    background: rgba(0,0,0,.65); color: #fff; font-size: 10px;
}
.media-meta { display: flex; flex-direction: column; gap: 2px; padding: 8px; font-size: 12px; }
.media-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.media-actions {
    display: flex; gap: 10px; align-items: center;
    margin-top: 6px; padding-top: 6px; border-top: 1px solid #f0f0f1;
}
.media-actions .button-link { font-size: 12px; }

/* Media picker modal */
.media-modal {
    position: fixed; inset: 0; z-index: 200;
    display: none; place-items: center;
    background: rgba(0,0,0,.65); padding: 20px;
}
.media-modal.open { display: grid; }
.media-modal-box {
    display: flex; flex-direction: column;
    width: 100%; max-width: 860px; max-height: 88vh;
    background: #fff; border-radius: var(--radius); overflow: hidden;
}
.media-modal-head, .media-modal-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px;
}
.media-modal-head { border-bottom: 1px solid var(--wp-border); }
.media-modal-head h2 { margin: 0; font-size: 16px; }
.media-modal-foot { border-top: 1px solid var(--wp-border); background: #f6f7f7; font-size: 12px; }
.media-close { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--wp-muted); }
.media-modal-body { flex: 1; overflow-y: auto; padding: 16px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.media-grid button {
    padding: 0; background: none; cursor: pointer;
    border: 2px solid transparent; border-radius: var(--radius); overflow: hidden;
}
.media-grid button:hover { border-color: var(--wp-blue); }
.media-grid img, .media-grid video { width: 100%; height: 100px; object-fit: cover; display: block; }

/* ---------------------------------------------------------------- Messages */
.message-view .message-meta { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.message-view .message-meta th {
    width: 110px; padding: 6px 10px 6px 0; text-align: left;
    color: var(--wp-muted); font-weight: 400; vertical-align: top;
}
.message-view .message-meta td { padding: 6px 0; }
.message-body {
    padding: 14px; background: #f6f7f7;
    border-left: 3px solid var(--wp-blue); border-radius: var(--radius);
    font-size: 14px; line-height: 1.7;
}
.message-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }

/* ---------------------------------------------------------------- Login */
/* ---- Sign-in / forgot / reset screens ----
   The colours come from the site's Colour Theme (Settings -> Appearance):
   admin_auth_theme_css() redefines the variables below in the page head.
   The values here are the fallbacks, so the stylesheet still looks right on
   its own if that block is ever missing. */
body.login-page {
    --auth-bg:        linear-gradient(160deg, #1d2327 0%, #2c1418 55%, #4a0e1a 100%);
    --auth-mark:      linear-gradient(135deg, #7b1e2b, #4a0e1a);
    --auth-accent:    #c8a24a;
    --auth-accent-lt: #f0d9a7;
    --auth-btn:       #7b1e2b;
    --auth-btn-hover: #4a0e1a;

    display: grid; place-items: center; min-height: 100vh; margin: 0;
    padding: 20px;
    background: var(--auth-bg);
    font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--wp-text);
}
.login-box { width: 100%; max-width: 380px; }
.login-logo { display: block; text-align: center; margin-bottom: 22px; text-decoration: none; }
.login-mark {
    display: grid; place-items: center;
    width: 60px; height: 60px; margin: 0 auto 12px;
    background: var(--auth-mark);
    border: 2px solid var(--auth-accent); border-radius: 50%;
    color: var(--auth-accent-lt); font-size: 26px; font-weight: 700;
    font-family: Georgia, "Times New Roman", serif;
}
/* Site logo on the auth screens — same artwork as the public header. */
.login-logo-img { display: block; max-height: 58px; width: auto; max-width: 100%; margin: 0 auto 10px; }
.login-logo-svg { display: block; color: #fff; margin: 0 auto 10px; }
.login-logo-svg svg { height: 36px; width: auto; display: block; margin: 0 auto; }
.login-name { display: block; color: #fff; font-size: 18px; font-weight: 600; font-family: Georgia, serif; }
.login-tag { display: block; margin-top: 4px; color: var(--auth-accent); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.login-form {
    padding: 24px; background: #fff;
    border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.login-form label { margin-top: 10px; }
.login-form label:first-child { margin-top: 0; }
.login-form input[type="text"], .login-form input[type="password"] { padding: 9px 10px; font-size: 15px; }
.login-form .button-primary { width: 100%; margin-top: 18px; text-align: center; }
/* The sign-in button wears the theme's primary colour rather than the
   admin blue, so the one action on the screen matches the backdrop. */
.login-page .button-primary { background: var(--auth-btn); border-color: var(--auth-btn); color: #fff; }
.login-page .button-primary:hover,
.login-page .button-primary:focus { background: var(--auth-btn-hover); border-color: var(--auth-btn-hover); color: #fff; }
.pw-wrap { position: relative; }
.pw-toggle {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    background: none; border: 0; cursor: pointer;
    color: var(--wp-muted); font-size: 12px;
}
.login-error {
    margin-bottom: 14px; padding: 10px 14px;
    background: #fff; border-left: 4px solid var(--wp-red);
    border-radius: var(--radius); font-size: 13px;
}
.login-hint, .login-back { margin: 14px 0 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.7); }
.login-hint strong { color: var(--auth-accent); }
.login-hint a { color: var(--auth-accent); text-decoration: none; }
.login-hint a:hover { text-decoration: underline; }
.login-back a { color: rgba(255,255,255,.8); }
/* Forgot / reset password screens */
.login-lead { margin: 0 0 16px; font-size: 13px; line-height: 1.55; color: var(--wp-muted); }
.login-note {
    padding: 20px 22px; background: #fff;
    border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.35);
    font-size: 13.5px; line-height: 1.6;
}
.login-note p { margin: 0 0 10px; }
.login-note p:last-child { margin-bottom: 0; }
.login-note .muted { color: var(--wp-muted); font-size: 12.5px; }

/* =====================================================================
   Responsive
   ===================================================================== */

/* Tablet */
@media (max-width: 1100px) {
    .post-body { grid-template-columns: 1fr; }
    .post-body-side { order: -1; }
}

/* Mobile: sidebar becomes an off-canvas drawer */
@media (max-width: 782px) {
    .menu-toggle { display: flex; }
    .hide-xs { display: none !important; }

    #adminmenuwrap {
        width: 230px;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,.3);
    }
    body.menu-open #adminmenuwrap { transform: translateX(0); }
    body.folded #adminmenuwrap { width: 230px; }
    body.menu-open .menu-overlay {
        display: block; position: fixed; inset: var(--bar-h) 0 0 0; z-index: 89;
        background: rgba(0,0,0,.5);
    }
    #collapse-button { display: none; }
    #adminmenu .menu-top > a { padding: 12px 14px; font-size: 14px; }
    #adminmenu .submenu a { padding: 10px 14px 10px 42px; }

    #wpcontent, body.folded #wpcontent { margin-left: 0; }
    #wpbody-content { padding: 10px 12px 30px; }

    .wp-heading-inline { font-size: 20px; }
    .search-form { justify-content: stretch; }
    .search-form input[type="search"] { flex: 1; min-width: 0; }

    /* List tables reflow into stacked cards */
    .wp-list-table thead { display: none; }
    .wp-list-table, .wp-list-table tbody, .wp-list-table tr, .wp-list-table td, .wp-list-table th {
        display: block; width: 100%;
    }
    .wp-list-table tr {
        position: relative;
        margin-bottom: 10px; padding: 8px 8px 8px 40px;
        background: #fff !important; border: 1px solid var(--wp-border); border-radius: var(--radius);
    }
    .wp-list-table tbody td, .wp-list-table tbody th {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 7px 4px; border-top: 1px solid #f0f0f1; text-align: right;
    }
    .wp-list-table tbody td:first-of-type { border-top: 0; }
    .wp-list-table td[data-label]::before {
        content: attr(data-label);
        font-weight: 600; color: var(--wp-muted); font-size: 12px; text-align: left;
    }
    .wp-list-table .check-column {
        position: absolute; top: 10px; left: 8px;
        width: auto; padding: 0; border: 0;
    }
    .wp-list-table .col-thumb { justify-content: flex-start; border-top: 0; }
    .wp-list-table .hide-sm { display: none; }
    .row-actions { visibility: visible; }
    .no-items td { padding-left: 8px; }

    .tablenav { justify-content: space-between; }
    .dash-grid { grid-template-columns: 1fr; }
    .stat-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .field-half { flex: 1 1 100%; }
    .media-library { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 480px) {
    .stat-tiles { grid-template-columns: 1fr 1fr; }
    .stat-num { font-size: 22px; }
    .welcome-panel { padding: 16px; }
    .page-title-action { margin-top: 6px; }
    .postbox-footer { flex-wrap: wrap; }
}
