/* CashKhel admin — classic WordPress (wp-admin) look. Breakpoints like WP:
   >960px full menu · 783–960px icon-only menu · ≤782px off-canvas menu + mobile tables. */
:root {
  --bar: #1d2327; --menu: #1d2327; --menu-hover: #2c3338; --menu-text: #f0f0f1; --menu-icon: #a7aaad;
  --blue: #2271b1; --blue-dark: #135e96; --bg: #f0f0f1; --box: #fff; --border: #c3c4c7; --border-soft: #dcdcde;
  --text: #1d2327; --muted: #50575e; --green: #00a32a; --red: #d63638; --amber: #dba617;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Noto Sans Telugu", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 13px/1.4em var(--font); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
.ico { fill: currentColor; flex: none; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* ---------- admin bar */
#adminbar { position: fixed; inset: 0 0 auto 0; height: 32px; background: var(--bar); color: #c3c4c7; display: flex; align-items: center; gap: 4px; padding: 0 8px; z-index: 100; }
#adminbar a { color: #f0f0f1; text-decoration: none; }
#adminbar a:hover { color: #72aee6; }
.ab-toggle { display: none; background: none; border: 0; color: #f0f0f1; height: 32px; width: 40px; cursor: pointer; }
.ab-site { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 0 8px; height: 32px; }
.ab-site .ico { color: #72aee6; }
.ab-dev { background: var(--amber); color: #1d2327; font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 2px; }
.ab-right { margin-left: auto; display: flex; gap: 14px; align-items: center; padding-right: 6px; }
.ab-hello strong { color: #f0f0f1; }

/* ---------- layout */
#wrapper { display: flex; min-height: 100vh; padding-top: 32px; }
#adminmenu { position: fixed; top: 32px; bottom: 0; left: 0; width: 160px; background: var(--menu); overflow-y: auto; z-index: 90; }
#adminmenu ul { list-style: none; margin: 12px 0 0; padding: 0; }
#adminmenu li a, #adminmenu li button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; color: var(--menu-text); font: 14px/18px var(--font); text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; }
#adminmenu li a .ico { color: var(--menu-icon); }
#adminmenu li a:hover { background: var(--menu-hover); color: #72aee6; }
#adminmenu li a:hover .ico { color: #72aee6; }
#adminmenu li.current a { background: var(--blue); color: #fff; position: relative; }
#adminmenu li.current a .ico { color: #fff; }
#adminmenu li.current a::after { content: ""; position: absolute; right: 0; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: var(--bg); }
.mi-soon { margin-left: auto; font-size: 10px; line-height: 14px; padding: 0 5px; border-radius: 9px; background: #3c434a; color: #a7aaad; }
#adminmenu li.collapse { margin-top: 10px; }
#adminmenu li.collapse button { color: #a7aaad; font-size: 13px; }
#adminmenu li.collapse button:hover { color: #72aee6; }
.ci { display: inline-block; width: 20px; text-align: center; font-size: 11px; }
#content { flex: 1; margin-left: 160px; padding: 10px 20px 0; min-width: 0; display: flex; flex-direction: column; }
.wrap { flex: 1; max-width: 1400px; }
.wp-heading { font-size: 23px; font-weight: 400; margin: 0; padding: 9px 0 4px; line-height: 1.3; }
#footer { display: flex; justify-content: space-between; color: var(--muted); padding: 20px 0 14px; font-size: 13px; font-style: italic; }
.menu-shade { display: none; }

/* folded (icon-only) menu — user choice on desktop, automatic 783–960px */
body.folded #adminmenu { width: 36px; }
body.folded #content { margin-left: 36px; }
body.folded .mi-label, body.folded .mi-soon { display: none; }
body.folded .ci { transform: rotate(180deg); }
@media (min-width: 783px) and (max-width: 960px) {
  #adminmenu { width: 36px; } #content { margin-left: 36px; }
  .mi-label, .mi-soon, #adminmenu li.collapse { display: none; }
}

/* ---------- boxes */
.postbox { background: var(--box); border: 1px solid var(--border); box-shadow: 0 1px 1px rgba(0,0,0,.04); min-width: 0; }
.hndle { margin: 0; padding: 8px 12px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border-soft); line-height: 1.4; }
.hndle-sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.inside { padding: 0 12px 12px; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 20px; margin-top: 14px; align-items: start; }
.span-2 { grid-column: span 2; }
@media (max-width: 1200px) { .dash-grid { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
@media (max-width: 782px) { .dash-grid { grid-template-columns: 1fr; gap: 14px; } .span-2 { grid-column: auto; } }

.glance { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.glance a { display: block; border: 1px solid var(--border-soft); border-radius: 2px; padding: 12px; color: var(--text); background: #f6f7f7; }
.glance a:hover { border-color: var(--blue); text-decoration: none; background: #fff; }
.g-num { display: block; font-size: 26px; line-height: 1.2; font-weight: 400; color: var(--blue); margin-bottom: 2px; }
@media (max-width: 600px) { .glance { grid-template-columns: 1fr 1fr; } }
.sub { color: var(--muted); margin: 12px 0 0; }
.health { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 12px 0 8px; }
.health .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #edfaef; }
.health.bad .dot { background: var(--red); box-shadow: 0 0 0 3px #fcf0f1; }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: 5px 0; border-top: 1px solid #f0f0f1; font-weight: 400; }
.kv th { color: var(--muted); width: 45%; }
.chart-box { position: relative; height: 240px; margin-top: 10px; }
.recent { list-style: none; margin: 8px 0 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0f0f1; }
.recent .who { display: flex; flex-direction: column; min-width: 0; }
.recent .who small { color: var(--muted); }
.recent .tag { margin-left: auto; }
.av { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; background: #f0f0f1; border-radius: 50%; font-size: 18px; }
.more { margin: 10px 0 0; }
.empty { color: var(--muted); }

/* help card (Telugu) */
.help-card { margin: 14px 0 0; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--blue); }
.help-card summary { cursor: pointer; padding: 9px 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; list-style: none; }
.help-card summary::-webkit-details-marker { display: none; }
.help-card summary .ico { color: var(--blue); }
.help-body { padding: 0 12px 6px 36px; font-size: 14px; line-height: 1.7; }
.help-body p { margin: 0 0 8px; }

/* notices */
.notice { background: #fff; border: 1px solid var(--border); border-left-width: 4px; box-shadow: 0 1px 1px rgba(0,0,0,.04); margin: 14px 0 6px; padding: 1px 12px; position: relative; }
.notice p { margin: .6em 0; }
.notice-success { border-left-color: var(--green); }
.notice-info { border-left-color: #72aee6; }
.notice-warning { border-left-color: var(--amber); }
.notice-dismiss { position: absolute; right: 4px; top: 4px; border: 0; background: none; font-size: 18px; color: #787c82; cursor: pointer; padding: 4px 8px; }
.notice-dismiss:hover { color: var(--red); }

/* buttons + inputs */
.button { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; font: 13px/2.15 var(--font); color: var(--blue); border: 1px solid var(--blue); border-radius: 3px; background: #f6f7f7; cursor: pointer; white-space: nowrap; text-decoration: none; }
.button:hover { background: #f0f0f1; color: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); color: #fff; }
.button.disabled { color: #a7aaad; border-color: #dcdcde; background: #f6f7f7; cursor: default; }
.button-large { min-height: 32px; padding: 0 12px; }
input[type=search], input[type=text], input[type=password], select { font: 14px var(--font); min-height: 30px; padding: 0 8px; border: 1px solid #8c8f94; border-radius: 4px; background: #fff; color: var(--text); }
select { padding-right: 24px; }
input:focus, select:focus, .button:focus { outline: 2px solid transparent; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

/* list table */
.subsubsub { list-style: none; margin: 14px 0 0; padding: 0; float: left; color: #646970; display: flex; flex-wrap: wrap; gap: 4px; }
.subsubsub a { padding: 0 2px; }
.subsubsub a.current { color: #000; font-weight: 600; }
.subsubsub .count { color: #50575e; font-weight: 400; }
.search-box { float: right; display: flex; gap: 4px; margin: 10px 0 0; }
.tablenav { clear: both; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0 6px; flex-wrap: wrap; }
.bulkactions { display: flex; gap: 6px; }
.tablenav-pages { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pagination-links { display: flex; align-items: center; gap: 4px; }
.pagination-links .button { min-width: 30px; justify-content: center; }
.paging-input { padding: 0 6px; }
.widefat { width: 100%; border-spacing: 0; border: 1px solid var(--border); background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.widefat th, .widefat td { text-align: left; padding: 8px 10px; vertical-align: middle; font-weight: 400; }
.widefat thead th, .widefat thead td, .widefat tfoot th, .widefat tfoot td { border-bottom: 1px solid var(--border); font-weight: 400; color: var(--text); }
.widefat tfoot th, .widefat tfoot td { border-top: 1px solid var(--border); border-bottom: 0; }
.striped > tbody > tr:nth-child(odd) { background: #f6f7f7; }
.widefat tbody tr:hover { background: #f0f6fc; }
.check-column { width: 2.2em; padding: 8px 0 8px 10px !important; }
.column-primary { display: flex; align-items: center; gap: 10px; }
.column-primary strong { color: var(--blue); font-weight: 600; }
tr.is-blocked .column-primary strong { color: #8c8f94; text-decoration: line-through; }
.toggle-row { display: none; }
.no-items td { padding: 16px 10px; color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.tag-green { background: #edfaef; color: #00701a; }
.tag-red { background: #fcf0f1; color: #b32d2e; }

/* ---------- mobile (≤782px): off-canvas menu, bigger touch targets, stacked rows */
@media (max-width: 782px) {
  body { font-size: 14px; }
  #adminbar { height: 46px; }
  .ab-toggle { display: inline-grid; place-items: center; height: 46px; width: 46px; }
  .ab-hello { display: none; }
  #wrapper { padding-top: 46px; }
  #adminmenu { top: 46px; width: 190px; transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open #adminmenu { transform: none; }
  body.menu-open .menu-shade { display: block; position: fixed; inset: 46px 0 0 0; background: rgba(0,0,0,.35); z-index: 80; }
  #adminmenu li.collapse { display: none; }
  #content { margin-left: 0 !important; padding: 10px 12px 0; }
  .button { min-height: 40px; font-size: 14px; }
  input[type=search], select { min-height: 40px; font-size: 16px; }
  .subsubsub, .search-box { float: none; }
  .search-box { margin-top: 12px; } .search-box input { flex: 1; }
  .tablenav-pages { width: 100%; justify-content: space-between; }
  /* WP-style stacked table: primary column + tap ▾ to see the rest */
  .widefat thead, .widefat tfoot { display: none; }
  .widefat tbody tr { display: grid; grid-template-columns: 2.2em 1fr; border-bottom: 1px solid var(--border-soft); }
  .widefat tbody td, .widefat tbody th { display: block; }
  .widefat tbody td.column-primary { display: flex; }
  .widefat tbody .check-column { align-self: center; }
  .widefat tbody td:not(.column-primary) { display: none; grid-column: 2; padding: 3px 10px 3px 10px; }
  .widefat tbody td:not(.column-primary)::before { content: attr(data-colname) ": "; color: var(--muted); }
  .widefat tbody tr.is-expanded td:not(.column-primary) { display: block; }
  .widefat tbody tr.is-expanded td:last-child { padding-bottom: 10px; }
  .toggle-row { display: inline-grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
  tr.is-expanded .toggle-row { transform: rotate(180deg); }
  .no-items { display: block !important; }
  #footer { flex-direction: column; gap: 4px; }
}

/* ---------- login screen */
body.login { background: var(--bg); display: flex; justify-content: center; }
#login { width: 320px; padding: 8% 0 0; }
#login h1 { text-align: center; margin: 0 0 24px; }
#login h1 a { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; color: var(--blue); font-size: 22px; font-weight: 600; text-decoration: none; }
#login form { background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 26px 24px; }
#login label { font-size: 14px; display: block; margin-bottom: 3px; }
#login .input { width: 100%; font-size: 24px; min-height: 40px; padding: 3px 5px; margin: 0 0 16px; }
#login .submit { display: flex; justify-content: flex-end; margin: 0; }
.login-error { background: #fff; border-left: 4px solid var(--red); box-shadow: 0 1px 1px rgba(0,0,0,.04); padding: 12px; margin-bottom: 20px; }
.backlink { color: var(--muted); padding: 0 24px; }

/* ---------- Notifications: WP "Posts" list + classic editor */
.wp-heading.inline { display: inline-block; margin-right: 6px; }
.page-title-action { display: inline-block; position: relative; top: -3px; padding: 4px 8px; border: 1px solid var(--blue); border-radius: 3px; background: #f6f7f7; color: var(--blue); font-size: 13px; line-height: 1.7; }
.page-title-action:hover { background: #f0f0f1; color: var(--blue-dark); text-decoration: none; }
.notice-error { border-left-color: var(--red); }
.tag-blue { background: #f0f6fc; color: #135e96; }
.tag-amber { background: #fcf9e8; color: #8a6d00; }
.tag-grey { background: #f0f0f1; color: #50575e; }
.muted { color: var(--muted); }
.danger { color: var(--red) !important; }
.notif-table .title-col { align-items: flex-start; }
.tc-main { min-width: 0; flex: 1; }
.row-title { font-size: 14px; font-weight: 600; }
.post-state { color: var(--muted); font-weight: 600; }
.excerpt { color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 520px; }
.row-actions { visibility: hidden; color: #a7aaad; font-size: 13px; padding-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.row-actions form { display: inline; margin: 0; }
tr:hover .row-actions, tr:focus-within .row-actions { visibility: visible; }
.linkish { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }
.linkish:hover { color: var(--blue-dark); text-decoration: underline; }
.date-col { white-space: nowrap; }

.poststuff { margin-top: 14px; }
.post-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.post-main > .postbox, .post-side > .postbox { margin-bottom: 20px; }
.title-input { width: 100%; font-size: 1.7em; line-height: 1.3; padding: 6px 10px; min-height: 46px; border: 1px solid #8c8f94; border-radius: 0; background: #fff; font-family: var(--font); }
.title-input:focus, textarea:focus, input[type=url]:focus, input[type=datetime-local]:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.field-meta { text-align: right; color: var(--muted); font-size: 12px; margin: 4px 0 14px; min-height: 16px; }
.field-meta .over { color: var(--red); font-weight: 600; }
.post-main textarea { width: 100%; margin-top: 12px; font: 15px/1.5 var(--font); padding: 8px 10px; border: 1px solid #8c8f94; border-radius: 4px; resize: vertical; }
.regular-text, input[type=url] { width: 100%; margin-top: 12px; min-height: 34px; font: 14px var(--font); padding: 0 8px; border: 1px solid #8c8f94; border-radius: 4px; }
.description { color: var(--muted); font-style: italic; font-size: 13px; margin: 6px 0 0; display: block; }
.publish .misc { padding: 12px 0 8px; color: var(--muted); }
.dash-ico { color: #a7aaad; margin-right: 6px; font-size: 10px; }
.when { border: 0; margin: 0; padding: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.when label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.when input[type=datetime-local] { min-height: 32px; font: 14px var(--font); padding: 0 6px; border: 1px solid #8c8f94; border-radius: 4px; margin-left: 22px; }
.when input[type=datetime-local]:disabled { opacity: .45; }
.when .description { margin-left: 22px; }
.major { display: flex; justify-content: space-between; gap: 8px; margin: 0 -12px -12px; padding: 10px 12px; background: #f6f7f7; border-top: 1px solid var(--border-soft); }
.aud { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid #f0f0f1; cursor: pointer; }
.aud input { margin-top: 3px; }
.aud span { display: flex; flex-direction: column; }
.aud small { color: var(--muted); }
.aud-count { margin: 10px 0 0; padding: 8px 10px; background: #f0f6fc; border-left: 3px solid var(--blue); }
.aud-count .ac-num { font-weight: 600; }
.aud-count.htmx-request { opacity: .5; }
.widefat-select { width: 100%; margin-top: 12px; }
.glance.compact li span { display: block; border: 1px solid var(--border-soft); padding: 10px; background: #f6f7f7; }

/* phone preview */
.phone { margin: 12px auto 0; max-width: 270px; background: #1d2327; border-radius: 26px; padding: 12px 10px 18px; box-shadow: inset 0 0 0 2px #3c434a; }
.phone-bar { display: flex; justify-content: space-between; color: #dcdcde; font-size: 11px; padding: 0 8px 10px; letter-spacing: 1px; }
.push-card { background: #fff; border-radius: 16px; padding: 10px 12px 12px; }
.push-head { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.push-ico { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; background: #2647b0; color: #ffc51f; font-weight: 800; font-size: 11px; }
.push-title { font-weight: 700; font-size: 14px; color: #1d2327; word-wrap: break-word; }
.push-body { font-size: 13px; color: #3c434a; margin-top: 2px; word-wrap: break-word; white-space: pre-line; }
.push-img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px; margin-top: 8px; background: #f0f0f1; }
.push-title.placeholder, .push-body.placeholder { color: #a7aaad; }

@media (max-width: 960px) { .post-body { grid-template-columns: 1fr; } }
@media (max-width: 782px) {
  .row-actions { visibility: visible; }
  .notif-table .excerpt { max-width: none; }
  .title-input { font-size: 1.4em; }
  .major .button { flex: 1; justify-content: center; }
}
.push-img[hidden] { display: none; }
@media (max-width: 782px) {
  /* notifications table has no checkbox column → one full-width column */
  .notif-table tbody tr { grid-template-columns: 1fr; padding: 4px 0; }
  .notif-table tbody td:not(.column-primary) { grid-column: 1; padding-left: 10px; }
  .notif-table .row-actions { gap: 10px; padding-top: 6px; }
}
