:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e4e7ec;
  --text: #1a2233;
  --text-muted: #667085;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --gray: #98a2b3;
  --gray-soft: #f2f4f7;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 8px 24px rgba(16,24,40,.10);
}

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 6px;
}
.login-sub { color: var(--text-muted); margin-bottom: 24px; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: #111827;
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 20px 0;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 20px;
  color: #fff; font-weight: 700; font-size: 18px;
  border-bottom: 1px solid #1f2937;
}
.sidebar .brand svg { color: var(--primary); }
.nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 8px; color: #d1d5db;
  font-weight: 500;
}
.nav a:hover { background: #1f2937; color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .user-box {
  border-top: 1px solid #1f2937; padding: 16px 20px; display: flex; align-items: center; gap: 10px;
}
.sidebar .user-box a { color: #d1d5db; }

.main { flex: 1; margin-left: 240px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.tb-right { display: flex; align-items: center; gap: 16px; }

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

/* ---------- Avatar ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; flex-shrink: 0;
}

/* ---------- Cards / Stats ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.stat-card .label { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .icon { float: right; opacity: .9; }
.stat-card.p-primary { border-top: 3px solid var(--primary); }
.stat-card.p-green { border-top: 3px solid var(--green); }
.stat-card.p-blue { border-top: 3px solid var(--blue); }
.stat-card.p-amber { border-top: 3px solid var(--amber); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .card-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card .card-h h2 { font-size: 16px; }
.card .card-b { padding: 20px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 12px 16px; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-card { overflow: hidden; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge.gray   { background: var(--gray-soft); color: #475467; }
.badge.blue   { background: var(--blue-soft); color: var(--blue); }
.badge.green  { background: var(--green-soft); color: var(--green); }
.badge.amber  { background: var(--amber-soft); color: var(--amber); }
.badge.red    { background: var(--red-soft); color: var(--red); }
.badge.priority-low { background: #f0f2f5; color: #475467; }
.badge.priority-medium { background: var(--blue-soft); color: var(--blue); }
.badge.priority-high { background: var(--amber-soft); color: var(--amber); }
.badge.priority-urgent { background: var(--red-soft); color: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); }

.actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 13px; color: var(--text); }
input, select, textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .filters { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Flash ---------- */
.flash { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.flash.success { background: var(--green-soft); color: var(--green); border: 1px solid #bbf7d0; }
.flash.error { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; }
.flash.info { background: var(--blue-soft); color: var(--blue); border: 1px solid #bfdbfe; }

/* ---------- Empty state ---------- */
.empty { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- KANBAN ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-col {
  background: #eef1f6;
  border-radius: 12px;
  padding: 12px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
}
.kanban-col.drag-over { border-color: var(--primary); background: #e6eaf7; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.col-head .title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-head .count { background: #d7dbe4; color: #475467; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; }

.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; flex: 1; }
.kanban-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; box-shadow: var(--shadow); cursor: grab;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
.kanban-card .k-title { font-weight: 600; margin: 8px 0; }
.kanban-card .k-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.kanban-card .k-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.k-avatar { width: 26px; height: 26px; border-radius: 50%; font-size: 11px; }
.k-avatar.unassigned { background: var(--gray-soft); color: var(--text-muted); }
.k-due { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.k-due.overdue { color: var(--red); font-weight: 600; }
.k-priority { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.k-priority.low { background: #98a2b3; }
.k-priority.medium { background: var(--blue); }
.k-priority.high { background: var(--amber); }
.k-priority.urgent { background: var(--red); }
.dot.to_do { background: #98a2b3; }
.dot.in_progress { background: var(--blue); }
.dot.review { background: var(--amber); }
.dot.done { background: var(--green); }
.dot.analysis { background: var(--amber); }
.dot.approved { background: var(--blue); }
.dot.finished { background: var(--green); }

.col-actions { display: flex; gap: 4px; }
@media (max-width: 1200px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Misc ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) {
  .sidebar { width: 62px; }
  .sidebar .brand span, .sidebar .nav a span, .sidebar .user-box .uinfo { display: none; }
  .sidebar .nav a { justify-content: center; }
  .main { margin-left: 62px; }
  .grid-2 { grid-template-columns: 1fr; }
}
.muted { color: var(--text-muted); }
.label-tag { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; display: block; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; }
.wrap { flex-wrap: wrap; }
.empty-row td { padding: 40px; text-align: center; color: var(--text-muted); }
.search-input { padding: 9px 30px 9px 12px; }

/* ---------- Notifica��es / Sino ---------- */
.bell { position: relative; color: var(--text-muted); display: inline-flex; }
.bell:hover { color: var(--text); }
.bell-badge {
  position: absolute; top: -5px; right: -6px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; min-width: 17px; height: 17px; line-height: 17px;
  text-align: center; padding: 0 4px;
}
.notif-item {
  display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-soft); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.notif-item .n-title { font-weight: 600; }
.notif-item .n-msg { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.notif-item .n-time { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.notif-item .n-actions { margin-top: 8px; }

/* ---------- Pagamentos ---------- */
.pay-methods { }
.install-table .i-num { font-weight: 700; color: var(--text); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.due { color: var(--red); }
.money.paid { color: var(--green); }
.timeline-upcoming li { list-style: none; padding-left: 0; }

/* mini pill toggles */
.seg { display: inline-flex; background: var(--gray-soft); border-radius: 8px; padding: 2px; }
.seg button, .seg a { border: none; background: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--text-muted); font-size: 13px; }
.seg button.active, .seg a.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.progress-bar { background: var(--gray-soft); border-radius: 6px; height: 8px; overflow: hidden; }

/* ---------- Modal de confirmação ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(16,24,40,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 400px;
  padding: 24px;
  transform: translateY(8px) scale(.98);
  transition: transform .15s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-soft); color: var(--red);
  margin-bottom: 16px;
}
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.modal p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Post-Its ---------- */
.postits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.postit {
  border-radius: 10px;
  padding: 16px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.postit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.postit.pinned { box-shadow: 0 0 0 2px var(--primary), var(--shadow-md); }
.postit-yellow { background: #fef9c3; color: #713f12; }
.postit-pink { background: #fce7f3; color: #831843; }
.postit-blue { background: #dbeafe; color: #1e3a5f; }
.postit-green { background: #dcfce7; color: #14532d; }
.postit-orange { background: #ffedd5; color: #7c2d12; }
.postit-purple { background: #f3e8ff; color: #581c87; }
.postit-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.postit-pin { font-size: 14px; opacity: .6; }
.postit-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.postit:hover .postit-actions { opacity: 1; }
.postit-actions a { display:flex; padding:4px; border-radius:4px; color:inherit; opacity:.6; }
.postit-actions a:hover { opacity:1; background:rgba(0,0,0,.08); }
.postit-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.postit-content { font-size: 13px; line-height: 1.5; flex: 1; opacity: .85; white-space: pre-wrap; }
.postit-footer { margin-top: 10px; font-size: 11px; opacity: .5; }
.color-dot { display:inline-block; width:28px; height:28px; border-radius:50%; transition:transform .15s; }
.postit-color-opt input:checked + .color-dot { transform:scale(1.2); }

/* Kanban card payment small tag */
