body {
  margin: 0;
  color: #1f2933;
  background: #f5f7fa;
  font-family: "Inter", PingFangSC, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #14555d;
  color: #fff;
}

.brand {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  font-size: 1.1rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  font-size: 0.95rem;
}

.btn-link {
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
}

.content {
  margin: 0 auto;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.layout {
  display: flex;
  min-height: calc(100vh - 57px);
}

.sidebar {
  width: 200px;
  flex: none;
  background: #12383e;
  padding: 14px 10px;
  box-sizing: border-box;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #cfe0e3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.sidebar-ico {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex: none;
}

@media (max-width: 820px) {
  .sidebar {
    width: 52px;
    padding: 14px 6px;
  }
  .sidebar-label {
    display: none;
  }
  .sidebar-link {
    justify-content: center;
    padding: 9px 0;
  }
}

.auth-card {
  max-width: 360px;
  margin: 4rem auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

.auth-card p {
  margin: 0 0 1rem;
}

.auth-card label,
.auth-card input {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.auth-card input {
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid #bcccdc;
  border-radius: 4px;
}

.auth-card button {
  width: 100%;
  padding: 0.6rem;
  background: #14555d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.auth-card button:hover {
  background: #0f4349;
}

.errorlist {
  color: #b00020;
  padding-left: 1rem;
}

/* ========== Task Board (prototype) ========== */

:root{
  --text:#1a1a1a; --text2:#555; --text3:#8a8a8a; --text4:#b3b3b3;
  --bg:#ffffff; --muted:#f6f6f6; --strong:#ececec; --border:#e2e2e2;
  --danger:#d64545; --warning:#c98a12; --positive:#2e9e5b;
  --c1:#3b73c4; --c2:#c94f4f; --c3:#4f9e64; --c4:#8a63c9; --c5:#7d7d7d;
  --radius:10px;
}

.wrap{max-width:1080px;margin:0 auto;padding:24px 20px 64px}
.header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
h1{font-size:20px;font-weight:600;margin:0}
.sub{font-size:12px;color:var(--text3);margin-top:2px}
.head-right{display:flex;align-items:center;gap:8px;position:relative}
.card{background:var(--bg);border:1px solid var(--border);border-radius:12px;}
table{width:100%;border-collapse:collapse;table-layout:fixed}
th{font-size:12px;font-weight:500;color:var(--text3);text-align:left;padding:9px 14px;border-bottom:1px solid var(--border);background:var(--muted)}
th.sortable{cursor:pointer;user-select:none}
th.sortable:hover{color:var(--text)}
th[data-sort="status"] { color: #ff6b4a; font-weight: bold; }
th[data-sort="title"] { color: #ffb020; font-weight: bold; }
th[data-sort="date"] { color: #ff4d8d; font-weight: bold; }
th[data-sort="brief"] { color: #8e44ad; font-weight: bold; }
th[data-sort="assignee"] { font-weight: bold; }
.gripcol{padding:9px 6px}
td{padding:9px 14px;border-bottom:1px solid var(--border);vertical-align:middle}
.drag-handle{width:30px;padding:9px 6px;cursor:grab;text-align:center;color:var(--text4);font-size:14px;user-select:none}
.drag-handle:hover,.drag-handle:active{cursor:grabbing;color:var(--text2)}
.sortable-ghost{opacity:.4}
tbody tr{cursor:pointer;transition:background .12s}
tbody tr:hover{background:var(--muted)}
tbody tr:last-child td{border-bottom:none}
.statusbtn{display:inline-flex;align-items:center;gap:6px;border:none;border-radius:6px;padding:3px 9px;font-size:12px;font-weight:500;cursor:pointer;white-space:nowrap}
.dot{width:8px;height:8px;border-radius:50%;flex:none}
.menu{position:absolute;z-index:20;background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:4px;box-shadow:0 6px 20px rgba(0,0,0,.14);min-width:140px}
.menu button{display:flex;width:100%;align-items:center;gap:8px;padding:7px 9px;border:none;background:none;border-radius:6px;cursor:pointer;font-size:13px;text-align:left}
.menu button:hover{background:var(--muted)}
.taskcell{font-weight:500;display:flex;align-items:center;gap:8px;min-width:0}
.meta-ico{color:var(--text4);display:inline-flex;align-items:center;gap:3px;font-size:12px;font-weight:400}
.rowactions{display:flex;gap:4px;margin-left:auto;opacity:0;transition:opacity .12s}
tr:hover .rowactions{opacity:1}
.iconbtn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:none;background:none;border-radius:8px;cursor:pointer;color:var(--text3);padding:0}
.iconbtn:hover{background:var(--strong);color:var(--text)}
.iconbtn.danger:hover{color:var(--danger);background:rgba(214,69,69,.1)}
.datecell{font-variant-numeric:tabular-nums;white-space:nowrap}
.datecell.overdue{color:var(--danger);font-weight:500}
.briefcell{color:var(--text2);max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.assignee{display:inline-flex;align-items:center;gap:6px;color:var(--text2);border:none;background:none;cursor:pointer;border-radius:8px;padding:3px 6px;font-size:13px;white-space:nowrap}
.assignee:hover{background:var(--strong)}
.avatar{width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;color:#fff;flex:none}
.avatar.lg{width:30px;height:30px;font-size:12px}
.searchbar{border:1px solid var(--border);border-radius:8px;padding:6px 10px;font-size:13px;background:var(--bg);color:var(--text2);width:180px;outline:none}
.searchbar:focus{outline:2px solid var(--text);outline-offset:-1px}
.btn{display:inline-flex;align-items:center;gap:6px;border:none;background:var(--text);color:#fff;border-radius:8px;padding:7px 14px;font-size:13px;font-weight:500;cursor:pointer}
.btn:hover{opacity:.88}
.btn.ghost{background:transparent;color:var(--text2);border:1px solid var(--border)}
.btn.ghost:hover{background:var(--strong);opacity:1}
.btn.danger{background:transparent;border:1px solid var(--border);color:var(--text2)}
.btn.danger:hover{border-color:var(--danger);color:var(--danger)}
.btn.danger.confirm{background:var(--danger);border-color:var(--danger);color:#fff}
.ghost-btn{background:transparent;color:var(--text2);border:1px solid var(--border);border-radius:8px;padding:4px 8px;font-size:12px;cursor:pointer;white-space:nowrap}
.ghost-btn:hover{background:var(--strong)}
.addrow input,.addrow select{width:100%;border:1px solid var(--border);border-radius:8px;padding:6px 9px;font-size:13px;background:var(--bg)}
.addrow input:focus,.composer textarea:focus,.mailpanel input:focus{outline:2px solid var(--text);outline-offset:-1px}
.backbtn{display:inline-flex;align-items:center;gap:6px;border:none;background:none;color:var(--text2);font-size:13px;cursor:pointer;padding:4px 8px 4px 0;border-radius:8px;margin-bottom:10px}
.backbtn:hover{color:var(--text)}
.detail{background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:24px 28px}
.detail h2{font-size:22px;font-weight:600;margin:0 0 14px}
.titleinput{width:100%;font-family:inherit;font-size:22px;font-weight:600;color:var(--text);border:1px solid transparent;border-radius:8px;padding:4px 6px;margin:-4px 0 14px -6px;background:transparent;box-sizing:border-box}
.titleinput:hover{border-color:var(--strong)}
.titleinput:focus{outline:2px solid var(--text);outline-offset:-1px;background:var(--bg)}
.detail button {margin-bottom: 10px;}
.detail-grid{display:flex;flex-wrap:wrap;gap:12px 26px;align-items:center;margin-bottom:18px;font-size:13px;position:relative}
.detail-meta{color:var(--text3);display:inline-flex;align-items:center;gap:6px}
.dateinput{border:1px solid var(--border);border-radius:8px;padding:4px 8px;font-size:13px;background:var(--bg);color:var(--text2)}
.detail-brief{font-size:14px;color:var(--text2);padding-bottom:18px;border-bottom:1px solid var(--border);margin-bottom:6px}
.briefinput{width:100%;border:1px solid var(--border);border-radius:10px;padding:8px 10px;font-size:14px;resize:vertical;background:var(--bg);box-sizing:border-box}
.briefinput:focus{outline:2px solid var(--text);outline-offset:-1px}
trix-editor{min-height:80px;background:var(--bg)}
.detail-brief trix-editor{min-height:60px;border:none;padding:6px 0}
.comment-editor-wrap trix-editor{min-height:80px;border:1px solid var(--border);border-radius:10px}
.editcomposer trix-editor{min-height:80px;background:var(--bg)}
trix-editor img{max-width:min(160px,100%);height:auto;cursor:zoom-in}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:100;display:flex;align-items:center;justify-content:center;cursor:zoom-out;padding:24px}
.lightbox img{max-width:100%;max-height:100%;box-shadow:0 8px 40px rgba(0,0,0,.5)}
body.lightbox-open{overflow:hidden}
.section-label{font-size:12px;font-weight:500;color:var(--text3);margin:18px 0 8px}
.attachchip{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text2);background:var(--muted);border-radius:8px;padding:6px 10px;margin:0 6px 6px 0;text-decoration:none}
.attachbtn{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text2);border:1px dashed var(--border);background:none;border-radius:8px;padding:6px 10px;margin:0 6px 6px 0;cursor:pointer}
.attachbtn:hover{background:var(--muted)}
.comment{display:flex;gap:10px;margin-bottom:12px;max-width:620px}
.comment-body{background:var(--muted);border-radius:10px;padding:9px 12px;flex:1;min-width:0}
.comment-author{font-size:13px;font-weight:600}
.comment-time{font-size:11px;color:var(--text4);margin-left:6px}
.comment-time.edited{color:var(--text3)}
.comment-text{font-size:14px;margin-top:2px;white-space:pre-wrap;word-wrap:break-word}
.comment-actions{display:flex;gap:10px;margin-top:4px;opacity:0;transition:opacity .12s}
.comment:hover .comment-actions{opacity:1}
.actbtn{background:none;border:none;padding:0;font-size:12px;color:var(--text3);cursor:pointer}
.actbtn:hover{color:var(--text);text-decoration:underline}
.actbtn.confirm{color:var(--danger);font-weight:600}
.editcomposer textarea{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:10px;padding:8px 10px;font-size:14px;resize:vertical;background:var(--bg)}
.editcomposer textarea:focus{outline:2px solid var(--text);outline-offset:-1px}
.mention{font-weight:600;color:var(--c1)}
.event{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text3);margin-bottom:10px;max-width:620px}
.event .edot{width:6px;height:6px;border-radius:50%;background:var(--text4);flex:none;margin-left:12px}
.composer{max-width:620px;margin-top:14px}
.composer textarea{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:10px;padding:9px 11px;font-size:14px;resize:vertical;background:var(--bg)}
.notifyrow{display:flex;align-items:center;gap:6px;margin:8px 0;font-size:12px;color:var(--text3);flex-wrap:wrap}
.notifychip{width:28px;height:28px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;background:none;opacity:.4;transition:opacity .12s}
.notifychip .avatar{width:22px;height:22px}
.notifychip.on{opacity:1;border-color:var(--text)}
.sendrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.sentnote{font-size:12px;color:var(--positive)}
.mailbtn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid var(--border);background:var(--bg);border-radius:8px;cursor:pointer;color:var(--text2)}
.mailbtn:hover{color:var(--text)}
.badge{position:absolute;top:-5px;right:-5px;min-width:16px;height:16px;border-radius:8px;background:var(--danger);color:#fff;font-size:10px;font-weight:600;display:flex;align-items:center;justify-content:center;padding:0 4px}
.mailpanel{position:absolute;right:0;top:42px;z-index:30;width:340px;background:var(--bg);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.15);padding:8px}
.mailtabs{display:flex;gap:4px;margin-bottom:6px}
.mailtabs button{flex:1;border:none;background:none;padding:6px 8px;border-radius:8px;font-size:13px;color:var(--text2);cursor:pointer}
.mailtabs button.on{background:var(--strong);color:var(--text);font-weight:500}
.mailitem{display:flex;gap:8px;padding:9px;border-radius:8px;align-items:flex-start}
.mailitem:hover{background:var(--muted)}
.mail-from{font-size:13px;font-weight:600}
.mail-time{font-weight:400;font-size:11px;color:var(--text4);margin-left:6px}
.mail-subj{font-size:12px;color:var(--text2);margin-top:1px}
.mail-ex{font-size:12px;color:var(--text3);margin-top:2px;word-wrap:break-word}
.mail-send{flex:none;margin-top:2px;font-size:11px;color:var(--c1);background:none;border:none;cursor:pointer;padding:2px 4px;border-radius:4px}
.mail-send:hover{text-decoration:underline}
.emptymail{font-size:12px;color:var(--text4);text-align:center;padding:18px 8px}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%) translateY(20px);background:var(--text);color:#fff;font-size:13px;padding:9px 16px;border-radius:10px;opacity:0;pointer-events:none;transition:all .25s;z-index:50;max-width:90vw}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.footer{margin-top:24px;font-size:12px;color:var(--text4);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}
.footer button{background:none;border:none;color:var(--text4);cursor:pointer;font-size:12px;text-decoration:underline}
.hidden{display:none!important}

/* ========== Statuses page ========== */
.messages{margin-bottom:14px}
.flash{border-radius:10px;padding:10px 14px;font-size:13px;margin-bottom:8px}
.flash.success{background:rgba(46,158,91,.12);color:var(--positive)}
.flash.error{background:rgba(214,69,69,.12);color:var(--danger)}
.sheet{margin-bottom:22px}
.card-head{margin:22px 0 12px}
.card-head h2{font-size:16px}
.status-table td .statusbtn{margin-right:4px}
.form-card{padding:20px 24px}
.form-card .field,.form-card .checkrow{margin-bottom:14px}
.field label{display:block;font-size:12px;font-weight:500;color:var(--text3);margin-bottom:5px}
.field input[type=text]{width:100%;box-sizing:border-box;border:1px solid var(--border);border-radius:8px;padding:8px 10px;font-size:14px;background:var(--bg)}
.field input[type=text]:focus{outline:2px solid var(--text);outline-offset:-1px}
.color-wrap{display:inline-flex;align-items:center;gap:10px}
.color-input{width:44px;height:34px;padding:2px;border:1px solid var(--border);border-radius:8px;background:var(--bg);cursor:pointer}
.color-hint{font-size:13px;color:var(--text2);font-variant-numeric:tabular-nums}
.checkrow{display:flex;align-items:center;gap:8px;font-size:14px;cursor:pointer;flex-wrap:wrap}
.checkrow input[type=checkbox]{width:16px;height:16px}
.checkrow small{width:100%;font-size:12px;color:var(--text3)}
.save-row{display:flex;gap:10px;align-items:center;margin-top:18px}
.inline{display:inline}
.btn.danger-sm{color:var(--danger)}
.btn.danger-sm:disabled{opacity:.45;cursor:not-allowed}
.userdot{display:inline-block;width:14px;height:14px;border-radius:50%;vertical-align:middle}
.inactive{color:var(--danger)}

/* ========== Notification topbar bell ========== */
.notifbtn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;background:none;border:none;border-radius:8px;cursor:pointer;color:var(--text3);font-size:15px;padding:0;margin-left:0}
.notifbtn:hover{color:var(--text);background:rgba(255,255,255,.08)}
.notif-ico{line-height:1}
.notifpanel{position:absolute;right:0;top:42px;z-index:40;width:360px;max-height:340px;overflow-y:auto;background:var(--bg);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.15);padding:8px}
.notif-mr{display:block;width:100%;text-align:center;padding:7px;border:none;background:none;border-radius:8px;font-size:12px;color:var(--positive);cursor:pointer;margin-bottom:6px;font-weight:500}
.notif-mr:hover{background:var(--muted)}
.notif-item{display:flex;gap:8px;padding:9px 10px;border-radius:8px;text-decoration:none;color:var(--text);font-size:13px;align-items:flex-start;word-break:break-word}
.notif-item:hover{background:var(--muted)}
.notif-unread{background:rgba(59,115,196,.06);font-weight:500}
.notif-msg{flex:1;min-width:0}
.notif-time{font-size:11px;color:var(--text4);flex:none;white-space:nowrap}
.notif-empty{font-size:12px;color:var(--text4);text-align:center;padding:14px 8px}
@media(max-width:820px){
  .briefcol,.briefcell{display:none}
  .wrap{padding:16px 12px 48px}
}

.errorlist {
  color: #b00020;
  padding-left: 1rem;
}
