/* layout.css e components.css V2 consolidados */

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  transition: transform 0.3s ease, width 0.3s ease, background-color 0.3s ease;
  z-index: 50;
  border-right: 1px solid var(--border-color);
}

.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 12px;
  padding: 8px;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.025em;
}

.nav-menu {
  list-style: none;
  padding: 0 15px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 12px;
}

.nav-item:hover {
  background-color: var(--hover-bg);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.main-content {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  overflow-y: auto;
  overflow-x: hidden;
}

.content-wrapper {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-2xl);
  padding: 35px;
  border-top: 6px solid var(--primary-light);
  flex: 1;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--card-bg);
  padding: 16px 25px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

/* ==========================================================================
   COMPONENTES (Botões, Inputs, Cards)
   ========================================================================== */

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 8px;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Inputs e Formulários */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-control {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: var(--hover-bg);
  color: var(--text-main);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  background-color: var(--card-bg);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
  transform: translateY(-1px);
}

/* Tabelas Avançadas */
.table-container {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background-color: var(--card-bg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: var(--table-header);
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover td {
  background-color: var(--hover-bg);
}

/* Badges Status */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-aberta { background-color: rgba(59, 130, 246, 0.15); color: var(--primary); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-exercida { background-color: rgba(16, 185, 129, 0.15); color: var(--secondary); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-vencida { background-color: rgba(107, 114, 128, 0.15); color: var(--text-muted); border: 1px solid rgba(107, 114, 128, 0.3); }
.badge-fechada { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Dashboard Cards (V2) */
.stat-card {
  background-color: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.stat-card:hover::before {
  opacity: 1;
}

/* Responsividade Mobile */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    height: 100vh;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    padding: 15px;
  }
  .content-wrapper {
    padding: 20px;
  }
}
