@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

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

:root {
  --color-bg:        #F9F9F9;
  --color-primary:   #1A8F89;
  --color-primary-hover: #15766f;
  --color-sidebar:   #263238;
  --color-text:      #1F1F1F;
  --color-text-secondary: #263238;
  --color-border:    #A5DCD7;
  --color-white:     #FFFFFF;
  --color-hover:     #EBF1F5;
  --color-error-bg:  #F5B8A6;
  --color-error-text:#7a2a1a;
  --radius:          8px;
  --font:            'Poppins', sans-serif;
  --shadow-sm:       0 4px 8px rgba(0,0,0,0.08);
  --shadow-md:       0 1px 8px rgba(0,0,0,0.12);
  --sidebar-w:       220px;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

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

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}

.login-logo svg { width: 72px; height: 72px; }

.login-logo span {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text-secondary);
  letter-spacing: -0.5px;
}

.login-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.login-card h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-group input {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--color-primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  padding: 11px 20px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

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

.btn-primary.full-width { width: 100%; margin-top: 8px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

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

.error-msg {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 12px;
  display: none;
}

.error-msg.visible { display: block; }

/* ── Dashboard layout ─────────────────────── */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--color-sidebar);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 24px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
}

.sidebar-logo svg { width: 52px; height: 52px; }

.sidebar-logo span {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.5px;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 0 0 20px;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: auto;
}

.sidebar-user-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-user-email {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  word-break: break-all;
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--color-border);
  font-weight: 500;
  margin-top: 2px;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: rgba(255,255,255,0.65);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-top: 24px;
  width: 100%;
  justify-content: center;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
}

.dashboard-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 48px;
  background: var(--color-bg);
}

.dashboard-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.group-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 28px;
}

/* ── Table (admin view) ───────────────────── */

.table-wrapper {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr {
  background: var(--color-hover);
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 13px;
  border-bottom: 1.5px solid var(--color-border);
}

tbody tr {
  border-bottom: 1px solid #eef2f4;
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--color-hover); }

tbody td {
  padding: 12px 16px;
  color: var(--color-text);
  vertical-align: middle;
}

.url-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #555;
}

.actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-active {
  display: inline-block;
  background: #C8FACC;
  color: #1a5e20;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.badge-inactive {
  display: inline-block;
  background: #F5B8A6;
  color: var(--color-error-text);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Cotizador view ───────────────────────── */

.cotizador-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 40px 36px;
  max-width: 520px;
}

.cotizador-card h4 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.embed-url-text {
  margin-top: 16px;
  font-size: 13px;
  color: #555;
  word-break: break-all;
  background: var(--color-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  user-select: all;
}

/* ── Stats bar ───────────────────────────── */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  font-size: 28px !important;
  color: var(--color-primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.stat-body { display: flex; flex-direction: column; gap: 2px; }

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-secondary);
  line-height: 1.2;
}

.stat-sub {
  font-size: 12px;
  color: #aaa;
}

/* ── Cotizador sections ───────────────────── */

.cot-section {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.section-title .material-symbols-outlined {
  font-size: 20px !important;
  color: var(--color-primary);
}

.new-quote-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.new-quote-row .form-group input:disabled {
  background: var(--color-bg);
  cursor: not-allowed;
  color: #aaa;
}

.map-btn {
  margin-bottom: 12px;
}

.badge-process {
  display: inline-block;
  background: #FFF6B7;
  color: #7a6000;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.badge-done {
  display: inline-block;
  background: var(--color-hover);
  color: #555;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Shared ───────────────────────────────── */

.material-symbols-outlined {
  font-size: 18px;
  vertical-align: middle;
  line-height: 1;
}

.info-msg {
  font-size: 14px;
  color: #555;
  padding: 20px 0;
}
