/* ============================================
   AgencyPro — Professional Blue Theme
   ============================================ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --primary-50:    #eff6ff;
  --accent:        #0ea5e9;
  --success:       #10b981;
  --success-light: #d1fae5;
  --warning:       #f59e0b;
  --warning-light: #fef3c7;
  --danger:        #ef4444;
  --danger-light:  #fee2e2;
  --info:          #6366f1;
  --info-light:    #e0e7ff;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-light:     #cbd5e1;

  --bg-base:    #f8fafc;
  --bg-white:   #ffffff;
  --bg-subtle:  #f1f5f9;
  --bg-hover:   #f0f7ff;

  --border:       #e2e8f0;
  --border-focus: #93c5fd;

  --sidebar-w: 248px;
  --topbar-h:  60px;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
  --shadow-blue: 0 4px 14px rgba(37,99,235,.3);
}

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

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: #0f172a;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: width .2s ease, transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-collapse-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s ease;
}
.sidebar-collapse-toggle:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-label {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
  padding: 10px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s ease;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-blue);
}

.nav-item svg { flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

.nav-item-toggle { cursor: pointer; }
.nav-chevron { margin-left: auto; transition: transform .2s ease; opacity: .6; }
.nav-item-toggle.open .nav-chevron { transform: rotate(180deg); }

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease;
}
.nav-submenu.open { max-height: 300px; }

.nav-subitem {
  padding-left: 32px;
  font-size: .8rem;
}

/* ---- Sidebar Colapsado (modo ícones) ---- */
.sidebar.collapsed { width: 68px; }

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .user-info,
.sidebar.collapsed .user-role {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  gap: 10px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
}

.sidebar.collapsed .user-card {
  justify-content: center;
}

.sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  gap: 8px;
}

.main-content.collapsed { margin-left: 68px; }


.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.user-card:hover { background: rgba(255,255,255,.07); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: .75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

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

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

.user-role {
  display: block;
  font-size: .7rem;
  color: rgba(255,255,255,.4);
}

.btn-logout {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.4);
  transition: all .15s;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: rgba(239,68,68,.15);
  color: #ef4444;
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .2s ease;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.sidebar-toggle:hover { background: var(--bg-subtle); }

.page-title { flex: 1; }
.page-title h1 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: .75rem;
  color: var(--text-muted);
}

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

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-muted); }

.date-display {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---- Page Content ---- */
.page-content {
  padding: 24px;
  flex: 1;
}

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

.alert-success { background: var(--success-light); color: #065f46; border-left: 3px solid var(--success); }
.alert-danger   { background: var(--danger-light);  color: #991b1b; border-left: 3px solid var(--danger); }
.alert-warning  { background: var(--warning-light); color: #92400e; border-left: 3px solid var(--warning); }

/* ---- Cards ---- */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}

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

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue   { background: var(--primary-light);  color: var(--primary); }
.stat-icon.green  { background: var(--success-light);  color: var(--success); }
.stat-icon.orange { background: var(--warning-light);  color: var(--warning); }
.stat-icon.red    { background: var(--danger-light);   color: var(--danger); }
.stat-icon.purple { background: var(--info-light);     color: var(--info); }

.stat-data { flex: 1; min-width: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.stat-sub   { font-size: .75rem; color: var(--text-secondary); margin-top: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-blue);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-subtle); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { background: #059669; }

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

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

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

.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 10px 22px; font-size: .95rem; }
.btn-icon { padding: 8px; }

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
}

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

thead th {
  background: var(--bg-subtle);
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

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

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger  { background: var(--danger-light);  color: #991b1b; }
.badge-info    { background: var(--info-light);    color: #3730a3; }
.badge-primary { background: var(--primary-light); color: #1e40af; }
.badge-secondary { background: var(--bg-subtle);  color: var(--text-secondary); }

/* ---- Forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-text {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================================
   Modal genérico (Dar Baixa, e reutilizável em outras telas)
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  margin: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 700; font-size: .95rem; color: var(--text-primary); }
.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-desc { font-size: .85rem; color: var(--text-secondary); margin: 0; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}


label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
input[type=url],
input[type=tel],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .875rem;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

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

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: -2px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-header-left h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header-left p {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Filters ---- */
.filters-bar {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.filter-group label {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-group select,
.filter-group input {
  padding: 6px 10px;
  min-width: 140px;
  font-size: .82rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrapper input {
  padding-left: 34px;
}

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

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: .82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

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

.pagination-links a,
.pagination-links span {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  transition: all .15s;
}

.pagination-links a:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.pagination-links .active { background: var(--primary); border-color: var(--primary); color: white; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg { opacity: .3; margin-bottom: 14px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: .85rem; }

/* ---- Detail View ---- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.detail-item {}
.detail-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detail-value {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ---- Login Page ---- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.auth-body::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,.2) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.auth-body::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(14,165,233,.15) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  border-radius: 50%;
}

.auth-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo .brand-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
}

.auth-logo .brand-name {
  font-size: 1.3rem;
  color: var(--text-primary);
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-card .form-group { margin-bottom: 16px; }

.auth-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 10px 20px;
  font-size: .925rem;
  margin-top: 8px;
}

/* ---- Receipt / Print ---- */
.receipt-wrapper {
  max-width: 680px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.receipt-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 32px 36px;
}

.receipt-header h1 { font-size: 1.6rem; font-weight: 800; }
.receipt-header p  { opacity: .8; font-size: .875rem; margin-top: 4px; }

.receipt-body { padding: 32px 36px; }

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.receipt-row:last-child { border-bottom: none; }
.receipt-row .label { color: var(--text-secondary); font-size: .875rem; }
.receipt-row .value { font-weight: 600; }

.receipt-total {
  background: var(--primary-50);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}

.receipt-total .total-label { font-weight: 600; font-size: 1rem; color: var(--primary); }
.receipt-total .total-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .sidebar.collapsed {
    width: var(--sidebar-w);
  }

  .sidebar.collapsed .brand-name,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .nav-chevron,
  .sidebar.collapsed .user-info,
  .sidebar.collapsed .user-role {
    display: initial;
  }

  .sidebar.collapsed .nav-submenu.open {
    max-height: 300px;
  }

  .main-content.collapsed {
    margin-left: 0;
  }

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-content { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card  { margin: 16px; padding: 28px 24px; }
}

/* ---- Dashboard ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.dashboard-grid .card.full { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ---- Activity List ---- */
.activity-list { list-style: none; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-text { font-size: .875rem; color: var(--text-secondary); line-height: 1.4; }
.activity-time { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Task Kanban Colors ---- */
.priority-alta   { color: var(--danger); }
.priority-media  { color: var(--warning); }
.priority-baixa  { color: var(--success); }

/* ---- Utils ---- */
.text-muted    { color: var(--text-muted); }
.text-primary  { color: var(--primary); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.fw-600        { font-weight: 600; }

/* Título/descrição clicável em listagens (Tarefas, Controle de Caixa) */
.task-title-link:hover { text-decoration: underline; color: var(--primary) !important; }
.fw-700        { font-weight: 700; }
.mb-0          { margin-bottom: 0; }
.mb-16         { margin-bottom: 16px; }
.mb-24         { margin-bottom: 24px; }
.mt-16         { margin-top: 16px; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.justify-between { justify-content: space-between; }

@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .doc-header { break-inside: avoid; }
  .card-header { break-after: avoid; }
  .table-wrapper { overflow: visible !important; }
  table, tr, td, th { break-inside: avoid; }
  .alert { break-inside: avoid; }

  @page { margin: 18mm 14mm; }
}

/* Document letterhead (Pré-Análise / Diagnóstico NEW 360) */
.doc-header {
  text-align: center;
  padding: 30px 20px 24px;
  margin-bottom: 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.doc-header-logo {
  width: 210px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
}
.doc-header-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: .3px;
  margin: 0 0 8px;
}
.doc-header-contact {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.doc-header-subtitle {
  font-style: italic;
  color: var(--text-secondary);
  font-size: .95rem;
  margin-bottom: 20px;
}
.doc-info-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.doc-info-table th {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.doc-info-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--text-primary);
}
.doc-info-date { font-weight: 600; }

/* Signature block (Pré-Análise / Diagnóstico) */
.assinatura {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.assinatura-img {
  height: 46px;
  width: auto;
  margin-bottom: 4px;
  object-fit: contain;
}
.linha-assinatura {
  border-bottom: 2px solid var(--text-primary);
  width: 260px;
  margin-bottom: 8px;
}
.assinatura .nome {
  font-weight: 700;
  color: var(--text-primary);
}
.assinatura .cargo {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.confidencial-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: var(--text-muted);
  font-size: .78rem;
  margin: 8px 0 24px;
}
.confidencial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
}

/* ============================================================
   Painel de Atividade da Tarefa (estilo ClickUp)
   Adicionar ao final de public/css/app.css
   ============================================================ */

.task-edit-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .task-edit-layout {
        grid-template-columns: 1fr;
    }
}

.task-main-card { max-width: 100%; }

.task-activity-card {
    max-width: 100%;
    position: sticky;
    top: 20px;
}

.activity-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px !important;
}

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.activity-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 24px 8px;
}

.activity-item {
    display: flex;
    gap: 10px;
}

.activity-avatar {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-content {
    flex: 1;
    min-width: 0;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.activity-author {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.activity-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.activity-delete-form {
    margin-left: auto;
}

.activity-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.activity-delete-btn:hover {
    color: var(--danger);
}

.activity-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.activity-form {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-form textarea {
    width: 100%;
    resize: vertical;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.activity-form textarea:focus {
    outline: none;
    border-color: var(--border-focus);
}

.activity-form-actions {
    display: flex;
    justify-content: flex-end;
}