@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Melhorias para mobile */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }

  .topbar h1 {
    font-size: 1.5rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .stat-info .value {
    font-size: 1.2rem;
  }

  .table th, .table td {
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .input-group .btn {
    width: auto;
  }

  .form-control, .form-select {
    font-size: 0.9rem;
  }

  .sidebar {
    margin-left: -100%;
    width: 280px;
  }

  .sidebar.show {
    margin-left: 0;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }

  .sidebar-overlay.show {
    display: block;
  }
}


:root {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #4834D4;
  --secondary: #00B894;
  --accent: #0984E3;
  --danger: #FF6B6B;
  --warning: #FECA57;
  --dark: #1E272E;
  --dark-light: #2C3A47;
  --bg-light: #F4F6FA;
  --text: #2D3436;
  --text-muted: #636E72;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow: 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.1);
  --sidebar-width: 260px;
}

* {
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-light);
  color: var(--text);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-width);
  background: #FFFFFF;
  color: var(--text);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 2px 0 12px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  border-right: 1px solid #F0F0F0;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6C5CE7, #00B894);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(108,92,231,0.3);
}

.logo-text {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: -0.5px;
}

/* Perfil */
.profile-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem;
  background: #F8F9FA;
  border-radius: 14px;
  margin-bottom: 1.5rem;
  transition: background 0.2s;
}

.profile-card:hover {
  background: #F1F3F5;
}

.profile-card .avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6C5CE7, #00B894);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(108,92,231,0.3);
}

.profile-card .info {
  flex: 1;
  min-width: 0;
}

.profile-card .info strong {
  display: block;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.profile-card .info small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Menu */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-menu .menu-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem 0.75rem;
  font-weight: 600;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 2px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sidebar-menu a:hover {
  background: #F8F9FA;
  color: var(--text);
}

.sidebar-menu a.active {
  background: #F1F0FE;
  color: var(--primary);
  font-weight: 600;
}

.sidebar-menu a.active i {
  color: var(--primary);
}

.sidebar-menu a i {
  width: 22px;
  font-size: 1.1rem;
  margin-right: 10px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.2s;
}

/* Rodapé da sidebar */
.sidebar-footer {
  border-top: 1px solid #F0F0F0;
  padding-top: 1rem;
}

.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sidebar-footer .nav-link:hover {
  background: #F8F9FA;
  color: var(--text);
}

.sidebar-footer .nav-link i {
  width: 22px;
  font-size: 1.1rem;
  margin-right: 10px;
  text-align: center;
}

/* Conteúdo principal */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  transition: margin-left 0.3s;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.topbar h1 {
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.5px;
  margin: 0;
  color: var(--text);
}

.search-box {
  position: relative;
}

.search-box input {
  background: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  font-size: 0.9rem;
  width: 280px;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Cards */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.bg-purple { background: rgba(108,92,231,0.1); }
.bg-green { background: rgba(0,184,148,0.1); }
.bg-blue { background: rgba(9,132,227,0.1); }
.bg-orange { background: rgba(254,202,87,0.2); }
.bg-red { background: rgba(255,107,107,0.1); }

.stat-info .value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-info .label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Botões */
.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.55rem 1.3rem;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--secondary);
}

.btn-danger {
  background: var(--danger);
}

/* Tabelas */
.table-responsive {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table {
  background: #fff;
  margin-bottom: 0;
}

.table thead {
  background: #F8F9FA;
}

.table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.8px;
  border-bottom: none;
  padding: 1rem;
  color: var(--text-muted);
}

.table td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #F0F0F0;
}

.table-hover tbody tr:hover {
  background-color: #F8F9FA;
}

/* Responsivo */
@media (max-width: 768px) {
  .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  .sidebar.show {
    margin-left: 0;
  }
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  .topbar {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  .search-box input {
    width: 100%;
  }
}
/* ============ RESPONSIVIDADE MOBILE ============ */

/* Overlay do menu mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    transition: opacity 0.3s;
}
.sidebar-overlay.show {
    display: block;
}

/* Botão hambúrguer fixo */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: #1E272E;
    color: #fff;
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
}

@media (max-width: 768px) {
    /* Botão hambúrguer visível */
    .mobile-menu-btn {
        display: flex;
    }

    /* Sidebar vira drawer */
    .sidebar {
        margin-left: -100%;
        width: 280px;
        transition: margin-left 0.3s ease;
    }
    .sidebar.show {
        margin-left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    /* Conteúdo principal ocupa toda a largura */
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
        padding-top: 70px; /* espaço para o botão hambúrguer */
    }

    /* Topbar empilhada */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }
    .topbar h1 {
        font-size: 1.4rem;
    }
    .topbar .btn {
        width: 100%;
    }

    /* Cards em coluna única */
    .stat-card {
        padding: 1rem;
    }
    .stat-info .value {
        font-size: 1.3rem;
    }

    /* Tabelas viram cards */
    .table-responsive {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        background: transparent;
    }
    .table thead {
        display: none;
    }
    .table tbody tr {
        display: block;
        background: #fff;
        border-radius: 14px;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border: 1px solid #F0F0F0;
    }
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
        border: none;
        font-size: 0.88rem;
        text-align: right;
    }
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #636E72;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    .table tbody td:last-child {
        justify-content: flex-end;
        margin-top: 0.5rem;
        padding-top: 0.8rem;
        border-top: 1px solid #F0F0F0;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    .table tbody td:last-child::before {
        display: none;
    }

    /* Botões e inputs em largura total */
    .btn {
        padding: 0.55rem 1rem;
        font-size: 0.9rem;
    }
    .form-control, .form-select {
        font-size: 0.9rem;
    }

    /* Modal mais compacto */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-body {
        padding: 1rem;
    }

    /* Gráficos em altura reduzida */
    canvas {
        max-height: 260px;
    }

    /* Título do dashboard */
    h2, h1 {
        font-size: 1.3rem;
    }

    /* Cards de compartilhar links */
    .card-body .input-group {
        flex-wrap: nowrap;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
        padding-top: 65px;
    }
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    .stat-icon {
        margin-bottom: 0.5rem;
    }
    .topbar h1 {
        font-size: 1.2rem;
    }
    .table tbody td {
        font-size: 0.82rem;
    }
}