:root {
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  --color-bg: #f5f3ee;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #8a8a8a;
  --color-accent: #ff4d4d;
  --color-border: #e8e6e3;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 77, 77, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 140, 66, 0.03) 0%, transparent 50%);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 243, 238, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: 18px 0;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  transition: all 0.2s;
}

.site-nav a:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.site-main {
  padding: 40px 0 80px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-text-light);
  font-weight: 500;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.search-form {
  flex: 1;
  min-width: 280px;
}

.search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 160px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 2px solid transparent;
  border-radius: 100px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}

.search-input:focus {
  border-color: var(--color-accent);
}

.filter-select {
  padding: 12px 16px;
  background: var(--color-surface);
  border: 2px solid transparent;
  border-radius: 100px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
  cursor: pointer;
  min-width: 120px;
}

.filter-select:focus {
  border-color: var(--color-accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 100px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-text);
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  transform: scale(1.02);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

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

.add-btn {
  flex-shrink: 0;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 230, 227, 0.5);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
  transition: all 0.2s;
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff4d4d, #ff8c42);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.contact-position {
  font-size: 12px;
  color: var(--color-text-light);
  font-weight: 500;
}

.contact-details {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-link {
  font-size: 13px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--color-accent);
}

.contact-link.phone::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--color-text-light);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.contact-link.email::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--color-text-light);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.contact-notes {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 8px;
  line-height: 1.5;
  font-style: italic;
}

.contact-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-card:hover .contact-actions {
  opacity: 1;
}

.btn-sm {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-sm.edit {
  background: #e5f0ff;
  color: #2d6bcb;
}

.btn-sm.edit:hover {
  background: #2d6bcb;
  color: #fff;
}

.btn-sm.delete {
  background: #ffe7e5;
  color: #d63031;
}

.btn-sm.delete:hover {
  background: #d63031;
  color: #fff;
}

.form-wrap {
  max-width: 640px;
}

.contact-form {
  background: var(--color-surface);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 230, 227, 0.5);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.required {
  color: var(--color-accent);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--color-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.form-actions .btn {
  flex: 1;
}

.login-wrap {
  max-width: 400px;
  margin: 0 auto;
}

.login-form-inner {
  background: var(--color-surface);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 230, 227, 0.5);
}

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

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: #e5ffe7;
  color: #27ae60;
}

.alert-error {
  background: #ffe7e5;
  color: #d63031;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-light);
  font-size: 16px;
}

.site-footer {
  padding: 40px 0;
  text-align: center;
  color: var(--color-text-light);
  font-size: 14px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .site-nav a {
    padding: 6px 10px;
    font-size: 12px;
  }

  .site-main {
    padding: 24px 0 60px;
  }

  .toolbar {
    flex-direction: column;
  }

  .search-form {
    width: 100%;
  }

  .search-row {
    flex-wrap: nowrap;
  }

  .search-input {
    min-width: 0;
  }

  .add-btn {
    width: 100%;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .contact-card {
    padding: 20px;
    flex-wrap: wrap;
  }

  .contact-actions {
    opacity: 1;
    position: static;
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-form {
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .login-form-inner {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .search-row {
    flex-wrap: wrap;
  }

  .search-input {
    width: 100%;
    flex: none;
  }

  .filter-select {
    flex: 1;
    min-width: 0;
  }
}

/* ===== About Page ===== */
.about {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 60px;
}

.about-hero {
  text-align: center;
  padding: 40px 0 32px;
}

.about-hero-icon {
  margin-bottom: 20px;
}

.about-hero-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 12px;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

.about-hero-desc {
  font-size: 15px;
  color: #888;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 28px;
}

.about-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.about-hero-actions .btn {
  padding: 12px 28px;
  font-size: 15px;
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-outline:hover {
  background: var(--color-surface);
  border-color: var(--color-text-light);
}

.about-section {
  padding: 44px 0;
  border-bottom: 1px solid #f0f0f0;
}

.about-section:last-of-type {
  border-bottom: none;
}

.about-section.is-alt {
  background: #f9fafb;
  margin: 0 -32px;
  padding: 44px 32px;
  border-radius: 24px;
  border-bottom: none;
}

.about-section-header {
  margin-bottom: 24px;
}

.about-section-tag {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #bbb;
  margin-bottom: 8px;
}

.about-section-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
}

/* Intro */
.about-intro p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-intro p:last-child {
  margin-bottom: 0;
}

/* Features */
.about-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid #e8e6e3;
  border-radius: 12px;
  padding: 20px 24px;
}

.about-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #e8f4f8;
  color: #2c7a92;
  flex-shrink: 0;
}

.about-feature-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #1a1a1a;
}

.about-feature-body p {
  font-size: 14px;
  color: #888;
  line-height: 1.7;
  margin: 0;
}

/* Steps */
.about-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-steps-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid #e8e6e3;
  border-radius: 12px;
  padding: 20px 24px;
}

.about-steps-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.about-steps-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #1a1a1a;
}

.about-steps-body p {
  font-size: 14px;
  color: #888;
  line-height: 1.7;
  margin: 0;
}

/* Tech */
.about-tech p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-tech-tags span {
  font-size: 12px;
  font-weight: 600;
  color: #2c7a92;
  background: #e8f4f8;
  padding: 4px 12px;
  border-radius: 100px;
}

/* CTA footer */
.about-cta {
  text-align: center;
  padding: 36px 0 0;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.about-cta .btn {
  padding: 14px 32px;
  font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .about-hero-title {
    font-size: 26px;
  }

  .about-section {
    padding: 32px 0;
  }

  .about-section.is-alt {
    margin: 0 -16px;
    padding: 32px 16px;
    border-radius: 16px;
  }

  .about-feature {
    padding: 16px 20px;
  }

  .about-steps-item {
    padding: 16px 20px;
  }
}
