
  *,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #f5f7fb; --surface: #ffffff; --surface-2: #f8fafc;
    --border: #e2e8f0; --border-strong: #cbd5e1;
    --text: #0f172a; --text-muted: #64748b;
    --primary: #4f46e5; --primary-hover: #4338ca; --primary-light: #eef2ff;
    --success: #10b981; --warning: #f59e0b; --danger: #ef4444;
    --cat-daily: #0891b2; --cat-daily-light: #ecfeff;
    --cat-weekly: #8b5cf6; --cat-weekly-light: #f5f3ff;
    --cat-occasional: #f59e0b; --cat-occasional-light: #fffbeb;
    --cat-incident: #e11d48; --cat-incident-light: #fff1f2;
    --st-pending: #f97316; --st-pending-light: #fff7ed;
    --st-open: #f97316; --st-open-light: #fff7ed;
    --st-progress: #3b82f6; --st-progress-light: #eff6ff;
    --st-done: #22c55e; --st-done-light: #f0fdf4;
    --pri-high: #ef4444; --pri-normal: #64748b; --pri-low: #94a3b8;
    --note-bg: #fef3c7; --note-border: #fde68a; --note-text: #78350f;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow: 0 4px 12px rgba(15,23,42,.08);
    --shadow-lg: 0 10px 30px rgba(15,23,42,.12);
  }
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  button { font-family: inherit; cursor: pointer; border: none; }
  input, select, textarea { font-family: inherit; font-size: 14px; }
  .app { min-height: 100vh; }
  .header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 50; }
  .brand { display: flex; align-items: center; gap: 12px; }
  .brand-logo { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #7c3aed, #ec4899); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; font-weight: 700; box-shadow: var(--shadow); }
  .brand h1 { font-size: 18px; font-weight: 700; }
  .brand p { font-size: 12px; color: var(--text-muted); }
  .header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .app-settings-button { width: 34px; height: 34px; flex: 0 0 34px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text-muted); box-shadow: var(--shadow-sm); font-size: 16px; line-height: 1; transition: .15s ease; }
  .app-settings-button:hover { color: var(--primary); border-color: #c7d2fe; background: var(--primary-light); transform: translateY(-1px); }
  .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; margin-right: 6px; animation: pulse 2s infinite; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
  .status-text { font-size: 12px; color: var(--text-muted); }
  .container { padding: 24px 28px; max-width: 1500px; margin: 0 auto; width: 100%; }




   
  [contenteditable][data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #ca8a04; opacity: .55; pointer-events: none; font-style: italic;
  }
  [contenteditable]:focus { box-shadow: 0 0 0 3px rgba(245,158,11,.18); }




   
  .global-note {
    background: linear-gradient(135deg, var(--note-bg), #fffbeb);
    border: 2px solid var(--note-border);
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 4px 16px rgba(245, 158, 11, .15);
  }
  .global-note-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
  .global-note-title { font-size: 14px; font-weight: 800; color: var(--note-text); display: flex; align-items: center; gap: 8px; }
  .global-note-actions { display: flex; gap: 6px; }
  .global-note-textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--note-border); border-radius: 10px;
    background: rgba(255,255,255,.7); color: var(--note-text);
    font-size: 14px; line-height: 1.6; resize: vertical;
    min-height: 80px; font-family: inherit;
    white-space: pre-wrap;
  }
  .global-note-textarea:focus { outline: none; border-color: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
  .global-note-display {
    color: var(--note-text); font-size: 14px; line-height: 1.6; white-space: pre-wrap;
    padding: 8px 0;
    min-height: 24px;
  }
  .global-note-empty { color: #92400e80; font-style: italic; }




  .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
  .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
  .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
  .stat-value { font-size: 26px; font-weight: 800; margin: 4px 0; }
  .stat-sub { font-size: 11px; color: var(--text-muted); }
  .stat-icon { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 6px; }




  .tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 20px; box-shadow: var(--shadow-sm); width: fit-content; flex-wrap: wrap; }
  .tab { padding: 8px 16px; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 600; }
  .tab.active { background: var(--primary); color: #fff; }
  .tab:not(.active):hover { background: var(--surface-2); color: var(--text); }




  .filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; box-shadow: var(--shadow-sm); }
  .filter-bar select, .filter-bar input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
  .filter-bar input[type="search"] { min-width: 200px; }




  .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: all .15s; }
  .btn-primary { background: var(--primary); color: #fff; }
  .btn-primary:hover { background: var(--primary-hover); }
  .btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
  .btn-secondary:hover { background: var(--surface-2); }
  .btn-danger { background: var(--danger); color: #fff; }
  .btn-warning { background: var(--warning); color: #fff; }
  .btn-success { background: var(--success); color: #fff; }
  .btn-ghost { background: transparent; color: var(--text-muted); }
  .btn-ghost:hover { background: var(--surface-2); color: var(--text); }
  .btn-sm { padding: 5px 10px; font-size: 12px; }




   
  .checklist { display: flex; flex-direction: column; gap: 8px; }
  .check-item {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--cat-daily);
    border-radius: 10px; padding: 12px 14px;
    display: flex; gap: 12px; align-items: flex-start;
    transition: all .15s;
  }
  .check-item:hover { box-shadow: var(--shadow); }
  .check-item.done { opacity: .55; background: var(--surface-2); }
  .check-item.done .check-title { text-decoration: line-through; color: var(--text-muted); }
  .check-item.priority-high { border-left-color: var(--danger); }
  .check-item.priority-low { border-left-color: var(--text-muted); }
  .check-item.cat-weekly { border-left-color: var(--cat-weekly); }
  .check-item.cat-occasional { border-left-color: var(--cat-occasional); }
  .check-item.cat-incident { border-left-color: var(--cat-incident); }
  .check-toggle {
    width: 24px; height: 24px; border-radius: 6px;
    border: 2px solid var(--border-strong); background: var(--surface);
    cursor: pointer; flex-shrink: 0; margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
  }
  .check-toggle:hover { border-color: var(--primary); }
  .check-toggle.checked { background: var(--st-done); border-color: var(--st-done); color: #fff; font-weight: 700; }
  .check-content { flex: 1; min-width: 0; }
  .check-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; word-break: break-word; }
  .check-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-muted); }
  .check-actions { display: flex; gap: 4px; flex-shrink: 0; }




   
  .checklist-table-head {
    display: grid;
    grid-template-columns: 36px minmax(150px, 1.1fr) minmax(160px, 1.5fr) 90px 130px 130px 46px 70px;
    gap: 10px; align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f5f3ff, #faf5ff);
    border: 1px solid #e2e8f0; border-left: 4px solid var(--cat-daily);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .3px;
  }
  .checklist-table-head.cat-weekly { border-left-color: var(--cat-weekly); background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
  .checklist-table-head.cat-occasional { border-left-color: var(--cat-occasional); background: linear-gradient(135deg, #fffbeb, #fef3c7); }
  .check-item-grid {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--cat-daily);
    border-radius: 8px; padding: 10px 14px;
    display: grid;
    grid-template-columns: 36px minmax(150px, 1.1fr) minmax(160px, 1.5fr) 90px 130px 130px 46px 70px;
    gap: 10px; align-items: center;
    transition: all .15s;
  }
  .check-item-grid:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
  .check-item-grid.done { opacity: .55; background: var(--surface-2); }
  .check-item-grid.done .check-title { text-decoration: line-through; color: var(--text-muted); }
  .check-item-grid.priority-high { border-left-color: var(--danger); }
  .check-item-grid.priority-low { border-left-color: var(--text-muted); }
  .check-item-grid.cat-weekly { border-left-color: var(--cat-weekly); }
  .check-item-grid.cat-occasional { border-left-color: var(--cat-occasional); }
  .check-item-grid .col-title { min-width: 0; }
  .check-item-grid .check-title { font-size: 13px; font-weight: 700; word-break: break-word; cursor: pointer; line-height: 1.4; }
   
  .check-item-grid .col-content {
    min-width: 0; font-size: 12px; color: var(--text);
    line-height: 1.45; word-break: break-word; cursor: pointer;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
  }
  .check-item-grid .col-content :where(p,div) { margin: 0; }
  .check-item-grid .col-content b, .check-item-grid .col-content strong { font-weight: 800; }
  .check-item-grid .col-content-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; white-space: pre-wrap; line-height: 1.4; max-height: 38px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .check-item-grid .col-pri { display: flex; align-items: center; justify-content: flex-start; }
  .check-item-grid .col-link { font-size: 11.5px; min-width: 0; overflow: hidden; }
  .check-item-grid .col-link a { color: var(--primary); text-decoration: none; font-weight: 600; word-break: break-word; }
  .check-item-grid .col-link a:hover { text-decoration: underline; }
  .check-item-grid .col-empty { color: #cbd5e1; font-style: italic; font-size: 11px; }
  .check-item-grid .col-notes { text-align: center; font-size: 12px; }
  .check-item-grid .col-actions-grid { display: flex; gap: 3px; justify-content: flex-end; }
  .pri-tag-mini {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 10px; font-weight: 700;
    border: 1px solid;
  }
  .pri-tag-mini.high { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
  .pri-tag-mini.normal { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
  .pri-tag-mini.low { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }




  @media (max-width: 900px) {
    .checklist-table-head { display: none; }
    .check-item-grid {
      grid-template-columns: 36px 1fr 80px;
      grid-template-areas:
        "toggle title pri"
        "toggle content content"
        "toggle links links"
        "toggle actions actions";
      gap: 6px 10px;
    }
    .check-item-grid > .col-toggle-cell { grid-area: toggle; }
    .check-item-grid > .col-title { grid-area: title; }
    .check-item-grid > .col-content { grid-area: content; -webkit-line-clamp: 3; }
    .check-item-grid > .col-pri { grid-area: pri; justify-content: flex-end; }
    .check-item-grid > .col-link1 { grid-area: links; }
    .check-item-grid > .col-link2 { display: none; }
    .check-item-grid > .col-notes { display: none; }
    .check-item-grid > .col-actions-grid { grid-area: actions; justify-content: flex-end; }
  }




   
  .kanban-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .kanban-mobile-tabs { display: none; }
  .kc-next-time { white-space: nowrap; font-weight: 700; color: var(--text-muted); }
  .kc-quick-remind { background:#fff7ed !important; border:1px solid #fed7aa !important; color:#ea580c !important; opacity:1 !important; }
  .kc-quick-remind:hover { background:#ffedd5 !important; }
  .kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-height: 200px; transition: all .15s; }
  .kanban-col-head-v2 {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; margin-bottom: 8px;
    background: var(--surface); border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 5;
  }
  .kanban-col-head-v2 .col-icon { font-size: 16px; }
  .kanban-col-head-v2 .col-name { font-weight: 800; font-size: 13px; flex: 1; }
  .kanban-col-head-v2 .col-cnt { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; min-width: 26px; text-align: center; }
  .kanban-col-head-v2 .col-collapse { background: transparent; border: 1px solid var(--border); border-radius: 6px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); font-size: 11px; }
  .kanban-col-head-v2 .col-collapse:hover { background: var(--surface-2); }
  .kanban-pri-stats { display: flex; gap: 4px; padding: 0 2px 6px; flex-wrap: wrap; }
  .kanban-pri-stat { padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 800; }
  .kanban-pri-stat.high   { background: #fef2f2; color: #dc2626; }
  .kanban-pri-stat.normal { background: #eff6ff; color: #2563eb; }
  .kanban-pri-stat.low    { background: #f1f5f9; color: #64748b; }




   
  .kanban-card-v2 {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 10px 8px 10px;
    margin-bottom: 6px;
    cursor: grab; transition: all .12s;
    position: relative;
    border-left: 4px solid #cbd5e1;
  }
  .kanban-card-v2:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--primary); }
  .kanban-card-v2.priority-high   { border-left-color: #dc2626; }
  .kanban-card-v2.priority-normal { border-left-color: #3b82f6; }
  .kanban-card-v2.priority-low    { border-left-color: #94a3b8; }
  .kanban-card-v2.dragging { opacity: .4; background: #fef9c3; transform: scale(.97) rotate(-1deg); }
  .kc-row1 { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; min-height: 18px; }
  .kc-pri-pill { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; border: 1px solid; flex-shrink: 0; letter-spacing: .2px; }
  .kc-pri-pill.high   { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
  .kc-pri-pill.normal { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
  .kc-pri-pill.low    { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
  .kc-people { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; font-size: 10.5px; color: var(--text-muted); }
  .kc-people > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
  .kc-actions-mini { display: flex; align-items: center; gap: 2px; flex-shrink: 0; opacity: .5; transition: opacity .15s; }
  .kanban-card-v2:hover .kc-actions-mini { opacity: 1; }
  .kc-actions-mini button { background: transparent; border: none; cursor: pointer; padding: 2px 5px; border-radius: 4px; font-size: 11px; color: var(--text-muted); line-height: 1; }
  .kc-actions-mini button:hover { background: var(--surface-2); }
  .kc-actions-mini button.del:hover { background: #fee2e2; color: var(--danger); }
  .kc-title { font-weight: 700; font-size: 12.5px; line-height: 1.35; word-break: break-word; margin-bottom: 3px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .kc-desc { font-size: 10.5px; color: var(--text-muted); margin-bottom: 5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .kc-row3 { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-muted); }
  .kc-prog-bar { flex: 1; height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
  .kc-prog-fill { height: 100%; transition: width .3s; border-radius: 2px; }
  .kc-prog-label { font-weight: 800; min-width: 28px; text-align: right; font-size: 10px; }
  .kc-mini-icons { display: flex; align-items: center; gap: 5px; font-size: 10px; flex-shrink: 0; }
  .kc-mini-icons a { color: var(--primary); text-decoration: none; font-weight: 600; }
  .kc-mini-icons a:hover { text-decoration: underline; }
  .kc-divider { display: flex; align-items: center; gap: 5px; margin: 6px 0 3px; font-size: 9px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
  .kc-divider span:first-child, .kc-divider span:last-child { flex: 1; height: 1px; background: var(--border); }
  .kanban-drop-zone {
    border: 2px dashed transparent; transition: all .15s;
  }
  .kanban-drop-zone.over {
    background: var(--surface) !important;
    box-shadow: inset 0 0 0 3px currentColor;
    animation: dropPulse 1.2s ease infinite;
  }
  @keyframes dropPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.005); } }
  .kanban-col.collapsed { min-height: auto; }
  .kanban-col.collapsed .kanban-card-v2,
  .kanban-col.collapsed .kanban-pri-stats,
  .kanban-col.collapsed .kc-divider,
  .kanban-col.collapsed .kanban-empty-hint { display: none; }




  .kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: all .15s; }
  .kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
  .kanban-card.priority-high { border-left: 4px solid var(--danger); }




  .badge { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #fff; }
  .badge.priority-high { background: var(--danger); }
  .badge.priority-normal { background: var(--text-muted); }
  .badge.priority-low { background: var(--pri-low); }
  .badge.cat-daily { background: var(--cat-daily); }
  .badge.cat-weekly { background: var(--cat-weekly); }
  .badge.cat-occasional { background: var(--cat-occasional); }
  .badge.cat-incident { background: var(--cat-incident); }
  .badge.st-pending { background: var(--st-pending-light); color: var(--st-pending); border: 1px solid #fed7aa; padding: 2px 8px 2px 18px; position: relative; }
  .badge.st-pending::before { content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--st-pending); }
  .badge.st-open { background: var(--st-open-light); color: var(--st-open); border: 1px solid #fed7aa; padding: 2px 8px 2px 18px; position: relative; }
  .badge.st-open::before { content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--st-open); animation: pulse 2s infinite; }
  .badge.st-progress { background: var(--st-progress-light); color: var(--st-progress); border: 1px solid #bfdbfe; padding: 2px 8px 2px 18px; position: relative; }
  .badge.st-progress::before { content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--st-progress); animation: pulse 1.5s infinite; }
  .badge.st-done { background: var(--st-done-light); color: var(--st-done); border: 1px solid #bbf7d0; padding: 2px 8px 2px 18px; position: relative; }
  .badge.st-done::before { content: '✓'; position: absolute; left: 5px; top: 50%; transform: translateY(-50%); color: var(--st-done); font-weight: 800; font-size: 10px; }




  .progress-bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
  .progress-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
  .progress-fill { height: 100%; transition: width .3s; border-radius: 3px; }
  .progress-label { font-size: 11px; font-weight: 700; width: 35px; text-align: right; }




   
  .entry-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--cat-incident); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow-sm); transition: all .15s; }
  .entry-card:hover { box-shadow: var(--shadow); }
  .entry-card.cat-daily { border-left-color: var(--cat-daily); }
  .entry-card.cat-incident { border-left-color: var(--cat-incident); }
  .entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
  .entry-title { font-size: 14px; font-weight: 700; flex: 1 1 200px; }
  .entry-meta { display: flex; gap: 5px; flex-wrap: wrap; }
  .entry-content { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; white-space: pre-wrap; }
  .entry-info { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); align-items: center; margin-bottom: 8px; }
  .entry-info-item { display: flex; align-items: center; gap: 4px; }
  .entry-link { color: var(--primary); text-decoration: none; }
  .entry-link:hover { text-decoration: underline; }
  .entry-actions { display: flex; gap: 4px; flex-wrap: wrap; }




  .modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
  .modal-overlay.active { display: flex; }
  .modal { background: var(--surface); border-radius: 14px; padding: 22px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
  .modal h2 { font-size: 18px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .icon-btn { background: transparent; padding: 4px 8px; color: var(--text-muted); font-size: 22px; line-height: 1; border-radius: 6px; }
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
  .field { margin-bottom: 12px; }
  .field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
  .field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
  .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
  .field textarea { resize: vertical; min-height: 70px; }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

  /* Trình ghi âm dùng overlay riêng. Không dùng .modal vì .modal là thẻ nội dung tĩnh. */
  .voice-popup-overlay {
    position: fixed; inset: 0; z-index: 10050;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(15,23,42,.48);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  }
  .voice-popup-card {
    box-sizing: border-box; width: min(380px, 100%);
    max-height: calc(100vh - 32px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow-lg);
    padding: 20px; text-align: center;
    display: flex; flex-direction: column; gap: 10px;
  }
  .voice-popup-icon { font-size: 34px; line-height: 1; }
  .voice-popup-card h3 { margin: 0; font-size: 20px; }
  .voice-level { height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
  .voice-level span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#7c3aed,#22c55e); transition: width .1s; }
  .voice-popup-card .voice-action { width: 100%; justify-content: center; background: #7c3aed; color: #fff; }
  .voice-popup-card > .btn { width: 100%; justify-content: center; }
  .voice-help { font-size: 11px; }
  @media (max-width: 600px) {
    .voice-popup-overlay { padding: 12px; align-items: center; }
    .voice-popup-card { width: 100%; max-height: calc(100dvh - 24px); padding: 16px; border-radius: 14px; }
  }


   
  .img-dropzone {
    border: 2px dashed var(--border-strong); border-radius: 10px;
    background: var(--surface-2); padding: 16px 14px; text-align: center;
    cursor: pointer; transition: all .15s; outline: none;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
  }
  .img-dropzone:hover, .img-dropzone:focus { border-color: var(--primary); background: var(--primary-light); }
  .img-dropzone.over { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-light); transform: scale(1.005); }
  .img-dropzone.busy { opacity: .75; pointer-events: none; }
  .img-dropzone-icon { font-size: 26px; line-height: 1; }
  .img-dropzone-text { font-size: 13px; font-weight: 700; color: var(--text); }
  .img-dropzone-sub { font-size: 11px; color: var(--text-muted); }


  .img-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
  .img-thumb {
    position: relative; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border); background: var(--surface-2);
    aspect-ratio: 1 / 1; box-shadow: var(--shadow-sm);
  }
  .img-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; transition: transform .2s; }
  .img-thumb img:hover { transform: scale(1.06); }
  .img-thumb img.img-broken { object-fit: contain; padding: 10px; opacity: .4; }
  .img-thumb-del {
    position: absolute; top: 3px; right: 3px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(15,23,42,.6); color: #fff; border: none; cursor: pointer;
    font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s;
  }
  .img-thumb:hover .img-thumb-del { opacity: 1; }
  .img-thumb-del:hover { background: var(--danger); }
   
  .img-icon-btn {
    display: inline-flex; align-items: center; gap: 2px;
    cursor: zoom-in; font-size: 12px; line-height: 1;
    color: var(--primary); font-weight: 700;
    padding: 1px 3px; border-radius: 5px; transition: background .12s;
  }
  .img-icon-btn:hover { background: var(--primary-light); }
  .img-icon-count { font-size: 10px; font-weight: 800; }


  .img-lightbox {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(15,23,42,.86); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 24px;
    animation: slideIn .18s ease;
  }
  .img-lightbox-fig { max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; gap: 8px; margin: 0; }
  .img-lightbox-fig img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
  .img-lightbox-fig figcaption { display: flex; align-items: center; gap: 14px; color: #fff; font-size: 13px; font-weight: 600; padding: 0 4px; }
  .img-lightbox-fig figcaption a { color: #a5b4fc; text-decoration: none; font-weight: 700; white-space: nowrap; }
  .img-lightbox-fig figcaption a:hover { text-decoration: underline; }
  .img-lightbox-close {
    position: absolute; top: 16px; right: 20px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff; border: none; cursor: pointer;
    font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
  }
  .img-lightbox-close:hover { background: rgba(255,255,255,.28); }
  .img-lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff; border: none; cursor: pointer;
    font-size: 30px; line-height: 1; display: flex; align-items: center; justify-content: center;
  }
  .img-lightbox-nav:hover { background: rgba(255,255,255,.28); }
  .img-lightbox-nav.prev { left: 16px; }
  .img-lightbox-nav.next { right: 16px; }


   
  .detail-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 12px; line-height: 1.35; word-break: break-word; }
  .detail-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; margin: 14px 0 5px; }
  .detail-content {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; font-size: 14px; line-height: 1.65; color: var(--text);
    word-break: break-word; white-space: normal;
  }
  .detail-content :where(p, div) { margin: 0 0 2px; }
  .detail-content b, .detail-content strong { font-weight: 800; }
  .detail-content ul, .detail-content ol { padding-left: 20px; margin: 4px 0; }
  .detail-link { color: var(--primary); text-decoration: none; font-weight: 600; word-break: break-word; }
  .detail-link:hover { text-decoration: underline; }




   
  .cat-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .cat-opt { padding: 12px 8px; border: 2px solid var(--border); background: var(--surface); border-radius: 10px; font-weight: 600; font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 4px; transition: all .15s; }
  .cat-opt-daily.active { background: var(--cat-daily-light); border-color: var(--cat-daily); color: var(--cat-daily); }
  .cat-opt-weekly.active { background: var(--cat-weekly-light); border-color: var(--cat-weekly); color: var(--cat-weekly); }
  .cat-opt-occasional.active { background: var(--cat-occasional-light); border-color: var(--cat-occasional); color: var(--cat-occasional); }
  .cat-opt-incident.active { background: var(--cat-incident-light); border-color: var(--cat-incident); color: var(--cat-incident); }
  @media (max-width: 600px) {
    .cat-picker { grid-template-columns: repeat(2, 1fr); }
  }




   
  .status-picker { display: grid; gap: 8px; }
  .status-picker.daily-mode { grid-template-columns: repeat(2, 1fr); }
  .status-picker.incident-mode { grid-template-columns: repeat(3, 1fr); }
  .status-opt { padding: 10px 8px; border: 2px solid var(--border); background: var(--surface); border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--text-muted); transition: all .15s; }
  .status-opt-pending.active { background: var(--st-pending-light); border-color: var(--st-pending); color: var(--st-pending); }
  .status-opt-open.active { background: var(--st-open-light); border-color: var(--st-open); color: var(--st-open); }
  .status-opt-progress.active { background: var(--st-progress-light); border-color: var(--st-progress); color: var(--st-progress); }
  .status-opt-assigned.active { background: #dbeafe; border-color: #2563eb; color: #2563eb; }
  .status-opt-waiting.active { background: #fff7ed; border-color: #d97706; color: #d97706; }
  .status-opt-done.active { background: var(--st-done-light); border-color: var(--st-done); color: var(--st-done); }




   
  .pri-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pri-opt { padding: 8px 6px; border: 2px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
  .pri-opt-high.active { background: #fef2f2; border-color: var(--danger); color: var(--danger); }
  .pri-opt-normal.active { background: var(--surface-2); border-color: var(--text-muted); color: var(--text); }
  .pri-opt-low.active { background: #f1f5f9; border-color: var(--pri-low); color: var(--pri-low); }




  .login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #f5f3ff 0%, #fef3c7 50%, #ecfeff 100%); }
  .login-card { background: var(--surface); border-radius: 20px; padding: 32px 28px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(15,23,42,.12); border: 1px solid var(--border); }
  .login-logo { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #7c3aed, #ec4899); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 32px; margin: 0 auto 14px; box-shadow: 0 8px 20px rgba(124,58,237,.3); }
  .login-card h1 { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; }
  .login-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 20px; }
  .login-input { width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px; font-size: 16px; text-align: center; letter-spacing: 2px; font-weight: 600; background: var(--surface); text-transform: uppercase; }
  .login-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
  .login-btn { width: 100%; margin-top: 14px; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; font-weight: 700; font-size: 15px; }
  .login-btn:hover { filter: brightness(1.05); }
  .login-error { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; text-align: center; }




  .user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; }
  .user-avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }




  .loader-wrap { display: flex; justify-content: center; align-items: center; padding: 40px; color: var(--text-muted); }
  .spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin 1s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 200; animation: slideIn .25s ease; font-size: 13px; font-weight: 600; }
  .toast.success { background: var(--success); }
  .toast.error { background: var(--danger); }
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
  .empty-state .icon { font-size: 48px; margin-bottom: 12px; }




  .section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
  .section-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }




   
  .calendar { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm); }
  .cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 0 4px; flex-wrap: wrap; gap: 10px; }
  .cal-title { font-size: 18px; font-weight: 700; }
  .cal-nav { display: flex; gap: 6px; }
  .cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
  .cal-weekday { text-align: center; padding: 8px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
  .cal-weekday.sun { color: var(--danger); }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .cal-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; min-height: 120px; padding: 8px; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; overflow: hidden; }
  .cal-cell:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
  .cal-cell.other { opacity: .4; }
  .cal-cell.today { border-color: var(--primary); background: var(--primary-light); }
  .cal-cell.has-events { border-color: #8b5cf6; }
  .cal-cell.all-done { background: linear-gradient(135deg, var(--st-done-light), var(--surface-2)); }
  .cal-day { font-size: 14px; font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
  .cal-cell.sun .cal-day { color: var(--danger); }
  .cal-cell.today .cal-day { color: var(--primary); }
  .cal-day-stats { font-size: 10px; color: var(--text-muted); display: flex; gap: 4px; }
  .cal-day-stats span { padding: 1px 5px; border-radius: 4px; font-weight: 700; }
  .cal-pill { font-size: 10px; padding: 3px 6px; border-radius: 4px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
  .cal-pill.st-open { background: var(--st-open); }
  .cal-pill.st-progress { background: var(--st-progress); }
  .cal-pill.st-done { background: var(--st-done); opacity: .7; text-decoration: line-through; }
  .cal-pill.st-pending { background: var(--st-pending); }
  .cal-pill.priority-high { box-shadow: 0 0 0 1px rgba(239,68,68,.5); }
  .cal-pill-progress { font-size: 9px; opacity: .85; margin-left: 'auto'; }
  .cal-more { font-size: 10px; color: var(--text-muted); margin-top: 3px; font-style: italic; }
  .cal-legend { display: flex; gap: 12px; margin-top: 12px; font-size: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
  .cal-legend-item { display: flex; align-items: center; gap: 4px; color: var(--text-muted); }
  .cal-legend-dot { width: 12px; height: 12px; border-radius: 3px; }
  .cal-filter-toggle { display: flex; gap: 4px; background: var(--surface-2); border-radius: 8px; padding: 3px; }
  .cal-filter-toggle button { padding: 6px 12px; border-radius: 6px; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; }
  .cal-filter-toggle button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }




   
  .vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
  .vault-card {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow-sm); transition: all .15s;
    position: relative;
  }
  .vault-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
  .vault-card.type-account { border-left-color: var(--cat-incident); }
  .vault-card.type-doc { border-left-color: var(--cat-daily); }
  .vault-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
  .vault-name { font-size: 14px; font-weight: 700; word-break: break-word; flex: 1; }
  .vault-cat-badge { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
  .vault-field { font-size: 12px; margin: 4px 0; display: flex; gap: 6px; align-items: center; }
  .vault-field-label { color: var(--text-muted); font-weight: 600; min-width: 56px; }
  .vault-field-value { flex: 1; font-family: 'SFMono-Regular', Consolas, monospace; word-break: break-all; padding: 3px 6px; background: var(--surface-2); border-radius: 4px; font-size: 12px; }
  .vault-pwd { letter-spacing: 2px; }
  .vault-actions { display: flex; gap: 4px; flex-shrink: 0; }
  .vault-icon-btn { background: transparent; border: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 13px; color: var(--text-muted); }
  .vault-icon-btn:hover { background: var(--surface-2); color: var(--text); }
  .vault-foot { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
  .vault-note { font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 6px; padding: 6px 8px; background: var(--surface-2); border-radius: 6px; }
  .vault-warning {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 2px solid #fed7aa; border-radius: 10px;
    padding: 12px 16px; margin-bottom: 14px;
    font-size: 12px; color: #78350f; display: flex; gap: 10px; align-items: flex-start;
  }
  .vault-tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 8px; padding: 3px; margin-right: 6px; }
  .vault-tabs button { padding: 6px 12px; border-radius: 6px; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; }
  .vault-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }




   
  .daily-table-wrap {
    background: linear-gradient(135deg, #ecfeff, #f0fdfa);
    border: 2px solid #67e8f9;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 14px;
  }
  .daily-table-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; gap: 10px; flex-wrap: wrap;
  }
  .daily-table-title {
    font-size: 14px; font-weight: 800; color: #0e7490;
    display: flex; align-items: center; gap: 8px;
  }
  .daily-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface); border-radius: 10px; overflow: hidden;
    border: 1px solid #cbd5e1; font-size: 13px;
  }
  .daily-table thead th {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: #fff; padding: 10px 12px; text-align: left;
    font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all .15s;
    border-right: 1px solid rgba(255,255,255,.2);
    position: relative;
  }
  .daily-table thead th:hover { background: linear-gradient(135deg, #0e7490, #155e75); }
  .daily-table thead th:last-child { border-right: none; }
  .daily-table thead th .edit-icon { opacity: 0; margin-left: 4px; font-size: 11px; transition: opacity .15s; }
  .daily-table thead th:hover .edit-icon { opacity: 1; }
  .daily-table thead th input {
    width: 100%; padding: 4px 6px; border: 2px solid #fff; border-radius: 4px;
    background: #fff; color: var(--text); font-size: 12px; font-weight: 700;
  }
  .daily-table thead th input:focus { outline: none; box-shadow: 0 0 0 2px #67e8f9; }
  .daily-table tbody td {
    padding: 8px 12px; border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border-soft, #f1f5f9);
    vertical-align: middle;
  }
  .daily-table tbody td:last-child { border-right: none; }
  .daily-table tbody tr:last-child td { border-bottom: none; }
  .daily-table tbody tr:hover td { background: #f8fafc; }
  .daily-table tbody td .cell-display {
    cursor: pointer; padding: 4px 6px; border-radius: 4px;
    min-height: 22px; display: block;
    transition: background .15s;
  }
  .daily-table tbody td .cell-display:hover { background: #ecfeff; }
  .daily-table tbody td input {
    width: 100%; padding: 4px 8px; border: 2px solid #0891b2;
    border-radius: 4px; font-size: 13px;
  }
  .daily-table tbody td input:focus { outline: none; box-shadow: 0 0 0 2px #67e8f9; }
  .daily-table .cell-empty { color: #cbd5e1; font-style: italic; font-size: 12px; }
  .daily-table .cell-link {
    color: #0891b2; text-decoration: none; font-size: 12px;
    word-break: break-all; display: inline-flex; align-items: center; gap: 4px;
  }
  .daily-table .cell-link:hover { text-decoration: underline; }
  .daily-table .row-actions {
    width: 60px; text-align: center;
  }
  .daily-table .delete-row-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--danger); font-size: 14px;
    padding: 4px 8px; border-radius: 4px;
    opacity: .5; transition: opacity .15s;
  }
  .daily-table .delete-row-btn:hover { opacity: 1; background: #fee2e2; }
  .daily-table .empty-row {
    text-align: center; color: var(--text-muted); font-style: italic;
    padding: 24px 12px; font-size: 13px;
  }




   
  .cat-list { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
  .cat-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
  .cat-row input[type="text"] { padding: 5px 8px; font-size: 13px; }
  .cat-icon-input { width: 50px; text-align: center; font-size: 18px; }
  .cat-color-input { width: 40px; height: 32px; padding: 2px; cursor: pointer; }
  .cat-add-row { display: grid; grid-template-columns: 60px 1fr 50px auto; gap: 8px; align-items: center; padding: 10px; background: var(--primary-light); border: 1px dashed var(--primary); border-radius: 8px; margin-top: 8px; }




   
  .notes-section { margin-top: 16px; padding-top: 16px; border-top: 2px dashed var(--border); }
  .notes-section h3 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .notes-count-badge { background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
  .notes-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
  .note-item { background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: 8px; padding: 8px 10px; }
  .note-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
  .note-time { font-size: 10px; color: var(--text-muted); margin-left: auto; }
  .note-delete { background: transparent; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; padding: 1px 5px; border-radius: 4px; }
  .note-delete:hover { background: #fee2e2; color: var(--danger); }
  .note-content { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
  .note-add { margin-top: 10px; background: var(--surface-2); border-radius: 10px; padding: 8px; display: flex; gap: 6px; align-items: flex-end; }
  .note-add textarea { flex: 1; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; resize: vertical; min-height: 36px; max-height: 100px; }
  .note-add-btn { padding: 7px 12px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
  .note-add-btn:disabled { opacity: .5; }




  @media (max-width: 768px) {
    .container { padding: 14px; }
    .header { padding: 12px 14px; }
    .kanban-grid { grid-template-columns: 1fr; }
    .desktop-only-section { display:none !important; }
    .kanban-mobile-tabs { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; margin-bottom:10px; padding:4px; background:var(--surface-2); border:1px solid var(--border); border-radius:10px; position:sticky; top:0; z-index:8; }
    .kanban-mobile-tab { padding:8px 3px; border-radius:7px; font-size:10px; font-weight:800; color:var(--text-muted); background:transparent; border:1px solid transparent; }
    .kanban-mobile-tab.active { color:var(--primary); background:var(--surface); border-color:var(--primary); box-shadow:var(--shadow-sm); }
    .kanban-col { display:none; min-height:360px; }
    .kanban-col.mobile-active { display:block; }
    .kc-people > span { max-width:90px; }
    .field-row { grid-template-columns: 1fr; }
    .stat-value { font-size: 20px; }
    .cal-cell { min-height: 80px; padding: 5px; }
    .cal-day { font-size: 12px; }
    .cal-pill { font-size: 9px; padding: 1px 4px; }
  }

    .quick-note-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(190px,.8fr);gap:10px;align-items:stretch}
    .quick-note-text-col textarea{box-sizing:border-box;width:100%;min-height:116px;resize:vertical;padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:var(--surface);font:inherit;color:inherit}
    .quick-note-dropzone{box-sizing:border-box;min-height:116px;border:1.5px dashed #93a4bd;border-radius:9px;background:var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center;color:#64748b;cursor:pointer;padding:12px}
    .quick-note-dropzone.is-drag{border-color:#4f46e5;background:#eef2ff;color:#4338ca}
    .quick-note-dropzone span{font-size:11px}
    .quick-note-thumb-grid,.quick-note-history-images{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
    .quick-note-thumb{position:relative;width:68px;height:54px;border:1px solid var(--border);border-radius:7px;overflow:hidden;background:#fff}
    .quick-note-thumb img,.quick-note-history-images img{width:100%;height:100%;object-fit:cover;display:block}
    .quick-note-thumb button{position:absolute;right:2px;top:2px;width:20px;height:20px;border:0;border-radius:50%;background:rgba(15,23,42,.78);color:#fff;cursor:pointer;line-height:18px}
    .quick-note-save{grid-column:1/-1;justify-self:end}
    .quick-note-history-images a{display:block;width:88px;height:70px;border:1px solid var(--border);border-radius:7px;overflow:hidden;background:#fff}
    @media(max-width:700px){.quick-note-grid{grid-template-columns:1fr}.quick-note-save{width:100%;justify-content:center}}

    .reminder-countdown{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border:1px solid #fbbf24;border-radius:9px;background:#fffbeb;color:#92400e}
    .reminder-countdown strong{font-variant-numeric:tabular-nums;font-size:17px;color:#b45309}
    @media(max-width:600px){.reminder-countdown{align-items:flex-start;flex-direction:column;gap:3px}.modal-footer{flex-wrap:wrap}.modal-footer .btn{flex:1 1 auto}}

    .quick-note-history-body{display:grid;grid-template-columns:1fr;gap:8px;align-items:start}
    .quick-note-history-body.has-images{grid-template-columns:minmax(0,1fr) minmax(112px,.55fr)}
    .quick-note-history-images{margin-top:0;justify-content:flex-end}
    .quick-note-history-images button{position:relative;display:block;width:100%;max-width:150px;height:88px;padding:0;border:1px solid var(--border);border-radius:7px;overflow:hidden;background:#fff;cursor:zoom-in}
    .quick-note-history-images button img{width:100%;height:100%;object-fit:cover;display:block}
    .quick-note-history-images button span{position:absolute;right:5px;bottom:5px;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:rgba(15,23,42,.72);font-size:12px}
    @media(max-width:430px){.quick-note-history-body.has-images{grid-template-columns:minmax(0,1fr) 105px}.quick-note-history-images button{height:74px}}

    .note-head .note-time{display:flex;align-items:flex-end;flex-direction:column;gap:1px;line-height:1.15}
    .note-head .note-time b{font-size:10px;color:var(--text-muted);font-weight:700;font-variant-numeric:tabular-nums}
    .note-head .note-time em{font-size:9px;color:var(--text-muted);font-style:normal;font-weight:400}

    .quick-note-modes{display:flex;gap:6px;margin:7px 0 10px;flex-wrap:wrap}
    .quick-note-modes button{border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text-muted);padding:6px 10px;font-size:11px;font-weight:700;cursor:pointer}
    .quick-note-modes button.active{background:#eef2ff;border-color:#6366f1;color:#4338ca}
    .quick-note-grid{grid-template-columns:minmax(0,1.25fr) minmax(150px,.65fr) minmax(165px,.75fr)}
    .quick-note-voice-col{min-height:116px;border:1px solid var(--border);border-radius:9px;background:var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:10px;text-align:center}
    .quick-note-voice-col span{font-size:10px;color:var(--text-muted)}
    .voice-record-btn{border:0;border-radius:999px;background:#ede9fe;color:#5b21b6;padding:9px 13px;font-weight:800;cursor:pointer}
    .voice-record-btn.recording{background:#fee2e2;color:#b91c1c;animation:pulseVoice 1.1s infinite}
    .voice-interim{margin-top:5px;padding:5px 7px;border-radius:6px;background:#fef3c7;color:#92400e;font-size:11px}
    .ai-read-btn{width:100%;margin-top:7px;background:#f5f3ff;color:#6d28d9;border:1px solid #c4b5fd}
    @keyframes pulseVoice{50%{transform:scale(1.04);box-shadow:0 0 0 6px rgba(239,68,68,.12)}}
    @media(max-width:850px){.quick-note-grid{grid-template-columns:1fr 1fr}.quick-note-text-col{grid-column:1/-1}}
    @media(max-width:520px){.quick-note-grid{grid-template-columns:1fr 1fr}.quick-note-text-col{grid-column:1/-1}.quick-note-voice-col,.quick-note-dropzone{min-height:102px}}

 
@media (max-width: 600px) {
  .kanban-mobile-tabs { gap:2px !important; padding:3px !important; }
  .kanban-mobile-tab { padding:6px 1px !important; font-size:9px !important; line-height:1.15 !important; white-space:normal !important; }
  .kanban-col { padding:6px !important; border-radius:9px !important; }
  .kanban-col-head-v2 { padding:7px 8px !important; gap:6px !important; }
  .kanban-col-head-v2 .col-icon { font-size:14px !important; }
  .kanban-col-head-v2 .col-name { font-size:12px !important; line-height:1.15 !important; }
  .kanban-col-head-v2 .col-cnt { font-size:10px !important; min-width:22px !important; padding:2px 6px !important; }
  .kanban-card-v2 { padding:7px 8px !important; margin-bottom:5px !important; }
  .kc-title { font-size:11.5px !important; line-height:1.25 !important; }
  .kc-desc { font-size:9.5px !important; line-height:1.3 !important; }
  .kc-pri-pill { font-size:8px !important; padding:1px 5px !important; }
}

/* iPhone layout normalization */
html, body, #root, .app {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
body { margin: 0; }
.header, .container, .kanban-grid, .kanban-col, .kanban-card-v2 {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.brand, .brand > div, .header-actions,
.kc-row1, .kc-row2, .kc-row3, .kc-title, .kc-desc {
  min-width: 0;
}
.kc-title, .kc-desc, .kanban-card-v2 a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 768px) {
  .header {
    left: 0;
    right: 0;
    align-items: flex-start;
    overflow: hidden;
  }
  .brand { width: 100%; max-width: 100%; }
  .brand > div { flex: 1 1 auto; }
  .brand h1, .brand p { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .container { padding-left: 12px !important; padding-right: 12px !important; }
  .kanban-mobile-tabs {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: stretch;
    overflow: hidden;
  }
  .kanban-mobile-tab {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
  }
  .kanban-col.mobile-active { width: 100%; max-width: 100%; }
  .kanban-col-head-v2 { width: 100%; max-width: 100%; }
  .kanban-card-v2 { overflow: hidden; }
  input[type="range"] { max-width: 100%; }
}
@media (max-width: 430px) {
  .header { padding: 10px 12px !important; gap: 10px; }
  .brand-logo { width: 38px; height: 38px; flex: 0 0 38px; }
  .brand h1 { font-size: 17px; line-height: 1.2; }
  .header-actions .btn { min-width: 0; }
  .kanban-mobile-tab { font-size: 9px !important; line-height: 1.12 !important; padding: 6px 2px !important; }
}

