/* Sistema de Gestão de Pneus - Design Moderno e Profissional */
:root {
  /* Cores principais para sistema de autopeças/pneus */
  --primary: #1a1a2e;
  --primary-light: #16213e;
  --accent: #e94560;
  --accent-hover: #d63651;
  --success: #10b981;
  --success-dark: #059669;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --info: #06b6d4;
  --info-dark: #0891b2;
  --secondary: #6b7280;
  --light: #f8fafc;
  --lighter: #f1f5f9;
  --dark: #0f172a;
  --darker: #020617;
  --white: #ffffff;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --text: #1e293b;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #94a3b8;
  --sidebar-hover: #16213e;
  --sidebar-active: #e94560;
  /* Adicionada cor de hover para tabelas mais clara */
  --table-hover: #eee !important;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--light);
  overflow-x: hidden;
}

.bg-app {
  background: var(--light);
}

.app-wrapper {
  min-height: 100vh;
  display: flex;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .brand {
  padding: 1.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand .logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.5px;
}

.sidebar .brand .small {
  color: var(--sidebar-text);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.sidebar nav {
  padding: 1.25rem 0;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  font-weight: 500;
  font-size: 0.9375rem;
  margin: 0.25rem 0;
}

.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--white);
  padding-left: 1.5rem;
}

.sidebar .nav-link.active {
  background: var(--sidebar-hover);
  color: var(--sidebar-active);
  border-left-color: var(--sidebar-active);
  font-weight: 600;
}

.sidebar .nav-link.text-danger {
  color: var(--danger) !important;
  margin-top: 1rem;
}

.sidebar .nav-link.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger) !important;
}

.sidebar hr {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 1rem 1.25rem;
}

/* Botão toggle mobile */
.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1100;
  background: var(--primary);
  color: var(--white);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.menu-close {
  display: none;
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  background: transparent;
  color: var(--white);
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
}

/* ===== CONTENT AREA ===== */
.content {
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
  width: calc(100% - 260px);
  background: var(--light);
  transition: margin-left 0.3s ease, width 0.3s ease;
}

/* ===== CARDS ===== */
.card-app {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  padding: 1.5rem;
}

.card-app:hover {
  box-shadow: var(--card-shadow-hover);
}

/* Dashboard stats modernos */
.stat-card {
  background: var(--white);
  padding: 1.75rem;
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-left: 4px solid var(--accent);
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.stat-card.stat-primary {
  border-left-color: var(--accent);
  background: linear-gradient(135deg, #fff5f7 0%, #ffffff 100%);
}

.stat-card.stat-success {
  border-left-color: var(--success);
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
}

.stat-card.stat-danger {
  border-left-color: var(--danger);
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.stat-card.stat-warning {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.stat-card.stat-info {
  border-left-color: var(--info);
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.stat-icon {
  font-size: 2.75rem;
  opacity: 0.85;
  line-height: 1;
}

.stat-content h6 {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  line-height: 1.2;
}

/* Cards com headers coloridos */
.card-header-custom {
  border-radius: 0.75rem 0.75rem 0 0 !important;
  font-weight: 600;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.card-header-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  color: var(--white) !important;
}

.card-header-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%) !important;
  color: var(--white) !important;
}

.card-header-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%) !important;
  color: var(--white) !important;
}

.card-header-warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%) !important;
  color: var(--white) !important;
}

.card-header-info {
  background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%) !important;
  color: var(--white) !important;
}

/* ===== BADGES ===== */
.badge {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-transform: capitalize;
}

.badge-primary {
  background: var(--primary);
  color: var(--white);
}

.badge-success {
  background: var(--success);
  color: var(--white);
}

.badge-danger {
  background: var(--danger);
  color: var(--white);
}

.badge-warning {
  background: var(--warning);
  color: var(--white);
}

.badge-info {
  background: var(--info);
  color: var(--white);
}

.badge-secondary {
  background: var(--secondary);
  color: var(--white);
}

.badge-soft {
  background: var(--lighter);
  color: var(--text);
  font-weight: 500;
}

/* ===== TABELAS ===== */
.table-responsive {
  overflow-x: auto;
  background: var(--white);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}

.table-darksss {
  background: var(--white) !important;
  margin-bottom: 0;
}

.table-darksss th,
.table-darksss td {
  background: var(--white) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.table-darksss thead th {
  background: var(--lighter) !important;
  color: var(--dark) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  border-bottom: 2px solid var(--border-dark) !important;
}

.table-darksss tbody tr {
  /* Transição mais suave para o hover */
  transition: background-color 0.2s ease, box-shadow 0.15s ease;
  border-bottom: 1px solid var(--border);
}

.table-darksss tbody tr:hover {
  /* Background muito mais claro - rosa bem suave */
  background: var(--table-hover) !important;
  box-shadow: inset 0 0 0 1px rgba(233, 69, 96, 0.15);
}

.table-darksss tbody tr:hover td {
  /* Garante que o texto permaneça visível no hover */
  color: var(--text) !important;
  background: transparent !important;
}

.table-darksss tbody tr:last-child {
  border-bottom: none;
}

.table-darksss tbody tr:last-child td {
  border-bottom: none !important;
}

/* ===== BOTÕES ===== */
.btn {
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  justify-content: center;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(233, 69, 96, 0.2);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(233, 69, 96, 0.3);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: var(--success-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-warning {
  background: var(--warning);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
  background: var(--warning-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-info {
  background: var(--info);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.2);
}

.btn-info:hover {
  background: var(--info-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent) !important;
}

.btn-outline-primary:hover {
  background: var(--accent);
  color: var(--white);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger) !important;
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: var(--white);
}

.btn-outline-light {
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border) !important;
}

.btn-outline-light:hover {
  background: var(--lighter);
  border-color: var(--accent) !important;
  color: var(--accent);
}

.btn-outline-info {
  background: transparent;
  color: var(--info);
  border: 2px solid var(--info) !important;
}

.btn-outline-info:hover {
  background: var(--info);
  color: var(--white);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-whatsapp {
  background: #25d366;
  color: var(--white);
  box-shadow: 0 2px 4px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

/* ===== FORMS ===== */
input,
select,
textarea {
  background: var(--white) !important;
  color: var(--text) !important;
  border: 2px solid var(--border) !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  font-weight: 500;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1) !important;
  outline: none !important;
}

.form-label {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  display: block;
}

.form-control-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* ===== ALERTS ===== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
  font-weight: 500;
}

.alert-info {
  background: #eff6ff !important;
  border-left-color: var(--info) !important;
  color: #075985 !important;
}

.alert-success {
  background: #ecfdf5 !important;
  border-left-color: var(--success) !important;
  color: #065f46 !important;
}

.alert-danger {
  background: #fef2f2 !important;
  border-left-color: var(--danger) !important;
  color: #991b1b !important;
}

.alert-warning {
  background: #fffbeb !important;
  border-left-color: var(--warning) !important;
  color: #92400e !important;
}

/* ===== MODALS ===== */
.modal-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  background: var(--lighter);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  border-radius: 0.75rem 0.75rem 0 0;
}

.modal-title {
  font-weight: 700;
  color: var(--dark);
  font-size: 1.25rem;
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  background: var(--lighter);
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.75rem;
  border-radius: 0 0 0.75rem 0.75rem;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ===== TEXT UTILITIES ===== */
.text-primary {
  color: var(--accent) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-info {
  color: var(--info) !important;
}

.text-muted {
  color: var(--text-light) !important;
}

/* ===== HEADINGS ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--dark);
  font-weight: 700;
}

/* ===== GALERIA DE PNEUS ===== */
.tire-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.tire-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
}

.tire-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

.tire-card-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tire-card-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.tire-card-details {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.tire-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.75rem 0;
}

.tire-card-stock {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
}

.tire-card-stock.low-stock {
  color: var(--danger);
}

/* ===== SEARCH/FILTER ===== */
.search-filter-bar {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}

.search-filter-bar .form-group {
  flex: 1;
  min-width: 200px;
}

/* ===== RESPONSIVIDADE ===== */

/* Tablets */
@media (max-width: 992px) {
  .sidebar {
    width: 240px;
  }

  .content {
    margin-left: 240px;
    width: calc(100% - 240px);
    padding: 1.5rem;
  }

  .tire-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* Mobile - Menu toggle */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
  }

  .sidebar.show {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar.show .menu-close {
    display: block;
  }

  .content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    padding-top: 5rem;
  }

  .sidebar.show::before {
    content: "";
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }

  .card-app {
    margin-bottom: 1rem;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .table-darksss {
    font-size: 0.8125rem;
  }

  .table-darksss th,
  .table-darksss td {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
  }

  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }

  .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .col-md-3,
  .col-md-4,
  .col-md-5,
  .col-md-6,
  .col-md-7,
  .col-md-8,
  .col-md-12 {
    width: 100% !important;
    margin-bottom: 1rem;
  }

  .row.g-3 {
    gap: 0.75rem !important;
  }

  .tire-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .search-filter-bar {
    flex-direction: column;
  }

  .search-filter-bar .form-group {
    width: 100%;
  }
}

/* Mobile pequeno */
@media (max-width: 576px) {
  .sidebar {
    width: 260px;
  }

  .sidebar.show::before {
    left: 260px;
  }

  .content {
    padding: 0.75rem;
    padding-top: 4.5rem;
  }

  .sidebar .brand {
    padding: 1.5rem 1rem;
  }

  .sidebar .brand .logo {
    font-size: 1.25rem;
  }

  .sidebar .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .card-app {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .table-darksss {
    font-size: 0.75rem;
  }

  .table-darksss th,
  .table-darksss td {
    padding: 0.5rem 0.375rem;
  }

  input,
  select,
  textarea {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }

  .btn {
    font-size: 0.8125rem;
    padding: 0.5rem 0.875rem;
  }

  .btn-sm {
    padding: 0.325rem 0.625rem;
    font-size: 0.7rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-content h6 {
    font-size: 0.75rem;
  }

  .tire-gallery {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .tire-card {
    padding: 1rem;
  }

  .tire-card-icon {
    font-size: 2.5rem;
  }

  .tire-card-brand {
    font-size: 0.875rem;
  }

  .tire-card-price {
    font-size: 1rem;
  }
}

/* Impressão */
@media print {
  .sidebar,
  .menu-toggle,
  .btn {
    display: none !important;
  }

  .content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .card-app {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}
