*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green: #1D9E75;
    --green-light: #E1F5EE;
    --green-dark: #0F6E56;
    --bg: #f5f6f8;
    --bg2: #ffffff;
    --border: #e2e4e9;
    --text: #1a1a2e;
    --text2: #6b7280;
    --text3: #9ca3af;
    --danger: #E24B4A;
    --danger-light: #FCEBEB;
    --success: #1D9E75;
    --info: #378ADD;
    --info-light: #E6F1FB;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --radius: 10px;
    --radius-sm: 6px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }

/* TOPBAR */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 56px; background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--text); }

/* MAIN */
.main { max-width: 1280px; margin: 0 auto; padding: 20px; }

/* STATS */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-number { font-size: 28px; font-weight: 600; color: var(--text); }
.stat-number.success { color: var(--success); }
.stat-number.danger { color: var(--danger); }
.stat-number.info { color: var(--info); }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* FILTERS */
.filters { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-form select { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg2); color: var(--text); font-size: 13px; cursor: pointer; }
.filter-form select:focus { outline: none; border-color: var(--green); }

/* BOARD */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.col-header { padding: 12px 14px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.col-title { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; }
.col-dot { width: 8px; height: 8px; border-radius: 50%; }
.col-dot-todo { background: #9ca3af; }
.col-dot-doing { background: #378ADD; }
.col-dot-done { background: #1D9E75; }
.col-count { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; font-size: 11px; color: var(--text2); font-weight: 400; margin-left: auto; }
.col-body { padding: 10px; min-height: 120px; }
.col-empty { text-align: center; color: var(--text3); font-size: 12px; padding: 24px 0; }

/* TASK CARD */
.task-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; transition: box-shadow .15s, border-color .15s; user-select: none; }
.task-card:hover { box-shadow: var(--shadow); border-color: #c5c9d4; }
.task-card.late { border-left: 3px solid var(--danger); }
.task-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.task-desc { font-size: 12px; color: var(--text2); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; align-items: center; justify-content: space-between; }
.task-right { display: flex; align-items: center; gap: 6px; }
.task-done-time { font-size: 11px; color: var(--success); margin-top: 4px; }

/* TAGS */
.tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.tag-post  { background: #E1F5EE; color: #0F6E56; }
.tag-write { background: #FAEEDA; color: #854F0B; }
.tag-call  { background: var(--info-light); color: #185FA5; }
.tag-other { background: #f1f1f1; color: #5F5E5A; }

/* AVATAR */
.avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.avatar-sm { width: 22px; height: 22px; font-size: 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }

/* DEADLINE */
.deadline { font-size: 11px; color: var(--text3); }
.deadline.today { color: #BA7517; font-weight: 500; }
.deadline.late { color: var(--danger); font-weight: 500; }

/* USER PILL */
.user-pill { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px 4px 5px; font-size: 12px; color: var(--text2); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg2); color: var(--text); font-size: 13px; cursor: pointer; text-decoration: none; font-weight: 500; transition: background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--green); color: white; border-color: var(--green-dark); }
.btn-primary:hover { background: var(--green-dark); }
.btn-danger { background: var(--danger-light); color: var(--danger); border-color: #f0a0a0; }
.btn-danger:hover { background: #f9d0d0; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg); }
.btn-full { width: 100%; justify-content: center; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=password], input[type=date], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg2); color: var(--text); font-size: 13px; font-family: inherit;
    transition: border-color .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { resize: vertical; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg2); border-radius: var(--radius); padding: 20px 24px; width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text2); padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--bg); }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ALERTS */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: var(--danger-light); color: var(--danger); border: 1px solid #f0a0a0; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #9FE1CB; }

/* AUTH */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 90%; max-width: 360px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin-bottom: 24px; }
.auth-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; }

/* CARD + TABLE */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-head { padding: 12px 16px; font-weight: 500; border-bottom: 1px solid var(--border); background: var(--bg); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { padding: 10px 14px; text-align: left; font-weight: 500; font-size: 12px; color: var(--text2); border-bottom: 1px solid var(--border); background: var(--bg); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.form-inline { display: flex; gap: 8px; padding: 14px 16px; flex-wrap: wrap; align-items: flex-end; }
.badge { font-size: 11px; padding: 2px 10px; border-radius: 10px; font-weight: 500; }
.badge-admin  { background: #EEEDFE; color: #534AB7; }
.badge-member { background: var(--bg); color: var(--text2); border: 1px solid var(--border); }
code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 12px; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .board { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .topbar { padding: 0 12px; }
    .main { padding: 12px; }
}
