/* ============================================================
   TaskFlow — Employee Task Management UI Mockup
   Shared stylesheet for CEO / Manager / Employee dashboards
   (Mockup only — no backend wired yet)
   ============================================================ */

:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --border:    #e6e9f2;
  --text:      #1e2438;
  --text-soft: #6b7390;
  --muted:     #9aa1bd;

  --brand:     #4f46e5;
  --brand-600: #4338ca;
  --brand-50:  #eef0ff;

  /* role accents */
  --ceo:      #7c3aed;
  --ceo-50:   #f3ebff;
  --manager:  #2563eb;
  --manager-50:#e7efff;
  --employee: #0d9488;
  --employee-50:#e2f6f3;

  /* status colors */
  --st-pending:    #b45309;  --st-pending-bg:    #fef3c7;
  --st-progress:   #1d4ed8;  --st-progress-bg:   #dbeafe;
  --st-completed:  #047857;  --st-completed-bg:  #d1fae5;
  --st-overdue:    #b91c1c;  --st-overdue-bg:    #fee2e2;
  --st-review:     #7c3aed;  --st-review-bg:     #ede9fe;

  --shadow-sm: 0 1px 2px rgba(20,24,52,.06);
  --shadow:    0 4px 16px rgba(20,24,52,.08);
  --shadow-lg: 0 12px 40px rgba(20,24,52,.16);
  --radius:    14px;
  --radius-sm: 9px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ===================== App shell ===================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: #161a2e;
  color: #c7cce0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.brand .name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand .name small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .5px; }

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav .group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: #5e6486; padding: 14px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border-radius: 9px;
  color: #b6bcd6; font-weight: 500;
  margin-bottom: 2px; cursor: pointer;
  transition: all .15s;
}
.nav a .ico { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.nav a .badge { margin-left: auto; }

.side-user {
  padding: 14px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 11px;
}
.side-user .avatar { width: 36px; height: 36px; }
.side-user .meta { line-height: 1.3; overflow: hidden; }
.side-user .meta b { color: #fff; font-size: 13px; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.side-user .meta span { color: var(--muted); font-size: 11.5px; }
.side-user .logout { margin-left: auto; color: var(--muted); font-size: 16px; }
.side-user .logout:hover { color: #fff; }

/* ===================== Main ===================== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar h1 small { display: block; font-size: 12.5px; color: var(--text-soft); font-weight: 400; margin-top: 1px; }

.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  padding: 8px 13px; border-radius: 9px; width: 260px;
  color: var(--muted);
}
.search input { border: none; background: none; outline: none; flex: 1; font-size: 13px; color: var(--text); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; font-size: 16px;
  color: var(--text-soft); position: relative;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; border: 2px solid var(--surface); }

.content { padding: 26px 28px; flex: 1; }

/* role banner */
.role-banner {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 20px;
}
.role-banner.ceo      { background: var(--ceo-50);      color: var(--ceo); }
.role-banner.manager  { background: var(--manager-50);  color: var(--manager); }
.role-banner.employee { background: var(--employee-50); color: var(--employee); }

/* ===================== Stat cards ===================== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .ic {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; margin-bottom: 14px;
}
.stat .label { color: var(--text-soft); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; }
.stat .trend { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.trend.up { color: var(--st-completed); }
.trend.down { color: var(--st-overdue); }
.ic.purple { background: var(--ceo-50); color: var(--ceo); }
.ic.blue   { background: var(--manager-50); color: var(--manager); }
.ic.green  { background: var(--st-completed-bg); color: var(--st-completed); }
.ic.amber  { background: var(--st-pending-bg); color: var(--st-pending); }
.ic.red    { background: var(--st-overdue-bg); color: var(--st-overdue); }
.ic.teal   { background: var(--employee-50); color: var(--employee); }

/* ===================== Cards / panels ===================== */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.grid-2.even { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15.5px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--text-soft); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }

/* ===================== Tables ===================== */
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 600; padding: 12px 20px; background: #fafbff;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub  { font-size: 12px; color: var(--text-soft); }

/* ===================== Badges ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge .dotmark { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending   { background: var(--st-pending-bg);   color: var(--st-pending); }
.badge.progress  { background: var(--st-progress-bg);  color: var(--st-progress); }
.badge.completed { background: var(--st-completed-bg);  color: var(--st-completed); }
.badge.overdue   { background: var(--st-overdue-bg);   color: var(--st-overdue); }
.badge.review    { background: var(--st-review-bg);    color: var(--st-review); }
.badge.role-ceo      { background: var(--ceo-50);      color: var(--ceo); }
.badge.role-manager  { background: var(--manager-50);  color: var(--manager); }
.badge.role-employee { background: var(--employee-50); color: var(--employee); }
.badge.soft { background: var(--bg); color: var(--text-soft); }

.prio { display:inline-flex; align-items:center; gap:5px; font-weight:600; font-size:12.5px; }
.prio.high   { color: var(--st-overdue); }
.prio.medium { color: var(--st-pending); }
.prio.low    { color: var(--text-soft); }

/* ===================== Avatars ===================== */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.av-1 { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.av-2 { background: linear-gradient(135deg,#0ea5e9,#2563eb); }
.av-3 { background: linear-gradient(135deg,#10b981,#0d9488); }
.av-4 { background: linear-gradient(135deg,#f59e0b,#f97316); }
.av-5 { background: linear-gradient(135deg,#ec4899,#db2777); }
.av-6 { background: linear-gradient(135deg,#64748b,#475569); }
.user-cell { display: flex; align-items: center; gap: 11px; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.btn.primary:hover { background: var(--brand-600); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { color: var(--st-overdue); border-color: #f3c9c9; }
.btn.danger:hover { background: var(--st-overdue-bg); }

.act-icons { display: flex; gap: 4px; }
.act { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--text-soft); font-size: 14px; }
.act:hover { background: var(--bg); color: var(--text); }
.act.del:hover { background: var(--st-overdue-bg); color: var(--st-overdue); }

/* ===================== Forms ===================== */
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.input, .select, textarea.input {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: var(--surface); outline: none;
  transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
textarea.input { resize: vertical; min-height: 86px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ===================== Task list (employee) ===================== */
.task-item {
  display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); align-items: flex-start;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: #fafbff; }
.task-check {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 2px; cursor: pointer;
}
.task-check.done { background: var(--st-completed); border-color: var(--st-completed); color:#fff; display:grid; place-items:center; font-size:12px; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.task-desc { color: var(--text-soft); font-size: 13px; margin-bottom: 9px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-soft); }
.task-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* progress bar */
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,var(--brand),#8b5cf6); }

/* timeline / comments */
.comment { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.comment:last-child { border-bottom: none; }
.comment .body { flex: 1; }
.comment .body .who { font-weight: 600; font-size: 13px; }
.comment .body .when { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.comment .body .text { font-size: 13px; color: var(--text-soft); margin-top: 3px; }

/* ===================== Modal ===================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,24,52,.45); backdrop-filter: blur(2px);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: grid; }
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease;
}
.modal.lg { max-width: 720px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { font-size: 16.5px; font-weight: 700; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 20px; width:32px;height:32px;display:grid;place-items:center;border-radius:8px; }
.modal-head .x:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 22px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: #fafbff; }

/* ===================== Misc ===================== */
.section-title { font-size: 15px; font-weight: 700; margin: 4px 0 14px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.kv { display:flex; justify-content:space-between; padding:9px 0; border-bottom:1px dashed var(--border); font-size:13px; }
.kv:last-child { border-bottom:none; }
.kv span { color: var(--text-soft); }
.kv b { font-weight:600; }

.pill-tabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 4px; gap: 4px; }
.pill-tabs a { padding: 7px 15px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-soft); cursor: pointer; }
.pill-tabs a.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* responsive */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2,1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 820px)  { .sidebar { display: none; } .search { display: none; } }
