/* WordPress-style admin */
:root { --wp-dark: #1d2327; --wp-dark-2: #2c3338; --wp-blue: #2271b1; --wp-blue-2: #135e96; --wp-bg: #f0f0f1; --wp-border: #c3c4c7; --wp-text: #1d2327; --wp-muted: #646970; --menu-w: 200px; --bar-h: 46px; }
body { background: var(--wp-bg); color: var(--wp-text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 14px; }
a { color: var(--wp-blue); }
a:hover { color: var(--wp-blue-2); }

.btn-wp { background: var(--wp-blue); border-color: var(--wp-blue); color: #fff; }
.btn-wp:hover, .btn-wp:focus { background: var(--wp-blue-2); border-color: var(--wp-blue-2); color: #fff; }

#wpadminbar { position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h); background: var(--wp-dark); color: #f0f0f1; display: flex; align-items: center; padding: 0 12px; z-index: 1040; gap: 4px; }
#wpadminbar .ab-item { color: #f0f0f1; text-decoration: none; padding: 0 10px; height: var(--bar-h); display: inline-flex; align-items: center; gap: 6px; }
#wpadminbar .ab-item:hover { background: var(--wp-dark-2); color: #72aee6; }
.ab-count { background: #d63638; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; min-width: 18px; text-align: center; line-height: 18px; }

#adminmenu { background: var(--wp-dark) !important; width: var(--menu-w); }
@media (min-width: 992px) {
  #adminmenu { position: fixed; top: var(--bar-h); bottom: 0; left: 0; overflow-y: auto; }
  #wpbody { margin-left: var(--menu-w); }
}
@media (max-width: 991.98px) { #adminmenu { --bs-offcanvas-width: 240px; padding-top: var(--bar-h); } }
#adminmenu .menu { list-style: none; margin: 0; padding: 10px 0; }
#adminmenu .menu > li > a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: #f0f0f1; text-decoration: none; font-size: 14px; }
#adminmenu .menu > li > a i { color: #a7aaad; font-size: 17px; width: 20px; text-align: center; }
#adminmenu .menu > li > a:hover { background: var(--wp-dark-2); color: #72aee6; }
#adminmenu .menu > li > a:hover i { color: #72aee6; }
#adminmenu .menu > li.current > a { background: var(--wp-blue); color: #fff; font-weight: 600; }
#adminmenu .menu > li.current > a i { color: #fff; }
#adminmenu .menu-count { margin-left: auto; background: #d63638; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 7px; line-height: 18px; }
#adminmenu .submenu { list-style: none; padding: 6px 0 8px; margin: 0; background: var(--wp-dark-2); }
#adminmenu .submenu a { display: block; padding: 5px 12px 5px 42px; color: rgba(240,246,252,.7); text-decoration: none; font-size: 13px; }
#adminmenu .submenu a:hover, #adminmenu .submenu .current a { color: #fff; }
#adminmenu .submenu .current a { font-weight: 600; }
#adminmenu .sep { height: 1px; background: #3c434a; margin: 8px 0; }

#wpbody { padding-top: var(--bar-h); min-height: 100vh; display: flex; flex-direction: column; }
.wrap { padding: 20px 20px 40px; flex: 1; max-width: 1500px; }
.wp-heading { font-size: 23px; font-weight: 400; margin: 0 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-title-action { font-size: 13px; border: 1px solid var(--wp-blue); color: var(--wp-blue); border-radius: 3px; padding: 4px 10px; text-decoration: none; background: #f6f7f7; }
.page-title-action:hover { background: #f0f0f1; border-color: var(--wp-blue-2); }
.wp-footer { color: var(--wp-muted); font-size: 12px; padding: 12px 20px; }

.notice { background: #fff; border: 1px solid var(--wp-border); border-left-width: 4px; box-shadow: 0 1px 1px rgba(0,0,0,.04); padding: 10px 40px 10px 12px; margin-bottom: 16px; position: relative; }
.notice .btn-close { position: absolute; top: 12px; right: 10px; }
.notice-success { border-left-color: #00a32a; }
.notice-danger { border-left-color: #d63638; }
.notice-warning { border-left-color: #dba617; }
.notice-info { border-left-color: #72aee6; }

.postbox { background: #fff; border: 1px solid var(--wp-border); box-shadow: 0 1px 1px rgba(0,0,0,.04); padding: 16px 18px; margin-bottom: 20px; }
.postbox-title { font-size: 14px; font-weight: 600; margin: -16px -18px 14px; padding: 10px 18px; border-bottom: 1px solid #f0f0f1; }
.postbox-highlight { border-color: #00a32a; box-shadow: 0 0 0 1px #00a32a; }

.welcome-panel { background: linear-gradient(135deg, #1f3d2b, #2c5a3f); color: #fff; padding: 24px 28px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-radius: 4px; }
.welcome-panel h2 { font-size: 22px; font-weight: 600; }
.stat-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--wp-border); padding: 16px; height: 100%; text-decoration: none; color: var(--wp-text); border-top: 4px solid #8c8f94; }
.stat-card i { font-size: 20px; color: var(--wp-muted); }
.stat-card b { font-size: 26px; font-weight: 600; margin-top: 4px; }
.stat-card span { color: var(--wp-muted); font-size: 13px; }
.stat-warn { border-top-color: #dba617; } .stat-danger { border-top-color: #d63638; } .stat-ok { border-top-color: #00a32a; }
a.stat-card:hover { background: #f6f7f7; color: var(--wp-text); }
.action-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f0f1; text-decoration: none; color: var(--wp-text); }
.action-row:hover { background: #f6f7f7; color: var(--wp-text); }
.action-row:last-child { border-bottom: 0; }
.date-chip { width: 48px; text-align: center; border: 1px solid var(--wp-border); border-radius: 6px; padding: 4px 0; flex: none; }
.date-chip b { display: block; font-size: 18px; line-height: 1; }
.date-chip span { font-size: 11px; color: var(--wp-muted); text-transform: uppercase; }
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-links a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid #dcdcde; border-radius: 4px; text-decoration: none; color: var(--wp-text); font-size: 12px; text-align: center; }
.quick-links a i { font-size: 20px; color: var(--wp-blue); }
.quick-links a:hover { border-color: var(--wp-blue); }

.subsubsub { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; font-size: 13px; color: var(--wp-muted); }
.subsubsub li + li::before { content: "|"; margin: 0 6px; color: #a7aaad; }
.subsubsub a { text-decoration: none; }
.subsubsub a.current { color: var(--wp-text); font-weight: 600; }
.subsubsub .count { color: var(--wp-muted); font-weight: 400; }
.tablenav { margin-bottom: 10px; }
.wp-list-table { background: #fff; border: 1px solid var(--wp-border); margin-bottom: 12px; }
.wp-list-table thead th { font-weight: 400; font-size: 13px; border-bottom: 1px solid var(--wp-border); white-space: nowrap; }
.wp-list-table tbody tr:nth-child(odd):not(.collapse) td { background: #f6f7f7; }
.wp-list-table .row-title { font-weight: 600; font-size: 14px; text-decoration: none; }
.row-pending td:first-child { box-shadow: inset 4px 0 0 #dba617; }
.detail-table th { width: 160px; color: var(--wp-muted); font-weight: 400; }
.proof-img { max-height: 520px; }

.section-card { display: flex; align-items: center; gap: 12px; padding: 18px; background: #fff; border: 1px solid var(--wp-border); text-decoration: none; color: var(--wp-text); height: 100%; }
.section-card i { font-size: 22px; color: var(--wp-blue); }
.section-card:hover { border-color: var(--wp-blue); box-shadow: 0 0 0 1px var(--wp-blue); color: var(--wp-text); }

/* List editor */
.list-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid #dcdcde; border-radius: 4px; background: #fbfbfb; margin-bottom: 8px; }
.list-handle { display: flex; flex-direction: column; gap: 4px; }
.list-handle .btn { padding: 0 6px; }
.icon-preview { width: 42px; justify-content: center; font-size: 18px; }

/* Media field / library */
.media-field { display: flex; gap: 12px; align-items: center; }
.media-thumb { width: 96px; height: 72px; border: 1px dashed var(--wp-border); border-radius: 4px; overflow: hidden; display: grid; place-items: center; background: #f6f7f7; flex: none; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .placeholder-icon { font-size: 26px; color: #a7aaad; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-grid-lg { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.media-pick { border: 2px solid transparent; padding: 0; background: #f0f0f1; aspect-ratio: 1; overflow: hidden; position: relative; }
.media-pick img, .media-pick video { width: 100%; height: 100%; object-fit: cover; }
.media-pick:hover, .media-pick:focus { border-color: var(--wp-blue); }
.media-pick span { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item { background: #fff; border: 1px solid var(--wp-border); }
.media-item-thumb { aspect-ratio: 4/3; background: #f0f0f1; position: relative; }
.media-item-thumb img, .media-item-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-item-meta { padding: 8px; }
.upload-drop { position: relative; border: 2px dashed var(--wp-border); text-align: center; padding: 30px 16px; margin: 0; }
.upload-drop:hover { border-color: var(--wp-blue); background: #f6f7f7; }
.upload-drop > i { font-size: 34px; color: var(--wp-blue); }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Calendar */
.cal-legend-admin { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.cal-legend-admin i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
#adminCalendar a { color: inherit; text-decoration: none; }
#adminCalendar .fc-event { cursor: pointer; font-size: 12px; padding: 1px 3px; }
#adminCalendar .fc-toolbar-title { font-size: 1.3rem; }
#adminCalendar .fc-button-primary { background: var(--wp-blue); border-color: var(--wp-blue); }
#adminCalendar .fc-button-primary:not(:disabled).fc-button-active, #adminCalendar .fc-button-primary:hover { background: var(--wp-blue-2); border-color: var(--wp-blue-2); }
@media (max-width: 575.98px) { #adminCalendar .fc-toolbar { flex-direction: column; gap: 8px; } }

/* Login */
body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { width: 100%; max-width: 380px; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; }
.login-logo span { width: 52px; height: 52px; border-radius: 14px; background: #1f3d2b; color: #f2c14e; display: grid; place-items: center; font-size: 26px; }
.login-logo b { display: block; font-size: 22px; line-height: 1.1; }
.login-logo small { color: var(--wp-muted); }
.login-card { background: #fff; border: 1px solid var(--wp-border); box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 26px 24px; }
.stat-box { padding: .8rem 1rem !important; }
.report-table td, .report-table th { white-space: nowrap; }
.notice-info { border-left-color: #72aee6; }

/* Bilingual content fields */
.lang-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; font-size: 11px; font-weight: 700; letter-spacing: .04em; border: 1px solid #c3c4c7; background: #f6f7f7; color: #50575e; }
.input-group > .lang-badge { border-radius: 4px 0 0 4px; border-right: 0; }
.lang-badge.lang-en { background: #f0f6fc; color: #135e96; border-color: #c5d9ed; }
.lang-area { position: relative; }
.lang-area .lang-badge { position: absolute; top: 6px; right: 6px; min-width: 28px; padding: 1px 4px; border-radius: 3px; z-index: 1; }
.lang-area textarea { padding-right: 44px; }
