* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; background: linear-gradient(180deg, #eef1f5 0%, #dfe4ea 100%); color: #1d1d1f; min-height: 100vh; padding: 24px; }
.container { max-width: 1500px; margin: 0 auto; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.search { flex: 1; max-width: 400px; }
.search input { width: 100%; padding: 9px 14px; border: none; border-radius: 8px; font-size: 14px; background: rgba(255,255,255,0.85); font-family: inherit; box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); }
.search input:focus { outline: 2px solid #007aff; }
.topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.top-btn { background: rgba(255,255,255,0.9); border: none; padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 600; color: #1d1d1f; box-shadow: 0 1px 3px rgba(0,0,0,0.08); font-family: inherit; }
.top-btn:hover { background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* Tabs */
.tabs-row { display: flex; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.7); padding: 4px; border-radius: 8px; }
.tab { padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; color: #86868b; font-weight: 500; }
.tab.active { background: white; color: #1d1d1f; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* Filters */
.filters { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; }
.filter-chip { background: rgba(255,255,255,0.85); border: none; padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 500; color: #1d1d1f; box-shadow: 0 1px 2px rgba(0,0,0,0.06); font-family: inherit; }
.filter-chip.active { background: #007aff; color: white; box-shadow: 0 2px 8px rgba(0,122,255,0.4); }
.filter-chip.urgent { background: #ff2d55; color: white; font-weight: 600; box-shadow: 0 2px 12px rgba(255,45,85,0.5); animation: pulse-urgent 2s infinite; }
.filter-chip.urgent.active { background: #d70021; }
@keyframes pulse-urgent { 0%,100% { box-shadow: 0 2px 12px rgba(255,45,85,0.5); } 50% { box-shadow: 0 2px 20px rgba(255,45,85,0.9); } }
.spacer-lg { width: 40px; }

/* Columns */
.view { display: none; }
.view.active { display: block; }
.columns { display: grid; grid-template-columns: 1.1fr 0.9fr 1fr; gap: 16px; }
.column { background: rgba(255,255,255,0.7); border-radius: 14px; padding: 16px; backdrop-filter: blur(30px); box-shadow: 0 1px 3px rgba(0,0,0,0.06); min-height: 300px; }
.column-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.column-title { font-size: 15px; font-weight: 700; }
.column-count { background: rgba(0,0,0,0.05); color: #86868b; font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.column-overdue .column-title { color: #ff2d55; }

.group-header { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; margin: 14px 0 8px; color: #86868b; font-weight: 600; }
.group-header:first-child { margin-top: 0; }

.task { background: white; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; display: flex; gap: 10px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.04); position: relative; align-items: flex-start; }
.task:hover { background: #f0f7ff; }
.task.done { opacity: 0.5; }
.task.done .task-title { text-decoration: line-through; }
.prio-bar { position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; }
.prio-h { background: #ff2d55; }
.prio-m { background: #ff9500; }
.prio-l { background: #34c759; }
.cb { width: 18px; height: 18px; border: 1.5px solid #d2d2d7; border-radius: 50%; flex-shrink: 0; margin-top: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center; background: white; }
.cb.checked { background: #007aff; border-color: #007aff; }
.cb.checked::after { content: '✓'; color: white; font-size: 11px; font-weight: 700; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 14px; margin-bottom: 4px; font-weight: 500; }
.meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.tag-in { background: #e3f2fd; color: #007aff; }
.tag-ex { background: #ffe5e5; color: #ff2d55; }
.tag-info { background: #e8f5e9; color: #34c759; }
.tag-urgent { background: #fff4e5; color: #ff9500; }
.deadline { font-size: 12px; color: #86868b; }
.deadline.od { color: #ff2d55; font-weight: 600; }
.subtasks-badge { font-size: 11px; color: #86868b; background: rgba(0,0,0,0.05); padding: 1px 6px; border-radius: 8px; }

/* Quick add */
.quick-add { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 8px; border: 1px dashed rgba(0,0,0,0.15); border-radius: 8px; color: #86868b; font-size: 13px; cursor: text; }
.quick-add:hover { border-color: #007aff; color: #007aff; }
.quick-add input { flex: 1; border: none; background: transparent; font-size: 13px; outline: none; font-family: inherit; display: none; }
.quick-add.active input { display: block; }
.quick-add.active .quick-add-hint { display: none; }

/* Archive */
.archive-header { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.archive-header .column-title { margin-right: auto; }
select { background: white; border: 1px solid rgba(0,0,0,0.1); padding: 4px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; }

/* Stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; background: rgba(0,0,0,0.03); border-radius: 10px; margin-top: 16px; }
.stat { text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: #007aff; }
.stat-num.red { color: #ff2d55; }
.stat-label { font-size: 11px; color: #86868b; margin-top: 2px; }

/* Calendar */
.calendar { background: rgba(255,255,255,0.7); border-radius: 14px; padding: 20px; backdrop-filter: blur(30px); }
.cal-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-topbar h2 { font-size: 18px; font-weight: 700; }
.cal-nav { background: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); font-family: inherit; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-name { text-align: center; font-size: 11px; color: #86868b; font-weight: 600; text-transform: uppercase; padding: 8px 0; }
.cal-day { min-height: 90px; background: white; border-radius: 8px; padding: 8px; font-size: 12px; }
.cal-day.other-month { opacity: 0.3; }
.cal-day.today { background: #e3f2fd; border: 1.5px solid #007aff; }
.cal-num { font-weight: 600; color: #3c4043; margin-bottom: 4px; }
.cal-task { background: #007aff; color: white; padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-task.overdue { background: #ff2d55; }
.cal-task.done { background: #86868b; text-decoration: line-through; }

/* Panel (task detail) */
.panel-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 100; }
.panel-bg.open { display: block; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; background: white; padding: 24px; overflow-y: auto; box-shadow: -4px 0 20px rgba(0,0,0,0.1); }
.panel-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #86868b; float: right; padding: 0; line-height: 1; }
.panel h2 { font-size: 18px; margin-bottom: 8px; padding-right: 30px; font-weight: 600; }
.panel-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef0f2; font-size: 13px; }
.panel-row label { color: #86868b; width: 100px; flex-shrink: 0; }
.panel-row .value { color: #1d1d1f; }
.panel-section { margin-top: 20px; }
.panel-section h3 { font-size: 12px; font-weight: 700; color: #86868b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.description { color: #3c4043; font-size: 14px; line-height: 1.5; padding: 10px; background: #f7f9fc; border-radius: 8px; }
.subtask { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.subtask input[type="checkbox"] { width: 15px; height: 15px; }
.subtask.done { text-decoration: line-through; opacity: 0.6; }

/* Modal (fullscreen) */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; align-items: center; justify-content: center; padding: 24px; }
.modal-bg.open { display: flex; }
.modal-full { background: white; border-radius: 14px; width: 100%; max-width: 1200px; height: 100%; max-height: 800px; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgba(0,0,0,0.08); flex-shrink: 0; }
.modal-head h2 { font-size: 18px; font-weight: 700; margin-right: 8px; }
.modal-search { flex: 1; max-width: 300px; padding: 7px 12px; border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; font-size: 13px; font-family: inherit; }
.add-btn { background: #007aff; color: white; border: none; padding: 7px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; font-family: inherit; }
.add-btn:hover { background: #0060df; }
.add-btn.secondary { background: rgba(0,0,0,0.05); color: #1d1d1f; }
.add-btn.secondary:hover { background: rgba(0,0,0,0.1); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-body.notes-body { display: grid; grid-template-columns: 300px 1fr; padding: 0; overflow: hidden; }

/* Materials */
.material-item { background: #f7f9fc; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.material-item:hover { background: #edf2f7; }
.material-icon { width: 32px; height: 32px; border-radius: 8px; background: #007aff; color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.material-content { flex: 1; min-width: 0; }
.material-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.material-title a { color: #007aff; text-decoration: none; }
.material-desc { font-size: 12px; color: #86868b; margin-bottom: 4px; }
.material-cat { display: inline-block; font-size: 10px; padding: 1px 6px; background: rgba(0,0,0,0.05); border-radius: 4px; color: #86868b; }
.material-delete { background: none; border: none; color: #86868b; cursor: pointer; padding: 4px; font-size: 16px; }
.material-delete:hover { color: #ff2d55; }

/* Notes */
.notes-list { border-right: 1px solid rgba(0,0,0,0.08); overflow-y: auto; }
.note-item { padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); cursor: pointer; }
.note-item:hover { background: #f7f9fc; }
.note-item.active { background: #e3f2fd; }
.note-item-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.note-item-date { font-size: 11px; color: #86868b; }
.note-item-preview { font-size: 12px; color: #86868b; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-editor { display: flex; flex-direction: column; padding: 16px 20px; }
.note-title-input { border: none; font-size: 20px; font-weight: 700; padding: 8px 0; font-family: inherit; outline: none; }
.note-body-input { flex: 1; border: none; font-size: 15px; padding: 12px 0; font-family: inherit; outline: none; resize: none; line-height: 1.5; }

/* Drive */
.breadcrumb { flex: 1; font-size: 13px; color: #86868b; }
.breadcrumb span { color: #007aff; cursor: pointer; }
.drive-hint { font-size: 12px; color: #86868b; margin-bottom: 12px; padding: 10px; background: #fff8e1; border-radius: 8px; }
.drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.drive-item { padding: 14px 10px; background: #f7f9fc; border-radius: 10px; cursor: pointer; text-align: center; }
.drive-item:hover { background: #edf2f7; }
.drive-icon { font-size: 40px; margin-bottom: 8px; }
.drive-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-empty { text-align: center; color: #86868b; padding: 60px 20px; font-size: 14px; }

/* Form (for add material) */
.form-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300; display: none; align-items: center; justify-content: center; }
.form-overlay.open { display: flex; }
.form-box { background: white; border-radius: 12px; padding: 24px; width: 440px; max-width: 90vw; }
.form-box h3 { font-size: 17px; margin-bottom: 14px; font-weight: 600; }
.form-box label { display: block; font-size: 12px; color: #86868b; margin: 12px 0 6px; }
.form-box input, .form-box textarea, .form-box select { width: 100%; padding: 8px 12px; border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; font-size: 14px; font-family: inherit; }
.form-box textarea { min-height: 60px; resize: vertical; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.btn-cancel { background: rgba(0,0,0,0.05); color: #1d1d1f; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; font-family: inherit; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1d1d1f; color: white; padding: 12px 20px; border-radius: 10px; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); z-index: 500; opacity: 0; transform: translateY(20px); transition: all 0.25s; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Empty state */
.empty { text-align: center; color: #86868b; font-size: 13px; padding: 40px 20px; }

/* Responsive */
@media (max-width: 1100px) {
  .columns { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .search { order: 3; max-width: none; width: 100%; }
}
