* { box-sizing: border-box; }
:root { color-scheme: light; --ink:#202b42; --muted:#556179; --line:#e1e5ef; --surface:#fff; --base:#f4f6fb; --accent:#5b48ca; --nav:#181f32; --danger:#ae3246; font: 15px/1.5 "Segoe UI", system-ui, sans-serif; }
[hidden] { display:none !important; }
body { margin:0; background:var(--base); color:var(--ink); }
h1,h2,h3,p { margin:0; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:wait; opacity:.62; }
a { color:var(--accent); }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid #9b86ff; outline-offset:2px; }
.layout { min-height:100dvh; display:grid; grid-template-columns:228px minmax(0,1fr); }
.sidebar { position:sticky; top:0; height:100dvh; display:flex; flex-direction:column; background:var(--nav); padding:26px 16px 17px; color:#eef1ff; }
.brand { display:flex; align-items:center; gap:10px; margin:0 5px 37px; font-size:16px; font-weight:750; text-decoration:none; color:#fff; }
.brand-mark { display:grid; place-items:center; width:35px; height:35px; border-radius:10px; background:#795ff0; color:white; font-size:21px; font-weight:700; flex:none; }
.sidebar nav { display:grid; gap:5px; }
.sidebar button { border:0; color:inherit; background:transparent; }
.sidebar nav :is(button,a) { display:flex; align-items:center; gap:12px; width:100%; padding:10px 12px; border-radius:8px; text-align:left; color:#c2c9dc; text-decoration:none; }
.sidebar nav :is(button,a) span { font-size:19px; width:20px; line-height:1; text-align:center; }
.sidebar nav :is(button,a):hover,.sidebar nav button[aria-current="page"] { background:#323951; color:#fff; }
.sidebar nav button[aria-current="page"] span { color:#baaaff; }
.profile { margin-top:auto; padding:13px 3px 0; border-top:1px solid #394157; display:flex; align-items:center; gap:9px; min-width:0; }
#username { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.profile button { margin-left:auto; font-size:20px; padding:5px 9px; border-radius:7px; }
.profile button:hover { background:#323951; }
.avatar { display:grid; place-items:center; border-radius:50%; background:#37314f; color:#dacfff; width:33px; height:33px; flex:none; font-weight:700; }
.main { padding:34px clamp(18px, 3.8vw, 62px) 60px; min-width:0; max-width:1550px; width:100%; margin:0 auto; }
.top { display:flex; gap:18px; justify-content:space-between; align-items:flex-end; margin-bottom:28px; }
.date-line { color:var(--muted); font-size:13px; margin-bottom:7px; }
.date-line::first-letter { text-transform:uppercase; }
h1 { font-size:clamp(27px, 3.5vw, 39px); letter-spacing:-.04em; line-height:1.13; }
h2 { font-size:19px; letter-spacing:-.018em; }
h3 { font-size:15px; overflow-wrap:anywhere; }
.top-actions,.actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.button { color:var(--ink); background:white; border:1px solid var(--line); border-radius:8px; padding:8px 13px; text-decoration:none; display:inline-flex; justify-content:center; align-items:center; gap:6px; font-weight:650; font-size:13px; white-space:nowrap; }
.button:hover { background:#f0efff; border-color:#c9c1ef; }
.button.primary { background:var(--accent); color:white; border-color:var(--accent); }
.button.primary:hover { background:#4834b6; }
.button.danger { color:var(--danger); }
.metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; margin-bottom:23px; }
.metric { text-align:left; border:1px solid var(--line); background:var(--surface); padding:16px 17px; border-radius:12px; color:var(--ink); min-height:112px; }
.metric:hover { border-color:#a99bea; }
.metric span { color:var(--muted); display:block; font-weight:650; font-size:13px; }
.metric strong { display:block; font-size:34px; line-height:1; margin:9px 0 1px; letter-spacing:-.05em; }
.metric.late strong { color:var(--danger); }
.panel { border:1px solid var(--line); border-radius:12px; background:var(--surface); overflow:hidden; margin-bottom:16px; }
.panel-header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px 17px; border-bottom:1px solid var(--line); }
.panel-header p,.dim { color:var(--muted); font-size:13px; }
.filters { display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding:12px 15px; border-bottom:1px solid var(--line); }
input,select,textarea { max-width:100%; color:var(--ink); background:white; border:1px solid #cfd5e3; border-radius:7px; padding:8px 10px; min-width:0; }
.filters input { flex:1 1 150px; }
.filters select { max-width:200px; padding-right:8px; }
.table-scroll { overflow:auto; }
table { width:100%; border-spacing:0; text-align:left; font-size:13px; }
th,td { padding:10px 12px; vertical-align:middle; }
th:first-child,td:first-child { padding-left:17px; }
th { white-space:nowrap; background:#f8f9fd; color:var(--muted); font-weight:650; }
tbody tr + tr td { border-top:1px solid #eef0f6; }
tbody tr:hover { background:#fbfbff; }
td:nth-child(n+2) { white-space:nowrap; }
td:nth-child(2) { max-width:210px; overflow:hidden; text-overflow:ellipsis; }
.link-button { border:0; background:none; text-align:left; padding:0; color:var(--ink); font-weight:700; overflow-wrap:anywhere; }
.link-button:hover { color:var(--accent); text-decoration:underline; }
.subtext { color:var(--muted); display:block; font-size:12px; margin-top:2px; }
.late-text { color:var(--danger); font-weight:700; }
.tag,.status,.priority { display:inline-flex; align-items:center; gap:6px; padding:3px 7px; border-radius:6px; font-weight:650; font-size:11px; white-space:nowrap; }
.tag { background:#f1f3f8; color:#414c62; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--dot); border:1px solid #0002; flex:none; }
.status { background:#eef1f6; color:#4b5670; }
.status.doing { background:#e9e5fa; color:#5140a4; }
.status.waiting { background:#fff0dc; color:#855824; }
.status.done { background:#e2f5ee; color:#236b57; }
.priority.urgent { background:#fce6ea; color:#992e42; }
.priority.high { background:#fff0dc; color:#855824; }
.empty { padding:35px 18px; text-align:center; color:var(--muted); }
.empty strong { color:var(--ink); display:block; margin-bottom:5px; }
.project-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr)); gap:12px; padding:15px; }
.project-card { border:1px solid var(--line); border-radius:10px; padding:14px; min-width:0; }
.project-card > * + * { margin-top:8px; }
.project-card p { overflow-wrap:anywhere; }
.project-meta { display:flex; justify-content:space-between; gap:6px; flex-wrap:wrap; }
.calendar-scroll { overflow:auto; }
.calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); min-width:650px; }
.weekday { padding:7px 10px; font-size:12px; font-weight:700; color:var(--muted); background:#f8f9fd; }
.day { min-height:98px; padding:6px; border-top:1px solid var(--line); border-right:1px solid var(--line); min-width:0; }
.day.outside { background:#f8f9fd; color:var(--muted); }
.day time { display:grid; place-items:center; width:23px; height:23px; font-size:12px; }
.day.today time { background:var(--accent); border-radius:100%; color:white; }
.event { display:block; width:100%; text-align:left; border:0; border-left:3px solid #9a8cee; margin-top:4px; background:#f0edf9; color:#443588; padding:3px 4px; border-radius:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.event.control { border-color:#dca153; background:#fff1dd; color:#79501f; }
.calendar-key { display:flex; gap:12px; padding:10px 15px; color:var(--muted); font-size:12px; border-top:1px solid var(--line); }
.direction-list { display:grid; gap:0; padding:0 15px; }
.direction-line { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 2px; }
.direction-line + .direction-line { border-top:1px solid var(--line); }
dialog { border:1px solid var(--line); border-radius:14px; padding:0; background:white; color:var(--ink); width:min(550px,calc(100vw - 22px)); max-height:calc(100dvh - 30px); box-shadow:0 22px 80px #16193640; }
dialog::backdrop { background:#171d35a0; }
.modal-head,.modal-actions { display:flex; justify-content:space-between; align-items:center; padding:15px 19px; gap:8px; }
.modal-head { border-bottom:1px solid var(--line); }
.modal-body { display:grid; gap:12px; padding:15px 19px; }
.modal-actions { border-top:1px solid var(--line); justify-content:flex-end; }
.modal-actions .danger { margin-right:auto; }
.fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
label { display:grid; gap:4px; font-size:13px; font-weight:650; color:#46536c; }
label input,label select,label textarea { width:100%; font-weight:400; }
label textarea { resize:vertical; min-height:70px; }
input[type=color] { min-height:39px; }
.error { color:var(--danger); font-size:13px; }
.signin { min-height:100dvh; display:grid; place-items:center; padding:18px; background:radial-gradient(ellipse at 50% 10%,#eae5ff,#f4f6fb 64%); }
.login-panel { display:grid; gap:14px; width:min(100%,370px); border:1px solid var(--line); background:#fff; border-radius:16px; padding:26px; box-shadow:0 12px 42px #27235412; }
.login-panel h1 { font-size:27px; margin-bottom:5px; }
#notice { position:fixed; bottom:18px; right:18px; z-index:5; background:var(--nav); color:#fff; border-radius:9px; padding:9px 14px; max-width:calc(100% - 36px); }
@media (max-width:850px) {
  .layout { grid-template-columns:170px minmax(0,1fr); }
  .sidebar { padding-inline:10px; }
  .brand { font-size:14px; margin-inline:0; }
  .main { padding-inline:17px; }
  .panel-header { flex-wrap:wrap; }
}
@media (max-width:640px) {
  .layout { display:block; }
  .sidebar { position:static; height:auto; padding:10px 10px 7px; display:grid; grid-template-columns:1fr auto; gap:8px; }
  .brand { margin:0; }
  .sidebar nav { grid-column:1/-1; grid-row:2; display:flex; overflow-x:auto; gap:3px; }
  .sidebar nav :is(button,a) { padding:6px 8px; white-space:nowrap; width:auto; font-size:12px; }
  .sidebar nav :is(button,a) span,.profile .avatar { display:none; }
  .profile { margin:0; border:0; padding:0; font-size:12px; }
  .main { padding:18px 11px 40px; }
  .top { align-items:flex-start; flex-direction:column; margin-bottom:16px; gap:11px; }
  .metrics { gap:6px; margin-bottom:12px; }
  .metric { padding:9px 8px; min-height:80px; }
  .metric span { font-size:11px; }
  .metric strong { font-size:24px; }
  .filters select { width:calc(50% - 4px); max-width:100%; }
}
