:root {
  --bg-color-main: #0a0f1a;
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.1);
  --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-color: #00f2fe;
  --text-primary: #ffffff;
  --text-secondary: #a0aabf;
  --danger-color: #ff4757;
  --success-color: #2ed573;
  --warning-color: #ffa502;
  --font-main: "Inter", sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: var(--font-main);
  background-color: var(--bg-color-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: scroll !important; /* Trava de barra p/ evitar tremor na navegação */
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.glass-effect {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* === LOGIN PAGE === */
.login-bg {
  background:
    radial-gradient(circle at top left, #1a2a47, var(--bg-color-main) 70%),
    url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M54.627 0l.83.83-54.627 54.627-.83-.83L54.627 0zM15 0l45 45-.83.83L14.17 0H15zM0 15l45 45-.83.83L0 15.83V15z" fill="%23ffffff" fill-opacity="0.02" fill-rule="evenodd"/%3E%3C/svg%3E');
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 3rem 2rem;
  text-align: center;
}

.login-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header span {
  font-weight: 300;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.input-group {
  text-align: left;
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-control {
  width: 100%;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-main);
  transition: var(--transition);
  /* Fix layout issues when box sizing isn't correct */
  box-sizing: border-box;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
}

select.form-control {
  appearance: auto;
  cursor: pointer;
  background-color: var(--bg-glass);
}

select.form-control option {
  background-color: var(--bg-color-main);
  color: #fff;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent-color);
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

input[type="file"] {
  padding: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 1rem;
  transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.checkbox-list {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: var(--transition);
}

.checkbox-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.checkbox-item span {
  color: #fff;
  font-size: 0.95rem;
}

.checkbox-item small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-family: var(--font-main);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

select option {
  background-color: var(--bg-color-main);
  color: var(--text-primary);
}

.btn-block {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

.btn-danger {
  background: var(--danger-color);
  color: #fff;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
}

/* === APP LAYOUT === */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: rgba(10, 15, 26, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: var(--bg-glass);
  color: var(--accent-color);
}

.nav-item i {
  margin-right: 1rem;
  font-size: 1.2rem;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-glass);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: 280px;
  padding: 2rem;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #1a2a47 0%, transparent 60%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.topbar-title h1 {
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

.topbar-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.page-header > div {
  flex: 1 1 300px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

/* DASHBOARD CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 242, 254, 0.15), inset 0 0 10px rgba(0, 242, 254, 0.05);
  border-color: rgba(0, 242, 254, 0.3);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* CHARTS & PANELS */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.panel {
  padding: 1.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 242, 254, 0.05);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1rem;
}

.badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
}
.badge-company {
  background: rgba(0, 242, 254, 0.2);
  color: #00f2fe;
}
.badge-team {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
}
.badge-personal {
  background: rgba(255, 165, 2, 0.2);
  color: #ffa502;
}

/* TABLES */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

th {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* KANBAN BOARD */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.kanban-col {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem;
}

.kanban-col-header {
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.kanban-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.2s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.kanban-card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 242, 254, 0.1);
}

/* MODALS */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--bg-color-main);
  width: 100%;
  max-width: 600px;
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  border: 1px solid var(--border-glass);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.close-btn:hover {
  color: var(--danger-color);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* CHARTS & PANELS SUPPLEMENT */
.dash-grid-main {
  display: grid; 
  grid-template-columns: 2fr 1fr; 
  gap: 1rem; 
  margin-bottom: 1.5rem;
}

.dash-grid-bottom {
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 1rem;
}

.north-star-banner {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.1) 0%, rgba(10, 15, 26, 0.9) 100%);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 242, 254, 0.15);
  overflow: hidden;
}
.north-star-banner .compass-icon {
  position: absolute;
  right: -5%;
  top: -20%;
  font-size: 15rem;
  color: rgba(255,255,255,0.02);
  transform: rotate(15deg);
  pointer-events: none;
}
.edit-strategic-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(0,242,254,0.1);
  border: 1px solid rgba(0,242,254,0.3);
  color: var(--accent-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
  z-index: 5;
}
.edit-strategic-btn:hover {
  background: var(--accent-color);
  color: #000;
}
.ns-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(240,147,251,0.1);
  border: 1px solid rgba(240,147,251,0.3);
  color: #f093fb;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.ns-title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  max-width: 85%;
  text-shadow: 0 0 20px rgba(0,242,254,0.3);
}
.ns-footer {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
}
.ns-footer-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.alert-panel-dropdown {
  position: absolute;
  top: 3rem;
  right: 0;
  width: 350px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,242,254,0.2);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  border-radius: 12px;
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
  flex-direction: column;
  gap: 0.5rem;
}

/* RESPONSIVE */
@media (max-width: 992px) {
  .grid-2, .dash-grid-main, .dash-grid-bottom {
    grid-template-columns: 1fr;
  }
  .dash-grid-main, .dash-grid-bottom {
    margin-bottom: 1rem;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative;
  }
  .app-wrapper {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 1rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .mobile-menu-btn {
    display: block !important;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
  }
  .page-header > div {
    flex: none;
    width: 100%;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .north-star-banner {
    padding: 1.5rem;
  }
  .ns-title {
    font-size: 1.5rem;
    max-width: 100%;
  }
  .north-star-banner .compass-icon {
    font-size: 10rem;
    right: -10%;
    top: -5%;
  }
  .ns-footer {
    gap: 1.5rem;
  }
  .alert-panel-dropdown {
    position: fixed;
    top: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 95vw;
    max-width: 380px;
    right: auto;
    z-index: 1000;
  }
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* === BOARD CARDS (SWOT & CANVAS) === */
.board-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  color: #fff;
  font-size: 0.9rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.board-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}
.board-card-drag {
  color: var(--text-secondary);
  cursor: grab;
  opacity: 0.3;
  transition: all 0.2s;
  padding: 0.2rem 0.2rem 0.2rem 0;
  display: flex;
  align-items: center;
}
.board-card:hover .board-card-drag {
  opacity: 0.8;
}
.board-card-content {
  flex: 1;
  outline: none;
  word-break: break-word;
  min-height: 1.2rem;
  line-height: 1.4;
}
.board-card-content:empty:before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  display: block; /* For Firefox to show cursor correctly */
}
.board-card-delete {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0;
  transition: all 0.2s;
  padding: 0.2rem;
}
.board-card:hover .board-card-delete {
  opacity: 0.5;
}
.board-card-delete:hover {
  color: var(--danger-color) !important;
  opacity: 1 !important;
}
.add-board-card-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-secondary);
  padding: 0.6rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  margin-top: 0.5rem;
  display: block;
  width: 100%;
}
.add-board-card-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.board-items-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}
