/*
Theme Name: DojoGrow Portal
Theme URI: https://dojogrow.com
Author: DojoGrow
Description: Clean membership portal theme with large typography and navy→fresh-blue gradient accents.
Version: 1.0.4
Text Domain: dojogrow-portal
*/

:root{
  --bg: #0b1220;
  --surface: #0f1a2e;
  --surface-2: #111f38;
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --subtle: rgba(255,255,255,0.58);
  --accentA: #0b1b4f;          /* navy */
  --accentB: #2aa7ff;          /* fresh blue */
  --accentC: #35d0ff;          /* bright blue */
  --good: #47d18c;
  --warn: #ffcb57;
  --bad:  #ff5a6a;
  --shadow: 0 18px 40px rgba(0,0,0,0.35);
  --radius: 18px;
  --radius-sm: 14px;
  --pad: 22px;
  --max: 1180px;
  --focus: 0 0 0 4px rgba(42,167,255,0.25);
}

/* Baseline */
html { font-size: 18px; }
@media (max-width: 920px){ html { font-size: 17px; } }
@media (max-width: 520px){ html { font-size: 16px; } }

body{
  margin:0;
  color: var(--text);
  background: radial-gradient(1200px 700px at 15% -10%, rgba(42,167,255,0.26), transparent 60%),
              radial-gradient(900px 600px at 85% 0%, rgba(53,208,255,0.18), transparent 55%),
              linear-gradient(180deg, #07101f 0%, #0b1220 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.55;
}

a { color: rgba(42,167,255,0.96); text-decoration: none; }
a:hover { text-decoration: underline; }

.dg-shell{ display:flex; min-height: 100vh; }
.dg-sidebar{
  width: 280px;
  padding: 26px 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,31,56,0.88) 0%, rgba(11,18,32,0.84) 100%);
  position: sticky;
  top:0;
  height: 100vh;
}
.dg-brand{
  display:flex; align-items:center; gap: 12px;
  padding: 8px 10px 14px 10px;
}
.dg-logo{
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accentA), var(--accentB));
  box-shadow: 0 12px 28px rgba(42,167,255,0.22);
}
/* If a WP Custom Logo is set, keep it sized like the default badge */
.dg-logo-img a{ display:block; line-height:0; }
.dg-logo-img img{ width: 42px; height: 42px; object-fit: contain; border-radius: 14px; }
.dg-brand h1{
  font-size: 1.05rem; margin:0;
  letter-spacing: 0.2px;
}
.dg-brand small{ display:block; color: var(--subtle); font-size: 0.86rem; margin-top: 2px; }

.dg-nav{ margin-top: 12px; display:flex; flex-direction: column; gap: 6px; }
.dg-nav a{
  display:flex; align-items:center; justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  transition: 160ms ease;
  text-decoration:none;
}
.dg-nav a:hover{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
  text-decoration:none;
}
.dg-nav a.dg-active{
  background: linear-gradient(135deg, rgba(11,27,79,0.55), rgba(42,167,255,0.18));
  border-color: rgba(42,167,255,0.35);
  box-shadow: 0 14px 30px rgba(0,0,0,0.26);
}
.dg-pill{
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--muted);
}

.dg-content{
  flex:1;
  padding: 34px 28px;
  min-width: 0; /* allow flex children to shrink; prevents clipping */
}
.dg-container{ max-width: var(--max); margin: 0 auto; }

.dg-topbar{
  display:flex; gap: 14px; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.dg-title h2{ margin:0; font-size: 1.8rem; letter-spacing: -0.2px; }
.dg-title p{ margin: 6px 0 0 0; color: var(--muted); }

.dg-actions{ display:flex; gap: 10px; align-items:center; }
.dg-btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 600;
  cursor:pointer;
  transition: 160ms ease;
}
.dg-btn:hover{ transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,0.30); }
.dg-btn:focus{ outline:none; box-shadow: var(--focus); }
.dg-btn-primary{
  border: 1px solid rgba(42,167,255,0.55);
  background: linear-gradient(135deg, rgba(11,27,79,0.9), rgba(42,167,255,0.55));
}
.dg-btn-primary:hover{ text-decoration:none; }

.dg-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.dg-card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17,31,56,0.84) 0%, rgba(11,18,32,0.86) 100%);
  box-shadow: var(--shadow);
}
.dg-card .dg-card-inner{ padding: var(--pad); }
.dg-card h3{
  margin: 0 0 10px 0;
  font-size: 1.12rem;
}
.dg-kpi{
  display:flex; align-items:baseline; justify-content: space-between;
  gap: 12px;
}
.dg-kpi .dg-num{
  font-size: 2.0rem;
  font-weight: 800;
  letter-spacing: -0.7px;
}
.dg-kpi .dg-sub{ color: var(--muted); font-size: 0.95rem; }
.dg-kpi .dg-badge{
  font-size: 0.84rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--muted);
}

.dg-span-3{ grid-column: span 3; }
.dg-span-4{ grid-column: span 4; }
.dg-span-5{ grid-column: span 5; }
.dg-span-6{ grid-column: span 6; }
.dg-span-7{ grid-column: span 7; }
.dg-span-8{ grid-column: span 8; }
.dg-span-9{ grid-column: span 9; }
.dg-span-12{ grid-column: span 12; }

@media (max-width: 1020px){
  .dg-shell{ display:block; }
  .dg-content{ padding: 22px 14px; }
  .dg-span-3{ grid-column: span 6; }
  .dg-span-4{ grid-column: span 6; }
  .dg-span-5{ grid-column: span 12; }
  .dg-span-6{ grid-column: span 12; }
  .dg-span-7{ grid-column: span 12; }
  .dg-span-8{ grid-column: span 12; }
  .dg-span-9{ grid-column: span 12; }
}
.dg-table{
  width:100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  /* Don't clip wide tables; prefer responsive width, but allow swipe-scroll when needed */
  overflow: visible;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

@media (max-width: 820px){
  /* Tables (calls, leads) can be wider than phones; scroll instead of clipping */
  body.dg-portal .entry-content table,
  .dg-table{
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox: hide scrollbar */
    -ms-overflow-style: none;       /* IE/Edge legacy */
    touch-action: pan-x pan-y;      /* allow grab/swipe */
  }
  body.dg-portal .entry-content table::-webkit-scrollbar,
  .dg-table::-webkit-scrollbar{ height: 0; width: 0; }
  body.dg-portal .entry-content table th,
  body.dg-portal .entry-content table td,
  .dg-table th,
  .dg-table td{ white-space: nowrap; }
}

/* Wide-content safety: prefer max-width:100%; if overflow is unavoidable, allow swipe-scroll without ugly scrollbars */
body.dg-portal .entry-content,
.dg-card-inner{
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x pan-y;
}
body.dg-portal .entry-content::-webkit-scrollbar,
.dg-card-inner::-webkit-scrollbar{ height: 0; width: 0; }

/* Keep common embedded elements from overflowing their containers */
img, svg, video, iframe, audio, canvas{ max-width: 100%; height: auto; }

.dg-table th, .dg-table td{
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align:left;
}
.dg-table th{
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.25px;
  background: rgba(255,255,255,0.03);
}
.dg-table tr:last-child td{ border-bottom:none; }
.dg-table tr:hover td{ background: rgba(255,255,255,0.02); }

.dg-input, .dg-select{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}
.dg-input:focus, .dg-select:focus{ outline:none; box-shadow: var(--focus); border-color: rgba(42,167,255,0.55); }

.dg-form-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 680px){ .dg-form-row{ grid-template-columns: 1fr; } }

.dg-empty{
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.18);
  color: var(--muted);
}

.dg-mobilebar{
  display:none;
}
@media (max-width: 1020px){
  .dg-mobilebar{
    display:flex;
    position: sticky;
    top:0;
    z-index: 50;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(11,18,32,0.82);
    backdrop-filter: blur(8px);
    align-items:center;
    justify-content: space-between;
  }
  .dg-mobilebar .dg-brand h1{ font-size: 1.0rem; }

  /* Mobile drawer menu (restores sidebar on small screens) */
  .dg-shell{ display:block; }
  .dg-sidebar{
    display:block;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: min(86vw, 320px);
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    overflow-y: auto;
    overflow-x: hidden;
  }
  body.dg-menu-open .dg-sidebar{ transform: translateX(0); }

  .dg-content{ padding: 18px 14px; }

  .dg-overlay{
    display:none;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0,0,0,0.55);
  }
  body.dg-menu-open .dg-overlay{ display:block; }
  body.dg-menu-open{ overflow: hidden; }
}

/* Standard hamburger button */
.dg-hamburger{
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.dg-hamburger:focus{ outline:none; box-shadow: var(--focus); }
.dg-hamburger .dg-bars{
  width: 18px;
  height: 12px;
  position: relative;
}
.dg-hamburger .dg-bars span{
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.92);
}
.dg-hamburger .dg-bars span:nth-child(1){ top: 0; }
.dg-hamburger .dg-bars span:nth-child(2){ top: 5px; }
.dg-hamburger .dg-bars span:nth-child(3){ top: 10px; }

/* WordPress content defaults */
.entry-content{ color: var(--text); }
.wp-block{ max-width: var(--max); }
