:root{
  --bg:#0f172a; --panel:#1e293b; --panel2:#273549; --border:#334155;
  --text:#e2e8f0; --muted:#94a3b8; --accent:#1f8a63; --accent2:#3ab58a;
  --green:#22c55e; --red:#ef4444; --amber:#f59e0b;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:14px}
button{font-family:inherit;cursor:pointer}
input,select,textarea{font-family:inherit;background:var(--panel2);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:7px 9px}
.btn{background:var(--panel2);border:1px solid var(--border);color:var(--text);padding:7px 12px;border-radius:8px;font-size:13px}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
.btn.ghost{background:transparent}
.btn.danger{background:transparent;border-color:var(--red);color:var(--red)}
.btn.sm{padding:5px 9px;font-size:12px}
.hidden{display:none!important}

/* ===== LOGIN ===== */
#loginScreen,#lockScreen{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:var(--bg);z-index:50}
#lockScreen{z-index:90}
.login-box{width:320px;background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:28px}
.login-box h1{font-size:18px;margin:0 0 4px}
.login-box p{color:var(--muted);font-size:12.5px;margin:0 0 18px}
.login-box input{width:100%;margin-bottom:10px}
.login-box .btn{width:100%;margin-top:6px}
.login-remember{display:flex;align-items:flex-start;gap:8px;margin:2px 0 7px;color:var(--muted);font-size:11.5px;line-height:1.45;cursor:pointer}
.login-box .login-remember input{width:auto;min-height:0;margin:2px 0 0;accent-color:var(--accent)}
.login-err{color:var(--red);font-size:12.5px;min-height:16px;margin-top:6px}
.login-note{margin-top:16px;padding-top:14px;border-top:1px solid var(--border);font-size:11.5px;color:var(--muted);line-height:1.6}
.login-secondary-action{display:block;width:100%;padding:7px 4px;border:0;background:transparent;color:var(--accent);font-size:12px;text-align:center}
.login-secondary-action:hover{text-decoration:underline}.login-totp-hint{font-weight:400;font-size:12px}

/* ===== SHELL ===== */
#app{display:flex;min-height:100vh}
.sidebar{width:220px;flex:0 0 220px;background:var(--panel);border-right:1px solid var(--border);padding:14px 10px;display:flex;flex-direction:column}
.sidebar h2{font-size:15px;padding:0 8px 14px;margin:0}
.nav button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:none;color:var(--text);padding:9px 8px;border-radius:8px;font-size:13px;margin-bottom:2px}
.nav button:hover{background:var(--panel2)}
.nav button.active{background:var(--accent);color:#fff;font-weight:600}
.foot-user{margin-top:auto;padding:10px 8px;border-top:1px solid var(--border);font-size:12px}
.foot-user b{display:block}
.foot-user a{color:var(--accent2);cursor:pointer;font-size:11.5px}
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{display:flex;align-items:center;gap:10px;padding:12px 18px;border-bottom:1px solid var(--border);flex-wrap:wrap}
.topbar-title-row{display:contents}
.topbar h1{font-size:17px;margin:0;flex:0 0 auto}
.topbar-tools{display:flex;align-items:center;gap:6px}
.notification-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;min-width:36px;padding:0;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted)}
.notification-bell:hover,.notification-bell.has-unread{color:var(--accent2);background:rgba(58,181,138,.1);border-color:rgba(58,181,138,.22)}
.notification-bell svg{width:20px;height:20px}
.notification-badge{position:absolute;top:-4px;right:-5px;min-width:17px;height:17px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--bg);border-radius:99px;background:var(--red);color:#fff;font-size:9px;font-weight:750;line-height:1;font-variant-numeric:tabular-nums}
.mobile-filter-toggle{display:none}
.content{padding:18px;flex:1;overflow:auto}

/* ===== EMPTY / MISC ===== */
.mt-empty{text-align:center;color:var(--muted);padding:40px 20px}
.mt-empty .big{font-size:34px;margin-bottom:8px}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--panel2);border:1px solid var(--border);padding:10px 16px;border-radius:8px;font-size:13px;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s}
.toast.show{opacity:1}
.badge{display:inline-block;border-radius:20px;padding:2px 9px;font-size:11px;font-weight:600}

/* ===== TASK CARD LIST (Viec cua toi) ===== */
.task-card{background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin-bottom:8px;cursor:pointer}
.task-card:hover{border-color:var(--accent)}
.task-card .row1{display:flex;justify-content:space-between;gap:8px;align-items:center}
.task-card .name{font-weight:600}
.task-card .meta{font-size:11.5px;color:var(--muted);margin-top:4px}
.task-card.late{border-left:3px solid var(--red)}

/* ===== KANBAN ===== */
.kanban{display:flex;gap:12px;overflow-x:auto;align-items:flex-start}
.kb-col{flex:0 0 260px;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:10px}
.kb-col h3{font-size:12.5px;margin:0 0 10px;display:flex;align-items:center;gap:6px}
.kb-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.kb-card{background:var(--panel2);border:1px solid var(--border);border-radius:8px;padding:8px 10px;margin-bottom:8px;font-size:12.5px;cursor:pointer}
.kb-card.late{border-left:3px solid var(--red)}

/* ===== GANTT (port tu ban Apps Script, giu nguyen logic/class de de doi chieu) ===== */
.gt-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.gt-latebadge{color:var(--red);font-size:12.5px;font-weight:700;background:rgba(239,68,68,.12);padding:4px 10px;border-radius:20px}
.gt-wrap{border:1px solid var(--border);border-radius:10px;overflow-x:auto;background:var(--panel)}
.gt-scroll{min-width:900px}
.gt-header{display:flex;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--panel);z-index:1}
.gt-label{flex:0 0 180px}
.gt-days{flex:1;display:flex}
.gt-daycell{flex:1;text-align:center;font-size:10px;color:var(--muted);padding:8px 2px;border-left:1px solid var(--border)}
.gt-daycell.today{color:var(--accent2);font-weight:700}
.gt-daycell.weekend{background:rgba(255,255,255,.03)}
.gt-body{max-height:60vh;overflow-y:auto}
.gt-row{display:flex;align-items:center;border-bottom:1px solid var(--border);min-height:40px}
.gt-row:last-child{border-bottom:none}
.gt-row .gt-label{padding:6px 10px;font-size:12px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gt-subrow .gt-label{color:var(--muted);font-size:11.5px;padding-left:22px}
.gt-namesub{display:block;font-size:10px;color:var(--muted);font-weight:400}
.gt-track{flex:1;position:relative;height:100%;min-height:40px}
.gt-bar{position:absolute;top:8px;bottom:8px;border-radius:6px;cursor:pointer;display:flex;align-items:center;padding:0 8px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.gt-barlabel{color:#fff;font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.gt-milestone{position:absolute;top:50%;width:12px;height:12px;transform:translate(-50%,-50%) rotate(45deg);cursor:pointer;border:2px solid var(--panel)}

/* ===== DASHBOARD ===== */
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:20px}
.kpi-card{position:relative;display:flex;flex-direction:column;justify-content:space-between;width:100%;min-height:104px;background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:14px;text-align:left;color:var(--text);overflow:hidden}
.kpi-card::before{content:'';position:absolute;inset:0 auto 0 0;width:3px;background:var(--accent2)}
.kpi-card--late::before{background:var(--red)}.kpi-card--done::before{background:var(--green)}.kpi-card--active::before{background:#60a5fa}
.kpi-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:12px}
.kpi-card-label{font-weight:650}.kpi-card-arrow{font-size:20px;line-height:1;color:var(--muted)}
.kpi-card .num{display:block;margin-top:7px;font-size:26px;font-weight:750;line-height:1.05;font-variant-numeric:tabular-nums}
.kpi-card--late .num{color:var(--red)}.kpi-card--done .num{color:var(--green)}.kpi-card--active .num{color:#60a5fa}
.kpi-card .lbl{display:block;margin-top:4px;font-size:12px;color:var(--muted)}

/* ===== DỰ ÁN ===== */
.project-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px;flex-wrap:wrap}
.project-toolbar b{display:block;font-size:15px}.project-toolbar span{display:block;margin-top:3px;color:var(--muted);font-size:12px}
.project-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:12px}
.project-card{position:relative;min-width:0;padding:15px;background:var(--panel);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-sm,0 5px 14px rgba(2,6,23,.09));overflow:hidden}
.project-card:hover{border-color:var(--accent);box-shadow:var(--shadow-md,0 10px 24px rgba(2,6,23,.15))}
.project-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.project-title-wrap{display:flex;align-items:flex-start;min-width:0;gap:10px}.project-color{flex:0 0 10px;width:10px;height:38px;border-radius:99px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.project-title-wrap h2{margin:0;color:var(--text);font-size:15px;line-height:1.35;overflow-wrap:anywhere}.project-status{display:inline-block;margin-top:4px;color:var(--muted);font-size:11.5px}
.project-late{flex:0 0 auto;padding:4px 7px;border-radius:999px;background:rgba(239,68,68,.12);color:var(--red);font-size:10.5px;font-weight:700;white-space:nowrap}
.project-description{min-height:38px;margin:12px 0 0;color:var(--text);font-size:12.5px;line-height:1.5;white-space:pre-wrap}.project-description-empty{color:var(--muted);font-style:italic}
.project-meta{display:flex;gap:8px 12px;flex-wrap:wrap;margin-top:11px;color:var(--muted);font-size:11.5px;line-height:1.4}.project-meta span{min-width:0;overflow-wrap:anywhere}
.project-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:13px;padding-top:12px;border-top:1px solid var(--border)}
.project-stats span{min-width:0;padding:7px 5px;border-radius:8px;background:var(--panel2);color:var(--muted);font-size:10.5px;line-height:1.25;text-align:center}.project-stats b{display:block;margin-bottom:2px;color:var(--text);font-size:15px;font-variant-numeric:tabular-nums}.project-stats b.is-late{color:var(--red)}
.project-card-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px}.project-card-actions .btn b{margin-left:2px;font-variant-numeric:tabular-nums}
.project-empty p{max-width:390px;margin:8px auto 16px;line-height:1.5}.project-delete-note{margin:14px 0 0;color:var(--muted);font-size:11.5px;line-height:1.5}
.project-tabs button{white-space:nowrap}
.project-tabpane{display:none}.project-tabpane.active{display:block}
.project-history-pane{padding-top:2px}
.project-history-intro{margin:0 0 14px;padding:9px 10px;border-left:3px solid var(--accent2);border-radius:0 9px 9px 0;background:rgba(58,181,138,.09);color:var(--muted);font-size:11.5px;line-height:1.5}
.project-history-list{min-height:86px}
.project-history-placeholder,.project-history-empty{padding:24px 12px;text-align:center;color:var(--muted);font-size:12.5px;line-height:1.5}
.project-history-empty .big{margin-bottom:6px;font-size:26px}
.project-history-empty .btn{margin-top:10px}
.project-history-entry{position:relative;display:flex;gap:11px;padding:0 0 16px;min-width:0}
.project-history-entry:not(:last-child)::after{content:'';position:absolute;left:7px;top:17px;bottom:0;width:1px;background:var(--border)}
.project-history-dot{position:relative;z-index:1;display:block;flex:0 0 15px;width:15px;height:15px;margin-top:2px;border:3px solid var(--panel);border-radius:50%;background:var(--accent2);box-shadow:0 0 0 1px rgba(58,181,138,.45)}
.project-history-entry-main{min-width:0;flex:1;padding-bottom:1px}
.project-history-entry-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.project-history-entry-top b{min-width:0;overflow-wrap:anywhere;font-size:12.5px}.project-history-entry-top time{flex:0 0 auto;color:var(--muted);font-size:10.5px;white-space:nowrap;font-variant-numeric:tabular-nums}
.project-history-action{margin-top:2px;color:var(--text);font-size:12.5px;font-weight:650;line-height:1.45}.project-history-summary{margin:3px 0 0;color:var(--muted);font-size:11.5px;line-height:1.45;white-space:pre-wrap}
.project-history-changes{display:flex;flex-direction:column;gap:5px;margin:8px 0 0;padding:0;list-style:none}.project-history-changes li{padding:7px 8px;border:1px solid var(--border);border-radius:8px;background:var(--panel2);font-size:11px;line-height:1.45}.project-history-changes li b{display:block;margin-bottom:2px;color:var(--muted);font-size:10.5px;font-weight:650}.project-history-change-value{display:flex;align-items:flex-start;gap:6px;min-width:0;color:var(--text)}.project-history-before,.project-history-after{min-width:0;overflow-wrap:anywhere}.project-history-before{color:var(--muted);text-decoration:line-through}.project-history-arrow{flex:0 0 auto;color:var(--accent2);font-weight:800}
#projectOverlay.is-readonly .people-picker{opacity:.82}#projectOverlay.is-readonly .pp-item{cursor:default}#projectOverlay.is-readonly .pp-item:has(input:disabled){pointer-events:none}

/* ===== MODAL ===== */
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);display:none;align-items:center;justify-content:center;z-index:60;padding:20px}
.overlay.show{display:flex}
.modal{background:var(--panel);border:1px solid var(--border);border-radius:12px;width:480px;max-width:100%;max-height:90vh;display:flex;flex-direction:column}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--border)}
.modal-head h2{font-size:15px;margin:0}
.modal-head .x{background:none;border:none;color:var(--muted);font-size:16px}
.modal-body{padding:14px 16px;overflow:auto}
.modal-foot{display:flex;gap:8px;justify-content:flex-end;padding:12px 16px;border-top:1px solid var(--border)}
.totp-modal{width:520px}.totp-intro{margin:0 0 14px;color:var(--muted);font-size:13px;line-height:1.55}
.totp-status{display:flex;align-items:center;gap:8px;margin:0 0 14px;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:var(--panel2);font-size:13px}
.totp-status-dot{width:9px;height:9px;border-radius:99px;background:var(--muted);flex:0 0 auto}.totp-status.enabled .totp-status-dot{background:var(--green)}.totp-status.warning .totp-status-dot{background:var(--amber)}
.totp-setup-key{display:block;width:100%;padding:10px;border:1px dashed var(--border);border-radius:9px;background:var(--panel2);color:var(--text);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:15px;letter-spacing:.08em;line-height:1.45;word-break:break-all;text-align:center}
.totp-uri{display:block;width:100%;min-height:88px;padding:9px;resize:vertical;color:var(--muted);font-size:11px;line-height:1.4;word-break:break-all}
.totp-step{margin:0 0 13px;padding:12px;border:1px solid var(--border);border-radius:11px;background:var(--panel2)}.totp-step:last-child{margin-bottom:0}.totp-step strong{display:block;margin-bottom:5px;font-size:13px}.totp-step p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.totp-code-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.totp-code{padding:10px 8px;border:1px solid var(--border);border-radius:9px;background:var(--panel2);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:13px;letter-spacing:.05em;text-align:center}
.totp-ack{display:flex;gap:9px;align-items:flex-start;margin-top:14px;padding:11px;border-radius:10px;background:rgba(245,158,11,.12);font-size:12px;line-height:1.45}.totp-ack input{width:18px;min-width:18px;height:18px;margin:0;accent-color:var(--accent)}
.totp-danger-note{margin:12px 0 0;padding:10px;border-left:3px solid var(--red);border-radius:0 8px 8px 0;background:rgba(239,68,68,.1);color:var(--muted);font-size:12px;line-height:1.5}
.frm{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.frm .full{grid-column:1/-1}
.frm label{display:block;font-size:11.5px;color:var(--muted);margin-bottom:3px}
.frm input,.frm select,.frm textarea{width:100%}
.permission-editor{padding:13px;border:1px solid var(--border);border-radius:12px;background:rgba(15,23,42,.24)}
/* Chon nhieu nhan su (thanh vien du an / nguoi phu trach cong viec): chip co avatar chu cai + dau tich */
.people-picker{display:flex;flex-wrap:wrap;gap:8px;max-height:210px;overflow:auto;padding:11px;border:1px solid var(--border);border-radius:13px;background:var(--panel);box-shadow:var(--shadow-sm,0 5px 14px rgba(2,6,23,.06)) inset}
.pp-item{position:relative;display:inline-flex;align-items:center;gap:9px;padding:5px 15px 5px 5px;border:1.5px solid var(--border);border-radius:999px;background:var(--panel2);cursor:pointer;user-select:none;min-height:44px;transition:border-color .12s,background .12s,box-shadow .12s}
.pp-item:hover{border-color:var(--accent2)}
.pp-item.on{border-color:var(--accent);background:rgba(31,138,99,.1);box-shadow:0 0 0 1px var(--accent) inset}
.pp-item input{position:absolute;opacity:0;width:0;height:0;margin:0;pointer-events:none}
.pp-avatar{position:relative;flex:none;width:33px;height:33px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:12.5px;letter-spacing:.01em;box-shadow:inset 0 0 0 1px rgba(255,255,255,.22)}
.pp-check{position:absolute;right:-3px;bottom:-3px;width:16px;height:16px;border-radius:50%;background:var(--accent);color:#fff;font-size:9.5px;font-weight:800;display:none;align-items:center;justify-content:center;border:2px solid var(--panel);line-height:1}
.pp-item.on .pp-check{display:flex}
.pp-name{font-size:14px;line-height:1.15;color:var(--text);white-space:nowrap;max-width:170px;overflow:hidden;text-overflow:ellipsis}
.pp-item.on .pp-name{font-weight:600}
.pp-name small{color:var(--muted);font-size:11px;font-weight:400}
.pp-empty{color:var(--muted);font-size:13px;padding:6px 2px}
.permission-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:9px}
.permission-editor-title{font-size:13px;font-weight:750;color:var(--text)}
.permission-editor-hint{margin:3px 0 0;color:var(--muted);font-size:11.5px;line-height:1.4}
.permission-actions{display:flex;flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end;gap:5px}
.permission-action,.permission-reset{min-height:30px;padding:4px 7px;border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--accent2);font-size:11px;font-weight:650;white-space:nowrap}
.permission-action:hover,.permission-reset:hover{background:rgba(58,181,138,.10);border-color:rgba(58,181,138,.45)}
.permission-reset.hidden{display:none}
.permission-mode{display:flex!important;align-items:center;gap:8px;min-height:34px;margin:0 0 10px!important;color:var(--text)!important;font-size:12.5px!important;font-weight:650;cursor:pointer}
.permission-mode-state{display:none!important}
.permission-admin-note{margin:0 0 10px;padding:8px 9px;border-left:3px solid var(--accent2);border-radius:0 8px 8px 0;background:rgba(58,181,138,.08);color:var(--muted);font-size:11.5px;line-height:1.42}
.frm .permission-mode input[type=checkbox],.frm .permission-option input[type=checkbox]{width:17px;min-width:17px;height:17px;margin:0;accent-color:var(--accent2);cursor:pointer}
.permission-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.permission-group{min-width:0;margin:0;padding:9px;border:1px solid rgba(148,163,184,.18);border-radius:10px;background:rgba(2,6,23,.14)}
.permission-group legend{padding:0 4px;color:var(--text);font-size:11.5px;font-weight:750}
.permission-option{display:flex!important;align-items:flex-start;gap:8px;min-height:29px;margin:0!important;padding:4px 2px;color:var(--text)!important;font-size:11.5px!important;line-height:1.35;cursor:pointer}
.permission-option span{padding-top:1px}.permission-option input:disabled{opacity:.48;cursor:default}.permission-option:has(input:disabled){color:var(--muted)!important;cursor:default}
.permission-badge{display:inline-flex;align-items:center;min-height:23px;padding:2px 7px;border:1px solid rgba(148,163,184,.28);border-radius:999px;color:var(--muted);font-size:10.5px;font-weight:650;white-space:nowrap}
.permission-badge.custom{border-color:rgba(58,181,138,.42);background:rgba(58,181,138,.1);color:var(--accent2)}
.tabs{display:flex;border-bottom:1px solid var(--border);padding:0 16px}
.tabs button{background:none;border:none;color:var(--muted);padding:10px 4px;margin-right:16px;font-size:12.5px;border-bottom:2px solid transparent}
.tabs button.active{color:var(--text);border-color:var(--accent)}
.tabpane{display:none}
.tabpane.active{display:block}
.sub-row{display:flex;gap:6px;align-items:center;margin-bottom:6px}
.sub-row input,.sub-row select{font-size:12px}

/* ===== THONG BAO TRONG APP ===== */
.notification-overlay{align-items:flex-start;justify-content:flex-end;padding:60px 22px 22px;z-index:75}
.notification-panel{width:min(400px,100%);max-height:min(640px,calc(100vh - 82px));display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border);border-radius:16px;background:var(--panel);box-shadow:0 20px 54px rgba(2,6,23,.48)}
.push-overlay{z-index:76}.push-panel{width:min(430px,calc(100% - 28px));margin:auto}.push-panel .modal-head p{margin:3px 0 0;color:var(--muted);font-size:11.5px}.push-status-card{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--border);border-radius:14px;background:rgba(58,181,138,.07)}.push-status-card.success{background:rgba(58,181,138,.12);border-color:rgba(58,181,138,.35)}.push-status-card.warn{background:rgba(245,158,11,.08);border-color:rgba(245,158,11,.3)}.push-status-icon{flex:0 0 30px;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:var(--accent);color:#fff;font-size:17px;font-weight:800}.push-status-card.warn .push-status-icon{background:#d97706}.push-status-card b{font-size:13px}.push-status-card p,.push-privacy-note,.push-error{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.push-privacy-note{padding:0 2px}.push-error{color:var(--red)}
.notification-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:14px 15px 12px;border-bottom:1px solid var(--border)}
.notification-head h2{margin:0;font-size:16px}.notification-head p{margin:3px 0 0;color:var(--muted);font-size:11.5px}
.notification-head-actions{display:flex;align-items:center;gap:4px}.notification-head .x{min-width:32px;min-height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:17px}
.notification-read-all{min-height:32px;padding:5px 7px;border:0;border-radius:8px;background:transparent;color:var(--accent2);font-size:11.5px;font-weight:650;white-space:nowrap}.notification-read-all:disabled{opacity:.45;cursor:default}
.notification-list{min-height:112px;overflow:auto;overscroll-behavior:contain}
.notification-item{display:flex;gap:10px;width:100%;padding:12px 14px;border:0;border-bottom:1px solid rgba(148,163,184,.13);background:transparent;color:var(--text);text-align:left;font:inherit;cursor:pointer}
.notification-item:last-child{border-bottom:0}.notification-item:hover{background:rgba(148,163,184,.06)}.notification-item.unread{background:rgba(58,181,138,.075)}
.notification-item-icon{flex:0 0 32px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:rgba(148,163,184,.12);font-size:16px}.notification-item--task .notification-item-icon{background:rgba(59,130,246,.14)}.notification-item--customer .notification-item-icon{background:rgba(58,181,138,.15)}
.notification-item-main{min-width:0;flex:1}.notification-item-top{display:flex;gap:8px;align-items:baseline;justify-content:space-between}.notification-item-title{font-size:13px;font-weight:700;line-height:1.35}.notification-item-time{flex:0 0 auto;color:var(--muted);font-size:10.5px;white-space:nowrap}.notification-item-body{margin-top:3px;color:var(--muted);font-size:12px;line-height:1.42}.notification-unread-dot{flex:0 0 7px;width:7px;height:7px;margin-top:7px;border-radius:50%;background:var(--accent2)}
.notification-empty{padding:31px 20px;text-align:center;color:var(--muted);font-size:13px;line-height:1.5}.notification-empty .big{font-size:27px;margin-bottom:6px}

/* ===== VAT TU / NCC / DON HANG / KHACH HANG / NHAN SU ===== */
.mat-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.mat-card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:14px;margin-bottom:10px;cursor:pointer}
.mat-card:hover{border-color:var(--accent)}
.mat-card .mat-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.mat-card .mat-name{font-size:15px;font-weight:600;line-height:1.35}
.mat-card .mat-nums{display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;color:var(--muted);margin-top:8px}
.mat-card .mat-nums b{color:var(--text)}
.mat-badge{font-size:11px;padding:3px 9px;border-radius:12px;white-space:nowrap;font-weight:600}
.mat-note{font-size:11.5px;color:var(--muted);margin-top:8px;white-space:pre-wrap}
.mat-warn-box{background:rgba(239,68,68,.08);border:1px solid rgba(239,68,68,.3);border-radius:10px;padding:12px 14px;margin-bottom:16px}
.mat-warn-box .wl{font-size:12.5px;color:var(--text);margin:4px 0}
.po-item-row{display:flex;gap:6px;align-items:center;margin-bottom:6px}
.po-item-row input{font-size:12.5px}
.hist-row{display:flex;justify-content:space-between;gap:8px;font-size:12.5px;padding:5px 0;border-bottom:1px solid var(--border)}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
table th{text-align:left;color:var(--muted);font-weight:600;font-size:11.5px;padding:8px 10px;border-bottom:1px solid var(--border)}
table td{padding:9px 10px;border-bottom:1px solid var(--border);vertical-align:top}
table tr:last-child td{border-bottom:none}

/* ===== CONG TRINH (Tang/Phong) + NHAT KY ===== */
.floor-box{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:14px;margin-bottom:12px}
.floor-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.floor-head .fname{font-size:15px;font-weight:700}
.room-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}
.room-card{background:var(--panel2);border:1px solid var(--border);border-radius:10px;padding:11px 12px;cursor:pointer}
.room-card:hover{border-color:var(--accent)}
.room-card .rname{font-weight:600;font-size:13.5px;margin-bottom:6px}
.room-card .rmeta{font-size:11px;color:var(--muted);margin-top:6px}
.ph-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;margin-top:8px}
.ph-item{position:relative;border-radius:8px;overflow:hidden;background:var(--panel2);border:1px solid var(--border);aspect-ratio:1/1}
.ph-item img,.ph-item video{width:100%;height:100%;object-fit:cover;display:block;cursor:pointer}
.ph-item .ph-file{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;font-size:10.5px;color:var(--muted);text-align:center;padding:6px;text-decoration:none}
.ph-item .ph-file .ic{font-size:24px;margin-bottom:4px}
.ph-item .ph-del{position:absolute;top:3px;right:3px;background:rgba(0,0,0,.65);border:none;color:#fff;border-radius:6px;font-size:11px;padding:2px 6px;line-height:1.4}
.ph-sec-title{font-size:12px;color:var(--muted);margin-top:12px;font-weight:600}
.diary-card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:14px;margin-bottom:10px}
.diary-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline;flex-wrap:wrap}
.diary-date{font-weight:700;font-size:14px}
.diary-author{font-size:11.5px;color:var(--muted)}
.diary-content{font-size:13px;margin-top:6px;white-space:pre-wrap;line-height:1.5}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.9);display:none;align-items:center;justify-content:center;z-index:80}
.lightbox.show{display:flex}
.lightbox img,.lightbox video{max-width:92vw;max-height:86vh;object-fit:contain}
.lb-nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.12);border:none;color:#fff;font-size:22px;padding:12px 16px;border-radius:10px}
.lb-nav.prev{left:12px}.lb-nav.next{right:12px}
.lb-close{position:absolute;top:14px;right:16px;background:rgba(255,255,255,.12);border:none;color:#fff;font-size:18px;padding:8px 13px;border-radius:10px}
.lb-count{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);color:#fff;font-size:12.5px;background:rgba(0,0,0,.5);padding:5px 12px;border-radius:20px}

/* ===== TAI CHINH (bao gia / chi phi / phat sinh / cong no / loi nhuan) ===== */
.fin-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.money{font-variant-numeric:tabular-nums;white-space:nowrap}
.money.pos{color:var(--green)}.money.neg{color:var(--red)}
.q-card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:14px;margin-bottom:10px;cursor:pointer}
.q-card:hover{border-color:var(--accent)}
.q-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.q-code{font-weight:700;font-size:14.5px}
.q-amount{font-size:17px;font-weight:800;color:var(--accent)}
.q-meta{font-size:11.5px;color:var(--muted);margin-top:6px}
.q-line{display:flex;gap:6px;align-items:center;margin-bottom:6px}
.q-line input{font-size:12.5px}
.audit-row{font-size:11.5px;color:var(--muted);padding:4px 0;border-bottom:1px solid var(--border)}
.audit-row b{color:var(--text)}
.profit-note{background:rgba(245,158,11,.1);border:1px solid rgba(245,158,11,.35);border-radius:10px;padding:11px 14px;font-size:12.5px;margin-bottom:14px;line-height:1.55}
.urgent-tag{background:rgba(239,68,68,.15);color:var(--red);font-size:10.5px;font-weight:700;padding:2px 7px;border-radius:10px;margin-left:6px}

/* ===== MINDMAP (port nguyen tu ban Apps Script) ===== */
.mindmap{padding:10px;overflow-x:auto}
.tree,.tree ul{list-style:none;padding-left:34px;position:relative}
.tree>li{padding-left:0}
.tree ul li{position:relative;padding:6px 0 6px 20px}
.tree ul li::before{content:'';position:absolute;left:0;top:0;bottom:0;border-left:2px solid var(--border)}
.tree ul li:last-child::before{height:22px;bottom:auto}
.tree ul li::after{content:'';position:absolute;left:0;top:22px;width:18px;border-top:2px solid var(--border)}
.node{display:inline-block;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:8px 14px;font-size:13px;cursor:pointer}
.node:hover{border-color:var(--accent)}
.node.proj{font-weight:700;border-left:4px solid var(--accent)}
.node.done{opacity:.55;text-decoration:line-through}
.node small{color:var(--muted);margin-left:8px}

/* ===== WORKFLOW EDITOR ===== */
.wf-row{display:flex;gap:8px;align-items:center;margin-bottom:8px;background:var(--panel2);border-radius:9px;padding:8px 10px}
.wf-row input[type=color]{width:42px;padding:2px;height:32px}
.wf-order{color:var(--muted);font-size:11.5px;width:18px;text-align:center}

@media (max-width:760px){
  .tree,.tree ul{padding-left:18px}
  .tree ul li{padding-left:14px}
  .node{font-size:12.5px;padding:7px 10px}
}


/* ===== MAN HINH TONG QUAN ===== */
.kpi-card{cursor:pointer}
.dash-sec{font-size:12.5px;color:var(--muted);font-weight:600;margin:20px 0 9px;text-transform:uppercase;letter-spacing:.4px}
.alert-list{display:flex;flex-direction:column;gap:8px}
.alert-row{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  background:var(--panel);border:1px solid var(--border);border-radius:12px;
  padding:12px 14px;color:var(--text);font-size:14px;cursor:pointer;
}
.alert-row:hover{border-color:var(--accent)}
.alert-num{
  flex:0 0 auto;min-width:34px;height:30px;border-radius:9px;
  display:inline-flex;align-items:center;justify-content:center;
  font-weight:700;font-size:15px;padding:0 8px;
}
.alert-lbl{flex:1}
.alert-go{color:var(--muted);font-size:20px;line-height:1}
.alert-ok{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:16px 14px;color:var(--muted);font-size:13.5px}
.short-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:10px}
.short-tile{
  background:var(--panel);border:1px solid var(--border);border-radius:14px;color:var(--text);
  min-height:92px;padding:12px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  font-size:12px;font-weight:600;text-align:center;line-height:1.25;cursor:pointer;
}
.short-tile .ic,.more-icon,.more-quick-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1}
.short-tile .ic{width:32px;height:32px;border-radius:10px;background:rgba(58,181,138,.12);color:var(--accent2)}
.short-tile .ic svg{width:19px;height:19px;stroke-width:2}
.short-tile--all .ic{background:rgba(148,163,184,.13);color:var(--muted)}
.short-tile:hover{border-color:var(--accent)}

button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent2);outline-offset:2px}

/* ===== THAO LUAN DU AN ===== */
.discussion{max-width:860px;margin:0 auto}.discussion-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.discussion-head b{display:block;font-size:16px}.discussion-head span{display:block;margin-top:3px;color:var(--muted);font-size:12px}.discussion-list{display:flex;flex-direction:column;gap:9px}.discussion-message{position:relative;max-width:82%;padding:11px 13px;background:var(--panel);border:1px solid var(--border);border-radius:13px}.discussion-message.own{align-self:flex-end;background:rgba(58,181,138,.11);border-color:rgba(58,181,138,.32)}.discussion-author{font-weight:700;font-size:12px;color:var(--accent2)}.discussion-author span{margin-left:7px;font-weight:400;color:var(--muted);font-size:11px}.discussion-body{margin-top:5px;white-space:normal;line-height:1.48;font-size:14px}.discussion-delete{margin-top:7px;padding:0;border:0;background:transparent;color:var(--muted);font-size:11px;cursor:pointer}.discussion-delete:hover{color:var(--red)}.discussion-compose{display:flex;gap:9px;align-items:flex-end;margin-top:14px;padding:11px;background:var(--panel);border:1px solid var(--border);border-radius:14px}.discussion-compose textarea{flex:1;resize:vertical;min-height:62px}.discussion-compose .btn{white-space:nowrap}.discussion-loading{color:var(--muted);padding:20px 0;text-align:center}

/* ===== O TIM NHANH ===== */
.qsearch{min-width:220px}
.qs-empty{text-align:center;color:var(--muted);padding:34px 20px;font-size:14px}
.table-hint{display:none}

/* ===== TRẢI NGHIỆM ỨNG DỤNG ĐIỆN THOẠI =====
   Màn hình nhỏ dùng khung app cố định: chỉ vùng nội dung được cuộn, điều hướng luôn trong tầm ngón cái. */
.tabbar,.more-sheet{display:none}

@media (max-width:760px){
  html,body{height:100%;height:100dvh;min-height:100%;min-height:100dvh;overflow:hidden;background:var(--panel);overscroll-behavior:none}
  body{-webkit-tap-highlight-color:transparent;touch-action:manipulation;-webkit-user-select:none;user-select:none}
  input,textarea,select,[contenteditable="true"]{-webkit-user-select:text;user-select:text}
  button,input,select,textarea{font-size:16px}
  /* iPhone se tu phong to trang neu o nhap lieu nho hon 16px. Nhieu dong form sinh dong co font
     rieng, nen khoa lai o day de tat ca form deu giu ty le man hinh. */
  input:not([type=hidden]),select,textarea,[contenteditable="true"]{font-size:16px!important}
  button,.btn{min-height:44px}

  #loginScreen,#lockScreen{padding:20px max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));align-items:center}
  .login-box{width:min(100%,390px);padding:26px 22px;border-radius:20px}
  .login-box h1{font-size:22px}.login-box p{font-size:14px}.login-box input{min-height:48px}

  #app{position:relative;height:100%;height:100dvh;min-height:0;padding-bottom:52px;overflow:hidden;display:flex;flex-direction:column;background:var(--bg)}
  .sidebar{display:none}
  .main{height:auto;flex:1 1 auto;min-height:0;width:100%}
  .topbar{padding:calc(12px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 12px max(14px,env(safe-area-inset-left));gap:10px;flex:0 0 auto;background:linear-gradient(180deg,var(--bg) 0%,rgba(15,23,42,.97) 100%)}
  .topbar-title-row{display:flex;align-items:center;justify-content:space-between;width:100%;gap:12px}
  .topbar h1{width:auto;flex:1;font-size:22px;line-height:1.2;letter-spacing:-.35px}
  .topbar-tools{gap:4px}
  .notification-bell{width:40px;height:40px;min-width:40px;border-radius:12px}
  .notification-bell svg{width:21px;height:21px}
  .mobile-filter-toggle{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:36px;padding:6px 10px;background:rgba(148,163,184,.09);border:1px solid rgba(148,163,184,.2);border-radius:11px;color:var(--muted);font-size:12px;font-weight:650;white-space:nowrap}
  .mobile-filter-toggle.is-active{color:var(--accent2);border-color:rgba(58,181,138,.42);background:rgba(58,181,138,.11)}
  .topbar-actions{width:100%;display:flex;flex-wrap:wrap;gap:8px}
  .qsearch{order:-1;min-width:0;width:100%;height:46px;flex:0 0 100%;border-radius:13px;background:rgba(39,53,73,.84);padding-left:13px;box-shadow:inset 0 1px 0 rgba(255,255,255,.025)}
  #fProject{order:1;flex:1 1 calc(62% - 4px);min-width:0;height:44px;border-radius:12px;background:var(--panel)}
  #btnNewTask{order:2;flex:1 1 calc(38% - 4px);padding:7px 8px;border-radius:12px;white-space:nowrap}
  #fUser{order:3;display:none;flex:1 0 100%;min-width:0;height:44px;border-radius:12px;background:var(--panel)}
  .topbar.filters-open #fUser{display:block}
  .topbar.no-task-action #fProject{flex-basis:100%}
  #btnNewProject{display:none!important}
  .content{padding:16px max(14px,env(safe-area-inset-right)) 20px max(14px,env(safe-area-inset-left));min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}

  /* Thanh dieu huong phai co chieu cao CO DINH. Khong cong env(safe-area-inset-bottom): tren mot
     so PWA iOS no tra gia tri lon, lam thanh tab phinh ra thanh mot khoang trong rat xau. */
  .tabbar{position:absolute;left:0;right:0;bottom:0;display:flex;flex:0 0 52px;width:100%;height:52px;min-height:52px;max-height:52px;padding:2px 8px;background:rgba(15,23,42,.94);border-top:1px solid rgba(148,163,184,.18);box-shadow:0 -2px 10px rgba(2,6,23,.14);z-index:40;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}
  .mobile-tab{position:relative;flex:1 1 0;min-width:0;min-height:48px;display:flex;align-items:center;justify-content:center;padding:2px;background:transparent;border:0;border-radius:0;color:var(--muted)}
  .mobile-tab svg{position:relative;z-index:1;width:23px;height:23px;stroke-width:2}
  .mobile-tab-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
  .mobile-tab.active{color:var(--accent2);background:transparent}
  .mobile-tab.active::before{content:'';position:absolute;width:36px;height:32px;border-radius:11px;background:rgba(58,181,138,.12)}
  .mobile-tab.active svg{stroke-width:2.35}
  .mobile-tab:active,.more-item:active,.short-tile:active,.alert-row:active,.task-card:active,.mat-card:active,.q-card:active,.room-card:active{opacity:.84}

  .more-sheet{position:fixed;inset:0;z-index:70;display:flex;align-items:flex-end;background:rgba(2,6,23,.62);opacity:0;pointer-events:none;transition:opacity .2s ease}
  .more-sheet.show{opacity:1;pointer-events:auto}
  .more-panel{width:100%;max-height:min(84dvh,720px);overflow:auto;background:linear-gradient(180deg,#223047 0%,var(--panel) 22%);border:1px solid var(--border);border-bottom:0;border-radius:24px 24px 0 0;padding:7px max(14px,env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));transform:translateY(100%);transition:transform .24s ease;overscroll-behavior:contain}
  .more-sheet.show .more-panel{transform:translateY(0)}
  .sheet-handle{width:38px;height:4px;margin:2px auto 10px;border-radius:99px;background:var(--border)}
  .more-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
  .more-head h2{margin:0;font-size:17px}.more-head .x{border:0;background:transparent;color:var(--muted);font-size:22px;min-width:44px}
  .more-grid{display:block}
  .more-quick-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:18px}
  .more-quick-action:only-child{grid-column:1/-1}
  .more-quick-action{min-height:48px;display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 10px;background:rgba(148,163,184,.08);border:1px solid var(--border);border-radius:13px;color:var(--text);font-size:12.5px;font-weight:650;text-align:center}
  .more-quick-action.primary{background:var(--accent);border-color:var(--accent);color:#fff}
  .more-quick-icon{width:20px;height:20px}.more-quick-icon svg{width:19px;height:19px;stroke-width:2.2}
  .more-section{margin-top:18px}.more-section:first-child{margin-top:0}.more-section h3{margin:0 0 7px;padding:0 3px;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.45px;text-transform:uppercase}
  .more-list{border:1px solid rgba(148,163,184,.15);border-radius:15px;overflow:hidden;background:rgba(15,23,42,.23)}
  .more-item{width:100%;min-height:55px;display:flex;flex-direction:row;align-items:center;gap:10px;padding:8px 11px;background:transparent;border:0;border-bottom:1px solid rgba(148,163,184,.13);border-radius:0;color:var(--text);font-size:13.5px;line-height:1.2;text-align:left}
  .more-item:last-child{border-bottom:0}.more-item.active{color:var(--accent2);background:rgba(58,181,138,.07)}
  .more-icon{flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:rgba(58,181,138,.12);color:var(--accent2)}
  .more-icon svg{width:18px;height:18px;stroke-width:2}.more-label{flex:1;min-width:0}.more-chevron{color:var(--muted);font-size:21px;line-height:1}
  .more-account{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:18px;padding:12px;border:1px solid rgba(148,163,184,.15);border-radius:14px;background:rgba(15,23,42,.25);font-size:13px}
  .more-account b,.more-account span{display:block}.more-account span{margin-top:2px;color:var(--muted);font-size:11.5px}
  .more-account-actions{display:flex;gap:5px;flex-wrap:wrap}.more-account-actions button{min-height:34px;padding:5px 8px;background:transparent;border:1px solid var(--border);border-radius:8px;color:var(--text);font-size:11.5px}

  .toast{bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100% - 32px);max-width:420px;text-align:center;border-radius:12px;z-index:100}
  .overlay{align-items:flex-end;padding:0;background:rgba(2,6,23,.62)}
  .modal{width:100%!important;max-width:none;max-height:calc(92dvh - env(safe-area-inset-top));border-radius:20px 20px 0 0;border-bottom:0}
  .modal-head{padding:14px 16px}.modal-head::before{content:'';position:absolute;left:50%;top:7px;width:38px;height:4px;transform:translateX(-50%);border-radius:99px;background:var(--border)}
  .modal-head{position:relative;padding-top:20px}.modal-head h2{font-size:17px}.modal-head .x{min-width:44px;min-height:40px;font-size:20px}
  .modal-body{padding:14px 16px;overscroll-behavior:contain}.modal-foot{padding:10px 16px calc(10px + env(safe-area-inset-bottom));gap:8px;flex-wrap:wrap}
  .modal-foot .btn{flex:1 1 0;min-width:90px}.modal-foot .btn.danger{flex-basis:100%;margin-right:0!important}
  .frm{grid-template-columns:1fr;gap:12px}.frm .full{grid-column:auto}.frm input,.frm select,.frm textarea{min-height:44px}
  .permission-editor{padding:12px}.permission-editor-head{gap:8px;flex-direction:column}.permission-actions{justify-content:flex-start}.permission-groups{grid-template-columns:1fr;gap:8px}
  .permission-group{padding:9px 10px}.permission-option{min-height:40px;padding:8px 2px;font-size:12.5px!important}.permission-option span{padding-top:2px}
  .frm .permission-mode input[type=checkbox],.frm .permission-option input[type=checkbox]{width:19px;min-width:19px;height:19px}
  .tabs{padding:0 16px}.tabs button{min-height:44px;font-size:14px;padding:10px 5px}
  .project-tabs{overflow-x:auto;scrollbar-width:none}.project-tabs::-webkit-scrollbar{display:none}.project-tabs button{flex:0 0 auto;margin-right:14px}
  .project-history-intro{margin-bottom:12px;font-size:12px}.project-history-entry{gap:9px;padding-bottom:15px}.project-history-entry:not(:last-child)::after{left:6px}.project-history-dot{flex-basis:13px;width:13px;height:13px;margin-top:3px;border-width:2px}.project-history-entry-top{align-items:flex-start;flex-direction:column;gap:1px}.project-history-entry-top time{white-space:normal}.project-history-changes li{padding:8px;font-size:11.5px}

  .notification-overlay{align-items:flex-end;padding:0}
  .notification-panel{width:100%;max-height:calc(82dvh - env(safe-area-inset-top));border-bottom:0;border-radius:22px 22px 0 0;box-shadow:0 -14px 42px rgba(2,6,23,.35)}
  .push-overlay{align-items:flex-end;padding:0}.push-panel{width:100%;margin:0;border-bottom:0;border-radius:22px 22px 0 0;box-shadow:0 -14px 42px rgba(2,6,23,.25)}.push-panel .modal-head{position:relative;padding-top:21px}.push-panel .modal-head::before{content:'';position:absolute;left:50%;top:7px;width:38px;height:4px;transform:translateX(-50%);border-radius:99px;background:var(--border)}.push-panel .modal-foot{padding-bottom:calc(13px + env(safe-area-inset-bottom))}
  .notification-head{position:relative;padding:21px 16px 12px}.notification-head::before{content:'';position:absolute;left:50%;top:7px;width:38px;height:4px;transform:translateX(-50%);border-radius:99px;background:var(--border)}
  .notification-head h2{font-size:17px}.notification-head .x{min-width:40px;min-height:40px;font-size:20px}.notification-read-all{min-height:40px;font-size:12px}
  .notification-item{padding:13px 16px}.notification-item:active{opacity:.84}.notification-list{padding-bottom:calc(8px + env(safe-area-inset-bottom))}

  .dashboard-section + .dashboard-section{margin-top:18px}
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:0}.kpi-card{min-height:100px;padding:12px 12px 12px 14px;border-radius:16px;background:linear-gradient(145deg,rgba(39,53,73,.98),rgba(30,41,59,.98));box-shadow:0 7px 18px rgba(2,6,23,.14)}.kpi-card .num{margin-top:8px;font-size:28px}.kpi-card .lbl{font-size:11px;line-height:1.25}.kpi-card-top{font-size:11px}
  .short-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.short-tile{min-height:88px;padding:9px 5px;font-size:11px;border-radius:14px;background:linear-gradient(145deg,rgba(39,53,73,.98),rgba(30,41,59,.98));box-shadow:0 5px 14px rgba(2,6,23,.1)}.short-tile .ic{width:31px;height:31px}.short-tile .ic svg{width:18px;height:18px}.short-tile>span:last-child{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .alert-row{min-height:60px;padding:10px 12px;border-radius:15px;background:linear-gradient(145deg,rgba(39,53,73,.96),rgba(30,41,59,.96))}.dash-sec{margin:0 0 9px;font-size:11px;letter-spacing:.55px}.alert-ok{border-radius:15px}
  .task-card,.mat-card,.q-card,.floor-box,.diary-card{border-radius:15px;background:linear-gradient(145deg,rgba(39,53,73,.96),rgba(30,41,59,.96));box-shadow:0 5px 14px rgba(2,6,23,.09)}
  .kanban{gap:10px;scroll-snap-type:x mandatory;margin:0 -14px;padding:0 14px}.kb-col{flex-basis:calc(100vw - 52px);scroll-snap-align:start;padding:10px}.kb-card{padding:11px 12px;font-size:13px}
  .gt-wrap{margin:0 -14px;border-radius:0;border-left:0;border-right:0}.gt-body{max-height:none}
  .mat-toolbar{align-items:stretch}.mat-toolbar .btn{width:100%}.mat-card,.q-card,.floor-box,.diary-card{padding:12px}.room-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.ph-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .table-wrap{margin:0 -14px;padding:0 14px}.table-hint{display:block;margin:-3px 0 8px;color:var(--muted);font-size:12px;text-align:right}
  table{font-size:12px;min-width:620px}table th,table td{padding:9px 8px}
  .po-item-row,.q-line,.sub-row{align-items:stretch;flex-wrap:wrap}.po-item-row input,.q-line input{min-height:40px}.po-item-row .btn,.q-line .btn,.sub-row .btn{min-height:40px}
  .lightbox img,.lightbox video{max-width:100vw;max-height:82dvh}.lb-nav{padding:12px}.lb-nav.prev{left:5px}.lb-nav.next{right:5px}
}

/* iOS PWA + viewport-fit=cover: WebKit co the cho 100dvh ngan hon man hinh thuc, de lai mot
   khoang trong duoi app. Trong che do app da cai, 100vh moi la viewport lon dung de khung app
   cham sat canh duoi. Class duoc JS them de ho tro ca cac ban iOS cu khong nhan display-mode. */
@media all and (display-mode:standalone) and (max-width:760px){
  html,body,#app{height:100vh;min-height:100vh}
}
html.ios-standalone,html.ios-standalone body,html.ios-standalone #app{height:100vh;min-height:100vh}

@media (hover:hover) and (pointer:fine){
  .mobile-tab:active,.more-item:active,.short-tile:active,.alert-row:active,.task-card:active,.mat-card:active,.q-card:active,.room-card:active{opacity:1}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}

/* ===== IINSTU UI 2.0 — LỚP HOÀN THIỆN GIAO DIỆN =====
   Giữ nguyên các class và chức năng hiện có; phần này chỉ chuẩn hoá trải nghiệm
   thành một giao diện quản lý công trình hiện đại, dễ đọc trên cả máy tính và iPhone. */
:root{
  --bg:#0b1220;
  --panel:#111c2e;
  --panel2:#17263b;
  --border:rgba(148,163,184,.18);
  --text:#f1f5f9;
  --muted:#94a3b8;
  --accent:#138a68;
  --accent2:#55d6aa;
  --green:#4ade80;
  --red:#fb7185;
  --amber:#fbbf24;
  --shadow-sm:0 6px 18px rgba(2,6,23,.18);
  --shadow-md:0 16px 38px rgba(2,6,23,.28);
}

body{
  font-size:14px;
  line-height:1.45;
  letter-spacing:.005em;
  background:
    radial-gradient(circle at 84% -10%,rgba(19,138,104,.16),transparent 31rem),
    radial-gradient(circle at -8% 88%,rgba(37,99,235,.10),transparent 28rem),
    var(--bg);
}
button,input,select,textarea{transition:border-color .18s ease,background-color .18s ease,box-shadow .18s ease,transform .18s ease}
input,select,textarea{
  min-height:38px;
  border-color:rgba(148,163,184,.22);
  border-radius:10px;
  background:rgba(23,38,59,.92);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
input::placeholder,textarea::placeholder{color:#718198}
input:hover,select:hover,textarea:hover{border-color:rgba(148,163,184,.38)}
input:focus,select:focus,textarea:focus{border-color:var(--accent2);box-shadow:0 0 0 3px rgba(85,214,170,.13);outline:0}
.btn{
  min-height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-color:rgba(148,163,184,.24);
  border-radius:10px;
  font-weight:650;
  letter-spacing:.005em;
  background:rgba(23,38,59,.9);
}
.btn:hover{border-color:rgba(148,163,184,.48);background:#20324a;transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn.primary{background:linear-gradient(135deg,#109573,#13795f);border-color:#159576;box-shadow:0 7px 16px rgba(16,149,115,.18)}
.btn.primary:hover{background:linear-gradient(135deg,#17a680,#138b6c);border-color:#42caa1;box-shadow:0 9px 20px rgba(16,149,115,.27)}
.btn.ghost{background:transparent}

/* Khung ứng dụng trên màn hình lớn */
.sidebar{
  width:244px;
  flex-basis:244px;
  padding:19px 11px 13px;
  background:linear-gradient(180deg,rgba(17,28,46,.98),rgba(12,22,36,.98));
  border-right-color:rgba(148,163,184,.14);
}
.sidebar h2{
  display:flex;
  align-items:center;
  min-height:39px;
  padding:0 11px 15px;
  font-size:17px;
  letter-spacing:.01em;
}
.nav{padding:2px 0;overflow-y:auto}
.nav button{
  min-height:37px;
  margin-bottom:2px;
  padding:8px 10px;
  border-radius:10px;
  color:#bdc9d9;
  font-size:13px;
  font-weight:560;
}
.nav button:hover{background:rgba(148,163,184,.09);color:var(--text)}
.nav button.active{background:linear-gradient(90deg,rgba(19,138,104,.95),rgba(17,112,91,.95));box-shadow:0 7px 15px rgba(4,27,27,.17)}
.foot-user{margin:12px 2px 0;padding:13px 10px 4px;border-top-color:rgba(148,163,184,.13);color:#cbd5e1}
.foot-user a{color:var(--accent2);font-weight:650}
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  padding:15px 24px 14px;
  gap:14px;
  background:rgba(11,18,32,.86);
  border-bottom-color:rgba(148,163,184,.13);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
}
.topbar h1{font-size:20px;font-weight:760;letter-spacing:-.025em}
.topbar-actions{display:flex;align-items:center;gap:8px;flex:1;justify-content:flex-end}
.qsearch{min-height:38px;border-radius:11px;min-width:250px}
#fProject,#fUser{min-height:38px;border-radius:10px}
.notification-bell{border-radius:11px}.notification-bell:hover,.notification-bell.has-unread{box-shadow:0 0 0 1px rgba(85,214,170,.14)}
.content{padding:25px 26px 32px;max-width:1540px;width:100%;margin:0 auto}

/* Khối thông tin: cùng độ bo góc, viền và chiều sâu */
.kpi-card,.task-card,.mat-card,.q-card,.floor-box,.diary-card,.kb-col,.gt-wrap,.node,.discussion-message{
  border-color:rgba(148,163,184,.17);
  box-shadow:var(--shadow-sm);
}
.kpi-card{border-radius:16px;min-height:116px;padding:16px;background:linear-gradient(145deg,rgba(27,43,65,.98),rgba(17,28,46,.98))}
.kpi-card:hover{border-color:rgba(85,214,170,.42);transform:translateY(-2px);box-shadow:var(--shadow-md)}
.kpi-card::before{width:4px}.kpi-card .num{font-size:30px;letter-spacing:-.035em}
.kpi-card-top{font-size:12px}.kpi-card-label{font-weight:700}.kpi-card .lbl{font-size:11.5px}
.dash-sec{margin-top:26px;font-size:11px;font-weight:750;letter-spacing:.09em}
.alert-row{border-color:rgba(148,163,184,.17);box-shadow:var(--shadow-sm);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.alert-row:hover{border-color:rgba(85,214,170,.42);transform:translateY(-1px);box-shadow:var(--shadow-md)}
.short-tile{border-color:rgba(148,163,184,.17);box-shadow:var(--shadow-sm);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.short-tile:hover{border-color:rgba(85,214,170,.42);transform:translateY(-2px);box-shadow:var(--shadow-md)}
.short-tile .ic{background:rgba(85,214,170,.13);color:var(--accent2)}
.task-card,.mat-card,.q-card,.floor-box,.diary-card{border-radius:14px}
.task-card:hover,.mat-card:hover,.q-card:hover,.room-card:hover,.node:hover{border-color:rgba(85,214,170,.62);box-shadow:var(--shadow-sm)}
.task-card{padding:14px 15px}.task-card .name{font-size:14px}.task-card .meta{line-height:1.5}
.kb-col{border-radius:14px;padding:12px;background:rgba(17,28,46,.88)}
.kb-card{border-radius:10px;padding:10px 11px;background:rgba(23,38,59,.92)}
.badge,.mat-badge{font-weight:700;letter-spacing:.015em}

/* Cửa sổ, bảng và phản hồi */
.overlay{background:rgba(2,6,23,.72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
.modal{border-color:rgba(148,163,184,.2);border-radius:18px;box-shadow:0 28px 80px rgba(0,0,0,.42);background:linear-gradient(160deg,#17263b,#111c2e)}
.modal-head{padding:17px 18px}.modal-head h2{font-size:16px;font-weight:760}.modal-body{padding:17px 18px}.modal-foot{padding:13px 18px}
.tabs button{font-weight:650}.tabs button.active{border-color:var(--accent2);color:#fff}
.notification-panel{border-color:rgba(148,163,184,.2);background:linear-gradient(160deg,#17263b,#111c2e);box-shadow:0 24px 70px rgba(0,0,0,.36)}
.notification-item:hover{background:rgba(85,214,170,.065)}
table th{font-weight:700;letter-spacing:.025em}table tr:hover td{background:rgba(148,163,184,.035)}
.toast{border-radius:12px;box-shadow:var(--shadow-md)}

/* Đăng nhập: nhận diện thương hiệu rõ ràng hơn */
#loginScreen,#lockScreen{background:radial-gradient(circle at 78% 13%,rgba(19,138,104,.28),transparent 29rem),radial-gradient(circle at 12% 88%,rgba(37,99,235,.16),transparent 28rem),var(--bg)}
.login-box{width:370px;padding:32px;border-radius:22px;border-color:rgba(148,163,184,.22);box-shadow:0 26px 80px rgba(2,6,23,.42);background:linear-gradient(160deg,rgba(27,43,65,.98),rgba(17,28,46,.98))}
.login-box h1{font-size:25px;letter-spacing:-.04em}.login-box h1::before{content:'◆';display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;margin-right:9px;border-radius:9px;background:linear-gradient(135deg,#18a77f,#126d58);color:#e8fff7;font-size:13px;vertical-align:middle;box-shadow:0 6px 14px rgba(16,149,115,.25)}
.login-box p{font-size:13.5px}.login-box input{min-height:43px;border-radius:11px}.login-box .btn{min-height:43px;border-radius:11px}.login-note{line-height:1.65}

@media (max-width:760px){
  .topbar{box-shadow:0 8px 24px rgba(2,6,23,.12)}
  .content{padding-top:17px}
  /* Dock cong cu: gon, noi tren nen app va dua nut Them ve chinh giua. */
  /* Vùng dành cho dock = chiều cao dock + khoảng cách an toàn của Home Indicator. */
  #app{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
  #tabbar{
    left:12px;right:12px;bottom:12px;bottom:max(12px,env(safe-area-inset-bottom));width:auto;
    border:1px solid rgba(148,163,184,.26);border-radius:18px;
    background:linear-gradient(135deg,rgba(29,46,68,.96),rgba(14,24,39,.96));
    background-clip:padding-box;overflow:hidden;isolation:isolate;
    -webkit-transform:translateZ(0);transform:translateZ(0);
    box-shadow:0 8px 18px rgba(2,6,23,.28),inset 0 1px 0 rgba(255,255,255,.06);
  }
  #tabbar .mobile-tab{min-height:46px;border-radius:13px;color:#aab8ca;transition:color .18s ease,background .18s ease,transform .18s ease}
  #tabbar .mobile-tab svg{width:21px;height:21px}
  #tabbar .mobile-tab.active{color:#ecfff8}
  #tabbar .mobile-tab.active::before{width:38px;height:36px;border-radius:12px;background:rgba(85,214,170,.17);box-shadow:inset 0 0 0 1px rgba(85,214,170,.08)}
  #tabbar .mobile-tab:active{transform:translateY(1px)}
  /* HTML giu nguyen thu tu de an toan, chi doi vi tri trinh bay bang flex. */
  #tabbar .mobile-tab:nth-child(1){order:1}#tabbar .mobile-tab:nth-child(2){order:2}
  #tabbar .more-tab{position:relative;z-index:1;order:3;margin:0 2px;color:#fff}
  #tabbar .mobile-tab:nth-child(3){order:4}#tabbar .mobile-tab:nth-child(4){order:5}
  #tabbar .more-tab::before{width:39px;height:39px;border-radius:14px;background:linear-gradient(135deg,#18a77f,#137b63);box-shadow:0 6px 13px rgba(16,149,115,.3)}
  #tabbar .more-tab svg{width:20px;height:20px;stroke-width:2.4}
  #tabbar .more-tab.active::before{background:linear-gradient(135deg,#22bc90,#158167);box-shadow:0 7px 16px rgba(16,149,115,.38)}
  .mobile-tab.active::before{background:rgba(85,214,170,.14)}
  .more-panel{background:linear-gradient(180deg,#20334b 0%,#111c2e 24%)}
  .kpi-card,.short-tile,.task-card,.mat-card,.q-card,.floor-box,.diary-card{box-shadow:0 8px 20px rgba(2,6,23,.16)}
  .kpi-card{border-radius:17px}.task-card,.mat-card,.q-card,.floor-box,.diary-card{border-radius:16px}
  .login-box{padding:28px 23px;border-radius:23px}
}

/* ===== IIN LIGHT — giao diện sáng, dễ đọc trên điện thoại ===== */
:root{
  --bg:#f6faf6;
  --panel:#ffffff;
  --panel2:#eff7f1;
  --border:#dbe8de;
  --text:#193c2d;
  --muted:#64786c;
  /* Mau chu co do tuong phan du cho chu nho tren nen trang; xanh la van la nhan dien IIN. */
  --accent:#187b57;
  --accent2:#1e865f;
  --green:#177a54;
  --red:#b83d4e;
  --amber:#895900;
  --shadow-sm:0 7px 20px rgba(21,64,44,.075);
  --shadow-md:0 15px 34px rgba(21,64,44,.13);
}

body{
  color:var(--text);
  background:
    radial-gradient(circle at 86% -12%,rgba(48,157,112,.12),transparent 30rem),
    radial-gradient(circle at -8% 94%,rgba(31,138,99,.075),transparent 28rem),
    var(--bg);
}
input,select,textarea{
  color:var(--text);
  background:#fff;
  border-color:#d5e4d8;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
input::placeholder,textarea::placeholder{color:#91a197}
input:hover,select:hover,textarea:hover{border-color:#b9d2bf}
input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(31,138,99,.13)}
.btn{color:var(--text);background:#fff;border-color:#d3e1d6;box-shadow:0 1px 2px rgba(21,64,44,.03)}
.btn:hover{background:#f0f8f2;border-color:#a8cbb1;box-shadow:0 4px 10px rgba(21,64,44,.08)}
.btn.primary{background:linear-gradient(135deg,#239b6d,#1b7b59);border-color:#1f8a63;box-shadow:0 7px 16px rgba(31,138,99,.18)}
.btn.primary:hover{background:linear-gradient(135deg,#2ca777,#176e50);border-color:#197c58;box-shadow:0 9px 20px rgba(31,138,99,.24)}
.btn.ghost{background:transparent}

/* Nhận diện IIN: ba chữ luôn rõ, dùng cùng một hình thức ở đăng nhập, menu và điện thoại. */
.brand-wordmark{display:inline-flex;align-items:center;margin:0}
.brand-mark,.mobile-brand{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:56px;height:31px;padding:0 10px 0 12px;
  border-radius:9px;background:linear-gradient(135deg,#2aa476,#1d805d);
  box-shadow:0 6px 14px rgba(31,138,99,.20);color:#fff;
  font-size:17px;font-weight:850;letter-spacing:.11em;line-height:1;
}
.login-box h1::before{content:none}
.login-box .brand-wordmark{margin:0 0 7px}.login-box h1{font-size:0;letter-spacing:0}
.login-box{background:#fff;border-color:#d9e7dc;box-shadow:0 22px 60px rgba(21,64,44,.14)}
#loginScreen,#lockScreen{background:radial-gradient(circle at 79% 13%,rgba(31,138,99,.16),transparent 29rem),radial-gradient(circle at 10% 88%,rgba(108,180,125,.13),transparent 28rem),var(--bg)}
.login-box p{color:var(--muted)}
.login-note{border-top-color:#e3ede5}

/* Khung lớn: nền trắng sạch, xanh lá chỉ dành cho điểm cần hành động. */
.sidebar{background:linear-gradient(180deg,#ffffff,#f6fbf7);border-right-color:#dce9df;box-shadow:4px 0 16px rgba(21,64,44,.035)}
.sidebar h2{padding-bottom:16px}.nav button{color:#597064}.nav button:hover{background:#eff8f1;color:var(--accent)}
.nav button.active{background:#e2f3e7;color:#176c4e;box-shadow:inset 3px 0 0 var(--accent);font-weight:720}
.foot-user{border-top-color:#e1ece3;color:#425a4c}.foot-user a{color:var(--accent)}
.topbar{background:rgba(250,253,250,.90);border-bottom-color:#dfe9e1;box-shadow:0 4px 14px rgba(21,64,44,.035)}
.topbar h1{color:var(--text)}.notification-bell{color:#6b8274}.notification-bell:hover,.notification-bell.has-unread{color:var(--accent);background:#eaf6ed;border-color:#cde5d3}
.qsearch{background:#fff}

/* Thẻ thông tin, bảng và các khu vực thao tác. */
.kpi-card,.task-card,.mat-card,.q-card,.floor-box,.diary-card,.kb-col,.gt-wrap,.node,.discussion-message{border-color:#dce8df;box-shadow:var(--shadow-sm)}
.kpi-card{background:linear-gradient(145deg,#fff,#f8fcf8)}
.kpi-card:hover,.alert-row:hover,.short-tile:hover{border-color:#9dceb0;box-shadow:var(--shadow-md)}
.alert-row,.short-tile,.task-card,.mat-card,.q-card,.floor-box,.diary-card{background:#fff;border-color:#dce8df}
.short-tile .ic{background:#e3f4e8;color:var(--accent)}
.task-card:hover,.mat-card:hover,.q-card:hover,.room-card:hover,.node:hover{border-color:#92c8a5;box-shadow:var(--shadow-sm)}
.kb-col{background:#f7fbf7}.kb-card{background:#fff;border-color:#dce8df}
.room-card{background:#f7fbf7;border-color:#dce8df}.room-card:hover{background:#fff}
.project-card{background:#fff;border-color:#dce8df}.project-card:hover{border-color:#92c8a5;box-shadow:var(--shadow-md)}.project-stats{border-top-color:#e2ece4}.project-stats span{background:#f4faf5}
.alert-ok{background:#f3faf4;border-color:#dce9df}.profit-note{background:#fff8e7;border-color:#efd59a}
.discussion-message.own{background:#e8f6ed;border-color:#b9dfc4}.discussion-author{color:#187451}
table th{color:#64786c;border-bottom-color:#dce8df}table td{border-bottom-color:#e4ede6}table tr:hover td{background:#f6fbf7}

/* Cửa sổ và phản hồi giữ độ tương phản tốt trên nền sáng. */
.overlay{background:rgba(21,56,39,.30);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
.modal{color:var(--text);background:#fff;border-color:#d9e6dc;box-shadow:0 24px 65px rgba(21,64,44,.20)}
.modal-head,.modal-foot{border-color:#e0ebe2}.tabs button.active{color:var(--accent);border-color:var(--accent)}
.totp-status,.totp-step,.totp-code,.totp-setup-key{background:#f6fbf7;border-color:#dce9df}.totp-uri{background:#fff;border-color:#dce9df}
.totp-danger-note{background:#fff3f3;color:#785151}.totp-ack{background:#fff8e7;color:#665934}
.notification-panel{background:#fff;border-color:#d9e6dc;box-shadow:0 20px 54px rgba(21,64,44,.18)}
.push-status-card{background:#f4faf5;border-color:#dce9df}.push-status-card.success{background:#eaf8ee;border-color:#b9dfc4}.push-status-card.warn{background:#fff8e7;border-color:#efd59a}.push-status-icon{background:var(--accent)}
.notification-item:hover{background:#f1f9f3}.notification-item.unread{background:#edf8f0}.notification-item-icon{background:#edf4ef}
.permission-editor{background:#f5faf6;border-color:#dce9df}.permission-group{background:#fff;border-color:#dce8df}
.toast{background:#173c2d;border-color:#173c2d;color:#fff}

.mobile-brand{display:none}
@media (max-width:760px){
  html,body,#app{background:var(--bg)}
  .topbar{background:linear-gradient(180deg,#fbfefb 0%,rgba(246,250,246,.97) 100%);box-shadow:0 7px 20px rgba(21,64,44,.055)}
  .topbar-title-row{gap:8px}.mobile-brand{display:inline-flex;min-width:44px;height:27px;padding:0 7px 0 9px;border-radius:8px;font-size:13px;letter-spacing:.10em}
  .topbar h1{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
  .qsearch,#fProject,#fUser{background:#fff;border-color:#d5e4d8}
  .mobile-filter-toggle{background:#fff;border-color:#d5e4d8;color:#557064}
  .mobile-filter-toggle.is-active{background:#e8f6ec;border-color:#9cccae;color:#177151}

  #tabbar{border-color:#d7e6da;background:linear-gradient(135deg,rgba(255,255,255,.98),rgba(241,248,242,.98));box-shadow:0 8px 18px rgba(21,64,44,.14),inset 0 1px 0 rgba(255,255,255,.94)}
  #tabbar .mobile-tab{color:#6a8073}.mobile-tab.active{color:var(--accent)}
  #tabbar .mobile-tab.active::before{background:#e2f4e8;box-shadow:inset 0 0 0 1px #d1e9d8}
  #tabbar .more-tab{color:#fff}.mobile-tab.active.more-tab{color:#fff}
  #tabbar .more-tab::before{background:linear-gradient(135deg,#2aa476,#1d805d);box-shadow:0 6px 13px rgba(31,138,99,.24)}
  #tabbar .more-tab.active::before{background:linear-gradient(135deg,#24966b,#186e50)}
  .more-panel{background:linear-gradient(180deg,#f7fcf8 0%,#fff 24%);border-color:#d8e6db;box-shadow:0 -14px 42px rgba(21,64,44,.12)}
  .more-list{background:#fff;border-color:#dce8df}.more-item{color:var(--text);border-bottom-color:#e5eee6}.more-item.active{color:var(--accent);background:#edf8f0}
  .more-icon{background:#e4f4e9;color:var(--accent)}.more-account{background:#f5faf6;border-color:#dce8df}
  .more-account-actions button{background:#fff;border-color:#d5e4d8;color:var(--text)}
  .kpi-card,.short-tile,.task-card,.mat-card,.q-card,.floor-box,.diary-card,.project-card{background:#fff;box-shadow:0 6px 17px rgba(21,64,44,.07)}
  .alert-row{background:#fff}.login-box{background:#fff}
  .project-toolbar{align-items:stretch}.project-toolbar .btn{width:100%}.project-list{grid-template-columns:1fr;gap:10px}.project-card{padding:13px;border-radius:16px}.project-card-actions .btn{flex:1 1 auto}.project-description{min-height:0}
  .totp-code-grid{grid-template-columns:1fr}.totp-modal{max-height:92dvh}
}

@media (max-width:360px){
  .mobile-filter-toggle{width:40px;padding:0;font-size:0}.mobile-filter-toggle span{font-size:16px}
}

/* Tai khoan duoc cap mat khau tam chi co the dat mat khau rieng; khong dong modal bang nut X/Huy. */
#pwOverlay.password-required .password-close,
#pwOverlay.password-required .password-cancel{display:none}

/* Chuyen sang ban PWA moi: dong/ngan bottom sheet ngay, NHUNG giu dock dung yen. Neu iOS giu lai
   mot frame truoc khi tai lai, nguoi dung van thay dock on dinh thay vi mot vung bi cat/mat. */
@media (max-width:760px){
  html.iin-updating #tabbar{opacity:1;pointer-events:none;transition:none}
  html.iin-updating .more-sheet,html.iin-updating .more-panel{display:none!important;opacity:0;pointer-events:none;transition:none}
}

/* ===== IIN MOBILE DOCK v44 =====
   Safari iOS co the tra safe-area-inset-bottom = 0 o frame dau sau cap nhat PWA. Dock phai neo
   truc tiep vao viewport va co khoang du phong rieng, khong phu thuoc vao chieu cao #app luc do. */
@media (max-width:760px){
  :root{--iin-dock-bottom:max(14px,env(safe-area-inset-bottom))}
  #app{padding-bottom:calc(64px + var(--iin-dock-bottom))}
  #tabbar{
    position:fixed;left:12px;right:12px;bottom:var(--iin-dock-bottom);z-index:40;
    width:auto;height:52px;min-height:52px;max-height:52px;padding:2px 8px;
    border:1px solid #c8ddce;border-radius:18px;background:#fff;background-clip:padding-box;
    overflow:visible;isolation:auto;-webkit-transform:none;transform:none;will-change:auto;
    -webkit-backdrop-filter:none;backdrop-filter:none;
    box-shadow:0 8px 18px rgba(21,64,44,.16),inset 0 1px 0 #fff;
  }
  #tabbar .mobile-tab{min-height:46px;color:#355c48;transition:color .18s ease,background .18s ease,transform .18s ease}
  #tabbar .mobile-tab svg{width:22px;height:22px;stroke-width:2.25}
  #tabbar .mobile-tab.active:not(.more-tab){color:#0f6b49}
  #tabbar .mobile-tab.active:not(.more-tab)::before{background:#ccebd8;box-shadow:inset 0 0 0 1px #aad9ba}
  #tabbar .mobile-tab.active:not(.more-tab) svg{stroke-width:2.5}
  #tabbar .more-tab,#tabbar .more-tab.active{color:#fff}
  /* Nut giua phai tu tao pseudo-element ca khi CHUA duoc chon. Truoc do content chi ton tai o
     .mobile-tab.active::before, nen nut "Them" bien thanh mot khoang trong o man Tong quan. */
  #tabbar .more-tab::before{content:'';position:absolute;left:50%;top:50%;width:39px;height:39px;transform:translate(-50%,-50%);border-radius:14px;background:linear-gradient(135deg,#0b6b49,#09553b);box-shadow:0 6px 13px rgba(10,100,69,.28)}
  #tabbar .more-tab.active::before{background:linear-gradient(135deg,#0f7a54,#075039);box-shadow:0 7px 16px rgba(10,100,69,.34)}
}
@media (max-width:760px) and (orientation:portrait){
  html.ios-device{--iin-dock-bottom:max(34px,env(safe-area-inset-bottom))}
}

/* ===== Trang thai he thong dung chung =====
   Khong de man hinh trong luc cho mang. Cung mot mau hinh dung cho lan mo dau, tai tab moi va loi
   dong bo giup app co cam giac nhat quan nhu ung dung native. */
.app-loading,.app-load-error{
  width:min(100%,560px);min-height:230px;margin:7vh auto 0;padding:28px 24px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  border:1px solid var(--border);border-radius:20px;background:var(--panel);box-shadow:var(--shadow-sm);
}
.app-loading{gap:11px;color:var(--text)}
.app-loading-brand{
  display:inline-flex;align-items:center;justify-content:center;min-width:54px;height:32px;padding:0 10px 0 12px;
  border-radius:10px;background:linear-gradient(135deg,#2aa476,#1d805d);box-shadow:0 7px 16px rgba(31,138,99,.20);
  color:#fff;font-size:16px;font-weight:850;letter-spacing:.11em;
}
.app-loading b,.app-load-error b{display:block;font-size:15px;line-height:1.4}
.app-loading span{display:block;margin-top:3px;color:var(--muted);font-size:12.5px}
.app-skeleton-lines{width:min(100%,310px);display:flex;flex-direction:column;gap:8px;margin-top:7px}
.app-skeleton-lines i{height:10px;border-radius:999px;background:linear-gradient(90deg,#edf5ef 20%,#dceee1 42%,#edf5ef 64%);background-size:220% 100%;animation:iin-shimmer 1.35s ease-in-out infinite}
.app-skeleton-lines i:nth-child(2){width:82%;align-self:center}.app-skeleton-lines i:nth-child(3){width:62%;align-self:center}
@keyframes iin-shimmer{to{background-position:-220% 0}}
.app-load-error{min-height:250px;color:var(--text)}
.app-load-error .big{margin-bottom:7px;font-size:30px}.app-load-error p{max-width:360px;margin:7px 0 16px;color:var(--muted);font-size:12.5px;line-height:1.55}
.network-status{
  position:fixed;z-index:110;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));max-width:calc(100vw - 32px);
  transform:translate(-50%,18px);padding:9px 13px;border:1px solid #e3c177;border-radius:999px;
  background:#fff8e7;color:#754f00;box-shadow:0 8px 22px rgba(91,67,13,.15);font-size:12.5px;font-weight:650;
  opacity:0;pointer-events:none;transition:opacity .2s ease,transform .2s ease;
}
.network-status.show{opacity:1;transform:translate(-50%,0)}
@media (max-width:760px){
  /* 16px tranh Safari tu phong to form khi cham vao o nhap, nhung van cho nguoi dung tu chu dong zoom. */
  input,select,textarea{font-size:16px}
  .app-loading,.app-load-error{min-height:205px;margin:14px 0 0;padding:24px 18px;border-radius:18px}
  .network-status{bottom:calc(78px + var(--iin-dock-bottom,env(safe-area-inset-bottom)));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media (prefers-reduced-motion:reduce){.app-skeleton-lines i{animation:none}.network-status{transition:none}}

/* ===== CHON NHAN SU v55 =====
   Phan cong viec va thanh vien du an dung CHUNG mot mau hinh: danh sach co tim kiem, trang thai
   chon lon va tom tat de tranh chip chen nhau tren iPhone nho. */
:is(.people-picker--assignees,.people-picker--members){
  display:block;max-height:none;padding:12px;border-color:#cfe2d4;border-radius:16px;
  background:linear-gradient(145deg,#fbfefb,#f3f9f4);box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
.people-picker--assignees .pp-picker-head,.people-picker--members .pp-picker-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 9px}
.people-picker--assignees .pp-picker-head b,.people-picker--members .pp-picker-head b{display:block;color:var(--text);font-size:13px;font-weight:780;line-height:1.25}
.people-picker--assignees .pp-picker-head span,.people-picker--members .pp-picker-head span{display:block;margin-top:2px;color:var(--muted);font-size:11.5px;line-height:1.3}
.people-picker--assignees .pp-clear,.people-picker--members .pp-clear{min-height:30px;padding:5px 8px;border:1px solid #c8ddce;border-radius:8px;background:#fff;color:var(--accent);font:inherit;font-size:11.5px;font-weight:720;white-space:nowrap;cursor:pointer}
.people-picker--assignees .pp-clear:hover:not(:disabled),.people-picker--members .pp-clear:hover:not(:disabled){border-color:#9cc7a9;background:#eff8f1}
.people-picker--assignees .pp-clear:disabled,.people-picker--members .pp-clear:disabled{color:#9cad9f;border-color:#dde9df;background:#f7faf7;cursor:default}
.people-picker--assignees .pp-selected-summary,.people-picker--members .pp-selected-summary{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-height:31px;margin:0 0 9px}
.people-picker--assignees .pp-selected-empty,.people-picker--members .pp-selected-empty{color:#708176;font-size:11.5px;line-height:1.4}
.people-picker--assignees .pp-selected-chip,.people-picker--members .pp-selected-chip{display:inline-flex;align-items:center;gap:6px;min-height:30px;max-width:100%;padding:3px 7px 3px 4px;border:1px solid #a9d6b7;border-radius:999px;background:#e8f6ed;color:#176948;font:inherit;font-size:11.5px;font-weight:700;line-height:1;cursor:pointer}
.people-picker--assignees .pp-selected-chip:hover,.people-picker--members .pp-selected-chip:hover{border-color:#67ad7f;background:#dcf1e3}
.people-picker--assignees .pp-chip-avatar,.people-picker--members .pp-chip-avatar{flex:0 0 22px;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;font-size:9px;font-weight:800;letter-spacing:.01em}
.people-picker--assignees .pp-chip-remove,.people-picker--members .pp-chip-remove{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border-radius:50%;background:rgba(23,105,72,.12);font-size:14px;font-weight:700;line-height:1}
.people-picker--assignees .pp-search,.people-picker--members .pp-search{display:flex;align-items:center;gap:8px;min-height:40px;margin:0 0 9px;padding:0 11px;border:1px solid #d4e4d8;border-radius:11px;background:#fff;color:#6c8274}
.people-picker--assignees .pp-search:focus-within,.people-picker--members .pp-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(31,138,99,.12)}
.people-picker--assignees .pp-search>span,.people-picker--members .pp-search>span{font-size:18px;line-height:1;transform:rotate(-15deg)}
.people-picker--assignees .pp-search input,.people-picker--members .pp-search input{flex:1;width:auto;min-width:0;height:38px;padding:0;border:0!important;outline:0;background:transparent!important;box-shadow:none!important;font-size:13px}
.people-picker--assignees .pp-list,.people-picker--members .pp-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:236px;overflow:auto;overscroll-behavior:contain;padding:1px}
.people-picker--assignees .pp-item,.people-picker--members .pp-item{width:100%;min-width:0;min-height:58px;display:flex;gap:9px;padding:8px 9px;border:1.5px solid #d6e5d9;border-radius:13px;background:#fff;box-shadow:0 1px 1px rgba(21,64,44,.025)}
.people-picker--assignees .pp-item:hover,.people-picker--members .pp-item:hover{border-color:#91c5a1;background:#fbfefb}
.people-picker--assignees .pp-item.on,.people-picker--members .pp-item.on{border-color:#3c9b69;background:#ecf8f0;box-shadow:0 0 0 1px rgba(31,138,99,.14) inset}
.people-picker--assignees .pp-item:focus-within,.people-picker--members .pp-item:focus-within{outline:3px solid rgba(31,138,99,.16);outline-offset:1px}
.people-picker--assignees .pp-avatar,.people-picker--members .pp-avatar{width:38px;height:38px;font-size:12px}
.people-picker--assignees .pp-choice-copy,.people-picker--members .pp-choice-copy{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center;gap:2px}
.people-picker--assignees .pp-name,.people-picker--members .pp-name{max-width:none;color:var(--text);font-size:12.5px;font-weight:700;line-height:1.25}
.people-picker--assignees .pp-role,.people-picker--members .pp-role{overflow:hidden;color:var(--muted);font-size:10.5px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
.people-picker--assignees .pp-choice-state,.people-picker--members .pp-choice-state{flex:0 0 22px;width:22px;height:22px;align-self:center;display:inline-flex;align-items:center;justify-content:center;border:1.5px solid #c9ddce;border-radius:50%;background:#fff;color:transparent;font-size:13px;font-weight:850;line-height:1}
.people-picker--assignees .pp-item.on .pp-choice-state,.people-picker--members .pp-item.on .pp-choice-state{border-color:var(--accent);background:var(--accent);color:#fff;box-shadow:0 2px 5px rgba(24,123,87,.20)}
.people-picker--assignees .pp-search-empty,.people-picker--members .pp-search-empty{padding:10px 4px 2px;color:var(--muted);font-size:11.5px;text-align:center}
.people-picker--assignees .pp-list .pp-empty,.people-picker--members .pp-list .pp-empty{grid-column:1/-1;padding:13px 2px;text-align:center}
@media (max-width:760px){.people-picker--assignees .pp-search input,.people-picker--members .pp-search input{font-size:16px}}
@media (max-width:540px){
  :is(.people-picker--assignees,.people-picker--members){padding:11px}
  .people-picker--assignees .pp-list,.people-picker--members .pp-list{grid-template-columns:1fr;max-height:252px}
  .people-picker--assignees .pp-item,.people-picker--members .pp-item{min-height:60px;padding:10px}
  .people-picker--assignees .pp-name,.people-picker--members .pp-name{font-size:13px}
}

/* iOS thinh thoang tra safe-area-inset-top = 0 khi mo lai PWA, xoay may hoac vua cap nhat.
   Giu muc toi thieu 56px de tieu de khong chui vao Dynamic Island trong frame do. */
@media (max-width:760px){html.ios-device .topbar{padding-top:max(56px,calc(12px + env(safe-area-inset-top)))}}

/* ===== CONG VIEC: MO TA, NGUOI PHU TRACH VA TEP BAN GIAO v57 ===== */
.task-card-description{display:-webkit-box;margin:9px 0 0;color:var(--text);font-size:12.5px;line-height:1.52;white-space:pre-line;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}
.task-description-input{min-height:126px;resize:vertical;line-height:1.55}
.task-description-view{margin:0 0 14px;padding:14px 15px;border:1px solid #cfe3d5;border-left:4px solid var(--accent);border-radius:14px;background:linear-gradient(145deg,#fbfefb,#f1f8f3);box-shadow:0 4px 12px rgba(21,64,44,.045)}
.task-description-view[hidden]{display:none}.task-description-view-head{margin-bottom:7px;color:var(--accent);font-size:11px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.task-description-view-text{color:var(--text);font-size:14px;font-weight:560;line-height:1.65;overflow-wrap:anywhere;white-space:pre-wrap}
.changeorder-assignee-line{margin-top:5px;color:#3e6752;font-size:11.5px;font-weight:680;line-height:1.35}.changeorder-card-description{display:-webkit-box;margin:10px 0 0;color:var(--text);font-size:12.5px;line-height:1.5;white-space:pre-line;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}
.field-help{margin-top:5px;color:var(--muted);font-size:11.5px;line-height:1.45}

/* Phat sinh dung lai mau people picker cua giao viec: tim kiem, avatar, tom tat nguoi da chon. */
.people-picker--changeorder{display:block;max-height:none;padding:12px;border-color:#cfe2d4;border-radius:16px;background:linear-gradient(145deg,#fbfefb,#f3f9f4);box-shadow:inset 0 1px 0 rgba(255,255,255,.9)}
.people-picker--changeorder .pp-picker-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 9px}.people-picker--changeorder .pp-picker-head b{display:block;color:var(--text);font-size:13px;font-weight:780;line-height:1.25}.people-picker--changeorder .pp-picker-head span{display:block;margin-top:2px;color:var(--muted);font-size:11.5px;line-height:1.3}
.people-picker--changeorder .pp-clear{min-height:30px;padding:5px 8px;border:1px solid #c8ddce;border-radius:8px;background:#fff;color:var(--accent);font:inherit;font-size:11.5px;font-weight:720;white-space:nowrap;cursor:pointer}.people-picker--changeorder .pp-clear:hover:not(:disabled){border-color:#9cc7a9;background:#eff8f1}.people-picker--changeorder .pp-clear:disabled{color:#9cad9f;border-color:#dde9df;background:#f7faf7;cursor:default}
.people-picker--changeorder .pp-selected-summary{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-height:31px;margin:0 0 9px}.people-picker--changeorder .pp-selected-empty{color:#708176;font-size:11.5px;line-height:1.4}.people-picker--changeorder .pp-selected-chip{display:inline-flex;align-items:center;gap:6px;min-height:30px;max-width:100%;padding:3px 7px 3px 4px;border:1px solid #a9d6b7;border-radius:999px;background:#e8f6ed;color:#176948;font:inherit;font-size:11.5px;font-weight:700;line-height:1;cursor:pointer}.people-picker--changeorder .pp-selected-chip:hover{border-color:#67ad7f;background:#dcf1e3}.people-picker--changeorder .pp-chip-avatar{flex:0 0 22px;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;font-size:9px;font-weight:800;letter-spacing:.01em}.people-picker--changeorder .pp-chip-remove{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border-radius:50%;background:rgba(23,105,72,.12);font-size:14px;font-weight:700;line-height:1}
.people-picker--changeorder .pp-search{display:flex;align-items:center;gap:8px;min-height:40px;margin:0 0 9px;padding:0 11px;border:1px solid #d4e4d8;border-radius:11px;background:#fff;color:#6c8274}.people-picker--changeorder .pp-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(31,138,99,.12)}.people-picker--changeorder .pp-search>span{font-size:18px;line-height:1;transform:rotate(-15deg)}.people-picker--changeorder .pp-search input{flex:1;width:auto;min-width:0;height:38px;padding:0;border:0!important;outline:0;background:transparent!important;box-shadow:none!important;font-size:13px}
.people-picker--changeorder .pp-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:236px;overflow:auto;overscroll-behavior:contain;padding:1px}.people-picker--changeorder .pp-item{width:100%;min-width:0;min-height:58px;display:flex;gap:9px;padding:8px 9px;border:1.5px solid #d6e5d9;border-radius:13px;background:#fff;box-shadow:0 1px 1px rgba(21,64,44,.025)}.people-picker--changeorder .pp-item:hover{border-color:#91c5a1;background:#fbfefb}.people-picker--changeorder .pp-item.on{border-color:#3c9b69;background:#ecf8f0;box-shadow:0 0 0 1px rgba(31,138,99,.14) inset}.people-picker--changeorder .pp-item:focus-within{outline:3px solid rgba(31,138,99,.16);outline-offset:1px}.people-picker--changeorder .pp-avatar{width:38px;height:38px;font-size:12px}.people-picker--changeorder .pp-choice-copy{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center;gap:2px}.people-picker--changeorder .pp-name{max-width:none;color:var(--text);font-size:12.5px;font-weight:700;line-height:1.25}.people-picker--changeorder .pp-role{overflow:hidden;color:var(--muted);font-size:10.5px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.people-picker--changeorder .pp-choice-state{flex:0 0 22px;width:22px;height:22px;align-self:center;display:inline-flex;align-items:center;justify-content:center;border:1.5px solid #c9ddce;border-radius:50%;background:#fff;color:transparent;font-size:13px;font-weight:850;line-height:1}.people-picker--changeorder .pp-item.on .pp-choice-state{border-color:var(--accent);background:var(--accent);color:#fff;box-shadow:0 2px 5px rgba(24,123,87,.20)}.people-picker--changeorder .pp-search-empty{padding:10px 4px 2px;color:var(--muted);font-size:11.5px;text-align:center}.people-picker--changeorder .pp-list .pp-empty{grid-column:1/-1;padding:13px 2px;text-align:center}
.people-picker.is-disabled{opacity:.76}.people-picker.is-disabled .pp-item:has(input:disabled){pointer-events:none;cursor:default}.people-picker.is-disabled .pp-selected-chip{pointer-events:none}

.attachment-intro{display:flex;flex-direction:column;gap:3px;margin:0 0 11px}.attachment-intro b{font-size:13px}.attachment-intro span{color:var(--muted);font-size:11.5px;line-height:1.45}
.attachment-upload-card{padding:10px;border:1px dashed #b7d6c0;border-radius:14px;background:linear-gradient(145deg,#fbfefb,#f2f9f4)}.attachment-file-input{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.attachment-upload-action{display:flex;align-items:center;gap:10px;min-height:54px;padding:8px 10px;border:1px solid #cfe4d5;border-radius:11px;background:#fff;color:var(--text);cursor:pointer;transition:border-color .16s,background .16s,transform .16s}.attachment-upload-action:hover{border-color:#83b995;background:#f7fcf8}.attachment-file-input:focus + .attachment-upload-action{outline:3px solid rgba(31,138,99,.18);outline-offset:2px}.attachment-upload-action>span:last-child{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px}.attachment-upload-action b{font-size:12.5px;line-height:1.25}.attachment-upload-action small{color:var(--muted);font-size:11px;line-height:1.35}.attachment-upload-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:#e5f5ea;color:var(--accent);font-size:22px;font-weight:780;line-height:1}.attachment-upload-note{min-height:17px;margin:7px 2px 0;color:var(--muted);font-size:11px;line-height:1.4}.attachment-upload-card.is-disabled{border-style:solid;border-color:#dce8df;background:#f8fbf8}.attachment-upload-card.is-disabled .attachment-upload-action{border-color:#e0eae2;background:#f7faf7;color:#94a69a;cursor:default;pointer-events:none}.attachment-upload-card.is-disabled .attachment-upload-icon{background:#edf3ee;color:#91a298}.attachment-upload-card.is-uploading .attachment-upload-action{cursor:progress}
.attachment-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}.attachment-empty{padding:16px 12px;border:1px dashed #cfe0d3;border-radius:12px;color:var(--muted);font-size:12px;line-height:1.45;text-align:center}.attachment-loading{color:var(--accent)}.attachment-item{display:flex;align-items:center;gap:10px;min-width:0;min-height:64px;padding:8px;border:1px solid #dce8df;border-radius:13px;background:#fff;box-shadow:0 2px 5px rgba(21,64,44,.035)}.attachment-thumb,.attachment-file-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 46px;width:46px;height:46px;overflow:hidden;border:1px solid #d5e5d9;border-radius:10px;background:#eef7f0}.attachment-thumb img{width:100%;height:100%;object-fit:cover}.attachment-file-mark{padding:3px;background:#edf7f0;color:var(--accent);font-size:10px;font-weight:850;letter-spacing:.04em}.attachment-file-mark--cad{background:#eff4ff;color:#3e70bd}.attachment-file-mark--model3d{background:#f2edff;color:#7354b3}.attachment-file-mark--video{background:#fff4e7;color:#b46d1f}.attachment-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}.attachment-name{overflow:hidden;color:var(--text);font-size:12.5px;font-weight:720;line-height:1.35;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.attachment-name:hover{text-decoration:underline}.attachment-meta{overflow:hidden;color:var(--muted);font-size:10.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.attachment-remove{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:#9b4747;font-size:22px;line-height:1;cursor:pointer}.attachment-remove:hover:not(:disabled){background:#fff0f0;color:var(--red)}.attachment-remove:disabled{color:var(--muted);cursor:wait}
.notification-item--changeorder .notification-item-icon{background:rgba(245,158,11,.16);color:#a85f00}

@media (max-width:760px){.people-picker--changeorder .pp-search input{font-size:16px}.task-description-input{min-height:142px}.attachment-item{min-height:70px}.attachment-remove{min-width:44px}.attachment-upload-action{min-height:58px}}
@media (max-width:540px){.people-picker--changeorder{padding:11px}.people-picker--changeorder .pp-list{grid-template-columns:1fr;max-height:252px}.people-picker--changeorder .pp-item{min-height:60px;padding:10px}.people-picker--changeorder .pp-name{font-size:13px}.attachment-intro{margin-bottom:10px}}

/* ===== CHAM CONG v58 =====
   Ke thua card/button/token cua IIN; anh selfie chi hien qua API co dang nhap. */
.topbar[data-view="attendance"] .topbar-actions,.topbar[data-view="attendance"] .mobile-filter-toggle{display:none!important}
.attendance-page{width:min(100%,940px);margin:0 auto;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(300px,.92fr);gap:14px;align-items:start}
.attendance-page-head{grid-column:1/-1;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:2px}.attendance-page-head h1{margin:3px 0 4px;color:var(--text);font-size:21px;line-height:1.25}.attendance-page-head p{margin:0;color:var(--muted);font-size:12.5px;line-height:1.5}.attendance-eyebrow{display:block;color:var(--accent);font-size:10.5px;font-weight:820;letter-spacing:.1em;line-height:1.3}.attendance-refresh{min-width:96px;min-height:44px;flex:0 0 auto}
.attendance-card{min-width:0;padding:17px;border:1px solid #d8e7dc;border-radius:18px;background:#fff;box-shadow:0 7px 19px rgba(21,64,44,.065)}.attendance-card h2{margin:2px 0 0;color:var(--text);font-size:16px;line-height:1.3}.attendance-today-card{background:linear-gradient(145deg,#fff,#f5fbf6)}.attendance-today-card.attendance-is-done{border-color:#acd7b9;background:linear-gradient(145deg,#f9fefa,#edf9f1)}
.attendance-card-head,.attendance-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.attendance-section-head>span{color:var(--muted);font-size:11.5px;line-height:1.4}.attendance-status{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:5px 9px;border-radius:999px;font-size:10.5px;font-weight:780;line-height:1.1;white-space:nowrap}.attendance-status--done{background:#dff4e6;color:#116943}.attendance-status--waiting{background:#fff5dd;color:#8b5b00}.attendance-status--missing{background:#f1f4f2;color:#67796e}
.attendance-record{display:flex;align-items:center;gap:15px;padding:13px;border:1px solid #d6e8db;border-radius:15px;background:#fff}.attendance-record-selfie{display:flex;align-items:center;justify-content:center;flex:0 0 88px;width:88px;height:88px;overflow:hidden;border:3px solid #d8efe0;border-radius:16px;background:#e5f5ea;color:var(--accent);font-size:30px;font-weight:800;text-decoration:none}.attendance-record-selfie img{width:100%;height:100%;object-fit:cover}.attendance-record-copy{display:flex;min-width:0;flex-direction:column}.attendance-record-copy span{color:var(--muted);font-size:11.5px}.attendance-record-copy strong{margin:2px 0;color:#176d4e;font-size:34px;font-weight:820;letter-spacing:-.035em;line-height:1.05;font-variant-numeric:tabular-nums}.attendance-record-copy small{color:var(--muted);font-size:11px;line-height:1.4}
.attendance-today-card.attendance-is-working{border-color:#b8d9c2;background:linear-gradient(145deg,#fff,#f2faf4)}.attendance-status--working{background:#e4f1ff;color:#17609a}.attendance-shift-times{display:grid;grid-template-columns:repeat(2,minmax(72px,1fr));gap:18px;margin-bottom:5px}.attendance-record-copy .attendance-shift-times>span{display:flex;min-width:0;flex-direction:column}.attendance-record-copy .attendance-shift-times small{font-size:10.5px}.attendance-record-copy .attendance-shift-times strong{margin:1px 0;color:#176d4e;font-size:27px;line-height:1.12}.attendance-duration{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;padding-top:8px;border-top:1px solid #e3ece5}.attendance-record-copy .attendance-duration span{font-size:10.5px}.attendance-record-copy .attendance-duration b{color:var(--text);font-size:12px}.attendance-checkout{width:100%;min-height:48px;margin-top:11px}.attendance-checkout:disabled{opacity:.68;cursor:wait}
.attendance-private-note{margin:11px 1px 0;color:var(--muted);font-size:11px;line-height:1.5}.attendance-camera-empty{display:flex;min-height:248px;flex-direction:column;align-items:center;justify-content:center;padding:22px 16px;border:1px dashed #b9d8c2;border-radius:15px;background:#f7fcf8;text-align:center}.attendance-camera-icon{display:inline-flex;align-items:center;justify-content:center;width:54px;height:54px;margin-bottom:11px;border-radius:16px;background:#e0f3e6;color:var(--accent)}.attendance-camera-icon svg{width:28px;height:28px}.attendance-camera-empty b{max-width:360px;color:var(--text);font-size:14px;line-height:1.45}.attendance-camera-empty p{max-width:350px;margin:6px 0 15px;color:var(--muted);font-size:12px;line-height:1.5}.attendance-camera-input{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.attendance-camera-action{display:inline-flex;align-items:center;justify-content:center;min-width:190px;min-height:48px;cursor:pointer}.attendance-camera-input:focus+label{outline:3px solid rgba(31,138,99,.18);outline-offset:2px}
.attendance-preview{position:relative;overflow:hidden;border:1px solid #cee2d4;border-radius:16px;background:#edf5ef;aspect-ratio:4/3}.attendance-preview img{width:100%;height:100%;display:block;object-fit:cover}.attendance-preview span{position:absolute;left:10px;right:10px;bottom:10px;padding:7px 10px;border-radius:10px;background:rgba(15,55,39,.78);color:#fff;font-size:11px;font-weight:650;text-align:center;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.attendance-actions{display:grid;grid-template-columns:1fr 1.45fr;gap:9px;margin-top:11px}.attendance-actions .btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px}.attendance-change-photo{cursor:pointer}.attendance-confirm:disabled{opacity:.68;cursor:wait}
.attendance-history{grid-column:2}.attendance-history-list{display:flex;flex-direction:column}.attendance-history-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:9px;min-height:56px;padding:8px 2px;border-top:1px solid #e4ede6}.attendance-history-row:first-child{border-top:0}.attendance-history-dot{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;border-radius:9px;background:#e5f5ea;color:var(--accent);font-size:12px;font-weight:820}.attendance-history-row div{display:flex;min-width:0;flex-direction:column}.attendance-history-row b{font-size:12.5px}.attendance-history-row small{margin-top:2px;color:var(--muted);font-size:10.5px}.attendance-history-row>strong{color:#2b5e48;font-size:14px;font-variant-numeric:tabular-nums}
.attendance-history-dot.is-working{background:#e4f1ff;color:#17609a}.attendance-history-row .attendance-history-times{display:flex;flex-direction:row;align-items:center;gap:9px}.attendance-history-times>span{display:flex;min-width:42px;flex-direction:column;align-items:flex-end}.attendance-history-times small{font-size:9.5px}.attendance-history-times strong{color:#2b5e48;font-size:13px;font-variant-numeric:tabular-nums}
.attendance-team{grid-column:1/-1}.attendance-team-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:13px}.attendance-team-toolbar h2{margin-top:2px}.attendance-team-toolbar label{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:10.5px;font-weight:650}.attendance-team-toolbar input{min-width:154px;min-height:44px;background:#fff}.attendance-team-summary{display:flex;align-items:baseline;gap:7px;margin:15px 0 8px;padding:11px 13px;border-radius:13px;background:#f2f9f4}.attendance-team-summary strong{color:var(--accent);font-size:22px;font-variant-numeric:tabular-nums}.attendance-team-summary span{color:var(--muted);font-size:11.5px}.attendance-team-list{display:flex;flex-direction:column}.attendance-team-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto 48px;align-items:center;gap:10px;min-height:68px;padding:9px 3px;border-top:1px solid #e3ece5}.attendance-team-row:first-child{border-top:0}.attendance-person-avatar{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:14px;color:#fff;font-size:11.5px;font-weight:800}.attendance-person-copy{display:flex;min-width:0;flex-direction:column}.attendance-person-copy b{overflow:hidden;font-size:12.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.attendance-person-copy small{margin-top:2px;color:var(--muted);font-size:10.5px}.attendance-person-result{display:flex;min-width:120px;flex-direction:column;align-items:flex-end}.attendance-person-result strong{color:#176d4e;font-size:13px;font-variant-numeric:tabular-nums}.attendance-person-result span{margin-top:2px;color:var(--muted);font-size:10px}.attendance-selfie-link{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:1px solid #cde1d2;border-radius:11px;background:#f5faf6;color:var(--accent);font-size:11px;font-weight:720;text-decoration:none}.attendance-selfie-link:hover{border-color:#8fc39f;background:#eaf7ed}
.attendance-empty{padding:22px 12px;color:var(--muted);font-size:12px;line-height:1.5;text-align:center}.attendance-empty.attendance-error{display:flex;flex-direction:column;align-items:center;gap:9px;color:#8a4747}.attendance-empty .btn{min-height:44px}.attendance-loading,.attendance-load-error{grid-column:1/-1;min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.attendance-loading>span{width:34px;height:34px;margin-bottom:11px;border:3px solid #d8e9dc;border-top-color:var(--accent);border-radius:50%;animation:attendance-spin .85s linear infinite}.attendance-loading b{font-size:13px}.attendance-load-error b{font-size:15px}.attendance-load-error p{max-width:430px;margin:7px 0 14px;color:var(--muted);font-size:12px;line-height:1.5}.attendance-load-error .btn{min-height:44px}@keyframes attendance-spin{to{transform:rotate(360deg)}}

@media (max-width:760px){
  .attendance-page{display:flex;flex-direction:column;gap:11px}.attendance-page-head{width:100%;align-items:center;margin-bottom:2px}.attendance-page-head h1{font-size:18px}.attendance-page-head p{font-size:11.5px}.attendance-refresh{min-width:88px;padding:8px 10px;font-size:12px}
  .attendance-card{width:100%;padding:14px;border-radius:17px}.attendance-camera-empty{min-height:230px;padding:19px 13px}.attendance-record{padding:11px}.attendance-record-selfie{flex-basis:80px;width:80px;height:80px}.attendance-record-copy strong{font-size:31px}
  .attendance-team-toolbar{align-items:flex-end}.attendance-team-toolbar input{min-width:142px}.attendance-history-row{min-height:58px}.attendance-team-row{min-height:70px}.attendance-selfie-link{min-width:44px;min-height:44px}
}
@media (max-width:430px){
  .attendance-page-head{align-items:flex-start}.attendance-page-head p{max-width:245px}.attendance-actions{grid-template-columns:1fr}.attendance-actions .btn{min-height:50px}
  .attendance-team-toolbar{align-items:stretch;flex-direction:column}.attendance-team-toolbar label{width:100%}.attendance-team-toolbar input{width:100%}
  .attendance-team-row{grid-template-columns:42px minmax(0,1fr) auto}.attendance-selfie-link{grid-column:2/4;width:100%;min-height:44px}.attendance-person-result{min-width:108px}.attendance-shift-times{gap:12px}.attendance-record-copy .attendance-shift-times strong{font-size:24px}.attendance-history-row{grid-template-columns:28px minmax(0,1fr)}.attendance-history-times{grid-column:2;width:100%;justify-content:flex-start!important}.attendance-history-times>span{align-items:flex-start}
}
@media (max-width:350px){
  .attendance-record{gap:10px}.attendance-record-selfie{flex-basis:68px;width:68px;height:68px}.attendance-shift-times{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.attendance-record-copy .attendance-shift-times strong{font-size:21px}
}
@media (prefers-reduced-motion:reduce){.attendance-loading>span{animation:none}}
/* ================= PASSKEY / FACE ID / VAN TAY ================= */
.passkey-login-area{width:100%}
.login-divider{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px;margin:14px 0 10px}
.login-divider:before,.login-divider:after{content:"";height:1px;background:var(--border);flex:1}
.passkey-btn{min-height:48px;width:100%;background:#fff;color:var(--accent);border:1px solid var(--border);border-color:color-mix(in srgb,var(--accent) 45%,var(--border));font-weight:750}
.passkey-btn:before{content:"";display:inline-block;width:18px;height:18px;margin-right:8px;vertical-align:-4px;border:2px solid currentColor;border-radius:50% 50% 45% 45%;box-shadow:inset 0 -5px 0 -3px currentColor}
.passkey-btn:active{background:var(--panel2)}
.passkey-privacy{font-size:11.5px;line-height:1.45;color:var(--muted);margin:8px 2px 0;text-align:center}
.passkey-modal{max-width:560px}
.passkey-explain,.passkey-recovery{font-size:13px;line-height:1.55;color:var(--muted);background:var(--panel2);border:1px solid var(--border);border-radius:14px;padding:12px 14px}
.passkey-status{min-height:22px;margin:14px 0 8px;font-size:13px;color:var(--muted)}
.passkey-status.error{color:var(--danger)}
.passkey-list{display:grid;gap:10px;margin-bottom:14px}
.passkey-empty{padding:16px;border:1px dashed var(--border);border-radius:14px;color:var(--muted);text-align:center;font-size:13px}
.passkey-item{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--border);border-radius:14px;background:var(--panel)}
.passkey-item-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);font-size:21px;flex:0 0 auto}
.passkey-item-main{min-width:0;flex:1}
.passkey-item-main b{display:block;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.passkey-item-main span{display:block;color:var(--muted);font-size:11.5px;line-height:1.45;margin-top:3px}
.passkey-remove{min-width:44px;min-height:44px;border:0;border-radius:12px;background:var(--danger-soft,#fff0f1);color:var(--danger);font-weight:700;cursor:pointer}
.passkey-add-box{display:grid;grid-template-columns:1fr auto;gap:9px;align-items:end;margin:12px 0}
.passkey-add-box label{grid-column:1/-1;color:var(--text);font-size:12px;font-weight:700}
.passkey-add-box input{min-width:0;min-height:46px}
.passkey-add-box .btn{min-height:46px}
.passkey-recovery{margin-top:12px;background:#fffaf0}
.more-account-actions button{min-height:44px}
@media(max-width:600px){
  .passkey-add-box{grid-template-columns:1fr}
  .passkey-add-box label{grid-column:auto}
  .passkey-item{align-items:flex-start}
}
