/* ===== FLOW PWA — CSS ===== */
:root {
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --bg: #F0F2F5;
  --surface: #ffffff;
  --sidebar-bg: #1A1D23;
  --sidebar-text: #9CA3AF;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active: rgba(255,255,255,.12);
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --text: #111827;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --transition: .2s ease;
}

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

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

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul, li { list-style: none; }

/* ===== LOGIN PAGE ===== */
.login-mode { background: linear-gradient(135deg, #1A1D23 0%, #2D3748 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }

.login-page { width: 100%; }

.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: 0 25px 50px rgba(0,0,0,.4);
}

.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .logo-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  font-size: 28px; color: #fff;
  box-shadow: 0 8px 16px rgba(79,70,229,.4);
}
.login-logo h1 { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.login-logo p { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }

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

.field-icon { position: relative; }
.field-icon > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.field-icon input { width: 100%; padding: .65rem 2.5rem .65rem 2.5rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); outline: none; transition: border-color var(--transition); background: #FAFAFA; }
.field-icon input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.toggle-pass { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); padding: .25rem; }
.toggle-pass:hover { color: var(--text); }

.login-options { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--text-muted); font-size: .85rem; }
.checkbox-label input { width: auto; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; justify-content: center; }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  padding: .65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background var(--transition);
}
.btn-secondary:hover { background: var(--border); }

.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-top: 1rem; font-size: .85rem; }
.alert-error { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }

/* ===== APP LAYOUT ===== */
.app-mode { display: flex; min-height: 100vh; overflow: hidden; }

#app { display: flex; width: 100%; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
  z-index: 100;
}

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

.sidebar-logo { display: flex; align-items: center; gap: .65rem; }
.logo-icon-sm {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.logo-text { font-weight: 700; font-size: 1.1rem; color: #fff; letter-spacing: -.02em; }

.sidebar-close { color: var(--sidebar-text); padding: .25rem; border-radius: 4px; }
.sidebar-close:hover { color: #fff; background: var(--sidebar-hover); }

.sidebar-quick { padding: .75rem 1rem; }
.btn-quick-add {
  width: 100%;
  background: rgba(79,70,229,.2);
  color: #a5b4fc;
  border: 1.5px dashed rgba(79,70,229,.5);
  border-radius: var(--radius-sm);
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
  font-size: .85rem;
  transition: all var(--transition);
}
.btn-quick-add:hover { background: rgba(79,70,229,.35); color: #c7d2fe; border-color: rgba(79,70,229,.7); }

.sidebar-nav { padding: .5rem .75rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: .125rem;
}
.nav-item i { width: 18px; text-align: center; font-size: .85rem; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }

.sidebar-section { padding: .75rem 0; border-top: 1px solid rgba(255,255,255,.06); flex: 1; }
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .3rem 1rem .5rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
}
.sidebar-section-header .btn-icon { color: rgba(255,255,255,.3); padding: .2rem; }
.sidebar-section-header .btn-icon:hover { color: rgba(255,255,255,.7); }

.workspace-list { padding: 0 .75rem; }
.ws-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: .125rem;
  position: relative;
}
.ws-item:hover { background: var(--sidebar-hover); }
.ws-item.active { background: var(--sidebar-active); }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ws-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; flex-shrink: 0; }
.ws-name { flex: 1; font-size: .875rem; font-weight: 500; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-item:hover .ws-name, .ws-item.active .ws-name { color: #fff; }
.ws-count { font-size: .7rem; color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); padding: .1rem .4rem; border-radius: 10px; }
.ws-actions { display: none; gap: .15rem; }
.ws-item:hover .ws-actions { display: flex; }
.ws-actions button { color: rgba(255,255,255,.4); padding: .2rem .35rem; border-radius: 4px; font-size: .75rem; }
.ws-actions button:hover { color: #fff; background: rgba(255,255,255,.1); }

.loading-item { padding: .75rem; text-align: center; color: rgba(255,255,255,.2); font-size: .8rem; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 1rem;
}
.user-info { display: flex; align-items: center; gap: .65rem; }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.user-details { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: .85rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: .7rem; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .05em; }
.btn-icon { padding: .35rem; border-radius: 6px; color: var(--text-muted); transition: all var(--transition); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--border); color: var(--text); }

/* ===== MAIN CONTENT ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: .75rem; }
.topbar-right { display: flex; align-items: center; gap: .25rem; }

.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text-muted); }
.breadcrumb .sep { opacity: .4; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

.badge-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; }
.btn-icon { position: relative; }

.page-content { flex: 1; padding: 1.5rem; overflow-y: auto; }

.loading-screen { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--text-muted); }

/* ===== DASHBOARD ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-info { flex: 1; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title { font-size: 1rem; font-weight: 600; }

/* ===== WORKSPACE VIEW ===== */
.workspace-hero {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.workspace-hero-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff; flex-shrink: 0;
}
.workspace-hero-info { flex: 1; }
.workspace-hero-info h2 { font-size: 1.25rem; font-weight: 700; }
.workspace-hero-info p { color: var(--text-muted); font-size: .875rem; margin-top: .2rem; }
.workspace-hero-actions { display: flex; gap: .5rem; }

/* ===== PROJECT CARDS ===== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  border-left: 4px solid var(--primary);
  position: relative;
  overflow: hidden;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .75rem; }
.project-card-name { font-weight: 600; font-size: .95rem; flex: 1; margin-right: .5rem; }
.project-card-actions { display: none; gap: .25rem; }
.project-card:hover .project-card-actions { display: flex; }

.project-card-desc { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.project-progress { margin-bottom: .75rem; }
.progress-bar { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .3s ease; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: .3rem; font-size: .7rem; color: var(--text-muted); }

.project-card-footer { display: flex; align-items: center; justify-content: space-between; }
.project-badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .5rem; border-radius: 20px;
  font-size: .7rem; font-weight: 600;
}
.badge-p1 { background: #FEE2E2; color: #DC2626; }
.badge-p2 { background: #FEF3C7; color: #D97706; }
.badge-p3 { background: #EEF2FF; color: #4F46E5; }
.badge-p4 { background: #F3F4F6; color: #6B7280; }
.badge-active   { background: #D1FAE5; color: #059669; }
.badge-paused   { background: #FEF3C7; color: #D97706; }
.badge-completed{ background: #DBEAFE; color: #1D4ED8; }
.badge-overdue  { background: #FEE2E2; color: #DC2626; }

.project-due { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: .3rem; }
.project-due.overdue { color: var(--danger); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: .3; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; color: var(--text); }
.empty-state p { font-size: .875rem; }

/* ===== MODALS ===== */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }

.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s ease;
}
.modal-box-sm { max-width: 380px; }
.modal-box-lg { max-width: 600px; }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { color: var(--text-muted); padding: .25rem; border-radius: 4px; }
.modal-close:hover { color: var(--text); background: var(--bg); }

form { padding: 1.5rem; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.field-row { display: flex; gap: 1rem; }
.flex-1 { flex: 1; }

input[type="text"], input[type="email"], input[type="date"], input[type="password"],
input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: #FAFAFA;
  transition: border-color var(--transition);
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }

.color-picker-wrap { display: flex; align-items: center; gap: .75rem; }
.color-picker-wrap input[type="color"] { width: 36px; height: 36px; padding: 2px; border-radius: 6px; cursor: pointer; }
.color-presets { display: flex; gap: .35rem; flex-wrap: wrap; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); display: block; }
.color-dot:hover { transform: scale(1.2); }
.color-dot.selected { box-shadow: 0 0 0 3px white, 0 0 0 5px currentColor; }

.icon-picker { display: flex; gap: .35rem; flex-wrap: wrap; }
.icon-opt {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.icon-opt:hover { border-color: var(--primary); color: var(--primary); }
.icon-opt.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: #1F2937;
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 250px;
  max-width: 380px;
  animation: toast-in .25s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info    { border-left: 4px solid var(--primary); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== DROPDOWN ===== */
.dropdown-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 500;
  overflow: hidden;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1rem;
  font-size: .875rem;
  color: var(--text);
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: .25rem 0; }

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
  font-size: 1.25rem;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: all var(--transition);
}
.fab:hover { background: var(--primary-dark); transform: scale(1.08); }

/* ===== MOBILE ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 90;
}

.d-md-none { display: none; }

@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }

  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }

  .d-md-none { display: flex; }

  .page-content { padding: 1rem; }
  .fab { display: flex; }
  #btn-quick-add span { display: none; }

  .projects-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { flex-direction: column; gap: .75rem; }
  .modal-box { max-width: 100%; max-height: 95vh; }
  .toast-container { left: 1rem; right: 1rem; bottom: 1rem; }
  .toast { min-width: unset; }
  .workspace-hero { flex-wrap: wrap; }
}

@media (min-width: 769px) {
  .sidebar-close { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ===== UTILITIES ===== */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.gap-1 { gap: .5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.btn-link { background: none; border: none; color: var(--primary); font-size: .8rem; font-weight: 500; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: .25rem; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

/* ===== PROJECT HEADER (detalhe do projeto) ===== */
.project-detail-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.project-detail-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.project-detail-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff; flex-shrink: 0; }
.project-detail-info { flex: 1; min-width: 0; }
.project-detail-info h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: .2rem; }
.project-detail-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.project-detail-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ===== VIEW TABS ===== */
.view-tabs {
  display: flex;
  gap: .25rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: .35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  width: fit-content;
}
.view-tab {
  padding: .45rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: all var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}
.view-tab:hover { color: var(--text); background: var(--bg); }
.view-tab.active { background: var(--primary); color: #fff; }

/* ===== KANBAN BOARD ===== */
.kanban-wrapper {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
  min-height: calc(100vh - 280px);
}
.kanban-wrapper::-webkit-scrollbar { height: 6px; }

.kanban-col {
  flex-shrink: 0;
  width: 280px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
}
.col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.col-name-text { flex: 1; font-weight: 600; font-size: .875rem; }
.col-count { font-size: .7rem; background: var(--border); color: var(--text-muted); padding: .15rem .45rem; border-radius: 10px; font-weight: 600; }
.col-actions { display: flex; gap: .15rem; }
.col-actions button { color: var(--text-muted); padding: .2rem .35rem; border-radius: 4px; font-size: .75rem; }
.col-actions button:hover { background: var(--border); color: var(--text); }

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: .5rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.kanban-cards::-webkit-scrollbar { width: 3px; }

/* Card do Kanban */
.k-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: .75rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  border-left: 3px solid transparent;
  user-select: none;
}
.k-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.k-card.ui-sortable-helper { box-shadow: var(--shadow-lg); transform: rotate(1.5deg); opacity: .95; }
.k-card.ui-sortable-placeholder { background: var(--border); border: 2px dashed #D1D5DB; box-shadow: none; border-radius: var(--radius-sm); min-height: 60px; }

.k-card-title { font-weight: 500; font-size: .875rem; line-height: 1.35; margin-bottom: .5rem; }
.k-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.k-card-badges { display: flex; gap: .25rem; flex-wrap: wrap; }
.k-card-meta { display: flex; align-items: center; gap: .5rem; }
.k-card-due { font-size: .7rem; color: var(--text-muted); display: flex; align-items: center; gap: .2rem; }
.k-card-due.overdue { color: var(--danger); }
.k-card-check { font-size: .7rem; color: var(--text-muted); display: flex; align-items: center; gap: .2rem; }

/* Botão adicionar card na coluna */
.btn-add-card {
  width: 100%;
  padding: .55rem;
  text-align: left;
  color: var(--text-muted);
  font-size: .8rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .25rem .5rem .5rem;
  width: calc(100% - 1rem);
  transition: all var(--transition);
  background: none;
  border: 1.5px dashed transparent;
}
.btn-add-card:hover { color: var(--primary); border-color: var(--primary); background: rgba(79,70,229,.04); }

/* Botão adicionar coluna */
.btn-add-col {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  align-self: flex-start;
  margin-top: .35rem;
}
.btn-add-col:hover { color: var(--primary); transform: scale(1.1); box-shadow: var(--shadow-md); }

/* ===== LIST VIEW ===== */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.list-toolbar select, .list-toolbar input[type="text"] {
  width: auto;
  padding: .4rem .75rem;
  font-size: .8rem;
}
.list-search { flex: 1; min-width: 180px; }

.task-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-collapse: collapse;
  overflow: hidden;
}
.task-table th {
  padding: .65rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.task-table th:hover { color: var(--text); }
.task-table th .sort-icon { margin-left: .25rem; opacity: .4; }
.task-table th.sorted .sort-icon { opacity: 1; color: var(--primary); }

.task-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  vertical-align: middle;
}
.task-table tr:last-child td { border-bottom: none; }
.task-table tr:hover td { background: #FAFAFA; }

.task-row { cursor: pointer; transition: background var(--transition); }
.task-row td:first-child { padding-left: .75rem; }

.task-done-check {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: #fff;
}
.task-done-check.checked { background: var(--success); border-color: var(--success); color: #fff; }
.task-done-check.checked::after { content: '✓'; font-size: 10px; color: #fff; }

.task-title-cell { display: flex; align-items: center; gap: .65rem; }
.task-title-text { font-weight: 500; }
.task-title-text.done { text-decoration: line-through; color: var(--text-muted); }

/* ===== TASK MODAL BODY ===== */
.task-modal-body { display: flex; gap: 1.5rem; }
.task-modal-main { flex: 1; min-width: 0; }
.task-modal-meta { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: .75rem; }
.task-modal-meta .field-group { margin-bottom: 0; }
.task-modal-meta label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-check {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  transition: all var(--transition);
}
.checklist-check.done { background: var(--success); border-color: var(--success); }
.checklist-check.done::after { content: '✓'; font-size: 9px; color: #fff; }
.checklist-text { flex: 1; font-size: .875rem; background: none; border: none; outline: none; color: var(--text); }
.checklist-text.done { text-decoration: line-through; color: var(--text-muted); }
.checklist-remove { color: var(--text-muted); padding: .15rem .35rem; border-radius: 4px; font-size: .75rem; }
.checklist-remove:hover { color: var(--danger); background: #FEE2E2; }

.checklist-progress { margin-bottom: .5rem; }
.checklist-progress-bar { height: 3px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: .25rem; }
.checklist-progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width .3s; }

/* ===== TAGS ===== */
.tags-area { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .5rem; min-height: 38px; cursor: pointer; background: #FAFAFA; }
.tags-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  cursor: default;
}
.tag-chip .remove-tag { cursor: pointer; opacity: .6; font-size: .65rem; }
.tag-chip .remove-tag:hover { opacity: 1; }

.tags-picker { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.tag-option {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all var(--transition);
  opacity: .6;
}
.tag-option:hover { opacity: 1; }
.tag-option.selected { opacity: 1; border-color: currentColor; }

/* Tags na lista/kanban */
.k-card-tags { display: flex; flex-wrap: wrap; gap: .2rem; margin-bottom: .35rem; }

/* Gerenciador de tags */
.tags-manage-list { display: flex; flex-direction: column; gap: .35rem; max-height: 220px; overflow-y: auto; }
.tag-manage-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .65rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: #FAFAFA;
}
.tag-manage-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.tag-manage-name { flex: 1; font-weight: 500; font-size: .875rem; }
.tag-manage-actions { display: flex; gap: .25rem; }

/* ===== TIMELINE ===== */
.timeline-wrapper { overflow-x: auto; }
.timeline-nav {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem; background: var(--surface);
  padding: .75rem 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.timeline-nav h3 { font-size: 1rem; font-weight: 600; flex: 1; text-align: center; }
.timeline-nav button { padding: .4rem .85rem; border-radius: var(--radius-sm); font-size: .85rem; }

.timeline-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.timeline-table th {
  padding: .5rem .4rem;
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--bg);
  text-align: center;
  border-bottom: 1px solid var(--border);
  min-width: 32px;
  white-space: nowrap;
}
.timeline-table th.today-col { background: rgba(79,70,229,.08); color: var(--primary); }
.timeline-table th.task-label { text-align: left; min-width: 180px; max-width: 220px; padding: .5rem 1rem; }

.timeline-table td {
  border-bottom: 1px solid var(--border);
  padding: .3rem .2rem;
  text-align: center;
  vertical-align: middle;
  position: relative;
}
.timeline-table td.task-label-cell {
  text-align: left; padding: .4rem 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px; font-size: .8rem; font-weight: 500;
}
.timeline-table tr:last-child td { border-bottom: none; }
.timeline-table tr:hover td { background: #FAFAFA; }

.timeline-bar {
  height: 18px; border-radius: 4px; cursor: pointer;
  display: block; transition: opacity var(--transition);
  opacity: .85;
}
.timeline-bar:hover { opacity: 1; }

.today-line {
  position: absolute; top: 0; left: 50%; bottom: 0;
  width: 2px; background: var(--primary); opacity: .4;
  pointer-events: none;
}

.timeline-no-date {
  font-size: .75rem; color: var(--text-muted); font-style: italic;
}
.timeline-empty { padding: 3rem; text-align: center; color: var(--text-muted); font-size: .875rem; }

@media (max-width: 768px) {
  .task-modal-body { flex-direction: column; }
  .task-modal-meta { width: 100%; flex-direction: row; flex-wrap: wrap; gap: .75rem; }
  .task-modal-meta .field-group { flex: 1; min-width: 120px; }
  .kanban-wrapper { padding-bottom: 80px; }
  .task-table { font-size: .8rem; }
  .task-table th, .task-table td { padding: .5rem .6rem; }
  .view-tabs { width: 100%; }
  .view-tab { flex: 1; justify-content: center; }
}

/* ===== VAULT (Cofre) ===== */
.vault-toolbar {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.vault-toolbar h3 { flex: 1; font-size: 1rem; font-weight: 600; }

.vault-list { padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.vault-empty { padding: 3rem; text-align: center; color: var(--text-muted); }
.vault-empty i { font-size: 2.5rem; margin-bottom: .75rem; display: block; opacity: .4; }

.vault-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: box-shadow var(--transition);
}
.vault-card:hover { box-shadow: var(--shadow-md); }

.vault-card-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.vault-card-icon.type-ftp      { background: #EFF6FF; color: #3B82F6; }
.vault-card-icon.type-database { background: #F5F3FF; color: #7C3AED; }
.vault-card-icon.type-cpanel   { background: #FFF7ED; color: #EA580C; }
.vault-card-icon.type-ssh      { background: #F0FDF4; color: #16A34A; }
.vault-card-icon.type-dns      { background: #ECFDF5; color: #059669; }
.vault-card-icon.type-api_key  { background: #FFF1F2; color: #E11D48; }
.vault-card-icon.type-email    { background: #FEFCE8; color: #CA8A04; }
.vault-card-icon.type-other    { background: #F9FAFB; color: #6B7280; }

.vault-card-info { flex: 1; min-width: 0; }
.vault-card-label { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.vault-card-meta  { font-size: .8rem; color: var(--text-muted); display: flex; gap: .75rem; flex-wrap: wrap; }
.vault-card-meta span { display: flex; align-items: center; gap: .3rem; }

.vault-card-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.vault-card-actions button {
  width: 32px; height: 32px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.vault-card-actions button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.vault-card-actions button.btn-danger-icon:hover { background: var(--danger); border-color: var(--danger); }

/* Vault pass field */
.vault-pass-field { position: relative; }
.vault-pass-field input { padding-right: 2.5rem; }
.vault-pass-field .toggle-pass {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .9rem; padding: .25rem;
}
.vault-pass-hint { font-size: .75rem; color: var(--text-muted); font-weight: 400; }

/* Vault reveal result */
.vault-reveal-info {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: .75rem 1rem; font-size: .85rem;
}
.vault-reveal-info .reveal-row { display: flex; gap: .5rem; margin-bottom: .25rem; }
.vault-reveal-info .reveal-row:last-child { margin-bottom: 0; }
.vault-reveal-info .reveal-key { color: var(--text-muted); min-width: 70px; }
.vault-reveal-result {
  margin-top: 1rem; background: #F0FDF4; border: 1px solid #86EFAC;
  border-radius: var(--radius-sm); padding: .75rem 1rem;
}
.vault-revealed-label { font-size: .75rem; color: #16A34A; font-weight: 600; margin-bottom: .4rem; }
.vault-revealed-pass {
  display: flex; align-items: center; gap: .5rem;
}
.vault-revealed-pass code {
  flex: 1; font-family: 'Courier New', monospace; font-size: .9rem;
  word-break: break-all; background: white; padding: .4rem .6rem;
  border-radius: 4px; border: 1px solid #D1FAE5;
}
.btn-icon-sm {
  width: 30px; height: 30px; border: 1px solid #86EFAC; border-radius: 4px;
  background: white; cursor: pointer; color: #16A34A;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  flex-shrink: 0;
}
.vault-reveal-timer { font-size: .75rem; color: var(--text-muted); margin-top: .5rem; }

/* Vault PIN modal */
.vault-pin-desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* Vault log */
.vault-log-list { max-height: 400px; overflow-y: auto; }
.vault-log-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .6rem 0; border-bottom: 1px solid var(--border);
  font-size: .8rem;
}
.vault-log-item:last-child { border-bottom: none; }
.vault-log-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vault-log-detail { flex: 1; }
.vault-log-action { font-weight: 600; text-transform: capitalize; }
.vault-log-who { color: var(--text-muted); }
.vault-log-time { color: var(--text-muted); font-size: .75rem; white-space: nowrap; }

/* Vault type badge */
.vault-type-badge {
  font-size: .7rem; padding: .15rem .45rem; border-radius: 99px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}

/* ===================== FILES ===================== */
.files-toolbar {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.files-toolbar h3 { flex: 1; font-size: 1rem; font-weight: 600; }

.files-upload-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  cursor: pointer; user-select: none;
}

.files-drop-zone {
  margin: 1.25rem 1.5rem;
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 2rem; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  transition: border-color .2s, background .2s; cursor: pointer;
}
.files-drop-zone i { font-size: 2rem; opacity: .4; }
.files-drop-zone span { font-size: .9rem; }
.files-hint { font-size: .75rem; }
.files-drop-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }

.files-list { padding: .5rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.files-empty { padding: 2.5rem; text-align: center; color: var(--text-muted); }
.files-empty i { font-size: 2rem; opacity: .3; display: block; margin-bottom: .5rem; }

.file-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  transition: box-shadow .15s;
}
.file-row:hover { box-shadow: var(--shadow-md); }

.file-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.fi-image   { background: #EFF6FF; color: #3B82F6; }
.fi-pdf     { background: #FFF1F2; color: #E11D48; }
.fi-word    { background: #EFF6FF; color: #2563EB; }
.fi-excel   { background: #F0FDF4; color: #16A34A; }
.fi-zip     { background: #FFF7ED; color: #EA580C; }
.fi-other   { background: var(--bg); color: var(--text-muted); }

.file-info  { flex: 1; min-width: 0; }
.file-name  { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta  { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }

.file-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.file-actions .btn-icon, .file-actions a.btn-icon {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: .8rem; color: var(--text-muted);
  text-decoration: none; transition: background .15s, color .15s;
}
.file-actions .btn-icon:hover, .file-actions a.btn-icon:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.file-actions .btn-danger-icon:hover { background: var(--danger) !important; border-color: var(--danger) !important; }

/* File preview overlay */
.files-preview-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.files-preview-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.files-preview-close:hover { background: rgba(255,255,255,.3); }
.files-preview-inner {
  width: 90vw; height: 88vh; background: #fff; border-radius: 10px; overflow: hidden;
}
.files-preview-inner iframe { width: 100%; height: 100%; border: none; }
