/* ============================================================
   GymERP – app.css
   ============================================================ */

:root {
  --sidebar-w: 250px;
  --topbar-h:  60px;
  --primary:   #6366f1;
  --primary-dark: #4f46e5;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #1e293b;
  --muted:     #64748b;
  --sidebar-bg:    #155e57;
  --sidebar-hover: rgba(255,255,255,.08);
  --sidebar-active: rgba(99,102,241,.25);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; }

/* -------- Sidebar -------- */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  overflow-y: auto; z-index: 1040;
  transition: transform .25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1.25rem 1rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex-direction: column;
    justify-content: space-around;
}
.sidebar-nav { list-style: none; margin: 0; padding: .5rem 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem 1.25rem;
  color: rgba(255,255,255,.7);
  text-decoration: none; font-size: .875rem;
  border-radius: 8px; margin: 1px 8px;
  transition: background .15s, color .15s;
}
.sidebar-nav li a:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav li a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-section {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 1rem 1.25rem .25rem;
}
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #fff;
}

/* -------- Main wrap -------- */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* -------- Topbar -------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* -------- Content -------- */
.content-area { flex: 1; }

/* -------- Cards -------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-dash { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-header-dash {
  padding: .85rem 1.25rem;
  font-weight: 600; font-size: .875rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center;
}

/* -------- KPI Cards -------- */
.kpi-card {
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative; overflow: hidden;
  border: none;
}
.kpi-primary { background: linear-gradient(135deg,#6366f1,#818cf8); color:#fff; }
.kpi-success { background: linear-gradient(135deg,#10b981,#34d399); color:#fff; }
.kpi-warning { background: linear-gradient(135deg,#f59e0b,#fbbf24); color:#fff; }
.kpi-danger  { background: linear-gradient(135deg,#ef4444,#f87171); color:#fff; }
.kpi-icon { font-size: 2rem; opacity: .3; position: absolute; right: 1rem; top: 1rem; }
.kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.kpi-label { font-size: .8rem; opacity: .9; margin-top: .25rem; }
.kpi-sub   { font-size: .72rem; opacity: .75; margin-top: .2rem; }

/* -------- Avatars -------- */
.avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.avatar-lg {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.5rem; color: #fff; flex-shrink: 0;
}

/* -------- Profile header -------- */
.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* -------- Timeline CRM -------- */
.timeline-list { display: flex; flex-direction: column; gap: .75rem; max-height: 400px; overflow-y: auto; }
.timeline-item { display: flex; gap: .75rem; }
.timeline-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; flex-shrink: 0;
}
.timeline-body { flex: 1; background: var(--bg); border-radius: 8px; padding: .6rem .9rem; }

/* -------- Produto card -------- */
.produto-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.produto-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,.1); border-color: var(--primary) !important; }
.produto-icon { font-size: 1.5rem; }

/* -------- Acesso terminal -------- */
.acesso-icon { font-size: 3rem; }
.acesso-status { min-height: 120px; }

/* -------- Login -------- */
.login-page { background: linear-gradient(135deg, #237d97 0%, #5192b0 60%, #0f7466 100%); }
.login-card {
  background: #fff; border-radius: 20px;
  padding: 2.5rem; width: 100%; max-width: 400px;
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
}
.login-logo {
    width: 137px;
    height: 75px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin: 0 auto;
}

/* -------- Tables -------- */
.table th { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table td { font-size: .875rem; vertical-align: middle; }

/* -------- Badges -------- */
.badge { font-weight: 500; }

/* -------- Nav tabs -------- */
.nav-tabs .nav-link { color: var(--muted); font-size: .875rem; font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* -------- Responsive -------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
}

/* -------- Print -------- */
@media print {
  .sidebar, .topbar { display: none !important; }
  .main-wrap { margin: 0; }
  .content-area { padding: 0; }
}

/* -------- Scrollbar -------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
