:root{--bg:#f5f7fb;--card:#fff;--text:#182230;--muted:#667085;--line:#e4e7ec;--accent:#1d4ed8;--accent2:#0f172a;--danger:#b42318;--warn:#b54708;--ok:#027a48}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}a{color:var(--accent);text-decoration:none}.topbar{height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:28px;padding:0 28px;position:sticky;top:0;z-index:10}.brand{font-weight:800;font-size:20px}.brand a{color:var(--accent2)}nav{display:flex;gap:18px;flex:1}nav a{color:#344054;font-weight:600;font-size:14px}.userbox{display:flex;gap:14px;align-items:center;font-size:13px;color:var(--muted)}.app-wrap{max-width:1220px;margin:28px auto;padding:0 20px}.public-wrap{max-width:1120px;margin:0 auto;padding:0 20px}.hero{padding:90px 0 70px}.hero h1{font-size:56px;line-height:1.04;max-width:820px;margin:0 0 22px}.hero p{font-size:21px;color:var(--muted);max-width:760px;line-height:1.6}.actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:30px}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;padding:11px 16px;font-weight:700;cursor:pointer;background:var(--accent);color:#fff;font-size:14px}.btn.secondary{background:#fff;color:#344054;border:1px solid var(--line)}.btn.danger{background:#fff;color:var(--danger);border:1px solid #fecdca}.btn.small{padding:7px 10px;font-size:12px}.grid{display:grid;gap:18px}.grid-4{grid-template-columns:repeat(4,1fr)}.grid-3{grid-template-columns:repeat(3,1fr)}.grid-2{grid-template-columns:repeat(2,1fr)}.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px;box-shadow:0 1px 2px rgba(16,24,40,.03)}.stat .num{font-size:34px;font-weight:800;margin-top:6px}.label{color:var(--muted);font-size:13px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:28px 0 14px}.section-title h1,.section-title h2{margin:0}.table-wrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:14px}table{width:100%;border-collapse:collapse;min-width:780px}th,td{padding:13px 14px;border-bottom:1px solid var(--line);text-align:left;font-size:14px}th{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);background:#fcfcfd}.badge{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700;background:#eef2ff;color:#3730a3}.badge.overdue{background:#fef3f2;color:var(--danger)}.badge.today{background:#fff6ed;color:var(--warn)}.badge.soon{background:#fffaeb;color:#b54708}.badge.week{background:#eff8ff;color:#175cd3}.badge.done{background:#ecfdf3;color:var(--ok)}.form-card{max-width:760px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}.field{margin-bottom:14px}.field label{display:block;font-size:13px;font-weight:700;margin-bottom:6px}.field input,.field select,.field textarea{width:100%;border:1px solid #d0d5dd;border-radius:9px;padding:10px 11px;background:#fff;font:inherit}.field textarea{min-height:90px;resize:vertical}.login-shell{min-height:72vh;display:grid;place-items:center}.login-card{width:min(440px,100%);background:#fff;border:1px solid var(--line);border-radius:16px;padding:28px}.login-card h1{margin-top:0}.flash{padding:12px 14px;border-radius:10px;margin-bottom:16px}.flash.success{background:#ecfdf3;color:#027a48}.flash.error{background:#fef3f2;color:#b42318}.flash.warning{background:#fffaeb;color:#b54708}.muted{color:var(--muted)}.inline{display:inline}.footer{text-align:center;padding:34px 20px;color:#98a2b3;font-size:12px}.feature{padding:22px}.feature h3{margin:0 0 8px}.pricing{padding:70px 0}.price{font-size:30px;font-weight:800}.empty{padding:28px;text-align:center;color:var(--muted)}.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}.day{background:#fff;border:1px solid var(--line);border-radius:10px;min-height:110px;padding:10px}.day .date{font-weight:800}.event{font-size:11px;background:#eef4ff;border-radius:6px;padding:5px;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media(max-width:900px){.grid-4,.grid-3,.grid-2{grid-template-columns:1fr 1fr}.topbar nav{display:none}.hero h1{font-size:42px}}@media(max-width:620px){.grid-4,.grid-3,.grid-2,.form-row{grid-template-columns:1fr}.hero{padding:55px 0}.hero h1{font-size:36px}.topbar{padding:0 16px}.userbox span{display:none}}

/* ЮрСроки 3.0 */
.legal-page{max-width:900px;padding:45px 0 20px}.legal-page h1{font-size:40px;letter-spacing:-.02em}.legal-page h2{margin-top:30px}.legal-page p{line-height:1.7}.legal-links{text-align:center;padding:20px 0 55px;color:var(--muted)}
.card .price{overflow-wrap:anywhere}.money-positive{font-weight:800}.print-note{font-size:12px;color:var(--muted)}

/* 3.1 branding/security */
.brand a{display:flex;align-items:baseline;gap:7px;white-space:nowrap}
.brand-main{font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;font-weight:850}
.brand-by{font-family:Georgia,"Times New Roman",serif;font-size:11px;font-style:italic;font-weight:400;color:#667085;letter-spacing:.01em}
.brand-section{font-size:12px;font-weight:800;color:#344054;margin-left:4px}
.footer .brand-by{margin:0 3px}.public-topbar{position:relative}.secret-box{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:22px;font-weight:800;letter-spacing:.08em;background:#0f172a;color:#fff;padding:16px;border-radius:12px;word-break:break-all;margin:15px 0}
.setup-steps{padding-left:22px;color:#344054}.setup-steps li{margin:8px 0}
@media(max-width:620px){.brand-by{font-size:9px}.brand-section{display:none}}


/* ЮрСроки 3.1.2 — отдельный фирменный byline */
.brand a{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:2px;
  line-height:1;
  white-space:nowrap;
}

.brand-main{
  display:block;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  font-size:20px;
  font-weight:850;
  letter-spacing:-0.02em;
  color:#0f172a;
}

.brand-by{
  display:block;
  margin:0;
  font-family:"Palatino Linotype","Book Antiqua",Palatino,Georgia,serif;
  font-size:10px;
  line-height:1.15;
  font-weight:400;
  font-style:italic;
  letter-spacing:.055em;
  color:#667085;
  text-transform:none;
}

.brand-section{
  display:block;
  margin-top:2px;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  font-size:10px;
  line-height:1;
  font-style:normal;
  font-weight:800;
  letter-spacing:.08em;
  color:#475467;
}

.footer{
  line-height:1.55;
}

.footer .brand-main{
  display:block;
  font-size:14px;
  margin-bottom:2px;
}

.footer .brand-by{
  display:block;
  font-size:10px;
  margin-bottom:5px;
}

@media(max-width:620px){
  .brand-main{font-size:18px}
  .brand-by{font-size:8.5px;letter-spacing:.04em}
}


/* ЮрСроки 3.1.3 — journal spacing + larger Barnaev byline */

.brand a{
  gap:4px;
}

.brand-by{
  font-size:12px;
  line-height:1.2;
  letter-spacing:.05em;
}

.footer .brand-by{
  font-size:11.5px;
  margin-top:2px;
  margin-bottom:7px;
}

/* Журнал: записи визуально разделены */
.simple-filter{
  display:grid;
  grid-template-columns:minmax(280px,1fr) auto auto;
  gap:12px;
  align-items:center;
  max-width:760px;
  margin:0 0 28px;
  padding:0;
  background:transparent;
  border:0;
}

.simple-filter input{
  min-height:42px;
}

.activity{
  display:grid;
  gap:14px;
  margin-top:6px;
}

.activity-row{
  display:grid;
  grid-template-columns:160px minmax(0,1fr);
  gap:22px;
  align-items:start;
  padding:17px 19px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 1px 2px rgba(16,24,40,.035);
}

.activity-row > .muted:first-child{
  font-size:13px;
  line-height:1.45;
  padding-top:1px;
  white-space:nowrap;
}

.activity-row > div:last-child{
  line-height:1.5;
}

.activity-row > div:last-child strong{
  display:inline-block;
  margin-bottom:4px;
}

.activity-row > div:last-child .muted{
  display:block;
  margin-top:3px;
  line-height:1.45;
}

@media(max-width:700px){
  .simple-filter{
    grid-template-columns:1fr 1fr;
  }
  .simple-filter input{
    grid-column:1 / -1;
  }
  .activity-row{
    grid-template-columns:1fr;
    gap:7px;
    padding:15px;
  }
  .activity-row > .muted:first-child{
    white-space:normal;
  }
  .brand-by{
    font-size:10.5px;
  }
}

/* ЮрСроки 3.1.4 — legal footer */
.footer{
  border-top:1px solid var(--line);
  background:#fff;
  margin-top:46px;
  padding:28px 20px 34px;
}
.footer-legal{
  margin-top:8px;
  color:#667085;
  font-size:12px;
  line-height:1.55;
}
.footer-links{
  margin-top:7px;
  font-size:12px;
}
.footer-links a{
  color:#475467;
  text-decoration:underline;
  text-underline-offset:2px;
}
.copyright-warning{
  max-width:920px;
  margin:9px auto 0;
  color:#98a2b3;
  font-size:11px;
  line-height:1.5;
}


/* ЮрСроки 3.1.5 — fix filters on Deadlines and Cases */
.filterbar{
  display:grid;
  grid-template-columns:minmax(260px,2.2fr) minmax(130px,1fr) minmax(150px,1.15fr) minmax(150px,1.15fr) 150px 150px auto auto;
  gap:10px;
  align-items:center;
  width:100%;
  margin:0 0 18px;
}

.filterbar input,
.filterbar select{
  width:100%;
  min-width:0;
  height:42px;
  border:1px solid #d0d5dd;
  border-radius:9px;
  padding:9px 11px;
  background:#fff;
  color:var(--text);
  font:inherit;
}

.filterbar .btn{
  min-height:42px;
  white-space:nowrap;
  padding-left:16px;
  padding-right:16px;
}

/* Дела: строка фильтров короче, поэтому даём ей собственную сетку */
.filterbar.simple-case-filter{
  grid-template-columns:minmax(300px,2fr) minmax(190px,1fr) auto auto;
  max-width:820px;
}

/* Форма создания/редактирования — поля не должны вылезать из колонок */
.form-row > .field{
  min-width:0;
}
.field input,
.field select,
.field textarea{
  min-width:0;
  max-width:100%;
}

/* Планшеты */
@media(max-width:1180px){
  .filterbar{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .filterbar > input[name="q"]{
    grid-column:span 2;
  }
  .filterbar.simple-case-filter{
    grid-template-columns:minmax(0,2fr) minmax(180px,1fr) auto auto;
    max-width:none;
  }
}

/* Узкие экраны */
@media(max-width:760px){
  .section-title{
    align-items:flex-start;
    flex-direction:column;
  }
  .section-title .actions{
    width:100%;
    margin-top:0 !important;
  }
  .filterbar,
  .filterbar.simple-case-filter{
    grid-template-columns:1fr 1fr;
    max-width:none;
  }
  .filterbar > input[name="q"],
  .filterbar.simple-case-filter > input[name="q"]{
    grid-column:1 / -1;
  }
  .filterbar .btn{
    width:100%;
  }
}

@media(max-width:520px){
  .filterbar,
  .filterbar.simple-case-filter{
    grid-template-columns:1fr;
  }
  .filterbar > *,
  .filterbar > input[name="q"],
  .filterbar.simple-case-filter > input[name="q"]{
    grid-column:1;
  }
}
