@page{size:A4;margin:12mm}
:root{
  --bg:#f3f6fb;
  --card:#ffffff;
  --text:#18212f;
  --muted:#64748b;
  --border:#d8e2f0;
  --primary:#2563eb;
  --primary-soft:#e8f0ff;
  --danger:#dc2626;
  --shadow:0 10px 28px rgba(15,23,42,.08);
  --radius:22px;
}
*{box-sizing:border-box}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:linear-gradient(180deg,#f7f9fc 0%,#eef3f9 100%);color:var(--text)}
a{text-decoration:none;color:inherit}
h1,h2,h3{margin:0 0 12px}
.topbar{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:20px 22px;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:5}
.top-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.tabs{display:flex;gap:10px;padding:14px 22px 0;overflow:auto}
.tab{padding:12px 16px;border:1px solid var(--border);border-bottom:none;border-radius:16px 16px 0 0;background:#dde8fb;white-space:nowrap;transition:.18s ease}
.tab.active{background:#fff;font-weight:700;color:var(--primary);box-shadow:var(--shadow)}
main{padding:0 22px 22px}
.tile-grid{display:grid;gap:16px}
.tile-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
.tile-main{grid-template-columns:1.2fr 1fr;margin-top:16px}
.tile-masters{grid-template-columns:repeat(3,minmax(0,1fr))}
.tile-split{grid-template-columns:minmax(320px,420px) 1fr}
.card{background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);border:1px solid var(--border);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.tile-card{position:relative;overflow:hidden}
.tile-card::before{content:"";position:absolute;inset:0 0 auto 0;height:5px;background:linear-gradient(90deg,var(--primary),#60a5fa)}
.stat-tile{min-height:128px;display:flex;flex-direction:column;justify-content:center;gap:8px}
.stat-tile strong{font-size:2rem;line-height:1}
.feature-tile{min-height:100%}
.tile-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
.tile-badge{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;background:var(--primary-soft);border:1px solid var(--border);font-size:12px;font-weight:700;color:var(--primary)}
.button{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border-radius:14px;border:1px solid var(--border);background:#fff;transition:.18s ease}
.button.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.button.secondary{background:#fff}
.button.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.button.small{padding:7px 10px;font-size:13px}
.badge{padding:8px 12px;border-radius:999px;background:var(--primary-soft);border:1px solid var(--border)}
.muted{color:var(--muted)}
.stack{display:flex;flex-direction:column;gap:12px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.compact{gap:8px}
.space{justify-content:space-between}
label{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:14px}
input,select,textarea{padding:12px;border:1px solid var(--border);border-radius:14px;font:inherit;background:#fff}
.date-picker{width:100%;min-height:46px}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:11px 10px;border-bottom:1px solid var(--border);vertical-align:top}
th{background:#eef4ff}
.flash{padding:12px 14px;border-radius:14px;margin:0 0 12px}
.flash.success{background:#dcfce7}
.flash.error{background:#fee2e2}
.list-item{padding:12px 14px;border:1px solid var(--border);border-radius:14px;background:#fff}
.master-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.master-name{font-weight:600}
.master-edit-form{display:flex;flex-direction:column;gap:10px}
.mini-list{display:flex;flex-direction:column;gap:10px}
.mini-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--border);border-radius:16px;background:#fff}
.chip,.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{align-items:center;padding:8px 10px;border-radius:999px;background:#eef4ff;border:1px solid var(--border)}
.chip.red{background:#fee2e2}
.dot{width:12px;height:12px;border-radius:999px;display:inline-block}
.acc{border:1px solid var(--border);border-radius:16px;padding:12px 14px;margin-bottom:10px;background:#fff}
.acc summary{cursor:pointer}
.report-block{margin-top:18px}
.report-row{display:grid;grid-template-columns:220px 1fr;gap:12px;align-items:center;margin-bottom:12px}
.report-bar{display:flex;gap:6px;flex-wrap:wrap;border:1px solid var(--border);border-radius:16px;padding:8px;background:#fff}
.report-seg{padding:9px 10px;border-radius:10px;color:#111;min-width:120px}
.single-red{display:inline-block;padding:10px 14px;border-radius:12px;background:#fecaca}
.login-body{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(180deg,#f7f9fc 0%,#eef3f9 100%)}
.login-card{width:min(440px,100%);background:#fff;border:1px solid var(--border);border-radius:24px;padding:26px;box-shadow:0 14px 42px rgba(0,0,0,.10)}
.inline{display:flex;gap:8px;flex-wrap:wrap}
.color-swatch-wrap{display:flex;flex-wrap:wrap;gap:10px;padding-top:4px}
.color-swatch{width:32px;height:32px;border-radius:8px;border:2px solid #fff;box-shadow:0 0 0 1px var(--border);cursor:pointer}
.color-swatch.active{transform:scale(1.08);box-shadow:0 0 0 3px rgba(37,99,235,.15),0 0 0 1px var(--primary)}
.check-row{display:flex;flex-direction:row;align-items:center;gap:10px;font-weight:600}
.check-row input[type="checkbox"]{width:18px;height:18px}
.timeline-wrap{overflow:auto;border:1px solid var(--border);border-radius:18px;background:#fff}
.timeline-grid{display:grid;min-width:max-content}
.timeline-head,.timeline-head-day{position:sticky;top:0;z-index:3;background:#eef4ff;border-bottom:1px solid var(--border);padding:10px 8px;font-weight:700}
.timeline-head-day{text-align:center;min-width:28px;font-size:12px;border-left:1px solid #e6edf7}
.timeline-sticky-left{position:sticky;left:0;z-index:4;background:#fff;border-right:1px solid var(--border)}
.timeline-head.timeline-sticky-left{background:#eef4ff}
.timeline-label{padding:10px 12px;border-bottom:1px solid var(--border);min-height:56px}
.timeline-bar-row{position:relative;min-height:56px;border-bottom:1px solid var(--border);background-image:linear-gradient(to right,#edf2f8 1px,transparent 1px);background-size:28px 100%}
.timeline-bar{position:absolute;top:11px;height:34px;border-radius:10px;display:flex;align-items:center;padding:0 10px;color:#111;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 4px 12px rgba(0,0,0,.10)}
.timeline-bar span{overflow:hidden;text-overflow:ellipsis}
@media (max-width:980px){
  .tile-stats,.tile-main,.tile-masters,.tile-split,.report-row{grid-template-columns:1fr}
  .topbar,.master-row,.mini-row{flex-direction:column}
}
@media (max-width:640px){
  main,.topbar,.tabs{padding-left:12px;padding-right:12px}
  .card{padding:14px;border-radius:18px}
  body{font-size:15px}
}
@media print{
  .topbar,.tabs,.button{display:none !important}
  body{background:#fff}
  main{padding:0}
  .card{box-shadow:none;background:#fff}
}
