:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f7fb; color: #323338; padding: 24px 20px 60px;
}
.wrap { max-width: 1120px; margin: 0 auto; }
header { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0 0 4px; color: #323338; }
.sub { color: #676879; font-size: 14px; }

/* Login screen */
.login-screen { min-height: 70vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; text-align: center; }
.login-card { background: #fff; border: 1px solid #e6e9ef; border-radius: 14px; padding: 40px 44px; box-shadow: 0 4px 20px rgba(20,20,40,.06); max-width: 380px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card p { color: #676879; font-size: 13px; margin-bottom: 22px; }
#googleSignInBtn { display: flex; justify-content: center; }
.login-error { color: #a1273c; background: #fbe4e4; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-top: 14px; }

/* Current user chip */
.user-chip { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e6e9ef; border-radius: 30px; padding: 6px 14px 6px 6px; font-size: 13px; font-weight: 600; }
.user-chip img { width: 26px; height: 26px; border-radius: 50%; }
.user-chip .role-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 10px; background: #eef0f6; color: #676879; }
.user-chip .role-badge.admin { background: #e6f1fd; color: #0073ea; }
.user-chip button { border: none; background: none; color: #9699a6; font-size: 12px; cursor: pointer; text-decoration: underline; margin-left: 4px; }

.tabbar { display: flex; gap: 4px; border-bottom: 2px solid #e6e9ef; margin: 18px 0 22px; flex-wrap: wrap; align-items: center; }
.tab-btn { padding: 10px 16px; border: none; background: none; font-size: 14px; font-weight: 600; color: #676879; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: #0073ea; border-bottom-color: #0073ea; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 24px; }
.stat { background: #fff; border: 1px solid #e6e9ef; border-radius: 8px; padding: 12px 16px; min-width: 130px; flex: 1; }
.stat .num { font-size: 22px; font-weight: 700; color: #0073ea; }
.stat .label { font-size: 12px; color: #676879; margin-top: 2px; }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }
.client-card { background: #fff; border: 1px solid #e6e9ef; border-radius: 10px; padding: 16px; cursor: pointer; border-top: 4px solid #0073ea; }
.client-card:hover { box-shadow: 0 4px 14px rgba(20,20,40,.08); }
.client-card .cc-name { font-size: 15px; font-weight: 700; color: #323338; margin-bottom: 8px; }
.client-card .cc-row { display: flex; justify-content: space-between; font-size: 12px; color: #676879; margin-top: 4px; }
.client-card .cc-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }

.client-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.client-header h1 { font-size: 20px; margin: 0; }
.back-link { display: inline-block; font-size: 12px; font-weight: 600; color: #676879; text-decoration: none; margin-bottom: 6px; }
.back-link:hover { color: #0073ea; }
.quick-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.quick-link-btn {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e6e9ef; border-radius: 10px;
  padding: 12px 16px; text-decoration: none; color: #323338; font-weight: 600; font-size: 13px; flex: 1; min-width: 220px;
}
.quick-link-btn:hover { border-color: #0073ea; }
.quick-link-btn .ql-icon { font-size: 18px; }
.quick-link-btn .ql-text { display: flex; flex-direction: column; }
.quick-link-btn .ql-label { font-size: 11px; color: #9699a6; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.quick-link-btn.unset { color: #9699a6; border-style: dashed; }
.edit-link-icon { margin-left: auto; background: none; border: none; color: #9699a6; cursor: pointer; font-size: 13px; }

.extra-links { margin-bottom: 22px; }
.extra-link-chip { display: inline-flex; align-items: center; gap: 6px; background: #e6f1fd; color: #0073ea; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 6px; text-decoration: none; margin: 0 6px 6px 0; }
.extra-link-chip .del { color: #9699a6; cursor: pointer; margin-left: 4px; }
.add-link-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.add-link-row input { border: 1px solid #e6e9ef; border-radius: 6px; padding: 6px 10px; font-size: 12px; }
.add-link-row button { border: none; background: #323338; color: #fff; border-radius: 6px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }

/* Time tracking card */
.time-card { background: #fff; border: 1px solid #e6e9ef; border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; cursor: pointer; }
.time-card:hover { border-color: #0073ea; }
.time-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.time-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #9699a6; }
.time-card-edit { font-size: 12px; color: #0073ea; font-weight: 600; }
.time-card-numbers { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.time-card-numbers b { font-size: 15px; }
.time-bar-track { background: #eef0f6; border-radius: 20px; height: 8px; overflow: hidden; }
.time-bar-fill { height: 100%; border-radius: 20px; transition: width .2s; }
.time-card-over { color: #a1273c; font-weight: 700; }

.month-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.month-nav button.nav-arrow { border: 1px solid #e6e9ef; background: #fff; border-radius: 8px; width: 30px; height: 30px; font-size: 15px; cursor: pointer; }
.month-nav button.nav-arrow:hover { background: #f6f7fb; }
.month-label { font-weight: 700; font-size: 15px; min-width: 150px; }
.month-nav .btn-add-task { margin-left: auto; border: none; background: #0073ea; color: #fff; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }

.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.col { min-width: 260px; max-width: 260px; background: #eef0f6; border-radius: 10px; padding: 10px; flex-shrink: 0; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.col-head .name { font-weight: 800; font-size: 12.5px; }
.col-count { background: rgba(0,0,0,.08); border-radius: 20px; font-size: 11px; padding: 1px 8px; font-weight: 700; }
.col-cards { display: flex; flex-direction: column; gap: 8px; min-height: 24px; }
.col.dragover { outline: 2px dashed #0073ea; outline-offset: 2px; }
.task-card { background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(20,20,40,.08); cursor: grab; border-left: 4px solid #0073ea; }
.task-card:hover { box-shadow: 0 4px 12px rgba(20,20,40,.14); }
.task-card .tc-title { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.task-card .tc-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.assignee-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; color: #fff; }
.assignee-tag.chelsea { background: #0073ea; }
.assignee-tag.beau { background: #a25ddc; }
.assignee-tag.unassigned { background: #c4c4c4; }
.notify-btn { font-size: 10.5px; font-weight: 700; border: none; border-radius: 6px; padding: 3px 8px; background: #fdab3d; color: #fff; cursor: pointer; }
.notified-badge { font-size: 10.5px; color: #00c875; font-weight: 700; }
.add-card-btn { width: 100%; margin-top: 4px; background: none; border: 1.5px dashed #c9c4da; border-radius: 8px; padding: 7px; font-size: 12px; color: #9699a6; cursor: pointer; font-weight: 600; }
.add-card-btn:hover { border-color: #0073ea; color: #0073ea; }
.board-empty-note { font-size: 12px; color: #9699a6; padding: 6px; }

.wt-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.wt-add-btn { border: none; background: #0073ea; color: #fff; border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.wt-table-wrap { background: #fff; border: 1px solid #e6e9ef; border-radius: 10px; overflow: hidden; }
.wt-row-head, .wt-row { display: grid; grid-template-columns: 1.6fr 1.3fr 1.1fr 1.3fr 1.6fr 32px; gap: 10px; align-items: center; padding: 12px 16px; }
.wt-row-head { background: #f6f7fb; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #9699a6; }
.wt-row { border-top: 1px solid #eef0f6; font-size: 13px; cursor: pointer; }
.wt-row:hover { background: #fafbff; }
.wt-name { font-weight: 700; color: #323338; }
.wt-link { color: #0073ea; text-decoration: none; font-weight: 600; }
.wt-link:hover { text-decoration: underline; }
.wt-link.unset, .wt-notes { color: #9699a6; font-style: italic; }
.wt-stage-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; color: #fff; }
.wt-del { background: none; border: none; color: #9699a6; cursor: pointer; font-size: 15px; }
.wt-del:hover { color: #a1273c; }
.wt-empty { padding: 30px 16px; text-align: center; color: #9699a6; font-size: 13px; }

/* Team panel (admin) */
.team-table-wrap { background: #fff; border: 1px solid #e6e9ef; border-radius: 10px; overflow: hidden; }
.team-row-head, .team-row { display: grid; grid-template-columns: 2fr 1.4fr 1fr 160px; gap: 10px; align-items: center; padding: 12px 16px; }
.team-row-head { background: #f6f7fb; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #9699a6; }
.team-row { border-top: 1px solid #eef0f6; font-size: 13px; }
.team-person { display: flex; align-items: center; gap: 10px; }
.team-person img { width: 30px; height: 30px; border-radius: 50%; }
.team-row select { border: 1px solid #e6e9ef; border-radius: 6px; padding: 6px 8px; font-size: 12px; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(20,15,35,.45); align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px 24px; width: 420px; max-width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.modal-box h3 { margin: 0 0 14px; font-size: 17px; }
.form-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: #323338; margin-bottom: 12px; }
.form-field input, .form-field select, .form-field textarea { border: 1px solid #e6e9ef; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.form-field textarea { resize: vertical; min-height: 60px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: space-between; margin-top: 6px; }
.modal-actions .right { display: flex; gap: 8px; }
.modal-actions button { padding: 8px 16px; border-radius: 8px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.cancel-btn { background: #f1ede6; color: #4a4644; }
.save-btn { background: #0073ea; color: #fff; }
.save-btn:disabled { opacity: .6; cursor: default; }
.delete-btn { background: #fbe4e4; color: #a1273c; }

h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: #676879; margin: 0 0 12px; }
.notify-log { background: #fff; border: 1px solid #e6e9ef; border-radius: 10px; padding: 14px 16px; font-size: 13px; color: #4a4644; }
.notify-log-row { padding: 6px 0; border-bottom: 1px solid #f1ede6; }
.notify-log-row:last-child { border-bottom: none; }

.toast { position: fixed; bottom: 20px; right: 20px; background: #323338; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 2000; }
.toast.error { background: #a1273c; }
