/* ─────────────────────────────────────────────
   New Work — Main Stylesheet
   Palette: bg #f5f5f5 · text #2d2d2d · accent #c8f060
   Fonts: Inter (body) · Rajdhani (headings)
───────────────────────────────────────────── */

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

:root {
  --bg:         #f5f5f5;
  --surface:    #ffffff;
  --border:     #e4e4e4;
  --text:       #2d2d2d;
  --text-muted: #888888;
  --accent:     #c8f060;
  --accent-dark:#a8d040;
  --danger:     #e05252;
  --sidebar-w:  240px;
  --radius:     10px;
  --shadow:     0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --transition: 160ms ease;
}

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: .01em;
  line-height: 1.2;
}

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

/* ─── UTILITIES ─────────────────────────────── */
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ─── AUTH SCREEN ───────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 2.5rem;
}

.auth-logo {
  height: 36px;
  width: auto;
  display: block;
}

.auth-brand h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
}

.auth-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.4rem 2.8rem;
  width: 100%;
  max-width: 400px;
}

.auth-panel.active { display: block; }

.auth-panel h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .3rem;
}

.auth-sub {
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 1.8rem;
}

/* Fields */
.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}

.field input {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.field input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(200,240,96,.25);
  background: var(--surface);
}

.field input::placeholder { color: #bbb; }

/* Buttons */
.btn-primary {
  width: 100%;
  padding: .75rem 1rem;
  margin-top: .5rem;
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.btn-primary:hover  { background: var(--accent-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* Loader spinner */
.btn-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(45,45,45,.3);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Form errors */
.form-error {
  background: #fff0f0;
  border: 1px solid #fcc;
  color: var(--danger);
  border-radius: 6px;
  padding: .6rem .8rem;
  font-size: .85rem;
  margin-bottom: .8rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.4rem;
  font-size: .875rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── APP SHELL ─────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.4rem 1.2rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.sidebar-brand {
  cursor: pointer;
}

.sidebar-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .02em;
  color: var(--text);
}

/* Nav */
.sidebar-nav {
  padding: .8rem .6rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .7rem;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent);
  color: var(--text);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}

/* Sidebar bottom */
.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: .6rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  border-radius: 7px;
  margin-top: .4rem;
  overflow: hidden;
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .8rem;
  flex-shrink: 0;
  color: var(--text);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.logout-btn:hover { color: var(--danger); background: #fff0f0; }
.logout-btn svg { width: 15px; height: 15px; }

/* WebSocket status */
.ws-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem 1.2rem .8rem;
  font-size: .72rem;
  color: var(--text-muted);
  cursor: default;
}

.ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
  transition: background .5s;
}

.ws-status.connected .ws-dot  { background: #5cb85c; box-shadow: 0 0 0 2px rgba(92,184,92,.25); }
.ws-status.connected .ws-label { color: #5cb85c; }

/* ─── MAIN CONTENT ──────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#view-container {
  flex: 1;
  padding: 2rem 2.4rem;
}

/* ─── VIEW: PAGE HEADER ─────────────────────── */
.view-header {
  margin-bottom: 1.8rem;
}

.view-header h2 {
  font-size: 1.9rem;
  font-weight: 700;
}

.view-header p {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .2rem;
}

/* ─── VIEW: DASHBOARD ───────────────────────── */
.stats-dashboard-row {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stats-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stats-col-month {
  flex: 2 1 0;
  padding-right: 1rem;
  border-right: 2px solid var(--border);
}

.stats-col-general {
  flex: 1 1 0;
}

.stats-col-header {
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: .6rem;
}

.stats-col-header-month {
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
}

.stats-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  flex-shrink: 0;
  gap: .4rem;
  margin-bottom: 0;
}

.stat-group {
  display: contents;
}

.stat-group-hq .stat-card:first-child {
  margin-left: .5rem;
  padding-left: .5rem;
  border-left: 2px solid var(--border);
}

.stat-card {
  flex: 1 1 0;
  min-width: 0;
  padding: .55rem .45rem;
  white-space: normal;
}

.stat-card .stat-label {
  font-size: .62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.stat-card .stat-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: .62rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* Coluna "Este mês" — mais larga (2fr): fila única de 7 cards, com folga */
.stats-col-month .stats-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .6rem;
}

.stats-col-month .stat-card {
  padding: .8rem .55rem;
}

.stats-col-month .stat-card .stat-label {
  font-size: .64rem;
  letter-spacing: .03em;
}

.stats-col-month .stat-card .stat-value {
  font-size: 1.7rem;
}

.stats-col-month .stat-card .stat-sub {
  font-size: .66rem;
}

.stat-card-hq {
  background: #f4f7f2;
}

.stats-totals-chart {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  overflow: hidden;
}

/* ─── TOAST NOTIFICATIONS ───────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: 8px;
  font-size: .85rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  pointer-events: all;
  animation: slideIn .25s ease;
  max-width: 300px;
}

.toast.success { background: #3a7d44; }
.toast.error   { background: var(--danger); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── EMPTY STATE ───────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: .35;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: .4rem;
  color: var(--text);
}

/* ─── RESPONSIVE ────────────────────────────── */
@media (max-width: 640px) {
  .auth-panel { padding: 1.8rem 1.4rem; }
}

/* ─── BUTTONS (inline) ───────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .95rem;
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-accent            { background: var(--accent);    color: var(--text); }
.btn-accent:hover      { background: var(--accent-dark); }

.btn-ghost             { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover       { background: var(--bg); color: var(--text); }

.btn-danger            { background: var(--danger);  color: #fff; border-color: transparent; }
.btn-danger:hover      { background: #c94040; }

.btn-danger-ghost      { background: transparent; color: var(--danger); border-color: #fcc; }
.btn-danger-ghost:hover { background: #fff0f0; }

/* ─── VIEW HEADER ROW ────────────────────────── */
.view-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.6rem;
  gap: 1rem;
}

.view-header-row .view-header { margin-bottom: 0; }

/* ─── TABLE TOOLBAR ──────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: .5rem .8rem .5rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-wrap input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(200,240,96,.2);
  background: var(--surface);
}

.search-wrap input::placeholder { color: #bbb; }

.count-label {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

/* ─── DATA TABLE ─────────────────────────────── */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table th {
  text-align: left;
  padding: .65rem 1.1rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
}

.data-table td {
  padding: .78rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td      { background: var(--bg); }
.data-table .text-muted            { color: var(--text-muted); font-size: .85rem; }
.data-table .client-name           { font-weight: 500; }

.client-code {
  display: inline-block;
  padding: .18rem .48rem;
  background: rgba(200,240,96,.28);
  border-radius: 5px;
  font-family: 'Rajdhani', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
}

.row-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .3rem .35rem;
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}

.row-edit-btn:hover { color: var(--text); background: var(--border); }

.loading-row {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: .875rem;
}

.table-empty {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text-muted);
}

.table-empty svg {
  width: 44px;
  height: 44px;
  margin: 0 auto .9rem;
  display: block;
  opacity: .28;
}

.table-empty p     { font-size: .9rem; line-height: 1.7; }
.table-empty span  { font-size: .8rem; }

/* ─── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,30,30,.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .16s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.16);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp .2s ease;
}

/* form e wrappers intermédios herdam o flex do .modal para o scroll funcionar */
.modal > form,
.modal > div:not(.modal-header) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 { font-size: 1.2rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .3rem;
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}

.modal-close:hover { color: var(--text); background: var(--bg); }

.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  gap: .6rem;
  flex-shrink: 0;
}

.modal-footer-right {
  display: flex;
  gap: .6rem;
  margin-left: auto;
}

/* ─── FORM GRID (modal) ──────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1.1rem;
}

.form-grid .field.full { grid-column: 1 / -1; }

.field textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  min-height: 78px;
  outline: none;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field textarea:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(200,240,96,.25);
  background: var(--surface);
}

.input-readonly {
  opacity: .6 !important;
  cursor: default !important;
}

.req { color: var(--danger); margin-left: 1px; }

/* ─── FIELD SELECT ───────────────────────────── */
.field select {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.2rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.field select:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(200,240,96,.25);
  background-color: var(--surface);
}

/* ─── FILTER GROUP ───────────────────────────── */
.filter-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: .46rem .8rem;
  padding-right: 2rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  color: var(--text-muted);
  background: var(--bg);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.filter-select:focus  { border-color: var(--accent-dark); outline: none; }
.filter-select:hover  { border-color: #ccc; color: var(--text); }

/* ─── MONTH TABS ─────────────────────────────── */
.month-tabs {
  display: flex;
  gap: 7px;
  width: 100%;
  overflow-x: auto;
}

.month-tab-btn {
  flex: 1 1 0;
  padding: .5rem .9rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.month-tab-btn:hover { background: var(--bg); color: var(--text); }

.month-tab-btn.is-selected {
  background: #D6CFC7;
  border-color: #c1b6a9;
  color: var(--text);
}
.month-tab-btn.is-selected:hover { background: #cec5ba; }

.month-tab-btn.is-current-month::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: #555;
}

/* ─── BADGES ─────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .52rem;
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  line-height: 1.5;
}

.badge-muted   { background: rgba(136,136,136,.12); color: #666; }
.badge-info    { background: rgba(59,130,246,.12);  color: #2563eb; }
.badge-warn    { background: rgba(234,179,8,.15);   color: #a16207; }
.badge-success { background: rgba(34,197,94,.15);   color: #15803d; }
.badge-danger  { background: rgba(224,82,82,.13);   color: var(--danger); }

/* ─── TASK CODE ──────────────────────────────── */
.task-code {
  display: inline-block;
  padding: .18rem .48rem;
  background: rgba(200,240,96,.22);
  border-radius: 5px;
  font-family: 'Rajdhani', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  white-space: nowrap;
}

.task-title { font-weight: 500; }

/* ─── ASSIGNEE AVATARS ───────────────────────── */
.assignees-cell {
  display: flex;
  align-items: center;
  gap: -4px;
}

.assignee-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  font-size: .65rem;
  font-weight: 700;
  border: 2px solid var(--surface);
  margin-right: -5px;
  flex-shrink: 0;
  cursor: default;
}

/* ── Avatar picker (modal de tarefa) ─────────── */

.assignee-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  min-height: 2.4rem;
  align-items: center;
}

.picker-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  background: var(--accent);
  color: #000;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
  transition: border-color .13s, transform .1s, box-shadow .13s;
}

.picker-avatar:hover {
  transform: scale(1.1);
}

.picker-avatar.selected {
  border-color: #c8f060;
  box-shadow: 0 0 0 2px #c8f060;
}

.picker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
}

.assignee-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 600;
  border: 2px solid var(--surface);
  margin-left: 3px;
}

/* ─── PROJECT DOT ────────────────────────────── */
.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-block;
}

/* ─── PROGRESS BAR ───────────────────────────── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  min-width: 60px;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
  background: var(--accent);
}

.progress-label {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

/* ─── TASKS CHIP ─────────────────────────────── */
.tasks-chip {
  display: inline-block;
  padding: .15rem .45rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── COLOR PICKER ───────────────────────────── */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.color-swatches {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.color-swatch:hover         { transform: scale(1.15); }
.color-swatch-active        { border-color: var(--text) !important; transform: scale(1.15); }

.color-input {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 2px;
  background: var(--bg);
  cursor: pointer;
}

/* ─── ICON PICKER ─────────────────────────────── */
.icon-swatches {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.icon-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.icon-swatch:hover        { background: var(--bg); color: var(--text); }
.icon-swatch-active       { border-color: var(--text); background: var(--accent); color: var(--text); }

/* ─── CALENDAR ───────────────────────────────── */
.cal-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 175px);
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cal-month-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
}

.cal-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.cal-nav-btn:hover { background: var(--bg); color: var(--text); }

.cal-today-btn {
  margin-left: .4rem;
  font-size: .82rem;
  padding: .38rem .75rem;
}

.cal-grid-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cal-dow {
  padding: .55rem .75rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
}

.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: .45rem .55rem;
  min-height: 110px;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell:hover { background: #fafafa; }

.cal-cell.other-month { background: #fafafa; }
.cal-cell.other-month .cal-day-num { color: #ccc; }

.cal-cell.today .cal-day-num {
  background: var(--accent);
  color: var(--text);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.cal-day-num {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  align-self: flex-end;
  line-height: 1;
  margin-bottom: .1rem;
  flex-shrink: 0;
}

.cal-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.cal-event-pill {
  font-size: .71rem;
  font-weight: 500;
  padding: .18rem .42rem;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--transition), filter var(--transition);
  line-height: 1.5;
  mix-blend-mode: multiply;
}

.cal-event-pill:hover { filter: brightness(.9); }
.cal-event-task    { cursor: pointer; }
.cal-event-project { cursor: pointer; }
.cal-event-task:hover,
.cal-event-project:hover { filter: brightness(.88); }

/* ── Status dropdown inline (tabela tarefas) ──── */
.status-dd-wrap { position: relative; display: inline-block; }

.status-dd-btn {
  cursor: pointer;
  border: none;
  font-size: .76rem;
  font-weight: 600;
  padding: .22rem .6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.status-dd-btn:hover { filter: brightness(.9); }

.status-dd {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.14);
  z-index: 300;
  min-width: 130px;
  padding: .3rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.status-dd.hidden { display: none; }

.status-dd-opt {
  background: none;
  border: none;
  text-align: left;
  padding: .38rem .65rem;
  font-size: .8rem;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
}
.status-dd-opt:hover   { background: var(--bg); }
.status-dd-opt.current { font-weight: 600; color: var(--accent); }

/* ── Preview popup do calendário ─────────────── */
.cal-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,20,20,.35);
  backdrop-filter: blur(2px);
  animation: fadeIn .14s ease;
}
.cal-preview-overlay.hidden { display: none; }

.cal-preview-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: 320px;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  animation: slideUp .18s ease;
}

.cal-preview-header {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .9rem 1.1rem .8rem;
  border-bottom: 1px solid var(--border);
}

.cal-preview-header strong {
  flex: 1;
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-preview-close-x {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.cal-preview-close-x:hover { color: var(--text); background: var(--bg); }

.cal-preview-body {
  padding: .85rem 1.1rem;
  font-size: .84rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem .8rem;
  align-items: baseline;
  color: var(--text);
}
.cal-preview-body .lbl { color: var(--text-muted); white-space: nowrap; }

.cal-preview-footer {
  padding: .75rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.cal-overflow {
  font-size: .68rem;
  color: var(--text-muted);
  padding: .1rem .3rem;
  cursor: pointer;
  font-weight: 500;
}

.cal-overflow:hover { color: var(--text); }

/* ─── REPORTS ────────────────────────────────── */
.report-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.report-row.single {
  grid-template-columns: 1fr;
}

.report-section {
  padding: 1.4rem 1.6rem;
}

.report-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  color: var(--text);
}

.report-bar-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .65rem;
}

.report-bar-row:last-child { margin-bottom: 0; }

.report-bar-label {
  font-size: .82rem;
  color: var(--text-muted);
  min-width: 72px;
  white-space: nowrap;
  flex-shrink: 0;
}

.report-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.report-bar-fill {
  height: 100%;
  border-radius: 99px;
  min-width: 4px;
  transition: width .5s ease;
}

.report-bar-count {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.report-empty {
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0;
}

@media (max-width: 860px) {
  .report-row { grid-template-columns: 1fr; }
}

/* ─── AVATAR UPLOAD (Definições) ────────────────── */
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar-upload-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--border);
}

.avatar-upload-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
