:root {
  --ink: #172126;
  --muted: #68787f;
  --line: #dbe5e2;
  --panel: rgba(255,255,255,.84);
  --teal: #1f5e5b;
  --teal-2: #2d7a73;
  --mint: #eaf6f3;
  --gold: #bb8844;
  --gold-2: #efd8aa;
  --rose: #fff0ed;
  --sky: #eef6ff;
  --danger: #b84a4a;
  --shadow: 0 18px 55px rgba(22, 45, 49, .12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 6%, rgba(187,136,68,.24), transparent 30rem),
    radial-gradient(circle at 94% 12%, rgba(45,122,115,.16), transparent 30rem),
    linear-gradient(135deg, #fbf7ef 0%, #f3fbf8 45%, #fbfbff 100%);
  line-height: 1.8;
}

::selection { background: rgba(187,136,68,.22); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(219,229,226,.75);
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 35px rgba(31,94,91,.08);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--teal); white-space: nowrap; }
.mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--teal), var(--gold)); box-shadow: 0 9px 22px rgba(31,94,91,.2); }
.nav { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; color: #506167; font-size: 13px; font-weight: 700; }
.nav a { padding: 8px 11px; border-radius: 999px; }
.nav a:hover { background: var(--mint); color: var(--teal); }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.status-pill {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--teal);
  background: var(--mint);
  border: 1px solid #d2e8e3;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-pill.offline { color: #7a4d0d; background: #fff4d8; border-color: #f0d59a; }

.btn, .file-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #2d817a);
  box-shadow: 0 11px 24px rgba(31,94,91,.18);
  line-height: 1.4;
}
.btn.secondary, .file-button { color: var(--teal); background: #fff; border: 1px solid var(--line); box-shadow: none; }
.btn:hover, .file-button:hover { transform: translateY(-1px); }

.hero {
  position: relative;
  overflow: hidden;
  margin: 32px auto 24px;
  padding: clamp(26px, 5vw, 56px);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.64)),
    radial-gradient(circle at 20% 20%, rgba(187,136,68,.22), transparent 18rem),
    radial-gradient(circle at 84% 70%, rgba(31,94,91,.16), transparent 22rem);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}
.hero::before { content: ""; position: absolute; inset: auto -8% -45% auto; width: 420px; height: 420px; border-radius: 50%; background: conic-gradient(from 180deg, rgba(31,94,91,.16), rgba(187,136,68,.24), transparent, rgba(31,94,91,.16)); }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 28px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 7px 12px; border-radius: 999px; color: #6a4a1d; background: rgba(239,216,170,.54); font-size: 13px; font-weight: 900; }
h1, h2, h3 { margin: 0; line-height: 1.35; color: var(--teal); }
h1 { font-size: clamp(32px, 6vw, 62px); letter-spacing: -1.4px; }
h2 { font-size: clamp(23px, 3vw, 34px); letter-spacing: -.5px; }
h3 { font-size: 18px; }
.lead { max-width: 760px; margin: 18px 0 0; color: #506167; font-size: clamp(16px, 2vw, 20px); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }
.stat { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.72); border: 1px solid rgba(219,229,226,.9); }
.stat b { display: block; color: var(--teal); font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 700; }
.focus-card { padding: 22px; border-radius: 26px; color: #fff; background: linear-gradient(150deg, #1f5e5b, #2d7a73 58%, #bb8844); box-shadow: 0 22px 46px rgba(31,94,91,.22); }
.focus-card h3 { color: #fff; font-size: 22px; }
.focus-card input, .focus-card textarea { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); }
.focus-card input::placeholder, .focus-card textarea::placeholder { color: rgba(255,255,255,.68); }
.focus-card label { color: rgba(255,255,255,.86); }
.sync-note { margin: 12px 0 0; font-size: 12px; color: rgba(255,255,255,.82); }

main { padding-bottom: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 42px 0 16px; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 14px; border-radius: 999px; color: var(--teal); background: var(--mint); font-weight: 900; border: 1px solid #d3e9e4; margin-bottom: 10px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact { margin-top: 14px; gap: 10px; }
.section-gap { margin-top: 16px; }
.stack { display: grid; gap: 10px; }

.card { position: relative; overflow: hidden; padding: 20px; border: 1px solid rgba(219,229,226,.92); border-radius: var(--radius-lg); background: var(--panel); box-shadow: 0 12px 34px rgba(31,94,91,.08); }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255,255,255,.42), transparent 45%); }
.card > * { position: relative; z-index: 1; }
.card.soft { background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(248,241,229,.78)); }
.card.green { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(234,246,243,.86)); }
.card.rose { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,240,237,.86)); }
.card.sky { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(238,246,255,.86)); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 16px; color: var(--teal); background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 22px rgba(31,94,91,.08); font-size: 20px; }

label { display: block; color: #63747a; font-size: 12px; font-weight: 900; }
input[type="text"], input[type="number"], textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #c7d6d2;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: rgba(255,255,255,.72);
  outline: none;
  resize: vertical;
}
textarea { min-height: 96px; }
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(187,136,68,.12); background: #fff; }
.field-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.check-list { display: grid; gap: 9px; }
.check { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 10px; padding: 9px 10px; border-radius: 13px; background: rgba(255,255,255,.58); border: 1px solid rgba(219,229,226,.75); color: var(--ink); font-size: 14px; }
.check input { appearance: none; width: 20px; height: 20px; margin: 4px 0 0; border: 2px solid #a9bab6; border-radius: 7px; background: #fff; cursor: pointer; }
.check input:checked { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 4px #fff; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.74); table-layout: fixed; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); vertical-align: top; min-height: 42px; }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-left: 0; }
th { color: var(--teal); background: var(--mint); font-weight: 900; text-align: right; font-size: 13px; }
td input[type="text"] { margin: 0; min-width: 110px; }
td input[type="checkbox"] { width: 18px; height: 18px; }

.week-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.day-mini { min-height: 190px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.76); }
.day-mini h3 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--teal); }
.day-mini h3 span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--gold); font-size: 12px; }
.day-mini textarea { min-height: 110px; }
.daily-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 16px; align-items: start; }
.daily-page { margin-top: 18px; padding-top: 18px; border-top: 1px dashed #c6d5d1; }
.daily-page:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.day-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 16px 18px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, var(--teal), var(--teal-2)); box-shadow: 0 14px 30px rgba(31,94,91,.16); }
.day-header h2 { color: #fff; }
.day-meta { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 8px; flex: 1; max-width: 700px; }
.day-meta label { color: rgba(255,255,255,.86); }
.day-meta input { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); }
.day-meta input::placeholder { color: rgba(255,255,255,.72); }
.time-table th:first-child, .time-table td:first-child { width: 82px; text-align: center; color: var(--teal); font-weight: 900; }
.habit-table th, .habit-table td { text-align: center; }
.habit-table th:first-child, .habit-table td:first-child { text-align: right; width: 24%; }
.toolbar-note { margin-top: 10px; color: var(--muted); font-size: 13px; }

@media (max-width: 1100px) {
  .topbar { align-items: flex-start; border-radius: 24px; flex-direction: column; }
  .actions { width: 100%; }
  .hero-grid, .daily-layout { grid-template-columns: 1fr; }
  .grid.three, .field-grid { grid-template-columns: repeat(2, 1fr); }
  .week-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 22px, 1180px); }
  .hero { padding: 22px; }
  .hero-stats, .grid.two, .grid.three, .field-grid, .week-board { grid-template-columns: 1fr; }
  .day-header { align-items: stretch; flex-direction: column; }
  .day-meta { grid-template-columns: 1fr; max-width: none; }
  .nav { justify-content: flex-start; }
  .btn, .file-button { width: 100%; text-align: center; }
}

@media print {
  @page { size: A4; margin: 11mm; }
  body { background: #fff; color: #000; }
  .topbar, .no-print { display: none !important; }
  .shell { width: 100%; }
  .hero, .card, .focus-card, .day-header, .day-mini { box-shadow: none !important; break-inside: avoid; }
  .hero { margin-top: 0; }
  .hero::before, .card::after { display: none; }
  .daily-page { break-before: page; border-top: 0; padding-top: 0; }
  .daily-page:first-child { break-before: auto; }
  .card { background: #fff !important; }
  .day-header { background: #1f5e5b !important; color: #fff !important; }
  .week-board { grid-template-columns: repeat(2, 1fr); }
  th { background: #eaf6f3 !important; }
}
