:root {
  --holcim-blue: #0057b8;
  --holcim-blue-deep: #003f8a;
  --holcim-green: #00a870;
  --holcim-green-deep: #00885a;
  --bg: #f3f9ff;
  --panel: #ffffff;
  --ink: #0f1f33;
  --muted: #3d5a80;
  --muted-light: #5a7a9a;
  --line: #dbe8f7;
  --radius-lg: 16px;
  --radius-md: 12px;
}

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

body {
  min-height: 100vh;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 640px at -5% -10%, rgba(0, 87, 184, 0.14), transparent 62%),
    radial-gradient(1000px 560px at 108% 8%, rgba(0, 168, 112, 0.18), transparent 58%),
    linear-gradient(170deg, #f8fcff 0%, #edf6ff 45%, #edf9f4 100%);
  padding: 1rem;
}

.app { max-width: 1200px; margin: 0 auto; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(95deg, rgba(0, 87, 184, 0.06), rgba(0, 168, 112, 0.06));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 760;
  color: var(--holcim-blue);
  font-size: 1.25rem;
  text-decoration: none;
}

.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(140deg, var(--holcim-blue), var(--holcim-green));
  box-shadow: 0 0 0 4px rgba(0, 87, 184, 0.12);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a, .nav-links button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 150ms ease;
  background: transparent;
  cursor: pointer;
}

.nav-links a:hover, .nav-links button:hover {
  background: rgba(0, 87, 184, 0.1);
  color: var(--holcim-blue);
  border-color: var(--holcim-blue);
}

.user-name { color: var(--ink); font-weight: 500; font-size: 0.9rem; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  cursor: pointer;
}

.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--ink);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-primary {
  color: white;
  background: linear-gradient(140deg, var(--holcim-blue), var(--holcim-green));
  box-shadow: 0 6px 18px rgba(0, 87, 184, 0.24);
  border-radius: 999px;
  border: 0;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 87, 184, 0.30);
}

.btn-secondary {
  color: #24446f;
  background: #e9f2fb;
  border: 1px solid #c3d9f2;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-secondary:hover { transform: translateY(-1px); background: #dfedf9; }
.btn-small { 
  padding: 0.4rem 0.8rem; 
  font-size: 0.8rem; 
  border-radius: 999px; 
  border: 1px solid var(--line);
  font-weight: 600; 
  cursor: pointer; 
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  background: transparent;
  color: var(--muted);
}
.btn-small:hover { 
  transform: translateY(-1px); 
  background: rgba(0, 87, 184, 0.1); 
  border-color: var(--holcim-blue);
  color: var(--holcim-blue);
}
.btn-danger { color: white; background: linear-gradient(140deg, #ef4444, #dc2626); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.24); border: 0; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239, 68, 68, 0.30); }
.btn-small.btn-danger { border: 0; }
.btn-small.btn-secondary { background: #e9f2fb; border: 1px solid #c3d9f2; color: #24446f; }
.btn-small.btn-secondary:hover { transform: translateY(-1px); background: #dfedf9; }
.btn-small.btn-primary { color: white; background: linear-gradient(140deg, var(--holcim-blue), var(--holcim-green)); box-shadow: 0 4px 12px rgba(0, 87, 184, 0.24); border: 0; }
.btn-small.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 87, 184, 0.30); }

.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  transition: all 150ms ease;
}

.tab.active { background: var(--holcim-blue); color: white; border-color: var(--holcim-blue); }
.tab:hover:not(.active) { background: rgba(0, 87, 184, 0.1); color: var(--holcim-blue); }

.group-selector { display: flex; align-items: center; gap: 0.5rem; }
.group-selector label { color: var(--muted); font-size: 0.9rem; }
.group-selector select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.filters-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.filters-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.filter-group { display: flex; align-items: center; gap: 0.4rem; }
.filter-group label { color: var(--muted); font-size: 0.85rem; }

.filter-group input, .filter-group select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  background: white;
  color: var(--ink);
  min-width: 100px;
}

.filter-group input:focus, .filter-group select:focus {
  outline: none;
  border-color: var(--holcim-blue);
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.quote-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.quote-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 87, 184, 0.12);
}

.quote-content { margin-bottom: 0.75rem; }
.quote-text { color: var(--ink); font-size: 0.95rem; line-height: 1.5; font-style: italic; }

.quote-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.quote-author-info { display: flex; align-items: center; gap: 0.5rem; }

.quote-author-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(140deg, var(--holcim-blue), var(--holcim-green));
}

.quote-author-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

.quote-author-details { display: flex; flex-direction: column; }
.quote-author-name { color: var(--ink); font-weight: 600; font-size: 0.8rem; }
.quote-date { color: var(--muted); font-size: 0.7rem; }
.quote-actions { display: flex; align-items: center; }

.like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(0, 168, 112, 0.08);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 0.8rem;
}

.like-btn:hover { background: rgba(0, 168, 112, 0.15); }
.like-btn.liked { background: rgba(0, 168, 112, 0.2); border-color: var(--holcim-green); }
.heart { font-size: 0.9rem; }
.like-count { font-weight: 600; color: var(--holcim-green); }

.loading, .no-results, .error { text-align: center; padding: 2rem; color: var(--muted); grid-column: 1 / -1; }
.loading-more { text-align: center; padding: 1rem; color: var(--muted); font-size: 0.85rem; }

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 31, 51, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 1rem;
}

.modal:not(.hidden) { display: flex; }

.modal-content {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 450px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--ink); }

.modal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: white;
  color: var(--ink);
  margin-bottom: 0.75rem;
  font-family: inherit;
}

.modal-input:focus { outline: none; border-color: #7fb3f3; box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.16); }
textarea.modal-input { resize: vertical; min-height: 80px; }
.modal-content button { margin-top: 0.5rem; }
.modal-content .btn-primary { width: 100%; }

#quote-modal-body label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 0.4rem; margin-top: 0.75rem; font-size: 0.85rem; }
#quote-modal-body label:first-child { margin-top: 0; }
#quote-modal-body .btn-primary { margin-top: 1rem; width: 100%; }

.profile-photo-section { text-align: center; }
.profile-photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 1.5rem auto; display: block; border: 3px solid var(--holcim-green); }

.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.admin-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  transition: all 150ms ease;
}

.admin-tab:hover:not(.active) { background: rgba(0, 87, 184, 0.1); color: var(--holcim-blue); border-color: var(--holcim-blue); transform: translateY(-1px); }
.admin-tab.active { background: linear-gradient(140deg, var(--holcim-blue), var(--holcim-green)); color: white; border-color: var(--holcim-blue); box-shadow: 0 4px 12px rgba(0, 87, 184, 0.24); }
.admin-section { min-height: 200px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.admin-list { display: flex; flex-direction: column; gap: 0.5rem; }

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 87, 184, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.item-name { font-weight: 600; color: var(--ink); font-size: 0.9rem; }
.item-actions { display: flex; gap: 0.5rem; }
.user-info { display: flex; align-items: center; gap: 0.5rem; }

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(140deg, var(--holcim-blue), var(--holcim-green));
}

.user-avatar-small.placeholder { display: flex; align-items: center; justify-content: center; font-size: 16px; color: white; }
.user-details { display: flex; flex-direction: column; }
.user-email { color: var(--muted); font-size: 0.75rem; }
.user-groups { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.group-badge {
  background: var(--holcim-blue);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-remove { background: none; border: none; color: white; cursor: pointer; font-size: 12px; padding: 0; opacity: 0.7; }
.badge-remove:hover { opacity: 1; }
.quote-preview { display: flex; flex-direction: column; gap: 2px; }
.quote-text-preview { color: var(--ink); font-style: italic; font-size: 0.8rem; }
.quote-author-preview { color: var(--muted); font-size: 0.75rem; }
.quote-group-preview { color: var(--holcim-blue); font-size: 0.7rem; }
.quote-item { flex-direction: column; align-items: flex-start; }
.quote-item .item-actions { margin-top: 0.5rem; width: 100%; justify-content: flex-end; }
/* Login Page */
.container { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.login-card {
  max-width: 400px;
  margin: 4rem auto;
  text-align: center;
}

.logo h1 {
  font-size: 2.5rem;
  color: var(--holcim-blue);
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1rem;
}

.login-content {
  margin-top: 2rem;
}

.login-content h2 {
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.login-content p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 150ms ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* Navbar for Admin */
.navbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--holcim-blue);
}

/* Admin Container */
.admin-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.photo-preview { max-width: 120px; max-height: 120px; border-radius: 8px; margin: 0.5rem auto; display: block; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  header { flex-direction: column; gap: 1rem; }
  .nav-links { justify-content: center; }
  .quotes-grid { grid-template-columns: 1fr; }
  .filters-row { flex-direction: column; align-items: stretch; }
  .filter-group { width: 100%; }
  .filter-group input, .filter-group select { flex: 1; }
  .quote-footer { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .quote-actions { width: 100%; }
  .like-btn { width: 100%; justify-content: center; }
  .admin-tabs { flex-direction: column; }
  .section-header { flex-direction: column; gap: 0.5rem; }
}