/* ==========================================================================
   TICKET SYSTEM — DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Manrope:wght@600;700;800&display=swap');

/* ==========================================================================
   1. CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */

:root {
  --ink: #1a1a2e;
  --muted: #6b6b82;
  --subtle: #9393a8;
  --line: #e8e8ef;
  --surface: #f7f7fb;
  --white: #ffffff;
  --primary: #635bff;
  --primary-dark: #4f46e5;
  --primary-light: #f0efff;
  --primary-muted: #c7c5ff;
  --success: #087f5b;
  --success-bg: #e6fcf5;
  --danger: #c92a2a;
  --danger-bg: #fff5f5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 3px rgba(25,25,60,.06);
  --shadow-sm: 0 2px 8px rgba(25,25,60,.08);
  --shadow-md: 0 4px 16px rgba(25,25,60,.10);
  --shadow-lg: 0 8px 32px rgba(25,25,60,.14);
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Manrope', system-ui, sans-serif;
  --sidebar-w: 256px;
  --sidebar-w-sm: 64px;
  --transition: 0.2s ease;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin-top: 0;
  line-height: 1.25;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: var(--ink);
}

h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

p {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--subtle);
}

/* ==========================================================================
   4. LAYOUT — APP SHELL
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   5. LAYOUT — SIDEBAR
   ========================================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 24px 14px 20px;
  background: #1e1e30;
  color: #d5d5e4;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition);
  /* overflow: visible permite que o botão toggle apareça fora da sidebar */
  overflow: visible;
}

/* Collapsed state */
.sidebar-collapsed .sidebar {
  width: var(--sidebar-w-sm);
  padding: 24px 10px 20px;
}

/* ==========================================================================
   6. SIDEBAR — TOGGLE BUTTON
   ========================================================================== */

.sidebar-toggle {
  position: absolute;
  right: -14px;
  top: 32px;
  background: var(--primary);
  color: var(--white);
  border: 2px solid #1e1e30;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  z-index: 110;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.15);
}

/* ==========================================================================
   7. SIDEBAR — BRAND
   ========================================================================== */

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 6px 32px;
  color: var(--white);
  text-decoration: none;
  font: 800 22px var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  transition: padding var(--transition);
}

.brand:hover {
  text-decoration: none;
  color: var(--white);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--white);
  font: 800 17px var(--font-display);
  flex-shrink: 0;
}

.brand-text {
  transition: opacity var(--transition), width var(--transition);
  overflow: hidden;
}

.brand-dot {
  color: var(--primary-muted);
}

.sidebar-collapsed .brand {
  padding: 0 0 32px;
}

.sidebar-collapsed .brand-text {
  opacity: 0;
  width: 0;
}

/* ==========================================================================
   8. SIDEBAR — NAVIGATION
   ========================================================================== */

.nav-caption {
  margin: 14px 8px 6px;
  color: #7a7a94;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar-collapsed .nav-caption {
  opacity: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: #c3c3d5;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
}

.nav-link:hover {
  color: var(--white);
  background: #2e2d46;
  text-decoration: none;
}

.nav-link.active {
  color: var(--white);
  background: #2e2d46;
  box-shadow: inset 3px 0 0 var(--primary-muted);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.nav-link-text {
  transition: opacity var(--transition);
  overflow: hidden;
}

.sidebar-collapsed .nav-link-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}

/* ==========================================================================
   9. SIDEBAR — ACCOUNT
   ========================================================================== */

.account {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid #313048;
  overflow: hidden;
}

.account-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--transition);
}

.account-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-info small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #9a99b4;
  white-space: nowrap;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ee8d5d;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.account-avatar-link {
  display: flex;
  flex-shrink: 0;
  border-radius: 50%;
  transition: opacity var(--transition);
}

.account-avatar-link:hover {
  opacity: .8;
}

.account-name-link {
  text-decoration: none;
}

.account-name-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #9a99b4;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  padding: 0;
}

.logout-btn:hover {
  background: #2e2d46;
  color: var(--white);
}

.logout-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sidebar-collapsed .account-info {
  opacity: 0;
  width: 0;
}

.sidebar-collapsed .logout-btn {
  display: none;
}

/* ==========================================================================
   10. LAYOUT — CONTENT AREA
   ========================================================================== */

.content {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
  padding: 44px 56px;
  transition: margin-left var(--transition), width var(--transition);
  box-sizing: border-box;
}

.sidebar-collapsed .content {
  margin-left: var(--sidebar-w-sm);
  width: calc(100% - var(--sidebar-w-sm));
}

.page-header {
  margin-bottom: 28px;
}

.page-header.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

/* ==========================================================================
   11. COMPONENTS — PANEL
   ========================================================================== */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.form-panel {
  max-width: 820px;
  padding: 32px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   12. COMPONENTS — ALERTS
   ========================================================================== */

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b2f2dd;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #ffc9c9;
}

/* ==========================================================================
   13. COMPONENTS — BUTTONS
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font: 600 13px var(--font-body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), box-shadow var(--transition), color var(--transition), border-color var(--transition);
  line-height: 1;
}

.button.primary {
  background: var(--primary);
  color: var(--white);
}

.button.primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.button.ghost:hover {
  background: var(--surface);
  border-color: #c8c8d8;
  color: var(--ink);
  text-decoration: none;
}

.button.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #ffc9c9;
}

.button.danger:hover {
  background: #ffe0e0;
  text-decoration: none;
}

.button.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b2f2dd;
}

.button.success:hover {
  background: #ccf6ea;
  text-decoration: none;
}

.button.sm {
  padding: 6px 12px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

/* ==========================================================================
   14. COMPONENTS — FORMS
   ========================================================================== */

label {
  display: block;
  margin-bottom: 18px;
  color: #47475a;
  font-size: 13px;
  font-weight: 600;
}

label.label-required::after {
  content: ' *';
  color: var(--danger);
}

input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--white);
  color: var(--ink);
  font: 14px var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,91,255,.15);
}

input:disabled {
  background: #f3f3f7;
  color: #8a8a9b;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input[type="file"] {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

input[type="file"]:hover {
  border-color: var(--primary-muted);
  background: var(--primary-light);
}

input[type="checkbox"] {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: flex-start;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* ==========================================================================
   15. COMPONENTS — TABLE
   ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  border-bottom: 1px solid var(--line);
}

th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #fafafa;
}

table th:last-child,
table td:last-child {
  text-align: right;
  white-space: nowrap;
}

/* ==========================================================================
   16. COMPONENTS — BADGES & PILLS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}

.badge.purple {
  background: var(--primary-light);
  color: #5c55e3;
}

.badge.gray {
  background: #f0f0f5;
  color: var(--muted);
}

.badge.amber {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge.blue {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge.green {
  background: var(--success-bg);
  color: var(--success);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: #5c55e3;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ==========================================================================
   17. LOGIN PAGE
   ========================================================================== */

body.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 15% 15%, #deddff, transparent 30%), var(--surface);
  padding: 20px;
}

main.login-card {
  background: var(--white);
  padding: 44px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
}

.login-card .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 22px;
  margin-bottom: 20px;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.login-card > p {
  margin-bottom: 28px;
  font-size: 14px;
}

.login-card label {
  display: block;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  color: #444457;
}

.login-card label.check {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  margin: 8px 0 20px;
  cursor: pointer;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}

.login-card .check input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  display: inline;
  flex-shrink: 0;
}

.login-card .button.full {
  height: 44px;
  background: var(--primary);
  color: var(--white);
  font-size: 14px;
}

.login-card .button.full:hover {
  background: var(--primary-dark);
}

.field-error {
  display: block;
  margin: -8px 0 10px;
  font-size: 12px;
  color: var(--danger);
}

/* ==========================================================================
   18. KANBAN BOARD
   ========================================================================== */

.kanban-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  padding-bottom: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.kanban-board::-webkit-scrollbar {
  height: 6px;
}

.kanban-board::-webkit-scrollbar-track {
  background: rgba(0,0,0,.03);
  border-radius: var(--radius-full);
}

.kanban-board::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.12);
  border-radius: var(--radius-full);
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.22);
}

.kanban-col {
  flex: 1 1 0;
  min-width: 260px;
  max-width: 340px;
  background: #f2f2f8;
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  max-height: 78vh;
  transition: background var(--transition), border var(--transition);
  border: 2px solid transparent;
}

.kanban-col.drag-over {
  background: #ebe9ff;
  border: 2px dashed var(--primary-muted);
}

.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--col-color, #6366f1) 12%, transparent);
  border-left: 4px solid var(--col-color, #6366f1);
  flex-shrink: 0;
}

.col-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--col-color, var(--ink));
}

.col-count {
  background: var(--col-color, rgba(0,0,0,.08));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.col-tasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.col-tasks::-webkit-scrollbar {
  width: 4px;
}

.col-tasks::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.10);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   19. KANBAN — TASK CARDS
   ========================================================================== */

.task-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  word-break: break-word;
  transition: box-shadow var(--transition), transform var(--transition);
}

.task-card:hover {
  box-shadow: var(--shadow-sm);
}

.task-card.dragging {
  opacity: .45;
  transform: scale(.97);
  box-shadow: var(--shadow-md);
}

.task-id {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--subtle);
  margin-bottom: 4px;
  letter-spacing: .4px;
}

.task-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.task-excerpt {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.task-module {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.task-divider {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 8px 0;
}

.task-assignee-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.task-mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ee8d5d;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.task-unassigned {
  font-size: 12px;
  color: var(--danger);
  font-style: italic;
}

.assume-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b2f2dd;
  border-radius: var(--radius-full);
  font: 600 11px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}

.assume-btn:hover {
  background: #ccf6ea;
}

.admin-assign-select {
  font-size: 12px;
  padding: 4px 8px;
  margin: 0;
  width: 100%;
  border-radius: var(--radius-sm);
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-detail-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: none;
  border-radius: var(--radius-full);
  font: 600 11px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}

.task-detail-btn:hover {
  background: var(--primary-muted);
}

.empty-col {
  text-align: center;
  color: var(--subtle);
  padding: 24px 12px;
  font-size: 12px;
  font-style: italic;
}

/* Header select for kanban department switcher */
.kanban-header-select {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: 600 13px var(--font-body);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition);
}

.kanban-header-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,91,255,.12);
  outline: none;
}

/* ==========================================================================
   20. KANBAN MODAL
   ========================================================================== */

.k-modal {
  border: none;
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 90%;
  max-width: 660px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}

.k-modal::backdrop {
  background: rgba(10, 10, 30, .45);
  backdrop-filter: blur(2px);
}

.k-modal[open] {
  animation: modal-in 0.22s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.k-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.k-modal-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
  letter-spacing: .4px;
}

.k-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.k-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.k-modal-close:hover {
  background: var(--surface);
  color: var(--ink);
}

.k-modal-body {
  max-height: 62vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 4px;
}

.k-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--surface);
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--muted);
}

.k-info-item strong {
  color: var(--ink);
  font-weight: 600;
}

.k-section-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--subtle);
  margin-bottom: 8px;
}

.k-description {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
}

.k-conclusion-box {
  background: var(--success-bg);
  border: 1px solid #b2f2dd;
  padding: 14px;
  border-radius: var(--radius-md);
}

.k-conclusion-text {
  font-size: 13px;
  color: var(--success);
  white-space: pre-wrap;
  line-height: 1.6;
}

.k-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.k-comment {
  background: var(--primary-light);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.k-comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 5px;
}

.k-comment-text {
  font-size: 13px;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.5;
}

.k-no-comments {
  font-size: 12px;
  color: var(--subtle);
  font-style: italic;
}

.k-textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 12px;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 13px;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--ink);
}

.k-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,91,255,.12);
  outline: none;
}

.k-form-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.k-divider {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 4px 0;
}

.k-conclude-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  padding: 7px 20px;
  background: var(--success);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font: 600 12px var(--font-body);
  cursor: pointer;
  transition: background var(--transition);
}

.k-conclude-btn:hover {
  background: #066044;
}

/* ==========================================================================
   21. ADMIN PAGES — ADDITIONAL COMPONENTS
   ========================================================================== */

.form-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.25rem 0 1.5rem;
}

.dept-picker {
  max-height: 170px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  background: var(--white);
  margin-top: 7px;
  margin-bottom: 4px;
}

.dept-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  transition: background var(--transition);
}

.dept-item:hover {
  background: #f8f8ff;
}

.dept-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.dept-item label {
  margin: 0;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}

.dept-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dept-tag {
  background: #eef2ff;
  color: #4054b2;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}

.role-badge.master {
  background: var(--primary-light);
  color: #5c55e3;
}

.role-badge.common {
  background: #f0f0f5;
  color: var(--muted);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font: 600 12px var(--font-body);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background var(--transition);
}

.btn-icon.edit {
  background: #f0f0f8;
  color: #484860;
}

.btn-icon.edit:hover {
  background: #e4e4f5;
}

.btn-icon.delete {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-icon.delete:hover {
  background: #ffe4e4;
}

.form-cancel-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font: 600 13px var(--font-body);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}

.form-cancel-btn:hover {
  border-color: #aaa;
  color: var(--ink);
  background: #f8f8fb;
}

.user-name-cell strong {
  font-size: 14px;
  display: block;
  color: var(--ink);
}

.user-name-cell span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.no-dept-label {
  color: #c0c0cc;
  font-size: 12px;
}

.empty-users {
  text-align: center;
  color: #9495a4;
  padding: 40px 20px;
  font-size: 13px;
}

/* Ticket list page helpers */
.ticket-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}

.ticket-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.assignee-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

.assignee-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ef8e5b;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assignee-name {
  font-size: 13px;
  color: var(--ink);
}

.no-assignee {
  font-size: 13px;
  color: #bbb;
}

.date-cell {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: .35;
}

.empty-state p {
  color: #9495a4;
  font-size: 14px;
  margin: 0 0 16px;
}

.pagination-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.pagination-wrap nav {
  display: flex;
  gap: 4px;
}

.pagination-wrap span,
.pagination-wrap a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  background: var(--white);
}

.pagination-wrap a:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #d0cfff;
}

.pagination-wrap [aria-current="page"] span {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.pagination-wrap [aria-disabled="true"] span {
  opacity: .4;
  cursor: default;
}

/* Departments admin page */
.department-card .button {
  margin-right: 6px;
}

/* Kanban: cursor via atributo draggable */
.task-card[draggable="true"]  { cursor: grab; }
.task-card[draggable="false"] { cursor: default; }
.task-card--static            { cursor: default; }

/* Kanban: form do select de admin ocupa toda a linha */
.admin-assign-form { width: 100%; margin: 0; }

/* Kanban: nome do responsável no card */
.task-assignee-name { font-size: 12px; color: var(--muted); }

/* Kanban: linha de submit dentro do modal */
.k-form-submit-row { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Botão pílula (arredondado) */
.button--pill { border-radius: var(--radius-full); }

/* Kanban: controles do cabeçalho */
.kanban-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.kanban-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.kanban-search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--subtle);
  pointer-events: none;
  flex-shrink: 0;
}

.kanban-search-input {
  padding: 8px 32px 8px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: 14px var(--font-body);
  color: var(--ink);
  background: var(--white);
  width: 240px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.kanban-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,91,255,.12);
}

.kanban-search-input::placeholder {
  color: var(--subtle);
}

.kanban-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--subtle);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  line-height: 1;
  transition: color var(--transition);
}

.kanban-search-clear:hover { color: var(--ink); }

/* Kanban: badge de prioridade no card */
.k-priority { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.k-p-baixa   { background: #e6faf2; color: #087f5b; }
.k-p-media   { background: #e8f0ff; color: #2255cc; }
.k-p-alta    { background: #fff3e6; color: #b94d00; }
.k-p-urgente { background: #fff0f0; color: #c92a2a; }

/* Select de prioridade (admin) — herda visual do badge */
.priority-form { display: inline-flex; }
.priority-select { border: none; outline: none; cursor: pointer; font-weight: 700; font-family: var(--font-body); appearance: none; -webkit-appearance: none; padding: 2px 7px; border-radius: 20px; }

/* Kanban: previsão de entrega no card */
.task-due {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.task-due--late {
  color: var(--danger);
  font-weight: 600;
}

.task-due--empty {
  color: #ccc;
}

.task-due--concluded {
  color: var(--success);
  font-weight: 600;
  white-space: normal;
  line-height: 1.3;
  text-align: right;
}

.task-due--concluded small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

/* Kanban modal: seção de data prevista */
.k-due-display {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.k-due-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.k-due-input {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: 14px var(--font-body);
  color: var(--ink);
  background: #fff;
}

.button.sm {
  padding: 7px 14px;
  font-size: 13px;
}

/* Kanban modal: lista de anexos */
.k-attachments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.k-attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--transition), border-color var(--transition);
}

.k-attachment-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-muted);
  text-decoration: none;
  color: var(--primary-dark);
}

.k-attachment-icon { font-size: 16px; flex-shrink: 0; }

.k-attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.k-attachment-down {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ==========================================================================
   22. RESPONSIVE
   ========================================================================== */

/* --- Tabela sempre rolável em telas apertadas --- */
table {
  min-width: 480px;
}

/* --- Telas médias: sidebar ainda expandida, grid compacta --- */
@media (max-width: 1100px) {
  .content {
    padding: 36px 32px;
  }

  .admin-grid {
    grid-template-columns: 340px 1fr;
  }
}

/* --- Telas pequenas: sidebar recolhe automaticamente --- */
@media (max-width: 800px) {
  .sidebar {
    width: var(--sidebar-w-sm);
    padding: 20px 8px;
  }

  .sidebar-toggle {
    display: none; /* toggle manual não faz sentido no mobile */
  }

  .brand-text,
  .nav-caption,
  .nav-link-text,
  .account-info,
  .logout-btn {
    display: none;
  }

  .brand {
    justify-content: center;
    padding: 0 0 28px;
  }

  .nav-link {
    justify-content: center;
    padding: 10px 0;
  }

  .account {
    justify-content: center;
  }

  .content {
    margin-left: var(--sidebar-w-sm);
    width: calc(100% - var(--sidebar-w-sm));
    padding: 24px 16px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-header.row {
    flex-direction: column;
    gap: 12px;
  }

  .kanban-col {
    flex: 0 0 268px;
  }

  /* Botões de ação empilham no mobile */
  .action-group {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}

/* --- Telas muito pequenas --- */
@media (max-width: 480px) {
  .content {
    padding: 20px 12px;
  }

  main.login-card {
    padding: 28px 20px;
  }

  .form-panel {
    padding: 20px;
  }

  .k-modal {
    width: 96vw;
    border-radius: var(--radius-lg);
  }

  .k-modal-head,
  .k-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .k-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 20px 14px;
  }

  main.login-card {
    padding: 28px 20px;
  }
}

/* ==========================================================================
   PROJETOS — MONDAY.COM STYLE
   ========================================================================== */

/* INDEX — Cards */
.proj-dept-section { margin-bottom: 40px; }

.proj-dept-title {
  font-size: 13px; font-weight: 700; color: var(--subtle);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.proj-card {
  border-radius: var(--radius-md); background: var(--white);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  overflow: hidden; display: flex; flex-direction: column;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
}
.proj-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }

.proj-card-accent { height: 5px; background: var(--proj-color, #635bff); }
.proj-card-body { padding: 16px 18px 18px; }
.proj-card-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.proj-card-desc { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.proj-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--subtle); }
.proj-card-count { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-full); padding: 2px 10px; font-weight: 600; }

/* BOARD HEADER */
.proj-board-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 28px; flex-wrap: wrap;
}
.proj-back-link { font-size: 12px; color: var(--subtle); text-decoration: none; display: inline-block; margin-bottom: 8px; }
.proj-back-link:hover { color: var(--primary); text-decoration: none; }

.proj-board-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.proj-board-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.proj-board-name { font-size: 24px; font-weight: 800; margin: 0; }
.proj-dept-badge { font-size: 11px; font-weight: 700; background: var(--primary-light); color: var(--primary); border-radius: var(--radius-full); padding: 3px 12px; }
.proj-board-desc { font-size: 13px; color: var(--muted); margin-top: 6px; margin-bottom: 0; }
.proj-board-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* BOARD */
.proj-board { display: flex; flex-direction: column; gap: 0; padding-bottom: 60px; }

/* GRUPO */
.proj-group { margin-bottom: 24px; }

/* Título do grupo (estilo Monday.com — texto colorido grande) */
.proj-group-title-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 8px 0;
}

.proj-group-toggle { background: none; border: none; cursor: pointer; padding: 2px 4px; color: var(--muted); font-size: 14px; line-height: 1; }
.proj-group-chevron { display: inline-block; transition: transform 0.2s; }
.proj-group-chevron.collapsed { transform: rotate(-90deg); }

.proj-group-title-text {
  font-family: var(--font-display); font-size: 18px; font-weight: 800;
  outline: none; border-radius: var(--radius-xs); padding: 2px 6px;
  min-width: 0; letter-spacing: -0.3px;
}
.proj-group-title-text[contenteditable="true"]:hover { background: rgba(0,0,0,.04); }
.proj-group-title-text[contenteditable="true"]:focus { background: rgba(0,0,0,.06); }

.proj-group-count-badge {
  font-size: 11px; color: var(--subtle); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-full);
  padding: 2px 8px; font-weight: 700;
}

.proj-group-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.proj-group-title-row:hover .proj-group-actions { opacity: 1; }
.proj-group-action-btn { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-xs); font-size: 13px; color: var(--muted); line-height: 1; }
.proj-group-action-btn:hover { background: var(--surface); }

.proj-group-body { overflow: hidden; }
.proj-group-body--hidden { display: none; }

/* TABELA */
.proj-table { width: 100%; border-collapse: collapse; background: var(--white); }

.proj-col-headers th {
  font-size: 11px; font-weight: 600; color: var(--subtle); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left; white-space: nowrap;
  background: var(--surface);
}
/* Linha colorida embaixo do header para indicar o grupo */
.proj-col-headers { border-left: 3px solid var(--row-border, #635bff); }

/* Colunas */
.proj-col-title    { width: 35%; min-width: 180px; }
.proj-col-resp     { width: 52px; text-align: center; }
.proj-col-status   { width: 140px; }
.proj-col-timeline { width: 130px; }
.proj-col-prazo    { width: 70px; text-align: center; }
.proj-col-stars    { width: 100px; }
.proj-col-row-actions { width: 32px; }

/* Linhas dos itens */
.proj-item-row {
  cursor: pointer; border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--row-color, #635bff);
  transition: background var(--transition);
}
.proj-item-row:hover { background: #fafafe; }

.proj-item-row td { padding: 9px 12px; vertical-align: middle; }

.proj-item-title { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.4; }

/* AVATAR */
.proj-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  margin: 0 auto; cursor: default; flex-shrink: 0;
  text-transform: uppercase; user-select: none;
}
.proj-avatar--empty {
  background: var(--line); color: var(--subtle);
  border: 1.5px dashed var(--subtle); font-size: 14px; font-weight: 400;
}

/* STATUS PILL (large, full fill — Monday.com style) */
.proj-status-pill {
  display: block; text-align: center;
  font-size: 12px; font-weight: 700; color: #fff;
  padding: 5px 10px; border-radius: var(--radius-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.proj-status-pill--empty {
  background: var(--line); color: var(--subtle);
  font-weight: 400; font-size: 12px;
}

/* TIMELINE BAR */
.proj-timeline-bar-wrap {
  height: 8px; background: var(--line); border-radius: var(--radius-full); overflow: hidden;
}
.proj-timeline-bar-fill {
  height: 100%; border-radius: var(--radius-full);
  transition: width 0.4s ease;
  min-width: 0;
}

/* PRAZO */
.proj-prazo { font-size: 12px; color: var(--muted); white-space: nowrap; }
.proj-prazo--late { color: var(--danger); font-weight: 700; }
.proj-prazo-empty { font-size: 12px; color: var(--line); }

/* ESTRELAS */
.proj-stars { display: flex; gap: 1px; align-items: center; }
.proj-stars--lg { gap: 4px; }

.proj-star {
  font-size: 16px; color: #d1d5db; cursor: pointer;
  line-height: 1; transition: color var(--transition), transform 0.1s;
  user-select: none;
}
.proj-star:hover { transform: scale(1.2); }
.proj-star--on { color: #f59e0b; }
.proj-stars--lg .proj-star { font-size: 24px; }

/* AÇÕES DA LINHA */
.proj-item-delete-btn {
  background: none; border: none; cursor: pointer; color: var(--subtle);
  font-size: 12px; padding: 3px 5px; border-radius: var(--radius-xs);
  opacity: 0; transition: opacity var(--transition), color var(--transition);
}
.proj-item-row:hover .proj-item-delete-btn { opacity: 1; }
.proj-item-delete-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* ADICIONAR ITEM */
.proj-add-item-row { background: var(--white); border-bottom: 1px solid var(--line); }
.proj-add-item-input {
  width: 100%; border: none; padding: 10px 16px;
  font-family: var(--font-body); font-size: 13px; color: var(--muted);
  background: transparent; outline: none;
}
.proj-add-item-input::placeholder { color: var(--subtle); }
.proj-add-item-input:focus { background: var(--primary-light); color: var(--ink); }

/* ADICIONAR GRUPO */
.proj-add-group-row { padding: 16px 0; }
.proj-add-group-btn {
  background: none; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; color: var(--subtle); cursor: pointer;
  font-family: var(--font-body); width: 100%; text-align: left;
  transition: all var(--transition);
}
.proj-add-group-btn:hover { background: var(--surface); color: var(--primary); border-color: var(--primary-muted); }

/* MODAL DE DETALHE */
.proj-item-modal { max-width: 680px; }
.proj-item-modal-body { display: flex; flex-direction: column; gap: 0; }

.proj-status-badge-sm {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: var(--radius-full); color: #fff;
}

.proj-detail-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; padding-bottom: 20px;
}

.proj-detail-field { display: flex; flex-direction: column; gap: 6px; }
.proj-detail-label { font-size: 10px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.8px; }
.proj-detail-value { font-size: 13px; color: var(--ink); }

.proj-inline-select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 8px; font-family: var(--font-body); font-size: 12px; color: var(--ink);
  background: var(--white); cursor: pointer; outline: none; transition: border-color var(--transition);
}
.proj-inline-select:focus { border-color: var(--primary); }

.proj-date-input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 8px; font-family: var(--font-body); font-size: 12px; color: var(--ink);
  background: var(--white); outline: none;
}
.proj-date-input:focus { border-color: var(--primary); }

.proj-notes-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: var(--font-body); font-size: 13px; color: var(--ink);
  resize: vertical; outline: none; background: var(--surface); margin-top: 6px;
  transition: border-color var(--transition);
}
.proj-notes-textarea:focus { border-color: var(--primary); background: var(--white); }

/* GERENCIAR STATUS */
.proj-status-manage-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.proj-status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.proj-status-manage-name { font-size: 13px; color: var(--ink); flex: 1; }

/* CHECKLIST */
.proj-checklist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.proj-checklist-progress-text { font-size: 12px; font-weight: 700; color: var(--subtle); }
.proj-checklist-bar-wrap { margin-bottom: 12px; }
.proj-checklist-bar { height: 6px; background: var(--line); border-radius: var(--radius-full); overflow: hidden; }
.proj-checklist-bar-fill { height: 100%; border-radius: var(--radius-full); background: var(--primary); transition: width 0.35s ease, background 0.3s; }
.proj-checklist-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.proj-checklist-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); transition: background var(--transition); }
.proj-checklist-item:hover { background: var(--surface); }
.proj-check-label { display: flex; align-items: flex-start; gap: 10px; flex: 1; cursor: pointer; min-width: 0; }
.proj-check-input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; margin-top: 1px; }
.proj-check-text { font-size: 13px; color: var(--ink); line-height: 1.45; word-break: break-word; }
.proj-check-done { color: var(--subtle); text-decoration: line-through; }
.proj-check-delete { background: none; border: none; cursor: pointer; color: var(--subtle); font-size: 12px; padding: 3px 5px; border-radius: var(--radius-xs); opacity: 0; transition: opacity var(--transition); flex-shrink: 0; }
.proj-checklist-item:hover .proj-check-delete { opacity: 1; }
.proj-check-delete:hover { color: var(--danger); background: var(--danger-bg); }
.proj-checklist-empty, .proj-checklist-loading { font-size: 12px; color: var(--subtle); padding: 6px 8px; list-style: none; }
.proj-checklist-add-form { margin-top: 4px; }
.proj-checklist-input { width: 100%; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 8px 12px; font-family: var(--font-body); font-size: 13px; color: var(--ink); background: transparent; outline: none; transition: border-color var(--transition), background var(--transition); }
.proj-checklist-input::placeholder { color: var(--subtle); }
.proj-checklist-input:focus { border-color: var(--primary); background: var(--primary-light); border-style: solid; }

/* TITLE CELL WITH INLINE CHECKLIST TOGGLE */
.proj-title-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.proj-checklist-toggle {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--subtle); flex-shrink: 0; line-height: 1; border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
}
.proj-checklist-toggle:hover { color: var(--ink); background: var(--surface); }
.proj-cl-arrow {
  display: inline-block; font-size: 9px; transition: transform 0.2s ease;
}
.proj-cl-arrow--open { transform: rotate(90deg); }
.proj-cl-counter {
  font-size: 10px; font-weight: 700; color: var(--white);
  background: var(--subtle); border-radius: var(--radius-full);
  padding: 1px 6px; flex-shrink: 0; white-space: nowrap;
}

/* INLINE CHECKLIST ROW */
.proj-checklist-inline-row td { padding: 0 !important; }
.proj-checklist-inline-cell {
  padding: 10px 16px 12px 32px !important;
  background: var(--surface);
}
.proj-inline-cl { display: flex; flex-direction: column; gap: 4px; }
.proj-inline-cl-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.proj-inline-cl-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-xs); transition: background var(--transition); }
.proj-inline-cl-item:hover { background: var(--line); }
.proj-inline-cl-item .proj-check-delete { opacity: 0; }
.proj-inline-cl-item:hover .proj-check-delete { opacity: 1; }
.proj-inline-cl-add { margin: 0; }
.proj-inline-cl-input {
  width: 100%; max-width: 400px; border: none; border-bottom: 1px dashed var(--line);
  background: transparent; padding: 4px 2px; font-size: 12px; color: var(--ink);
  font-family: var(--font-body); outline: none; transition: border-color var(--transition);
}
.proj-inline-cl-input::placeholder { color: var(--subtle); }
.proj-inline-cl-input:focus { border-bottom-color: var(--primary); }

/* ITEM MODAL - LAYOUT TIPO TICKET */
.proj-item-modal { max-width: 900px !important; width: 95vw !important; }
.proj-item-modal-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0;
  min-height: 420px;
}
.proj-item-modal-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px 24px 24px 28px;
  overflow-y: auto;
}
.proj-item-modal-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.proj-item-modal-section:first-child { border-top: none; padding-top: 0; }
.proj-item-modal-section .section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--subtle);
  margin-bottom: 10px; display: block;
}
.proj-item-modal-section + .proj-item-modal-section { margin-top: 20px; }
.proj-item-modal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 1px solid var(--line);
  padding: 24px 20px;
  background: var(--surface);
  overflow-y: auto;
}
@media (max-width: 680px) {
  .proj-item-modal-layout { grid-template-columns: 1fr; }
  .proj-item-modal-sidebar { border-left: none; border-top: 1px solid var(--line); }
}

/* ANEXOS DO CHAMADO NO MODAL DO ITEM */
.proj-attachments-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proj-attachment-item {
  display: flex;
  align-items: center;
}
.proj-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background var(--transition), border-color var(--transition);
  word-break: break-all;
}
.proj-attachment-link:hover {
  background: var(--panel);
  border-color: var(--primary);
}
