/* =========================================================
   Portal BI Frooty - design system (inspirado em biexplorer.com.br)
   ========================================================= */

:root {
  --bi-primary: #1D4ED8;
  --bi-primary-700: #1E40AF;
  --bi-primary-50: #EFF6FF;
  --bi-accent: #F97316;
  --bi-accent-600: #EA580C;
  --bi-bg: #F8FAFC;
  --bi-surface: #FFFFFF;
  --bi-text: #0F172A;
  --bi-muted: #64748B;
  --bi-border: #E2E8F0;
  --bi-radius: 12px;
  --bi-radius-sm: 8px;
  --bi-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --bi-shadow-md: 0 4px 6px rgba(15, 23, 42, .04), 0 10px 25px rgba(15, 23, 42, .08);
  --bi-shadow-lg: 0 25px 50px rgba(15, 23, 42, .15);
}

* { box-sizing: border-box; }

html, body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--bi-bg);
  color: var(--bi-text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bi-primary); text-decoration: none; }
a:hover { color: var(--bi-primary-700); }

/* --------- Tabler overrides via classes globais --------- */
.btn {
  border-radius: var(--bi-radius-sm);
  font-weight: 600;
  padding: 10px 18px;
  transition: all .15s ease;
  border-width: 1px;
}
.btn-primary,
.btn-primary:focus {
  background-color: var(--bi-primary);
  border-color: var(--bi-primary);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:active {
  background-color: var(--bi-primary-700) !important;
  border-color: var(--bi-primary-700) !important;
  transform: translateY(-1px);
}
.btn-accent {
  background-color: var(--bi-accent);
  border-color: var(--bi-accent);
  color: #fff;
}
.btn-accent:hover {
  background-color: var(--bi-accent-600);
  border-color: var(--bi-accent-600);
  color: #fff;
  transform: translateY(-1px);
}
.btn-outline-primary {
  background: transparent;
  color: var(--bi-primary);
  border-color: var(--bi-primary);
}
.btn-outline-primary:hover {
  background: var(--bi-primary);
  color: #fff;
}
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.card {
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-radius: var(--bi-radius);
  box-shadow: var(--bi-shadow-sm);
  overflow: hidden;
}
.card-body { padding: 1.5rem; }

/* --------- Header --------- */
.bi-navbar {
  background: var(--bi-surface);
  border-bottom: 1px solid var(--bi-border);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.bi-navbar .bi-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--bi-text);
}
.bi-navbar .bi-brand:hover { color: var(--bi-primary); }
.bi-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--bi-primary) 0%, var(--bi-accent) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: -.02em;
  box-shadow: 0 4px 12px rgba(29, 78, 216, .25);
}

.bi-nav-user {
  display: flex; align-items: center; gap: 10px;
  background: var(--bi-bg);
  border: 1px solid var(--bi-border);
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.bi-nav-user:hover { border-color: var(--bi-primary); }
.bi-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bi-primary), var(--bi-accent));
  color: #fff; font-weight: 600; font-size: .8rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.bi-nav-user .meta { line-height: 1.1; }
.bi-nav-user .meta .name { font-weight: 600; font-size: .85rem; }
.bi-nav-user .meta .role { font-size: .72rem; color: var(--bi-muted); }

.dropdown-menu {
  border-radius: var(--bi-radius-sm);
  border: 1px solid var(--bi-border);
  box-shadow: var(--bi-shadow-md);
  padding: .35rem;
}
.dropdown-item {
  border-radius: 6px;
  padding: .55rem .75rem;
  font-weight: 500;
}
.dropdown-item:hover { background: var(--bi-primary-50); color: var(--bi-primary-700); }

/* --------- Page sections --------- */
.bi-page { padding: 2rem 0; }
.bi-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem;
}
.bi-page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.02em;
}
.bi-page-header .subtitle { color: var(--bi-muted); font-size: .95rem; margin-top: 4px; }

/* --------- Report cards --------- */
.report-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.report-card {
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-radius: var(--bi-radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all .2s ease;
  display: block; color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.report-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: linear-gradient(180deg, var(--bi-primary), var(--bi-accent));
  opacity: 0; transition: opacity .2s ease;
}
.report-card:hover {
  border-color: transparent;
  box-shadow: var(--bi-shadow-md);
  transform: translateY(-2px);
  color: inherit;
}
.report-card:hover::before { opacity: 1; }
.report-card .icon-wrap {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--bi-primary-50);
  color: var(--bi-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 1rem;
}
.report-card h3 {
  font-size: 1.05rem; font-weight: 600;
  margin: 0 0 .35rem; letter-spacing: -.01em;
}
.report-card p {
  color: var(--bi-muted);
  font-size: .875rem;
  margin: 0;
  line-height: 1.5;
}
.report-card .arrow {
  margin-top: 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--bi-primary);
  display: inline-flex; align-items: center; gap: 6px;
}

/* --------- Tabelas modernas --------- */
.table {
  background: transparent;
}
.table thead th {
  font-weight: 600;
  color: var(--bi-muted);
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--bi-border);
  padding: .85rem 1rem;
}
.table tbody td {
  padding: .85rem 1rem;
  border-color: var(--bi-border);
  vertical-align: middle;
}

.badge {
  font-weight: 500;
  padding: .35em .7em;
  border-radius: 999px;
  font-size: .72rem;
}
.badge.bg-success { background: #DCFCE7 !important; color: #166534 !important; }
.badge.bg-secondary { background: var(--bi-bg) !important; color: var(--bi-muted) !important; }
.badge.bg-azure-lt { background: var(--bi-primary-50) !important; color: var(--bi-primary-700) !important; }

/* --------- Forms --------- */
.form-control, .form-select {
  border-radius: var(--bi-radius-sm);
  border-color: var(--bi-border);
  padding: .65rem .85rem;
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--bi-primary);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, .1);
}
.form-label {
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .35rem;
}

/* --------- Welcome / login page --------- */
.bi-welcome {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px circle at 80% -20%, rgba(249, 115, 22, .12), transparent 60%),
    radial-gradient(1000px circle at -10% 110%, rgba(29, 78, 216, .15), transparent 60%),
    var(--bi-bg);
  padding: 2rem;
}
.bi-welcome-card {
  background: var(--bi-surface);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: var(--bi-shadow-lg);
  border: 1px solid var(--bi-border);
  max-width: 460px;
  width: 100%;
  text-align: center;
}
.bi-welcome-card .bi-logo-lg {
  width: 64px; height: 64px;
  border-radius: 16px;
  margin: 0 auto 1.5rem;
  font-size: 1.5rem;
}
.bi-welcome-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
}
.bi-welcome-card p.lead {
  color: var(--bi-muted);
  font-size: .98rem;
  margin: 0 0 2rem;
  line-height: 1.5;
}
.bi-microsoft-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 20px;
  background: #2F2F2F;
  color: #fff;
  border-radius: var(--bi-radius-sm);
  font-weight: 600;
  border: none;
  font-size: 1rem;
  transition: all .15s ease;
  text-decoration: none;
}
.bi-microsoft-btn:hover {
  background: #1A1A1A; color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--bi-shadow-md);
}
.bi-microsoft-btn svg { width: 20px; height: 20px; }

.bi-welcome-features {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  text-align: left;
  border-top: 1px solid var(--bi-border);
  padding-top: 1.5rem;
}
.bi-welcome-features .feat {
  display: flex; gap: .65rem; align-items: flex-start;
  font-size: .85rem; color: var(--bi-muted);
}
.bi-welcome-features .feat .ti {
  color: var(--bi-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* --------- Power BI embed full size --------- */
.powerbi-embed-container {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 500px;
  border: 1px solid var(--bi-border);
  border-radius: var(--bi-radius);
  background: var(--bi-surface);
  box-shadow: var(--bi-shadow-sm);
  overflow: hidden;
}
.bi-embed-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}

/* --------- Alerts --------- */
.alert {
  border-radius: var(--bi-radius-sm);
  border: 1px solid transparent;
  padding: .85rem 1rem;
  font-weight: 500;
  font-size: .9rem;
}
.alert-success { background: #DCFCE7; color: #14532D; border-color: #BBF7D0; }
.alert-danger  { background: #FEE2E2; color: #7F1D1D; border-color: #FECACA; }
.alert-warning { background: #FEF3C7; color: #78350F; border-color: #FDE68A; }

/* --------- Empty state --------- */
.empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bi-surface);
  border-radius: var(--bi-radius);
  border: 1px dashed var(--bi-border);
}
.empty-icon {
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: var(--bi-primary-50);
  color: var(--bi-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.empty-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .35rem; }
.empty-subtitle { color: var(--bi-muted); font-size: .9rem; margin: 0; }

/* --------- Footer --------- */
.bi-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--bi-muted);
  font-size: .8rem;
}
.bi-footer a { color: var(--bi-muted); }
.bi-footer a:hover { color: var(--bi-primary); }

/* --------- Utilidades responsivas --------- */
@media (max-width: 768px) {
  .bi-page-header { flex-direction: column; align-items: flex-start; }
  .bi-welcome-card { padding: 2rem 1.5rem; }
  .bi-welcome-card h1 { font-size: 1.5rem; }
  .report-grid { grid-template-columns: 1fr; }
}
