/* ==========================================================================
   LICITAI SUITE - DISEÑO CLARO, LIMPIO Y COMPACTO CON GOOGLE DRIVE
   ========================================================================== */

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --border-card: #e2e8f0;
  --border-focus: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --accent-blue: #0284c7;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
  --accent-emerald: #059669;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 16px 20px -4px rgba(0, 0, 0, 0.08), 0 6px 8px -4px rgba(0, 0, 0, 0.04);

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ENCABEZADO */
.suite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 6px 14px -3px rgba(37, 99, 235, 0.35);
}

.brand-logo svg {
  width: 26px;
  height: 26px;
}

.brand-text h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.brand-text h1 span {
  color: #0284c7;
}

.brand-text p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BOTÓN GOOGLE DRIVE */
.btn-drive {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  color: #1e293b;
  padding: 8px 15px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-drive:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.btn-drive.connected {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.google-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.suite-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background: var(--bg-subtle);
  border-color: var(--border-focus);
}

.btn-refresh svg {
  width: 14px;
  height: 14px;
}

/* BANNER */
.status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.banner-icon svg {
  width: 18px;
  height: 18px;
  color: #2563eb;
  flex-shrink: 0;
}

/* REJILLA DE MÓDULOS */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.card-accent {
  height: 4px;
  width: 100%;
}
.accent-crm { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.accent-licitai { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.accent-pert { background: linear-gradient(90deg, #d97706, #fbbf24); }
.accent-fotogeo { background: linear-gradient(90deg, #059669, #34d399); }

.card-header {
  padding: 20px 22px 12px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.module-icon svg { width: 22px; height: 22px; }

.icon-crm { background: #e0f2fe; color: #0284c7; }
.icon-licitai { background: #f3e8ff; color: #7c3aed; }
.icon-pert { background: #fef3c7; color: #d97706; }
.icon-fotogeo { background: #d1fae5; color: #059669; }

.module-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-light);
  border: 1px solid var(--border-card);
}

.module-status.active {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.module-status.inactive {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #94a3b8;
}

.module-status.active .status-dot { background: #22c55e; }
.module-status.inactive .status-dot { background: #f43f5e; }

.card-body {
  padding: 8px 22px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.module-tag {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.tag-crm { background: #e0f2fe; color: #0369a1; }
.tag-licitai { background: #f3e8ff; color: #6d28d9; }
.tag-pert { background: #fef3c7; color: #b45309; }
.tag-fotogeo { background: #d1fae5; color: #047857; }

.module-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.card-footer {
  padding: 14px 22px;
  background: #fbfcfe;
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.port-label {
  font-size: 11.5px;
  color: var(--text-light);
}

.port-label strong {
  color: var(--text-main);
  font-family: monospace;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
}

.btn-start {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

.btn-start:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-start svg {
  width: 11px;
  height: 11px;
}

.btn-open {
  background: #0284c7;
  color: white;
}

.btn-open:hover {
  background: #0369a1;
}

.btn-open svg {
  width: 12px;
  height: 12px;
}

/* PIE DE PÁGINA */
.suite-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  font-size: 12px;
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sep {
  opacity: 0.4;
}

@media (max-width: 900px) {
  .suite-header, .suite-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}
