/* ===== MyTasks front-end (auth + dashboard + team kanban) ===== */
#mytasks-app{
  --bg:#eef1f7; --panel:#ffffff; --panel2:#f3f6fb; --line:#e3e8f0;
  --text:#1f2a3d; --muted:#6b7686; --accent:#1d4ed8; --accent2:#2563eb;
  --todo:#94a3b8; --doing:#f59e0b; --done:#16a34a;
  --p-high:#ef4444; --p-mid:#f59e0b; --p-low:#94a3b8; --danger:#dc2626;
  --amber:#b45309; --red:#dc2626;
  font-family:"Segoe UI","Yu Gothic UI",system-ui,sans-serif;
  display:block; color:var(--text); background:var(--bg);
  height:80vh; min-height:600px;
}
#mytasks-app *{box-sizing:border-box}

/* buttons / inputs */
#mytasks-app .mt-btn{background:var(--accent2); color:#fff; border:none; border-radius:8px; padding:9px 16px; cursor:pointer; font-weight:600; font-size:13px; text-decoration:none; display:inline-block; text-align:center}
#mytasks-app .mt-btn:hover{background:var(--accent)}
#mytasks-app .mt-btn.ghost{background:var(--panel2); border:1px solid var(--line); color:var(--text); font-weight:500}
#mytasks-app .mt-btn.ghost:hover{border-color:var(--accent)}
#mytasks-app .mt-btn.sm{padding:6px 11px; font-size:12px}
#mytasks-app .mt-btn.danger{background:transparent; color:var(--danger); border:1px solid var(--line)}
#mytasks-app .mt-btn.danger:hover{background:var(--danger); color:#fff}
#mytasks-app .mt-btn.block{display:block; width:100%; padding:11px}
#mytasks-app .mt-btn[disabled]{opacity:.5; cursor:default}
#mytasks-app select,#mytasks-app input,#mytasks-app textarea{
  background:var(--panel2); color:var(--text); border:1px solid var(--line); border-radius:8px;
  padding:9px 11px; outline:none; font-size:13px; font-family:inherit; width:100%;
}
#mytasks-app select:focus,#mytasks-app input:focus,#mytasks-app textarea:focus{border-color:var(--accent)}
#mytasks-app textarea{resize:vertical; min-height:40px}
#mytasks-app .mt-loading{display:flex; align-items:center; justify-content:center; height:100%; color:var(--muted)}

/* ---------- auth screen ---------- */
#mytasks-app.mt-auth{display:flex; align-items:center; justify-content:center; padding:24px}
.mt-card-auth{width:340px; max-width:100%; background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:30px 28px}
.mt-logo{font-size:26px; font-weight:700; text-align:center; margin-bottom:4px}
.mt-logo span{color:var(--accent)}
.mt-tagline{font-size:12px; color:var(--muted); text-align:center; margin-bottom:22px}
.mt-tabs{display:flex; gap:6px; background:var(--panel2); border-radius:10px; padding:4px; margin-bottom:20px}
.mt-tab{flex:1; text-align:center; padding:8px; border-radius:7px; font-size:13px; color:var(--muted); cursor:pointer}
.mt-tab.active{background:var(--accent2); color:#fff; font-weight:600}
.mt-flabel{display:block; font-size:12px; color:var(--muted); margin:0 0 5px}
.mt-input-icon{position:relative; margin-bottom:13px}
.mt-auth-msg{font-size:12px; color:var(--red); min-height:16px; margin:2px 0 12px; text-align:center}
.mt-auth-foot{text-align:center; font-size:12px; color:var(--muted); margin-top:14px}
.mt-auth-foot a{color:var(--accent); cursor:pointer}

/* ---------- app shell ---------- */
#mytasks-app.mt-app{display:flex; flex-direction:column}
.mt-topbar{display:flex; align-items:center; gap:12px; padding:12px 20px; background:var(--panel); border-bottom:1px solid var(--line); flex-shrink:0}
.mt-topbar .mt-logo{font-size:18px; margin:0}
.mt-topbar .mt-grow{flex:1}
.mt-crumb{display:flex; align-items:center; gap:7px; font-size:13px; color:var(--muted)}
.mt-crumb a{color:var(--muted); cursor:pointer; text-decoration:none}
.mt-crumb a:hover{color:var(--text)}
.mt-icon-btn{display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border:1px solid var(--line); background:var(--panel); color:var(--muted); border-radius:8px; cursor:pointer; margin-right:12px}
.mt-icon-btn:hover{border-color:var(--accent); color:var(--accent)}
.mt-icon-btn:active{transform:scale(.94)}
.mt-user{display:flex; align-items:center; gap:8px; font-size:13px}
.mt-user a{color:var(--muted); display:flex; align-items:center}
.mt-ava{width:26px; height:26px; border-radius:50%; background:var(--accent2); color:#fff; font-size:11px; display:inline-flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0}
.mt-view{flex:1; min-height:0; display:flex; flex-direction:column}

/* ---------- dashboard ---------- */
.mt-dash{flex:1; overflow-y:auto; padding:24px}
.mt-welcome{font-size:20px; font-weight:600; margin:0 0 2px}
.mt-subtle{font-size:13px; color:var(--muted); margin:0 0 20px}
.mt-metrics{display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:26px}
.mt-metric{background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:15px 16px}
.mt-metric .l{font-size:12px; color:var(--muted); margin-bottom:7px}
.mt-metric .v{font-size:24px; font-weight:700}
.mt-metric .v.amber{color:var(--amber)} .mt-metric .v.red{color:var(--red)}
.mt-sec-head{display:flex; align-items:center; margin-bottom:13px}
.mt-sec-head h2{font-size:15px; font-weight:600; margin:0}
.mt-bcards{display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:13px}
.mt-bcard{background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px; cursor:pointer}
.mt-bcard:hover{border-color:var(--accent)}
.mt-bcard .n{font-size:15px; font-weight:600; margin-bottom:3px}
.mt-share-badge{font-size:10px; font-weight:500; background:#dcfce7; color:#15803d; border-radius:5px; padding:1px 7px; vertical-align:middle; margin-left:4px}
.mt-bcard .m{font-size:11px; color:var(--muted); margin-bottom:13px; display:flex; align-items:center; gap:5px}
.mt-bar{height:6px; background:var(--bg); border-radius:6px; overflow:hidden; margin-bottom:9px}
.mt-bar > span{display:block; height:100%; background:var(--accent); border-radius:6px}
.mt-bar > span.full{background:var(--done)}
.mt-bcard .c{font-size:11px; color:var(--muted)}
.mt-blank{flex:1; display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:14px; text-align:center; padding:40px}

/* ---------- home launcher ---------- */
.mt-home{flex:1; overflow-y:auto; padding:32px 24px}
.mt-tiles{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; margin-top:22px}
.mt-tile{background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px; cursor:pointer; transition:border-color .12s}
.mt-tile:hover{border-color:var(--accent)}
.mt-tile.soon{opacity:.55; cursor:default}
.mt-tile.soon:hover{border-color:var(--line)}
.mt-tile-ic{width:52px; height:52px; border-radius:13px; display:flex; align-items:center; justify-content:center; margin-bottom:14px; color:#fff}
.mt-tile.t-task .mt-tile-ic{background:#2563eb}
.mt-tile.t-dash .mt-tile-ic{background:#0ea5e9}
.mt-tile.t-att  .mt-tile-ic{background:#16a34a}
.mt-tile.t-shift .mt-tile-ic{background:#0891b2}
.mt-tile.t-shadm .mt-tile-ic{background:#0e7490}
.mt-tile.t-yor  .mt-tile-ic{background:#9333ea}
.mt-tile.t-soon .mt-tile-ic{background:var(--panel2); color:var(--muted)}
.mt-tile.t-admin .mt-tile-ic{background:#7c5cff}
.mt-tile-n{font-size:16px; font-weight:600; margin-bottom:4px}
.mt-tile-d{font-size:12px; color:var(--muted); line-height:1.5}

/* ---------- attendance ---------- */
.mt-att{flex:1; overflow-y:auto; padding:24px}
.mt-clock-card{background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:24px; text-align:center; margin-bottom:26px}
.mt-clock-date{font-size:13px; color:var(--muted); margin-bottom:4px}
.mt-clock-time{font-size:46px; font-weight:700; letter-spacing:2px; margin-bottom:18px; font-variant-numeric:tabular-nums}
.mt-clock-btns{display:flex; gap:12px; justify-content:center; margin-bottom:16px}
.mt-clock-btns .mt-btn{min-width:130px; padding:12px}
.mt-clock-status{font-size:13px; color:var(--muted)} .mt-clock-status b{color:var(--text)}
.mt-ym{font-size:13px; color:var(--text); min-width:90px; text-align:center}
.mt-table-wrap{border:1px solid var(--line); border-radius:12px; overflow:hidden}
.mt-table{width:100%; border-collapse:collapse; font-size:13px}
.mt-table th{background:var(--panel); color:var(--muted); font-weight:500; text-align:left; padding:10px 14px; border-bottom:1px solid var(--line)}
.mt-table td{padding:10px 14px; border-bottom:1px solid var(--line); color:var(--text)}
.mt-table tr:last-child td{border-bottom:none}
.mt-table td.mt-empty{text-align:center; color:var(--muted)}

/* ----------  ---------- */
.mt-yor-sec{margin-bottom:22px}
.mt-yor-sec h3{font-size:13px; color:var(--muted); font-weight:500; margin:0 0 9px}
.mt-yor-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px}
.mt-link{display:block; background:var(--panel); border:1px solid var(--line); border-radius:9px; padding:9px 12px; font-size:13px; color:var(--accent); text-decoration:none; margin-bottom:8px}
.mt-link:hover{border-color:var(--accent)}
.mt-memo{background:#fffbeb; border:1px solid #fde68a; border-radius:10px; padding:13px 14px; font-size:13px; color:#92400e; line-height:1.7; white-space:pre-wrap}
.mt-erow{display:flex; gap:8px; margin-bottom:8px}
.mt-erow input{flex:1}
@media (max-width:720px){ .mt-yor-grid{grid-template-columns:1fr} }

/* ----------  ---------- */
.mt-pinned{display:flex; align-items:center; gap:14px; background:var(--panel); border:1px solid var(--line); border-left:4px solid #9333ea; border-radius:12px; padding:14px 18px; margin-bottom:22px; cursor:pointer}
.mt-pinned:hover{border-color:#9333ea}
.mt-pin-ic{width:42px; height:42px; border-radius:11px; background:#f3e8ff; color:#9333ea; display:flex; align-items:center; justify-content:center; flex-shrink:0}
.mt-pin-t{font-size:15px; font-weight:600}
.mt-pin-d{font-size:12px; color:var(--muted)}
.mt-pin-go{margin-left:auto; font-size:13px; color:#9333ea; font-weight:600}
.mt-bcard.ot{border-left:4px solid #9333ea}
.mt-bcard.ot .mt-ot-ic{width:34px; height:34px; border-radius:9px; background:#f3e8ff; color:#9333ea; display:flex; align-items:center; justify-content:center; margin-bottom:10px}
.mt-bcard.ot .mt-ot-ic svg{width:20px; height:20px}
.mt-orders{flex:1; overflow-y:auto; padding:24px}
.mt-otoolbar{display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:14px}
.mt-chip{font-size:12px; padding:6px 13px; border-radius:20px; border:1px solid var(--line); background:var(--panel); color:var(--muted); cursor:pointer}
.mt-chip:hover{border-color:var(--accent)}
.mt-chip.active{background:var(--accent2); border-color:var(--accent2); color:#fff}
.mt-otable-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:var(--panel)}
.mt-otable{width:100%; border-collapse:collapse; font-size:12.5px; white-space:nowrap}
.mt-otable th{background:var(--panel2); color:var(--text); font-weight:600; text-align:left; padding:11px 12px; border-bottom:2px solid var(--line); white-space:nowrap}
.mt-otable td{padding:8px 12px; border-bottom:1px solid var(--line)}
.mt-otable tbody tr:last-child td{border-bottom:none}
.mt-otable tbody tr:hover{background:var(--panel2); cursor:pointer}
.mt-otable .num{text-align:right}
.mt-otable td.mt-empty{text-align:center; color:var(--muted); padding:24px}
.mt-otable .ocheck{width:16px; height:16px; cursor:pointer}
.mt-d-red{color:var(--red); font-weight:600}
.mt-d-amber{color:#b45309; font-weight:600}
.mt-badge-shop{font-size:11px; padding:2px 8px; border-radius:6px; background:#fde8ef; color:#9d2667}
.mt-tag-kind{font-size:11px; padding:2px 8px; border-radius:6px; background:#e7f6ee; color:#1d6b4f}
.mt-ostats{display:grid; grid-template-columns:repeat(6,1fr); gap:12px; margin-top:18px}
.mt-ostat{border-radius:12px; padding:14px 16px; border:1px solid var(--line); background:var(--panel)}
.mt-ostat .l{font-size:12px; color:var(--muted); margin-bottom:6px}
.mt-ostat .v{font-size:22px; font-weight:700}
.mt-ostat .v small{font-size:12px; font-weight:500; color:var(--muted); margin-left:3px}
.mt-ostat.c-blue .v{color:#2563eb} .mt-ostat.c-orange .v{color:#ea580c} .mt-ostat.c-amber .v{color:#b45309}
.mt-ostat.c-green .v{color:#16a34a} .mt-ostat.c-teal .v{color:#0d9488}
.mt-col-hidden{font-size:9px; font-weight:500; background:#fde8ef; color:#9d2667; border-radius:4px; padding:0 5px; margin-left:4px; vertical-align:middle}
.mt-collist{display:flex; flex-direction:column; gap:2px; margin-bottom:6px}
.mt-col-row{display:flex; align-items:center; justify-content:flex-start; gap:10px; padding:8px 6px; font-size:14px; cursor:pointer; border-radius:8px}
.mt-col-row:hover{background:var(--panel2)}
.mt-col-row input[type=checkbox]{flex:0 0 16px; width:16px; height:16px; margin:0; cursor:pointer; accent-color:var(--accent2)}
.mt-col-row span{flex:0 1 auto; color:var(--text); white-space:nowrap}
.mt-ochecks{display:flex; flex-wrap:wrap; gap:16px; font-size:13px; margin:6px 0 4px}
.mt-ochecks label{display:flex; align-items:center; gap:6px; cursor:pointer}
@media (max-width:900px){ .mt-ostats{grid-template-columns:repeat(3,1fr)} }

/* ----------  ---------- */
.sh-day{display:flex; align-items:center; gap:14px; padding:9px 10px; border-bottom:1px solid var(--line)}
.sh-day:last-child{border-bottom:none}
.sh-date{width:74px; flex-shrink:0; font-size:13px; color:var(--text)}
.sh-hours{display:flex; flex-wrap:wrap; gap:6px}
.sh-h{font-size:12px; padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--muted); cursor:pointer; user-select:none; min-width:46px; text-align:center}
.sh-h:hover{border-color:var(--accent)}
.sh-h.active{background:var(--accent2); border-color:var(--accent2); color:#fff; font-weight:600}

/*  */
.sh-grid th, .sh-grid td{text-align:center; padding:6px 5px; min-width:30px}
.sh-grid .sh-name{position:sticky; left:0; background:var(--panel); white-space:nowrap; font-weight:500; text-align:left; min-width:96px; z-index:1}
.sh-grid thead .sh-name{background:var(--panel2)}
.mt-otable td.sh-on{background:#2563eb}
.sh-grid .sh-covrow td{background:var(--panel2)}
.sh-grid .sh-covrow .sh-name{background:var(--panel2); font-weight:600}
.sh-grid td.sh-cov{font-weight:600; color:var(--accent)}

/*  */
.cal-head{display:grid; grid-template-columns:repeat(7,1fr); gap:6px; margin-bottom:6px}
.cal-h{text-align:center; font-size:12px; color:var(--muted); padding:4px}
.cal-h.cal-sun{color:#dc2626} .cal-h.cal-sat{color:#2563eb}
.cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px}
.cal-cell{min-height:78px; border:1px solid var(--line); border-radius:10px; background:var(--panel); padding:8px; display:flex; flex-direction:column}
.cal-cell.cal-empty{border:none; background:transparent}
.cal-d{font-size:13px; color:var(--text)}
.cal-cell.cal-sun .cal-d{color:#dc2626} .cal-cell.cal-sat .cal-d{color:#2563eb}
.cal-cnt{margin-top:auto; font-size:16px; font-weight:700; color:#1d4ed8; text-align:center; background:#e7effe; border-radius:7px; padding:5px 0}
.cal-cnt.cal-zero{color:var(--muted); background:var(--panel2); font-weight:500}

/* ---------- admin (user management) ---------- */
.mt-admin{flex:1; overflow-y:auto; padding:24px}
.mt-admin-table th:not(:first-child), .mt-admin-table td:not(:first-child){text-align:center; width:120px}
.mt-au{display:flex; align-items:center; gap:10px}
.mt-badge{font-size:10px; background:#7c5cff; color:#fff; border-radius:5px; padding:1px 6px; vertical-align:middle}
.mt-chk-admin{color:var(--done); font-weight:700}
.mt-switch{display:inline-block; position:relative; width:42px; height:24px; cursor:pointer}
.mt-switch input{position:absolute; opacity:0; width:0; height:0}
.mt-switch span{position:absolute; inset:0; background:var(--panel2); border:1px solid var(--line); border-radius:24px; transition:.15s}
.mt-switch span::before{content:""; position:absolute; width:18px; height:18px; left:2px; top:2px; background:var(--muted); border-radius:50%; transition:.15s}
.mt-switch input:checked + span{background:var(--accent2); border-color:var(--accent2)}
.mt-switch input:checked + span::before{transform:translateX(18px); background:#fff}
.mt-save-msg{font-size:12px; color:var(--muted); margin-top:12px; height:16px}
.mt-save-msg.ok{color:var(--done)} .mt-save-msg.ng{color:var(--danger)}

/* ---------- board (kanban) ---------- */
.mt-boardview{flex:1; min-height:0; display:flex; flex-direction:column}
.mt-bv-head{display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:13px 20px; border-bottom:1px solid var(--line); background:var(--panel)}
.mt-bv-head h2{font-size:16px; margin:0 6px 0 0}
.mt-grow{flex:1}
.mt-stat{font-size:12px; color:var(--muted)} .mt-stat b{color:var(--text)} .mt-stat .over{color:var(--danger)}
.mt-board{flex:1; display:grid; grid-template-columns:repeat(3,1fr); gap:14px; padding:18px 20px; overflow:hidden}
.mt-col{background:var(--panel); border:1px solid var(--line); border-radius:12px; display:flex; flex-direction:column; min-height:0}
.mt-col-head{display:flex; align-items:center; gap:8px; padding:12px 14px; border-bottom:1px solid var(--line); font-weight:600; font-size:14px}
.mt-dot{width:9px; height:9px; border-radius:50%}
.mt-dot.todo{background:var(--todo)} .mt-dot.doing{background:var(--doing)} .mt-dot.done{background:var(--done)}
.mt-count{margin-left:auto; font-size:12px; color:var(--muted); background:var(--panel2); border-radius:20px; padding:2px 9px}
.mt-col-body{flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:9px}
.mt-col-body.dragover{background:rgba(37,99,235,.08); outline:2px dashed var(--accent); outline-offset:-6px; border-radius:10px}
.mt-card{background:var(--panel2); border:1px solid var(--line); border-left:4px solid var(--p-mid); border-radius:10px; padding:11px 12px; cursor:grab; position:relative}
.mt-card.dragging{opacity:.4}
.mt-card.p-high{border-left-color:var(--p-high)} .mt-card.p-mid{border-left-color:var(--p-mid)} .mt-card.p-low{border-left-color:var(--p-low)}
.mt-card .mt-title{font-size:14px; line-height:1.4; margin-bottom:8px; word-break:break-word; padding-right:18px}
.mt-card.done-card .mt-title{text-decoration:line-through; color:var(--muted)}
.mt-meta{display:flex; flex-wrap:wrap; gap:6px; align-items:center}
.mt-tag{font-size:11px; padding:2px 8px; border-radius:20px; background:#e7effe; color:#1d4ed8; border:1px solid #c9ddfb}
.mt-prio{font-size:11px; padding:2px 8px; border-radius:20px; font-weight:600}
.mt-prio.high{background:#fdecec; color:#b91c1c}
.mt-prio.mid{background:#fef3c7; color:#b45309}
.mt-prio.low{background:#eef1f6; color:#475569}
.mt-due{font-size:11px; padding:2px 8px; border-radius:20px; background:var(--panel); color:var(--muted)}
.mt-due.soon{color:#b45309; background:#fef3c7}
.mt-due.over{color:#b91c1c; background:#fdecec; font-weight:600}
.mt-asg{display:inline-flex; align-items:center; gap:4px; font-size:11px; padding:2px 8px 2px 2px; border-radius:20px; background:var(--panel); color:var(--text)}
.mt-asg .mt-ava{width:18px; height:18px; font-size:10px}
.mt-card .mt-x{position:absolute; top:8px; right:8px; width:18px; height:18px; line-height:16px; text-align:center; border-radius:5px; color:var(--muted); cursor:pointer; font-size:14px}
.mt-card .mt-x:hover{background:var(--danger); color:#fff}
.mt-empty{color:var(--muted); font-size:12px; text-align:center; padding:24px 0}

/* ---------- modal ---------- */
.mt-overlay{position:fixed; inset:0; background:rgba(15,23,42,.45); display:none; align-items:center; justify-content:center; z-index:99999}
.mt-overlay.show{display:flex}
.mt-modal{background:var(--panel); border:1px solid var(--line); border-radius:14px; width:440px; max-width:92vw; max-height:88vh; overflow-y:auto; padding:22px; color:var(--text)}
.mt-modal h2{margin:0 0 16px; font-size:16px}
.mt-field{margin-bottom:13px}
.mt-field label{display:block; font-size:12px; color:var(--muted); margin-bottom:5px}
.mt-row2{display:flex; gap:10px} .mt-row2 .mt-field{flex:1}
.mt-actions{display:flex; gap:10px; justify-content:flex-end; margin-top:18px; flex-wrap:wrap}
.mt-mlist{display:flex; flex-direction:column; gap:8px; margin-bottom:14px}
.mt-mrow{display:flex; align-items:center; gap:10px; padding:8px 10px; background:var(--panel2); border-radius:9px}
.mt-mrow .mt-mname{font-size:13px} .mt-mrow .mt-mrole{font-size:11px; color:var(--muted)}
.mt-share-toggle{display:flex; align-items:center; gap:8px; font-size:14px; padding:10px 12px; background:var(--panel2); border:1px solid var(--line); border-radius:9px; cursor:pointer; margin-bottom:6px}
.mt-share-toggle input{width:16px; height:16px}

/* ---------- light-theme soft shadows ---------- */
.mt-topbar{box-shadow:0 1px 2px rgba(15,23,42,.05)}
.mt-tile,.mt-bcard,.mt-metric,.mt-clock-card,.mt-card-auth,.mt-modal,.mt-table-wrap,.mt-col{box-shadow:0 1px 3px rgba(15,23,42,.06)}
.mt-tile:hover,.mt-bcard:hover{box-shadow:0 4px 12px rgba(37,99,235,.12)}
