/* ============================================================
   Tool Dude v4 — "Aurora Glass" Mobile / Responsive Stylesheet
   Loaded after style.css. Owns: mobile header, offcanvas sidebar,
   bottom nav, every responsive breakpoint, and the admin panel's
   responsive rules (admin pages also load this file).
   ============================================================ */

/* ---------- Global safety: no horizontal page scroll ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
img, video, iframe, embed, object { max-width: 100%; }
.td-container, .td-content-card, .td-side-card, .td-form, .td-card, .td-tool-hero, .td-plan-card { max-width: 100%; }
.td-card-desc, .td-card-title, .td-rank-name, .td-rank-desc, .td-tool-hero h1,
.td-content-card p, .td-content-card li, .td-footer a, .td-footer p,
.td-blog-card p, .td-blog-card h3, .td-post-content { overflow-wrap: anywhere; word-wrap: break-word; }
.td-tool-grid > *, .td-post-layout > *, .td-hero-grid > * { min-width: 0; }

/* ---------- Mobile header (dark glass) ---------- */
.td-mobile-header {
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; min-height: 60px; position: sticky; top: 0; z-index: 85;
  background: linear-gradient(180deg, rgba(23,32,62,.92), rgba(12,18,38,.95));
  border-bottom: 1px solid rgba(130,165,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 14px 30px rgba(0,0,0,.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.td-mobile-header-brand { display: inline-flex; align-items: center; gap: 10px; color: #F5F7FF; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 15px; flex: 1; min-width: 0; }
.td-mobile-header-brand img { height: 38px; width: auto; max-width: 200px; object-fit: contain; flex: none; }
.td-mobile-header-brand span, .td-mobile-header-brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none !important; }
.td-mobile-header-actions { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.td-icon-btn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(130,165,255,.25); background: linear-gradient(180deg, rgba(38,50,88,.85), rgba(20,28,56,.9)); border-radius: 12px; cursor: pointer; color: #DCE4FA; padding: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); transition: all .15s; }
.td-icon-btn:hover { background: linear-gradient(180deg, #FF9A2E, #F45300); color: #fff; border-color: transparent; }
.td-icon-btn svg { width: 22px; height: 22px; display: block; }

/* ---------- Offcanvas sidebar (dark glossy) ---------- */
.td-mobile-sidebar {
  position: fixed; top: 0; left: 0; width: 86%; max-width: 350px; height: 100vh; height: 100dvh;
  background: linear-gradient(180deg, rgba(23,32,62,.99), rgba(10,15,32,1));
  border-right: 1px solid rgba(130,165,255,.20); z-index: 1000;
  transform: translateX(-105%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 24px 60px rgba(0,0,0,.6); display: flex; flex-direction: column;
  border-top-right-radius: 18px; border-bottom-right-radius: 18px; overflow: hidden;
}
body.td-mobile-sidebar-open .td-mobile-sidebar { transform: translateX(0); }
.td-mobile-sidebar-overlay { position: fixed; inset: 0; background: rgba(3,5,12,.62); z-index: 999; opacity: 0; visibility: hidden; transition: opacity .25s ease; backdrop-filter: blur(2px); }
body.td-mobile-sidebar-open .td-mobile-sidebar-overlay { opacity: 1; visibility: visible; }
body.td-mobile-sidebar-open { overflow: hidden; }
.td-msb-header { display: flex; align-items: center; gap: 12px; padding: 17px 18px 14px; border-bottom: 1px solid rgba(130,165,255,.14); background: linear-gradient(120deg, rgba(255,106,0,.14), transparent 60%); }
.td-msb-logo { display: inline-flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.td-msb-logo img { height: 42px; width: auto; max-width: 220px; object-fit: contain; }
.td-msb-logo .td-msb-site { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 16px; color: #F5F7FF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-msb-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(130,165,255,.25); background: linear-gradient(180deg, rgba(38,50,88,.85), rgba(20,28,56,.9)); color: #DCE4FA; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.td-msb-close:hover { background: linear-gradient(180deg, #FF9A2E, #F45300); color: #fff; border-color: transparent; }
.td-msb-close svg { width: 20px; height: 20px; }
.td-msb-search { padding: 12px 16px; border-bottom: 1px solid rgba(130,165,255,.12); }
.td-msb-search form { display: flex; align-items: center; background: rgba(8,12,28,.85); border: 1px solid rgba(130,165,255,.25); border-radius: 13px; padding: 4px 4px 4px 14px; box-shadow: inset 0 2px 8px rgba(0,0,0,.5); }
.td-msb-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; padding: 9px 4px; min-width: 0; color: #F5F7FF; }
.td-msb-search input::placeholder { color: #7E8DB4; }
.td-msb-search button { background: linear-gradient(180deg, #FF9A2E, #F45300); color: #fff; border: none; border-radius: 10px; width: 38px; height: 38px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(255,110,0,.4); }
.td-msb-search button svg { width: 18px; height: 18px; }
.td-msb-body { flex: 1; overflow-y: auto; padding: 8px 0 16px; -webkit-overflow-scrolling: touch; }
.td-msb-body::-webkit-scrollbar { width: 6px; }
.td-msb-body::-webkit-scrollbar-thumb { background: rgba(130,165,255,.25); border-radius: 6px; }
.td-msb-section-label { padding: 14px 18px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #7E8DB4; font-weight: 700; font-family: 'Poppins', sans-serif; }
.td-msb-link { display: flex; align-items: center; gap: 14px; padding: 12px 18px; color: #B9C5E4; font-size: 15px; font-weight: 500; border-left: 3px solid transparent; transition: all .15s; }
.td-msb-link:hover { background: rgba(255,106,0,.07); color: #FFB25E; }
.td-msb-link.active { background: linear-gradient(90deg, rgba(255,106,0,.14), transparent); color: #FF9A2E; border-left-color: #FF6A00; }
.td-msb-link svg, .td-msb-link i { width: 22px; height: 22px; flex: none; text-align: center; }
.td-msb-link svg { stroke-width: 1.8; }
.td-msb-link .td-msb-chip { margin-left: auto; font-size: 11px; background: linear-gradient(180deg, #FF9A2E, #F45300); color: #fff; padding: 2px 8px; border-radius: 50px; font-weight: 700; }
.td-msb-divider { height: 1px; background: rgba(130,165,255,.13); margin: 8px 16px; }
.td-msb-footer { border-top: 1px solid rgba(130,165,255,.14); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(8,12,28,.6); display: flex; flex-direction: column; gap: 8px; }
.td-msb-footer .td-btn, .td-msb-footer .td-msb-action { width: 100%; justify-content: center; min-height: 46px; }
.td-msb-footer .td-msb-action { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-weight: 600; font-size: 14px; border-radius: 12px; font-family: 'Poppins', sans-serif; }
.td-msb-footer .td-msb-action svg { width: 18px; height: 18px; }
.td-msb-social { display: flex; gap: 8px; justify-content: center; padding-top: 6px; }
.td-msb-social a { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; background: linear-gradient(180deg, rgba(38,50,88,.85), rgba(20,28,56,.9)); border: 1px solid rgba(130,165,255,.25); color: #C9D5F5; }
.td-msb-social a:hover { background: linear-gradient(180deg, #FF9A2E, #F45300); color: #fff; border-color: transparent; }

/* ---------- Bottom navigation (dark glossy) ---------- */
.td-bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: linear-gradient(180deg, rgba(23,32,62,.96), rgba(10,15,32,.98)); border-top: 1px solid rgba(130,165,255,.20); box-shadow: 0 -10px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top-left-radius: 18px; border-top-right-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.td-bottom-nav-inner { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; max-width: 640px; margin: 0 auto; }
.td-bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 4px; border: none; background: transparent; color: #9AA7C7; font-size: 11px; font-weight: 600; cursor: pointer; border-radius: 12px; transition: all .15s; min-height: 56px; position: relative; font-family: 'Poppins', sans-serif; min-width: 0; }
.td-bn-item svg { width: 24px; height: 24px; stroke-width: 1.8; display: block; }
.td-bn-item span { display: block; font-size: 10.5px; letter-spacing: .2px; line-height: 1.1; }
.td-bn-item:hover { color: #FFB25E; }
.td-bn-item.active { color: #FF9A2E; background: rgba(255,106,0,.10); }
.td-bn-item.active::before { content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #FF9A2E, #FF5500); box-shadow: 0 0 10px rgba(255,110,0,.7); }
.td-bn-item .td-bn-badge { position: absolute; top: 4px; right: 18%; background: linear-gradient(180deg, #F87171, #DC2626); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 50px; line-height: 1.3; }

/* ---------- Responsive switches ---------- */
@media (min-width: 993px) {
  .td-mobile-header, .td-mobile-sidebar, .td-mobile-sidebar-overlay, .td-bottom-nav { display: none !important; }
}
@media (max-width: 992px) {
  .td-mobile-header { display: flex; }
  .td-bottom-nav { display: block; }
  .td-header { display: none !important; }
  body.td-body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .td-footer { margin-bottom: 0; }
  .td-scrolltop { bottom: 96px; }
}

/* ---------- Breakpoint: ≤1200 ---------- */
@media (max-width: 1200px) {
  .td-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .td-cat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .td-header-main { gap: 16px; }
  .td-header-actions .td-btn { padding: 0 13px; }
}

/* ---------- Breakpoint: ≤992 (tablet) ---------- */
@media (max-width: 992px) {
  .td-container { padding: 0 18px; }
  .td-tool-grid { grid-template-columns: minmax(0, 1fr); }
  .td-tool-grid .td-sidebar { order: 2; }
  .td-post-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .td-post-sidebar.is-sticky { position: static; }
  .td-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .td-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-hero { padding-top: 24px; }
  .td-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .td-hero-mascot { min-height: 300px; order: 2; }
  .td-hero-mascot img { max-height: 290px; }
  .td-hero-mascot::before { width: min(320px, 84%); }
  .td-dash-stats, .td-dash-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-footer { margin: 30px 14px 20px; padding: 28px 24px 0; }
  .td-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .td-section-head h2 { font-size: 23px; }
}

/* ---------- Breakpoint: ≤820 (small tablet / large phone landscape) ---------- */
@media (max-width: 820px) {
  .td-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

/* ---------- Breakpoint: ≤768 (phone) ---------- */
@media (max-width: 768px) {
  .td-section { padding: 26px 0 4px; }
  .td-section-head { margin-bottom: 16px; align-items: flex-start; }
  .td-section-head h2 { font-size: 21px; }
  .td-section-head h2 i { width: 33px; height: 33px; font-size: 14px; border-radius: 10px; }
  .td-cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .td-faq-grid { grid-template-columns: minmax(0, 1fr); }
  .td-faq-a-inner { padding-left: 19px; }
  .td-hero h1 { font-size: 32px; }
  .td-hero p.lead { font-size: 15px; }
  .td-hero-stats { gap: 10px; }
  .td-hero-stats > div { padding: 11px 13px; }
  .td-hero-stats div b { font-size: 18px; }
  .td-pros-cons { grid-template-columns: minmax(0, 1fr); }
  .td-tool-hero { padding: 20px; }
  .td-tool-hero-top { grid-template-columns: 78px minmax(0, 1fr); gap: 16px; }
  .td-tool-hero-logo { width: 78px; height: 78px; border-radius: 19px; padding: 10px; }
  .td-tool-hero h1 { font-size: 23px; }
  .td-tool-hero .td-visit { grid-column: 1 / -1; width: 100%; justify-content: center; height: 50px; }
  .td-content-card { padding: 20px; }
  .td-newsletter { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; padding: 24px 22px; row-gap: 8px; }
  .td-newsletter form { grid-column: 1; grid-row: 3; margin-top: 10px; }
  .td-dash-hero { grid-template-columns: minmax(0, 1fr); text-align: center; padding: 22px 20px; }
  .td-dash-hero .td-dash-avatar { margin: 0 auto; }
  .td-dash-actions { justify-content: center; }
  .td-dash-welcome h1 { font-size: 22px; }
  .td-promo-block { margin: 16px auto; }
  .td-post-card { padding: 20px; }
  .td-post-featured { height: 230px; }
  .td-comment-item { margin-left: calc(var(--comment-depth, 0) * 10px); }
  body.td-body .td-pricing-page { padding: 34px 0 54px; }
}

/* ---------- Breakpoint: ≤640 ---------- */
@media (max-width: 640px) {
  .td-blog-grid { grid-template-columns: minmax(0, 1fr); }
  .td-feature-list { grid-template-columns: minmax(0, 1fr); }
  .td-form { padding: 20px; }
  .td-form .td-row { grid-template-columns: minmax(0, 1fr); }
  .td-filters { padding: 12px; gap: 8px; }
  .td-filters select, .td-filters input { flex: 1 1 140px; min-height: 44px; }
  .td-rank-row { grid-template-columns: 38px 44px minmax(0, 1fr) auto; gap: 11px; padding: 10px 13px; }
  .td-rank-views { display: none; }
  .td-rank-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  .td-table-wrap .td-table, .td-table-wrap .td-compare-table { min-width: 560px; }
  .td-content-card table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.td-body .td-plan-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; margin: 34px 0 30px; }
  body.td-body .td-plan-card { padding: 28px 22px 24px; }
  body.td-body .td-plan-featured { transform: none; }
  body.td-body .td-plan-price { font-size: 34px; }
  body.td-body .td-pricing-trust { gap: 14px; flex-direction: column; align-items: center; }
  body.td-body .td-auth-grid { grid-template-columns: minmax(0, 1fr); }
  .td-comment-form-actions .td-btn { flex: 1; justify-content: center; }
  .td-hero-search button { padding: 0 18px; }
}

/* ---------- Breakpoint: ≤560 (small phone — incl. ~390px targets) ---------- */
@media (max-width: 560px) {
  .td-container { padding: 0 14px; }
  .td-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-card-grid { gap: 13px; }
  .td-card-body { padding: 11px 14px 15px; }
  .td-card-thumb { padding: 18px 12px 4px; }
  .td-card-thumb img, .td-card-initials { width: 52px; height: 52px; font-size: 20px; border-radius: 14px; }
  .td-card-title { font-size: 15px; }
  .td-card-desc { height: 42px; -webkit-line-clamp: 2; font-size: 13px; }
  .td-card-actions { gap: 6px; padding-top: 11px; }
  .td-card-actions .td-btn { padding: 7px 8px; font-size: 12px; min-height: 38px; }
  .td-card-actions .td-compare-btn { display: none; }
  .td-card-badges span { font-size: 9px; padding: 3px 8px; }
  .td-fav-btn { width: 31px; height: 31px; top: 9px; right: 9px; }
  .td-hero h1 { font-size: 27px; }
  .td-hero-search { padding: 6px 6px 6px 14px; border-radius: 14px; }
  .td-hero-search input { font-size: 14px; }
  .td-hero-search button { height: 42px; font-size: 14px; }
  .td-hero-popular a { padding: 5px 11px; font-size: 12px; }
  .td-hero-mascot { min-height: 240px; }
  .td-hero-mascot img { max-height: 230px; }
  .td-tool-hero-top { grid-template-columns: 64px minmax(0, 1fr); }
  .td-tool-hero-logo { width: 64px; height: 64px; border-radius: 16px; padding: 8px; }
  .td-tool-hero h1 { font-size: 20px; }
  .td-tool-hero .td-tool-desc { font-size: 14px; }
  .td-footer { margin: 24px 10px 16px; padding: 24px 18px 0; border-radius: 16px; }
  .td-footer-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .td-footer-bottom { flex-direction: column; gap: 4px; }
  .td-newsletter form { flex-direction: column; align-items: stretch; background: transparent; border: none; padding: 0; gap: 8px; }
  .td-newsletter input { background: rgba(8,12,28,.85); border: 1px solid rgba(130,165,255,.28); border-radius: 12px; padding: 13px 15px; width: 100%; }
  .td-newsletter button { width: 100%; height: 46px; }
  body.td-body .td-auth-wrap { padding: 22px 12px; }
  body.td-body .td-auth-card { padding: 27px 20px; border-radius: 17px; }
  body.td-body .td-auth-head h1 { font-size: 21px; }
  .td-dash-section { padding: 16px; }
  .td-dash-stat { padding: 13px; gap: 11px; }
  .td-dash-stat-icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 17px; border-radius: 12px; }
  .td-dash-stat-value { font-size: 19px; }
  .td-tab-btn { padding: 8px 14px; font-size: 12.5px; }
  .td-scrolltop { right: 13px; width: 43px; height: 43px; }
  .td-sidebar-post { grid-template-columns: 74px minmax(0, 1fr); }
  .td-sidebar-post-thumb { width: 74px; height: 60px; }
  .td-comment-item { grid-template-columns: 38px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .td-comment-avatar { width: 38px; height: 38px; border-radius: 11px; }
  .td-comments-head { flex-direction: column; }
}

/* ---------- Breakpoint: ≤430 / ≤390 / ≤360 ---------- */
@media (max-width: 430px) {
  .td-card-grid { grid-template-columns: minmax(0, 1fr); }
  .td-card-actions .td-btn { min-height: 42px; }
  .td-dash-stats, .td-dash-quick { grid-template-columns: minmax(0, 1fr); }
  .td-hero h1 { font-size: 24px; }
  .td-mobile-header { padding: 9px 12px; min-height: 56px; }
  .td-mobile-header-brand img { height: 33px; max-width: 165px; }
  .td-icon-btn { width: 38px; height: 38px; }
  .td-icon-btn svg { width: 20px; height: 20px; }
  .td-bn-item { min-height: 52px; padding: 6px 2px; }
  .td-bn-item svg { width: 22px; height: 22px; }
  .td-bn-item span { font-size: 9.5px; }
  .td-msb-header { padding: 14px 14px 12px; }
  .td-msb-logo img { height: 36px; max-width: 190px; }
  .td-rank-stars .td-stars { letter-spacing: 1px; }
}
@media (max-width: 360px) {
  .td-container { padding: 0 12px; }
  .td-mobile-sidebar { width: 92%; }
  .td-msb-link { padding: 11px 14px; font-size: 14px; }
  .td-hero-stats { flex-direction: column; }
  .td-hero-stats > div { flex: 1 1 auto; }
  .td-bn-item span { font-size: 9px; }
}

/* Hide frontend mobile chrome inside admin pages */
body.ad-body .td-mobile-header, body.ad-body .td-mobile-sidebar,
body.ad-body .td-mobile-sidebar-overlay, body.ad-body .td-bottom-nav { display: none !important; }

/* ============================================================
   ADMIN PANEL — responsive rules (admin loads this file after
   admin.css; behavior preserved from the v1.1.4 mobile sheet)
   ============================================================ */
.ad-overlay { display: none; position: fixed; inset: 0; background: rgba(3,5,12,.6); z-index: 105; backdrop-filter: blur(2px); }
body.ad-sidebar-open .ad-overlay { display: block; }
.ad-sidebar-close { display: none; position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,.10); color: #fff; cursor: pointer; align-items: center; justify-content: center; z-index: 2; }
.ad-sidebar-close svg { width: 18px; height: 18px; }
body.ad-body, body.ad-body * { box-sizing: border-box; }
body.ad-body { width: 100%; max-width: 100%; overflow-x: hidden; }
body.ad-body img, body.ad-body iframe, body.ad-body video, body.ad-body embed, body.ad-body object { max-width: 100%; height: auto; }
.ad-main, .ad-header, .ad-footer, .ad-card, .ad-toolbar { min-width: 0; max-width: 100%; }
.ad-main { overflow-x: hidden; }
.ad-sidebar { z-index: 110; }
.ad-header { z-index: 80; }
.ad-header h1 { min-width: 0; line-height: 1.25; }
.ad-header-right { min-width: 0; }
.ad-stats, .ad-health-grid, .ad-grid-2, .ad-stat, .ad-health-item { min-width: 0; }
.ad-stat-value, .ad-stat-label, .ad-health-item, .ad-card h3 { overflow-wrap: anywhere; }
.ad-toolbar > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.ad-toolbar form { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ad-toolbar input, .ad-toolbar select, .ad-toolbar button { min-width: 0; }
body.ad-body .td-form input[type=text], body.ad-body .td-form input[type=email], body.ad-body .td-form input[type=password],
body.ad-body .td-form input[type=url], body.ad-body .td-form input[type=number], body.ad-body .td-form input[type=date],
body.ad-body .td-form input[type=file], body.ad-body .td-form select, body.ad-body .td-form textarea,
.ad-card input[type=text], .ad-card input[type=email], .ad-card input[type=password], .ad-card input[type=url],
.ad-card input[type=number], .ad-card input[type=date], .ad-card input[type=file], .ad-card select, .ad-card textarea { max-width: 100%; min-width: 0; }
body.ad-body input[type="checkbox"], body.ad-body input[type="radio"] { width: auto; min-height: auto; }
.ad-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.ad-table-scroll .td-table { display: table !important; width: 100%; min-width: 760px; box-shadow: none; }
.ad-table-scroll .td-table th, .ad-table-scroll .td-table td { white-space: normal; vertical-align: middle; }
.ad-actions { display: inline-flex; flex-wrap: nowrap; gap: 4px; min-width: max-content; }
.ad-actions a, .ad-actions button { margin: 0; flex: 0 0 30px; }
.ad-bulk-card { display: flex !important; gap: 8px !important; align-items: center !important; flex-wrap: wrap !important; }
.ad-bulk-card select { width: auto; min-width: 180px; }
.ad-bulk-card span { margin-left: auto; }
.ad-sidebar::-webkit-scrollbar { width: 6px; }
.ad-sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 6px; }
.ad-card .td-form, .ad-card .td-content-card { padding: 0; box-shadow: none; border: none; background: transparent; }

@media (max-width: 1200px) {
  body.ad-body .ad-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.ad-body .ad-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ad-body .ad-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
  body.ad-body { display: block !important; min-height: 100vh; padding-top: 60px; }
  body.ad-body .ad-header { position: fixed; top: 0; left: 0; right: 0; height: 60px; padding: 9px 12px; gap: 8px; }
  body.ad-body .ad-header h1 { flex: 1; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.ad-body .ad-header-right { flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
  body.ad-body .ad-user { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.ad-body .ad-main { padding: 16px; }
  body.ad-body .ad-footer { padding: 14px 12px 18px; }
  body.ad-body .ad-sidebar { position: fixed !important; top: 0 !important; left: 0 !important; width: min(86vw, 340px) !important; max-width: min(86vw, 340px) !important; height: 100vh !important; height: 100dvh !important; transform: translateX(-110%) !important; transition: transform .28s cubic-bezier(.4,0,.2,1) !important; border-top-right-radius: 20px; border-bottom-right-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.35); padding-top: 14px; }
  body.ad-body.ad-sidebar-open .ad-sidebar, body.ad-sidebar-open .ad-sidebar { transform: translateX(0) !important; }
  body.ad-sidebar-open { overflow: hidden; }
  body.ad-body .ad-sidebar-close { display: inline-flex; }
  body.ad-body .ad-logo { padding: 0 52px 14px 18px; margin-bottom: 8px; min-height: 54px; display: flex; align-items: center; }
  body.ad-body .ad-logo img { height: 34px; max-width: 170px; object-fit: contain; }
  body.ad-body .ad-nav a { min-height: 46px; padding: 12px 18px; font-size: 14px; }
  body.ad-body .ad-nav-group { padding: 14px 18px 6px; }
  body.ad-body .ad-mtoggle { display: inline-flex !important; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; }
  body.ad-body .ad-stats, body.ad-body .ad-stats[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; }
  body.ad-body .ad-health-grid { grid-template-columns: 1fr; }
  body.ad-body .ad-grid-2 { grid-template-columns: 1fr !important; gap: 16px; }
  body.ad-body .ad-card { padding: 16px; margin-bottom: 16px; border-radius: 14px; }
  body.ad-body .td-form { padding: 0; box-shadow: none; border: none; background: transparent; }
  body.ad-body .td-form .td-row { grid-template-columns: 1fr; gap: 0; }
  body.ad-body .td-form input, body.ad-body .td-form select, body.ad-body .td-form textarea,
  body.ad-body .ad-card input, body.ad-body .ad-card select, body.ad-body .ad-card textarea { width: 100%; min-height: 44px; font-size: 14px; }
  body.ad-body .td-btn { min-height: 42px; }
  body.ad-body .ad-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  body.ad-body .ad-toolbar .td-btn { flex: 1 1 auto; min-height: 42px; }
  body.ad-body .ad-toolbar form input, body.ad-body .ad-toolbar form select, body.ad-body .ad-toolbar form button { flex: 1 1 180px; min-height: 42px; }
}
@media (max-width: 768px) {
  body.ad-body .ad-main { padding: 14px 12px; }
  body.ad-body .ad-card { padding: 14px; }
  body.ad-body .ad-header h1 { font-size: 15.5px; }
  body.ad-body .ad-header-right .ad-user { display: none; }
  body.ad-body .ad-stat { padding: 13px; border-radius: 12px; gap: 10px; }
  body.ad-body .ad-stat-icon { width: 42px; height: 42px; border-radius: 11px; font-size: 18px; flex: 0 0 42px; }
  body.ad-body .ad-stat-value { font-size: 18px; line-height: 1.15; }
  body.ad-body .ad-bulk-card select, body.ad-body .ad-bulk-card button { flex: 1 1 150px; min-height: 42px; }
  body.ad-body .ad-bulk-card span { flex: 1 1 100%; margin-left: 0 !important; text-align: left; }
  body.ad-body .ad-table-scroll .td-table { min-width: 720px; }
}
@media (max-width: 576px) {
  body.ad-body { padding-top: 58px; }
  body.ad-body .ad-header { height: 58px; }
  body.ad-body .ad-header h1 { font-size: 14.5px; }
  body.ad-body .ad-mtoggle { width: 40px; height: 40px; flex-basis: 40px; }
  body.ad-body .ad-header-right { gap: 4px; }
  body.ad-body .ad-header-right .td-btn { width: 38px; min-width: 38px; height: 38px; padding: 0; border-radius: 10px; }
  body.ad-body .ad-main { padding: 12px 10px; }
  body.ad-body .ad-card { padding: 12px; border-radius: 13px; }
  body.ad-body .ad-stats, body.ad-body .ad-stats[style] { grid-template-columns: 1fr !important; }
  body.ad-body .ad-toolbar > div:first-child { flex-direction: column; align-items: stretch; }
  body.ad-body .ad-toolbar .td-btn, body.ad-body .ad-toolbar form input, body.ad-body .ad-toolbar form select, body.ad-body .ad-toolbar form button { width: 100%; flex: 1 1 100%; }
  body.ad-body [style*="display:grid"][style*="grid-template-columns:repeat(2,1fr)"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 430px) {
  body.ad-body .ad-sidebar { width: 92vw !important; max-width: 92vw !important; }
  body.ad-body .ad-logo img { max-width: 150px; }
  body.ad-body .ad-nav a { font-size: 13.5px; padding: 11px 16px; }
  body.ad-body .ad-main { padding-left: 8px; padding-right: 8px; }
  body.ad-body .ad-table-scroll .td-table { min-width: 680px; }
}
