/* Колледж Каспийского университета — фирменные цвета ccu.edu.kz:
   коралловый #eb5a40, графитово-серый #697276, акцентный синий #1890d7, шрифт Roboto */
:root {
  --coral: #eb5a40;
  --coral-dark: #cf452c;
  --coral-soft: #fdeeea;
  --slate: #697276;
  --slate-dark: #3b4347;
  --slate-darker: #262d30;
  --blue: #1890d7;
  --bg: #f2f4f5;
  --card: #ffffff;
  --line: #e4e8ea;
  --text: #263033;
  --muted: #78858a;
  --green: #2e9e6b;
  --green-soft: #e3f5ec;
  --amber: #e69a14;
  --amber-soft: #fff3da;
  --red: #c9302c;
  --red-soft: #fbe9e8;
  --blue-soft: #e4f2fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(25, 35, 40, .05), 0 6px 20px rgba(25, 35, 40, .06);
  --shadow-lg: 0 10px 34px rgba(25, 35, 40, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.55 "Roboto", "Segoe UI", system-ui, Arial, sans-serif;
  background: radial-gradient(1200px 380px at 85% -80px, rgba(235,90,64,.10), transparent 70%), var(--bg);
}
a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: #0f6fa8; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; } .right { text-align: right; }
.mt { margin-top: 20px; } .mb { margin-bottom: 22px; }
.ic { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }

/* ---- шапка ---- */
.topbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, #424b4f, var(--slate-dark)); color: #fff; border-bottom: 3px solid var(--coral); box-shadow: 0 4px 18px rgba(20,28,32,.25); }
.topbar .inner { max-width: 1360px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 10px 18px; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff !important; }
.brand img { height: 54px; width: auto; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.brand .t { line-height: 1.15; border-left: 1px solid rgba(255,255,255,.22); padding-left: 14px; }
.brand .t b { display: block; font-size: 15px; letter-spacing: .01em; }
.brand .t span { font-size: 12px; color: #c4cdd1; }
.nav { display: flex; gap: 1px; flex: 1; flex-wrap: nowrap; min-width: 0; }
.nav a { color: #dfe4e6; padding: 8px 10px; border-radius: 999px; font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active { background: var(--coral); color: #fff; box-shadow: 0 4px 12px rgba(235,90,64,.45); }
.user-box { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.user-box .who { text-align: right; line-height: 1.2; max-width: 150px; }
.user-box .who a, .user-box .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .who a { color: #fff; font-weight: 500; }
.user-box .who small { color: #b4bec2; display: block; font-size: 12px; }
.bell { position: relative; color: #fff !important; display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; background: rgba(255,255,255,.08); transition: background .15s; }
.bell:hover { background: rgba(255,255,255,.18); }
.bell .ic { width: 19px; height: 19px; }
.bell .badge-n { position: absolute; top: -4px; right: -4px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--slate-dark); }
.linklike { background: rgba(255,255,255,.08); border: 0; color: #dfe4e6; cursor: pointer; font: inherit; padding: 8px 12px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.linklike:hover { background: rgba(255,255,255,.18); color: #fff; }

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 24px 48px; animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.footer { background: var(--slate-darker); color: #a8b2b6; font-size: 13px; padding: 26px 24px; border-top: 3px solid var(--coral); }
.footer .inner { max-width: 1360px; margin: 0 auto; display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; }
.footer b { color: #fff; } .footer a { color: #e6e9ea; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; }
.page-head .sub { color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--coral); }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; border-radius: 20px; color: #fff; padding: 30px 34px; margin-bottom: 24px; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center;
  background: linear-gradient(120deg, #343c40 0%, #4a5559 55%, #5d696d 100%); box-shadow: var(--shadow-lg); }
.hero::before { content: ""; position: absolute; right: -90px; top: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(235,90,64,.55), rgba(235,90,64,0) 68%); }
.hero::after { content: ""; position: absolute; left: -60px; bottom: -140px; width: 320px; height: 320px; border-radius: 50%; border: 44px solid rgba(255,255,255,.04); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: #ffb8a9; margin-bottom: 8px; }
.hero h1 { color: #fff; font-size: 30px; margin-bottom: 6px; }
.hero .sub { color: #cfd7da; margin-bottom: 18px; }
.hero .actions .btn-outline { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.32); color: #fff !important; }
.hero .actions .btn-outline:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.6); color: #fff !important; }
.hero-ring { display: flex; align-items: center; gap: 26px; }
.hero-legend { display: grid; gap: 8px; font-size: 13.5px; color: #dbe2e5; }
.hero-legend b { color: #fff; font-size: 17px; margin-right: 4px; }
.hero-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 24px; } .hero-ring { justify-content: flex-start; } }

/* ---- кольцо прогресса ---- */
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .trk { stroke: rgba(120,133,138,.2); } .ring.on-dark .trk { stroke: rgba(255,255,255,.16); }
.ring .bar-c { transition: stroke-dashoffset .9s cubic-bezier(.3,.7,.2,1); stroke-linecap: round; }
.ring .val { position: absolute; text-align: center; line-height: 1.1; font-weight: 700; }
.ring .val small { display: block; font-size: 11px; font-weight: 500; opacity: .75; margin-top: 2px; }

/* ---- карточки ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; border: 1px solid rgba(228,232,234,.8); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.card-head h2 .ic { color: var(--coral); }
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 980px) { .grid.cols-2, .grid.cols-3, .grid.main-side { grid-template-columns: minmax(0, 1fr); } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; color: inherit !important; transition: transform .18s, box-shadow .18s; }
a.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi .ico { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: #eceff0; color: var(--slate); flex: none; }
.kpi .ico .ic { width: 22px; height: 22px; }
.kpi .v { font-size: 28px; font-weight: 700; line-height: 1.05; }
.kpi .l { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.25; }
.kpi.coral .ico { background: var(--coral-soft); color: var(--coral); } .kpi.coral .v { color: var(--coral); }
.kpi.green .ico { background: var(--green-soft); color: var(--green); } .kpi.green .v { color: var(--green); }
.kpi.red .ico { background: var(--red-soft); color: var(--red); } .kpi.red .v { color: var(--red); }
.kpi.amber .ico { background: var(--amber-soft); color: #c27d00; } .kpi.amber .v { color: #b97a00; }
.kpi.blue .ico { background: var(--blue-soft); color: var(--blue); } .kpi.blue .v { color: var(--blue); }

/* ---- карточки отделов ---- */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.dept-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); color: inherit !important; display: block; position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.dept-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--green)); }
.dept-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d4dadd; }
.dept-card .top { display: flex; gap: 14px; align-items: center; }
.dept-card h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.dept-card .head { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dept-card { display: flex; flex-direction: column; }
.dept-card .nums { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.dept-card .bar { margin-top: auto; }

/* ---- таблицы ---- */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #f8f9fa; white-space: nowrap; }
table.t td { padding: 13px 16px; border-bottom: 1px solid #eef1f2; vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .12s; }
table.t tbody tr:hover { background: #fafbfb; }
table.t td.title { min-width: 300px; }
table.t td.title a { color: var(--text); } table.t td.title a:hover { color: var(--coral-dark); }
table.t .code { font-size: 12px; color: var(--muted); font-weight: 500; }
.row-overdue td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.row-soon td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
.row-done td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.table-wrap { overflow-x: auto; }

/* ---- бейджи / прогресс ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before, .badge.nodot::before { display: none; }
.st-done { background: var(--green-soft); color: #1d7a50; }
.st-overdue { background: var(--red-soft); color: var(--red); }
.st-in_progress { background: var(--blue-soft); color: #0f6fa8; }
.st-open { background: var(--amber-soft); color: #94640a; }
.st-planned { background: #eceff0; color: var(--slate); }
.badge.coral { background: var(--coral-soft); color: var(--coral-dark); }
.badge.gray { background: #eceff0; color: var(--slate); }
.badge.green { background: var(--green-soft); color: #1d7a50; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: #94640a; }
.chip { display: inline-block; background: #eceff0; color: var(--slate); border-radius: 6px; padding: 1px 8px; font-size: 12px; margin: 1px 4px 1px 0; }
a.chip:hover { background: var(--coral-soft); color: var(--coral-dark); }

.bar { background: #e8ecee; border-radius: 99px; height: 9px; overflow: hidden; min-width: 90px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #f17a63, var(--coral)); border-radius: 99px; transition: width .7s cubic-bezier(.3,.7,.2,1); }
.bar.green > i { background: linear-gradient(90deg, #4cc08b, var(--green)); }
.bar.stack { display: flex; }
.bar.stack > i { border-radius: 0; background: none; transition: none; }
.bar.stack .s-done { background: var(--green); } .bar.stack .s-prog { background: var(--blue); }
.bar.stack .s-over { background: var(--red); } .bar.stack .s-rest { background: #cfd6d9; }
.pct { font-weight: 700; font-size: 13px; min-width: 38px; display: inline-block; text-align: right; }

/* ---- формы ---- */
label { display: block; font-weight: 500; font-size: 13.5px; margin-bottom: 5px; color: #4a5559; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid #d0d7da; border-radius: 10px; font: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px rgba(235,90,64,.15); }
input[type=file] { font: inherit; font-size: 13px; width: 100%; padding: 8px; border: 1.5px dashed #c9d1d4; border-radius: 10px; background: #fafbfb; }
input[type=file]::file-selector-button { border: 0; background: var(--slate-dark); color: #fff; padding: 6px 12px; border-radius: 7px; margin-right: 10px; cursor: pointer; font: inherit; font-size: 13px; }
.field { margin-bottom: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--coral); }
input[type=checkbox] { accent-color: var(--coral); }
.help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=range] { width: 100%; accent-color: var(--coral); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; line-height: 1.3; transition: transform .12s, box-shadow .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #ef6a50, var(--coral)); color: #fff !important; box-shadow: 0 4px 12px rgba(235,90,64,.35); }
.btn-primary:hover { background: linear-gradient(180deg, var(--coral), var(--coral-dark)); box-shadow: 0 6px 16px rgba(235,90,64,.45); }
.btn-outline { background: #fff; border-color: #cdd5d8; color: var(--slate-dark) !important; }
.btn-outline:hover { border-color: var(--coral); color: var(--coral-dark) !important; }
.btn-dark { background: var(--slate-dark); color: #fff !important; }
.btn-dark:hover { background: var(--slate-darker); }
.btn-green { background: var(--green); color: #fff !important; }
.btn-green:hover { background: #26855a; }
.btn-danger { background: #fff; border-color: #e8b9b7; color: var(--red) !important; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 12px; align-items: end; padding: 18px 24px; border-bottom: 1px solid var(--line); background: #f8f9fa; }
@media (max-width: 1100px) { .filters { grid-template-columns: 1fr 1fr; } }
.filters .field { margin: 0; }
.search-field { position: relative; }
.search-field .ic { position: absolute; left: 12px; bottom: 12px; color: var(--muted); }
.search-field input { padding-left: 38px; }

/* ---- flash ---- */
.flash { padding: 13px 18px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-weight: 500; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); transition: opacity .5s, transform .5s; }
.flash.success { background: var(--green-soft); border-color: #bfe5d1; color: #1d7a50; }
.flash.danger { background: var(--red-soft); border-color: #f0c2c0; color: var(--red); }
.flash.warning { background: var(--amber-soft); border-color: #f4dba0; color: #85590a; }
.flash.info { background: var(--blue-soft); border-color: #b9dcf0; color: #0f6fa8; }
.flash.hide { opacity: 0; transform: translateY(-6px); }

/* ---- детали ---- */
dl.facts { display: grid; grid-template-columns: 200px 1fr; gap: 12px 20px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 13.5px; padding-top: 1px; }
dl.facts dd { margin: 0; }
@media (max-width: 700px) { dl.facts { grid-template-columns: 1fr; gap: 2px; } dl.facts dd { margin-bottom: 10px; } }
.task-hero { display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.report { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; background: #fff; position: relative; }
.report.returned { border-color: #f0c2c0; background: #fffafa; }
.report.accepted { border-left: 4px solid var(--green); }
.report .meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.files a { display: inline-flex; align-items: center; gap: 6px; margin: 2px 8px 2px 0; padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #f8f9fa; color: var(--text); }
.files a:hover { border-color: var(--coral); color: var(--coral-dark); }
.timeline-note { border-left: 3px solid var(--coral); padding: 8px 14px; background: var(--coral-soft); border-radius: 0 8px 8px 0; margin: 10px 0; font-size: 13.5px; }
.sticky-form { position: sticky; top: 96px; }

.notif { display: flex; gap: 14px; padding: 15px 24px; border-bottom: 1px solid #eef1f2; align-items: flex-start; transition: background .12s; }
.notif:hover { background: #fafbfb; }
.notif.unread { background: #fffaf8; }
.notif .dot { width: 10px; height: 10px; border-radius: 50%; background: #cdd5d8; margin-top: 7px; flex: none; }
.notif.unread .dot { background: var(--coral); box-shadow: 0 0 0 4px rgba(235,90,64,.15); }
.notif.k-overdue .dot { background: var(--red); } .notif.k-soon .dot, .notif.k-today .dot { background: var(--amber); }
.notif a.t { font-weight: 600; color: var(--text); }
.notif:last-child { border-bottom: 0; }

.pagination { display: flex; gap: 6px; padding: 16px 24px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--slate-dark); background: #fff; }
.pagination a:hover { border-color: var(--coral); color: var(--coral-dark); }
.pagination span.cur { background: var(--coral); color: #fff; border-color: var(--coral); }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty .ic { width: 38px; height: 38px; display: block; margin: 0 auto 10px; color: #b8c2c6; }

/* ---- календарь ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: #fff; }
.cal .dow { padding: 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: #f8f9fa; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 128px; padding: 6px 7px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; background: #fff; }
.cal .day.out { background: #f8f9fa; }
.cal .day.today { background: #fff8f6; box-shadow: inset 0 0 0 2px var(--coral); }
.cal .day .n { font-size: 12.5px; font-weight: 700; color: var(--slate); display: flex; justify-content: space-between; }
.cal .day.out .n { color: #b8c2c6; }
.cal .day.today .n span:first-child { background: var(--coral); color: #fff; border-radius: 99px; padding: 0 7px; }
.cal .ev { display: block; font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid; color: var(--text) !important; }
.cal .ev.st-done { background: var(--green-soft); border-color: var(--green); } .cal .ev.st-overdue { background: var(--red-soft); border-color: var(--red); }
.cal .ev.st-in_progress { background: var(--blue-soft); border-color: var(--blue); } .cal .ev.st-open { background: var(--amber-soft); border-color: var(--amber); }
.cal .ev.st-planned { background: #eceff0; border-color: #aab4b8; }
.cal .more { font-size: 11.5px; font-weight: 600; }
@media (max-width: 800px) { .cal .day { min-height: 70px; } .cal .ev { font-size: 0; padding: 4px; height: 8px; } .cal .more { font-size: 10px; } }

/* ---- логин ---- */
.login-page { background: radial-gradient(900px 500px at 90% -10%, rgba(235,90,64,.55), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(24,144,215,.25), transparent 60%), linear-gradient(135deg, #20272a 0%, #3b4347 55%, #576266 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: #fff; border-radius: 22px; width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45); animation: fadeUp .5s ease both; }
.login-side { position: relative; background: linear-gradient(160deg, #424b4f, #2d3538); color: #fff; padding: 46px 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.login-side::before { content: ""; position: absolute; right: -120px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(235,90,64,.6), transparent 70%); }
.login-side > * { position: relative; }
.login-side img { width: 190px; max-width: 100%; margin-bottom: 26px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); }
.login-side h2 { font-size: 22px; margin-bottom: 10px; color: #fff; } .login-side p { color: #c3cbce; font-size: 14px; }
.login-feats { margin-top: 20px; display: grid; gap: 9px; text-align: left; font-size: 13.5px; color: #dbe2e5; }
.login-feats div { display: flex; gap: 10px; align-items: center; } .login-feats .ic { color: #ff9a85; }
.login-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 760px) { .login-card { grid-template-columns: 1fr; } .login-side { padding: 28px; } .login-side img { width: 110px; margin-bottom: 14px; } .login-feats { display: none; } .login-form { padding: 28px 24px; } }

.digest-frame { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart-box { position: relative; height: 270px; }
.details-text { white-space: pre-line; color: #4a5559; }
details summary { cursor: pointer; font-weight: 500; color: var(--blue); }
.tabs { display: inline-flex; background: #e9edee; border-radius: 999px; padding: 4px; gap: 2px; }
.tabs a { padding: 6px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--slate); }
.tabs a.on { background: #fff; color: var(--coral-dark); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* ---- адаптив ---- */
@media (max-width: 1290px) {
  .topbar .inner { padding: 10px 16px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .user-box { margin-left: auto; }
}
@media (max-width: 640px) {
  main { padding: 18px 12px 34px; }
  h1 { font-size: 22px; } .hero h1 { font-size: 23px; }
  .brand img { height: 42px; } .brand .t b { font-size: 13px; }
  .user-box .who { display: none; }
  .card { padding: 16px; } .card-head { padding: 14px 16px; } .filters { padding: 14px 16px; grid-template-columns: 1fr; }
  .hero-ring { flex-direction: column; align-items: flex-start; }
  .kpi { padding: 13px 14px; } .kpi .v { font-size: 24px; } .kpi .ico { width: 40px; height: 40px; }
  .notif { padding: 14px 16px; } .pagination { padding: 14px 16px; }
}
@media print { .topbar, .footer, .actions, .filters, .pagination { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }

/* ---- фильтры: на телефоне сворачиваются ---- */
.filters-check { position: absolute; opacity: 0; pointer-events: none; }
.filters-toggle { display: none; align-items: center; gap: 8px; margin: 0; padding: 13px 16px; font-weight: 500; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--line); background: #f8f9fa; }
.filters-compact { grid-template-columns: 1fr 1fr auto; }

/* ---- история пункта, список копий ---- */
.events { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.events li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; font-size: 14px; border-bottom: 1px solid #eef1f2; padding-bottom: 8px; }
.events.files-list li { grid-template-columns: minmax(0, 1fr) auto; }
.events li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---- календарь на телефоне: список дней ---- */
.agenda { display: none; }
.agenda-day { display: flex; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.agenda-day:last-child { border-bottom: 0; }
.agenda-day.today { background: #fff8f6; }
.agenda-date { flex: none; width: 34px; text-align: center; line-height: 1.15; }
.agenda-date b { display: block; font-size: 19px; }
.agenda-date span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; }
.agenda-day.today .agenda-date b { color: var(--coral-dark); }
.agenda-items { flex: 1; min-width: 0; display: grid; gap: 5px; }
.agenda .ev { display: block; font-size: 13px; line-height: 1.35; padding: 5px 9px; border-radius: 6px; border-left: 3px solid; color: var(--text) !important; }
.agenda .ev.st-done { background: var(--green-soft); border-color: var(--green); } .agenda .ev.st-overdue { background: var(--red-soft); border-color: var(--red); }
.agenda .ev.st-in_progress { background: var(--blue-soft); border-color: var(--blue); } .agenda .ev.st-open { background: var(--amber-soft); border-color: var(--amber); }
.agenda .ev.st-planned { background: #eceff0; border-color: #aab4b8; }
.cal-dept { min-width: 230px; width: auto; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
@media (max-height: 1000px) { .sticky-form { position: static; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

@media (max-width: 760px) {
  .filters-toggle { display: flex; }
  .filters-check:not(:checked) ~ .filters { display: none; }
  .filters, .filters-compact { grid-template-columns: 1fr; padding: 14px 16px; }
  .hide-sm { display: none; }

  /* таблицы со списками превращаются в карточки */
  table.t td.title { min-width: 0; }
  table.t td.nowrap.right { white-space: normal; min-width: 92px; }
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody { display: block; width: 100%; }
  table.t.cards tr { display: block; position: relative; padding: 13px 16px 11px; border-bottom: 1px solid var(--line); }
  table.t.cards tr:last-child { border-bottom: 0; }
  table.t.cards td { display: block; padding: 2px 0; border: 0; box-shadow: none !important; white-space: normal; }
  table.t.cards td.title { padding-right: 30px; margin-bottom: 5px; font-size: 14.5px; }
  table.t.cards td[data-label] { position: relative; padding-left: 110px; font-size: 13px; min-height: 22px; }
  table.t.cards td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 2px; color: var(--muted); font-size: 12.5px; }
  table.t.cards .pick-cell { position: absolute; top: 12px; right: 12px; padding: 0; }
  table.t.cards .pick { width: 20px; height: 20px; }
  table.t.cards tr.row-overdue { box-shadow: inset 4px 0 0 var(--red); }
  table.t.cards tr.row-soon { box-shadow: inset 4px 0 0 var(--amber); }
  table.t.cards tr.row-done { box-shadow: inset 4px 0 0 var(--green); }

  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis > .kpi:first-child { grid-column: 1 / -1; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dept-grid { gap: 12px; }
  .dept-card { padding: 14px 16px; }
  .dept-card .head { display: none; }
  .dept-card .nums { margin: 10px 0; }
  .chart-box { height: 230px; }
  .tabs a { padding: 5px 12px; font-size: 13px; }
  .hero .actions .btn { flex: 1 1 auto; }
  .hero-ring { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; }
  .page-head .actions { width: 100%; }
  .page-head .actions > .btn { flex: 1 1 auto; }

  .cal-card, .cal-card + .legend { display: none; }
  .agenda { display: block; }
  .cal-dept { width: 100%; min-width: 0; }
  .page-head .actions > form.actions { flex: 1 1 100%; }
  .events li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
