/* ============================================================
   Google Index Manager – Main Stylesheet
   ============================================================ */

:root {
  --gim-sidebar-width: 240px;
  --gim-sidebar-bg: #0f172a;
  --gim-sidebar-text: rgba(255,255,255,.75);
  --gim-sidebar-text-active: #fff;
  --gim-sidebar-accent: #4361ee;
  --gim-topbar-height: 56px;
  --gim-body-bg: #f1f5f9;
  --gim-card-bg: #fff;
  --gim-border: #e2e8f0;
  --gim-primary: #4361ee;
  --gim-radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gim-body-bg);
  color: #1e293b;
  font-size: 14px;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.gim-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--gim-sidebar-width);
  background: var(--gim-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gim-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.logo-text {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

/* Nav items */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--gim-sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.sidebar-nav-item.active {
  background: rgba(67,97,238,.2);
  color: var(--gim-sidebar-text-active);
  border-left-color: var(--gim-primary);
}

.sidebar-nav-item i {
  font-size: 16px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

/* Sidebar footer/user */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  background: var(--gim-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.5); text-transform: capitalize; }

.sidebar-logout {
  color: rgba(255,255,255,.4);
  font-size: 18px;
  text-decoration: none;
  transition: color .15s;
  flex-shrink: 0;
}
.sidebar-logout:hover { color: #ff4d4f; }

/* ── Main / Topbar ────────────────────────────────────────── */

.gim-main {
  margin-left: var(--gim-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin .25s ease;
}

.gim-topbar {
  height: var(--gim-topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--gim-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-toggle { background: none; border: none; font-size: 20px; color: #64748b; cursor: pointer; }
.topbar-title { font-size: 15px; font-weight: 600; color: #1e293b; }

.topbar-user {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  background: var(--gim-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.gim-content {
  flex: 1;
  padding: 24px;
}

.gim-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--gim-border);
  background: #fff;
  text-align: center;
}

/* ── Cards ────────────────────────────────────────────────── */

.card {
  background: var(--gim-card-bg);
  border: 1px solid var(--gim-border);
  border-radius: var(--gim-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--gim-border);
  padding: 14px 18px;
  border-radius: calc(var(--gim-radius) - 1px) calc(var(--gim-radius) - 1px) 0 0;
}

.card-body { padding: 18px; }

/* ── Page header ──────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

/* ── Stats cards row ──────────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stats-card {
  background: #fff;
  border: 1px solid var(--gim-border);
  border-radius: var(--gim-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.stats-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stats-value { font-size: 22px; font-weight: 700; line-height: 1; }
.stats-label { font-size: 12px; color: #64748b; margin-top: 2px; }

/* ── Mini stats ───────────────────────────────────────────── */

.mini-stat {
  background: #fff;
  border: 1px solid var(--gim-border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.mini-val { font-size: 20px; font-weight: 700; display: block; }
.mini-key { font-size: 11px; color: #64748b; }

/* ── Project cards ────────────────────────────────────────── */

.project-card { transition: box-shadow .2s; }
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

.project-icon {
  width: 40px;
  height: 40px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gim-primary);
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
}

.project-stat { text-align: center; }
.stat-val { font-size: 15px; font-weight: 700; }
.stat-key { font-size: 11px; color: #94a3b8; }

/* ── Bulk action bar ──────────────────────────────────────── */

.bulk-action-bar {
  padding: 10px 16px;
  background: #eff6ff;
  border-top: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
}

/* ── Activity list ────────────────────────────────────────── */

.activity-list { list-style: none; margin: 0; padding: 0; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gim-border);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon { font-size: 16px; flex-shrink: 0; }
.activity-content { flex: 1; min-width: 0; }

/* ── URL table ────────────────────────────────────────────── */

.url-cell {
  max-width: 350px;
  font-size: 12.5px;
}

/* ── User avatar ──────────────────────────────────────────── */

.user-avatar-sm {
  width: 30px;
  height: 30px;
  background: var(--gim-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: var(--gim-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

/* ── Empty state ──────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { color: #64748b; margin-bottom: 12px; }

/* ── Breadcrumb ───────────────────────────────────────────── */

.breadcrumb { font-size: 12px; }
.breadcrumb-item a { color: #64748b; text-decoration: none; }
.breadcrumb-item a:hover { color: var(--gim-primary); }

/* ── Login page ───────────────────────────────────────────── */

.login-page {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 56px;
  height: 56px;
  background: var(--gim-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  margin: 0 auto 12px;
}
.login-brand h4 { font-weight: 700; margin-bottom: 4px; }

.btn-toggle-pass { background: #f8fafc; border-left: 0; cursor: pointer; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 991px) {
  .gim-sidebar {
    transform: translateX(-100%);
  }
  .gim-sidebar.open {
    transform: translateX(0);
  }
  .gim-main {
    margin-left: 0;
  }
  .stats-row {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 576px) {
  .gim-content { padding: 16px; }
  .login-card { padding: 24px 20px; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
}

/* ── Utility ──────────────────────────────────────────────── */

.font-monospace { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bootstrap overrides */
.badge { font-weight: 500; letter-spacing: 0.2px; }
.table > :not(caption) > * > * { padding: 10px 14px; }
.form-control, .form-select { border-color: #e2e8f0; font-size: 13.5px; }
.form-control:focus, .form-select:focus { border-color: var(--gim-primary); box-shadow: 0 0 0 .2rem rgba(67,97,238,.15); }
.btn { font-size: 13.5px; font-weight: 500; }
.btn-primary { background-color: var(--gim-primary); border-color: var(--gim-primary); }
.btn-primary:hover { background-color: #3451d1; border-color: #3451d1; }

/* Subtle colors */
.bg-primary-subtle { background-color: #eff6ff !important; }
.text-primary { color: var(--gim-primary) !important; }
