/* ==============================================
   SE Tax Calculators — Self Employment Tax Tools
   ============================================== */
:root {
  --ink:    #2D3748;
  --muted:  #718096;
  --line:   #E2E8F0;
  --soft:   #F7FAFC;
  --accent: #2563EB;
  --accent2:#0F766E;
  --white:  #FFFFFF;
  --success: #059669;
  --warning: #D97706;
  --danger:  #DC2626;
  --bg:     #FAFBFC;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
aside {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 24px 20px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #2563EB, #059669);
  border-radius: 12px;
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 16px;
}
.brand h1 { font-size: 18px; line-height: 1.2; margin: 0; }
.brand .tag { color: var(--muted); font-size: 12px; margin-top: 2px; }

nav { display: grid; gap: 6px; margin-bottom: 24px; }
.nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px 12px; }
.nav-label:first-child { margin-top: 0; }
.tab {
  width: 100%; text-align: left;
  border: 1px solid transparent;
  background: transparent; color: var(--ink);
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; font-weight: 600; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
  transition: all .15s;
}
.tab:hover { background: var(--soft); border-color: var(--line); }
.tab.active { background: #EEF2FF; border-color: var(--accent); color: var(--accent); }
.tab-num { color: var(--muted); font-size: 12px; font-weight: 600; }

.side-footer {
  position: absolute; bottom: 20px; left: 20px; right: 20px;
  font-size: 11px; color: var(--muted); line-height: 1.5;
}

/* ---------- Main ---------- */
main { padding: 32px; max-width: 960px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #EEF2FF 0%, #ECFDF5 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 24px;
}
.hero h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; }
.hero p { color: var(--muted); margin: 0; max-width: 680px; }

/* Calculator card */
.calc-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}
.calc-card h3 { margin: 0 0 4px; font-size: 22px; }
.calc-desc { color: var(--muted); margin: 0 0 20px; }

/* Form elements */
label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 6px; }
label:first-child { margin-top: 0; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit; font-size: 15px;
  color: var(--ink);
  background: var(--white);
  transition: border-color .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Buttons */
.btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
button.primary {
  background: var(--accent);
  color: #FFF;
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 24px;
  font-weight: 700; font-size: 15px;
  cursor: pointer; transition: all .15s;
}
button.primary:hover { background: #1D4ED8; }
button.secondary {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 24px;
  font-weight: 700; font-size: 15px;
  cursor: pointer;
}

/* Results */
.results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--line);
}
.results h4 { margin: 0 0 16px; font-size: 18px; color: var(--muted); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.result-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.result-box .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.result-box .value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.result-box .value.positive { color: var(--success); }
.result-box .value.negative { color: var(--danger); }
.result-box .value.neutral { color: var(--accent); }
.result-box .detail { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Content pages */
.content-page { max-width: 780px; }
.content-page h2 { font-size: 30px; margin: 0 0 8px; }
.content-page h3 { font-size: 20px; margin: 28px 0 12px; }
.content-page p, .content-page li { color: #4A5568; font-size: 15px; line-height: 1.7; }
.content-page ul { padding-left: 20px; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: 14px; }

/* Footer */
footer { color: var(--muted); font-size: 13px; margin: 24px 0 10px; display: flex; gap: 14px; flex-wrap: wrap; }

/* AdSense ad placeholder */
.ad-placeholder {
  min-height: 90px;
  background: rgba(37, 99, 235, 0.04) !important;
  border: 1px dashed rgba(37, 99, 235, 0.2) !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  margin: 20px 0;
}
.ad-placeholder::before {
  content: 'Advertisement';
  color: rgba(37, 99, 235, 0.35);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ad-placeholder iframe { position: relative; z-index: 1; }
.ad-placeholder:has(iframe)::before { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  aside { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .side-footer { position: static; margin-top: 16px; }
  main { padding: 20px; }
  .hero { padding: 20px; }
  .hero h2 { font-size: 24px; }
  .row { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Print ---------- */
@media print {
  aside, .ad-placeholder, footer, .btns { display: none !important; }
  main { padding: 0; }
  .calc-card { border: none; padding: 0; }
}
