/* ════════════════════════════════════════════════════════════════════════════
   ARTAWAK NFC — Stylesheet
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: #1a202c;
  background: #f0f4f8;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ─── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --brand-dark:    #0d1b2a;
  --brand-navy:    #1a3a5c;
  --brand-gold:    #f0b429;
  --text-dark:     #1a202c;
  --text-muted:    #718096;
  --border:        #e2e8f0;
  --bg-light:      #f7f8fc;
  --white:         #ffffff;
  --shadow:        0 2px 12px rgba(0,0,0,.07);
  --shadow-md:     0 4px 20px rgba(0,0,0,.09);
  --shadow-lg:     0 8px 40px rgba(0,0,0,.12);
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    all .2s ease;
  --client-color:      #1a3a5c;
  --client-color-dark: #0d1b2a;
}

/* ─── Utilities ────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.hidden    { display: none !important; }

/* ════════════════════════════════════════════════════════════════════════════
   OFFLINE BANNER
   ════════════════════════════════════════════════════════════════════════════ */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  background: #b45309;
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  background: var(--brand-dark);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid transparent;
  animation: toastIn .28s ease, toastOut .28s ease 2.72s forwards;
  pointer-events: all;
}
.toast.success { border-color: #48bb78; }
.toast.error   { border-color: #fc8181; }
.toast.info    { border-color: var(--brand-gold); }

@keyframes toastIn  { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ════════════════════════════════════════════════════════════════════════════
   ADMIN — HEADER
   ════════════════════════════════════════════════════════════════════════════ */
.admin-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-navy) 100%);
  padding: .9rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

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

.admin-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.admin-logo-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.admin-logo-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: #fff;
}

.admin-logo-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  margin-left: .15rem;
  font-weight: 400;
  letter-spacing: .04em;
}

.admin-header-tag {
  font-size: .78rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .03em;
}

/* ════════════════════════════════════════════════════════════════════════════
   ADMIN — LAYOUT
   ════════════════════════════════════════════════════════════════════════════ */
.admin-main { padding: 2rem 0 3rem; }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr; }
}

/* ─── Card ──────────────────────────────────────────────────────────────────── */
.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.admin-card-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card-header h2 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: .01em;
}

.admin-card-body { padding: 1.4rem; }

/* ─── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
  background: var(--brand-navy);
  color: #fff;
  border-radius: 100px;
  padding: .15rem .65rem;
  font-size: .72rem;
  font-weight: 700;
  min-width: 1.6rem;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   ADMIN — FORM
   ════════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: .9rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}

@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: .73rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .3rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"] {
  width: 100%;
  padding: .58rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-dark);
  background: #fafbfc;
  transition: var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus {
  border-color: var(--brand-navy);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}

/* ─── Color field ───────────────────────────────────────────────────────────── */
.color-field { display: flex; align-items: center; gap: .75rem; }

input[type="color"] {
  width: 44px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  padding: 2px;
  flex-shrink: 0;
}

.color-hex { flex: 1; }

/* ─── Photo upload ──────────────────────────────────────────────────────────── */
.photo-row { display: flex; align-items: center; gap: .85rem; }
.photo-row input[type="url"] { flex: 1; }

.photo-upload-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  background: #f8fafc;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition);
}

.photo-upload-btn:hover {
  border-color: var(--brand-navy);
  background: #eef4fb;
}

.photo-upload-btn img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-upload-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  color: var(--text-muted);
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  pointer-events: none;
  text-align: center;
}

/* ─── Submit button ─────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem;
  min-height: 48px;
  background: linear-gradient(135deg, var(--brand-navy) 0%, #2d6ea0 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: .35rem;
  letter-spacing: .02em;
  touch-action: manipulation;
}

@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,58,92,.3); }
}
.btn-primary:active { transform: translateY(0); }

/* ════════════════════════════════════════════════════════════════════════════
   ADMIN — CLIENT LIST
   ════════════════════════════════════════════════════════════════════════════ */
.client-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid #f4f7fb;
  transition: background .15s;
}
.client-item:last-child { border-bottom: none; }
.client-item:hover      { background: #f8fafc; }

/* Avatar */
.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.client-avatar img { width: 100%; height: 100%; object-fit: cover; }

.client-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
}

/* Info */
.client-info { flex: 1; min-width: 0; }

.client-name {
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-meta {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ID chip */
.client-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .68rem;
  background: #edf2f7;
  color: var(--text-muted);
  padding: .15rem .5rem;
  border-radius: 5px;
  letter-spacing: .06em;
  flex-shrink: 0;
}

/* Action buttons */
.client-actions { display: flex; gap: .3rem; }

.btn-icon {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: var(--transition);
  touch-action: manipulation;
}
@media (hover: hover) {
  .btn-icon:hover { background: #edf2f7; }
}
.btn-icon:active { background: #edf2f7; }

.btn-view   { color: var(--brand-navy); }
.btn-copy   { color: #38a169; }
.btn-delete { color: #e53e3e; }
.btn-delete:hover { background: #fff5f5 !important; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state svg { opacity: .2; margin: 0 auto 1rem; display: block; }
.empty-state p   { font-weight: 500; margin-bottom: .3rem; }
.empty-state small { font-size: .8rem; }

/* ════════════════════════════════════════════════════════════════════════════
   PROFILE PAGE
   ════════════════════════════════════════════════════════════════════════════ */
body.profile-bg { background: #dde3ec; }

.profile-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f0f4f8;
}

@media (min-width: 500px) {
  .profile-page { box-shadow: var(--shadow-lg); }
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.profile-header {
  background: linear-gradient(160deg,
    var(--client-color) 0%,
    var(--client-color-dark) 100%);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  position: relative;
}

.profile-header-curve {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.profile-header-curve svg {
  display: block;
  width: 100%;
  height: 36px;
}

/* Photo */
.profile-photo-wrap {
  margin-bottom: 1rem;
  display: inline-block;
  position: relative;
}

.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.3);
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}

.photo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 4px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.75);
}

/* Name / title */
.profile-header-name {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
  line-height: 1.2;
}

.profile-header-title {
  color: rgba(255,255,255,.8);
  font-size: .88rem;
  margin-top: .3rem;
}

.profile-header-company {
  color: rgba(255,255,255,.9);
  font-size: .92rem;
  font-weight: 500;
  margin-top: .2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

/* ─── Body ──────────────────────────────────────────────────────────────────── */
.profile-body {
  flex: 1;
  padding: 1.75rem 1.25rem 1.5rem;
  margin-top: -1px;
  background: #f0f4f8;
}

/* ─── Contact card ──────────────────────────────────────────────────────────── */
.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem 1.1rem;
  min-height: 48px;
  border-bottom: 1px solid #f4f7fb;
  transition: background .15s;
  color: var(--text-dark);
  touch-action: manipulation;
}
.contact-link:last-child { border-bottom: none; }
@media (hover: hover) {
  .contact-link:hover { background: #f8fafc; }
}
.contact-link:active { background: #edf2f7; }

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.contact-icon-phone     { background: #38a169; }
.contact-icon-email     { background: #3182ce; }
.contact-icon-web       { background: #6b46c1; }
.contact-icon-linkedin  { background: #0077b5; }
.contact-icon-instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

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

.contact-link-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

.contact-link-value {
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dark);
}

/* ─── Add to contacts button ────────────────────────────────────────────────── */
.btn-add-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  padding: .95rem;
  background: var(--client-color);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .97rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  letter-spacing: .02em;
}

@media (hover: hover) {
  .btn-add-contact:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
}
.btn-add-contact:active { opacity: .9; transform: translateY(0); }
.btn-add-contact        { margin-bottom: 1rem; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.profile-footer {
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  background: #f0f4f8;
}

.artawak-brand-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  opacity: .45;
  transition: opacity .2s;
}
.artawak-brand-link:hover { opacity: .8; }

.artawak-brand-tag {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Error page ────────────────────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
  gap: 1rem;
  background: #f0f4f8;
}

.error-icon { color: #cbd5e0; }

.error-page h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
}

.error-page p { color: var(--text-muted); font-size: .9rem; }

.error-back {
  display: inline-block;
  margin-top: .5rem;
  padding: .65rem 1.4rem;
  background: var(--brand-navy);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: var(--transition);
}
.error-back:hover { opacity: .9; }

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in            { animation: fadeInUp .4s ease forwards; }
.animate-in-delay-1    { animation: fadeInUp .4s ease .08s forwards; opacity: 0; }
.animate-in-delay-2    { animation: fadeInUp .4s ease .18s forwards; opacity: 0; }
.animate-in-delay-3    { animation: fadeInUp .4s ease .28s forwards; opacity: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   AUTH OVERLAY
   ════════════════════════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(150deg, #0d1b2a 0%, #1a3a5c 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.auth-logo-name {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .15em;
  color: var(--brand-dark);
}

.auth-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: .3rem;
}

.auth-card > p {
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: 1.5rem;
}

.auth-input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  text-align: center;
  letter-spacing: .15em;
  outline: none;
  transition: var(--transition);
  margin-bottom: .5rem;
}
.auth-input:focus { border-color: var(--brand-navy); box-shadow: 0 0 0 3px rgba(26,58,92,.1); }

.auth-error {
  color: #e53e3e;
  font-size: .82rem;
  min-height: 1.3em;
  margin-bottom: .4rem;
}

.auth-btn {
  width: 100%;
  padding: .82rem;
  background: linear-gradient(135deg, var(--brand-navy), #2d6ea0);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: .3rem;
}
.auth-btn:hover  { opacity: .9; transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }

/* ─── Logout button ─────────────────────────────────────────────────────────── */
.admin-header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem .9rem;
  min-height: 44px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}
@media (hover: hover) {
  .btn-logout:hover { background: rgba(255,255,255,.18); color: #fff; }
}
.btn-logout:active { background: rgba(255,255,255,.18); color: #fff; }

/* ════════════════════════════════════════════════════════════════════════════
   QR CODE MODAL (admin)
   ════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,.65);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  width: 100%;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.modal-close {
  width: 44px;
  height: 44px;
  border: none;
  background: #f0f4f8;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
  touch-action: manipulation;
}
@media (hover: hover) {
  .modal-close:hover { background: #e2e8f0; color: var(--text-dark); }
}
.modal-close:active { background: #e2e8f0; color: var(--text-dark); }

.modal-body { padding: 1.5rem; text-align: center; }

.modal-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.modal-qr-wrap img,
.modal-qr-wrap canvas { border-radius: 8px; }

.modal-qr-url {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .7rem;
  color: var(--text-muted);
  word-break: break-all;
  background: #f8fafc;
  padding: .4rem .6rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.btn-qr-dl {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.2rem;
  background: var(--brand-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-qr-dl:hover { opacity: .9; transform: translateY(-1px); }

/* ─── QR button in client list ───────────────────────────────────────────────── */
.btn-qr { color: #805ad5; }
.btn-qr:hover { background: #faf5ff !important; }

/* ─── Edit button ───────────────────────────────────────────────────────────── */
.btn-edit { color: #d97706; }
.btn-edit:hover { background: #fffbeb !important; }

/* ─── Edit mode form UI ─────────────────────────────────────────────────────── */
.form-edit-banner {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.4rem;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: .82rem;
  color: #92400e;
}
.form-edit-banner svg { flex-shrink: 0; color: #d97706; }

.btn-update {
  background: linear-gradient(135deg, #276749 0%, #38a169 100%) !important;
}
.btn-update:hover {
  box-shadow: 0 4px 16px rgba(56,161,105,.35) !important;
}

.btn-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .62rem;
  margin-top: .5rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.btn-cancel:hover { background: #f8fafc; color: var(--text-dark); border-color: #cbd5e0; }

/* ════════════════════════════════════════════════════════════════════════════
   STATS SECTION (admin)
   ════════════════════════════════════════════════════════════════════════════ */
.stats-section { margin-top: 1.75rem; }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

.stats-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .7rem 1.1rem;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.stats-table td {
  padding: .8rem 1.1rem;
  font-size: .88rem;
  border-bottom: 1px solid #f4f7fb;
  vertical-align: middle;
}

.stats-table tr:last-child td { border-bottom: none; }
.stats-table tr:hover td      { background: #f8fafc; }

.stats-client-name { font-weight: 600; }
.stats-client-sub  { font-size: .75rem; color: var(--text-muted); }

.stats-views {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 700;
  color: var(--brand-navy);
  background: #ebf4ff;
  padding: .15rem .55rem;
  border-radius: 100px;
  font-size: .82rem;
}

.stats-views.stats-zero {
  color: var(--text-muted);
  background: #f0f4f8;
  font-weight: 400;
}

.stats-date  { color: var(--text-muted); font-size: .82rem; }
.stats-empty { text-align: center; color: var(--text-muted); padding: 2rem !important; }

/* ─── Inline stats in client items ──────────────────────────────────────────── */
.client-stats-line {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   PROFILE — WHATSAPP & MAPS ICONS
   ════════════════════════════════════════════════════════════════════════════ */
.contact-icon-whatsapp { background: #25d366; }
.contact-icon-facebook { background: #1877f2; }
.contact-icon-maps     { background: #ea4335; }

/* ════════════════════════════════════════════════════════════════════════════
   PROFILE — GOOGLE MAPS EMBED
   ════════════════════════════════════════════════════════════════════════════ */
.maps-embed {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1rem;
}

.maps-embed iframe {
  width: 100%;
  height: 210px;
  display: block;
  border: none;
}

/* ════════════════════════════════════════════════════════════════════════════
   PROFILE — QR CODE CARD
   ════════════════════════════════════════════════════════════════════════════ */
.qr-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.4rem;
  text-align: center;
  margin-top: 1rem;
}

.qr-card h3 {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.qr-code-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.qr-code-wrap img,
.qr-code-wrap canvas { border-radius: 8px; }

.btn-qr-download {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  background: #f0f4f8;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}
.btn-qr-download:hover  { background: #e2e8f0; transform: translateY(-1px); }

/* ════════════════════════════════════════════════════════════════════════════
   NOUVEAUX TYPES DE LIENS — icônes colorées
   ════════════════════════════════════════════════════════════════════════════ */
.contact-icon-tiktok   { background: #010101; }
.contact-icon-youtube  { background: #ff0000; }
.contact-icon-twitter  { background: #000000; }
.contact-icon-telegram { background: #2ca5e0; }
.contact-icon-document { background: #dd6b20; }

/* ════════════════════════════════════════════════════════════════════════════
   FORMULAIRE LIENS DYNAMIQUES (admin)
   ════════════════════════════════════════════════════════════════════════════ */
.links-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .75rem;
}

.links-empty {
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
  padding: .75rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
}

.link-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .5rem;
}

.link-type {
  flex-shrink: 0;
  padding: .4rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: .82rem;
  color: var(--text-dark);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  min-width: 110px;
}
.link-type:focus { border-color: var(--brand-navy); }

.link-value {
  flex: 1;
  padding: .4rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  background: #fff;
  color: var(--text-dark);
  outline: none;
}
.link-value:focus { border-color: var(--brand-navy); }

.link-doc {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.link-doc-label {
  width: 100%;
}

.link-doc-file {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.link-doc-file-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-dark);
  font-size: .8rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s;
}
.link-doc-file-btn:hover { border-color: var(--brand-navy); }

.link-doc-status {
  font-size: .8rem;
  color: var(--text-muted, #64748b);
  overflow-wrap: anywhere;
}
.link-doc-current { color: var(--brand-navy); text-decoration: underline; }
.link-doc-empty { font-style: italic; }

.btn-link-delete {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e53e3e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  touch-action: manipulation;
}
.btn-link-delete:hover { background: #fff5f5; }

.btn-add-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  background: transparent;
  border: 1.5px dashed var(--brand-navy);
  border-radius: var(--radius-sm);
  color: var(--brand-navy);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  touch-action: manipulation;
}
.btn-add-link:hover { background: #ebf4ff; }

/* ════════════════════════════════════════════════════════════════════════════
   MAPS PLACEHOLDER (lazy-load)
   ════════════════════════════════════════════════════════════════════════════ */
.maps-embed-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 210px;
  background: #f0f4f8;
  cursor: pointer;
  transition: background .2s;
}
.maps-embed-placeholder:hover { background: #e2e8f0; }

.maps-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
}
.maps-placeholder-inner svg { color: #ea4335; }
.btn-qr-download:active { transform: translateY(0); }

/* ════════════════════════════════════════════════════════════════════════════
   PROFILE — REDESIGN v2 (fun & professional)
   ════════════════════════════════════════════════════════════════════════════ */

/* Enhanced header: more padding + dot-pattern overlay (pure CSS, 0 requests) */
.profile-header {
  background: linear-gradient(160deg,
    var(--client-color) 0%,
    var(--client-color-dark) 100%);
  padding: 3rem 1.5rem 3.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

/* Larger photo */
.profile-photo,
.photo-placeholder {
  width: 112px;
  height: 112px;
}

/* Animated gold ring around photo */
.profile-photo-wrap::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(240, 180, 41, .55);
  animation: ringPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0%, 100% { opacity: .5;  transform: scale(1); }
  50%       { opacity: .95; transform: scale(1.06); }
}

/* Gold accent line under name */
.profile-header-name::after {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: #f0b429;
  border-radius: 2px;
  margin: .5rem auto 0;
}

/* Title displayed as a pill */
.profile-header-title {
  display: inline-block !important;
  background: rgba(255,255,255,.14);
  border-radius: 100px;
  padding: .28rem .95rem;
  margin-top: .6rem;
  font-size: .83rem;
  color: rgba(255,255,255,.95);
  letter-spacing: .01em;
}

/* ─── Social grid ──────────────────────────────────────────────────────────── */
.social-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1rem;
}

.social-card-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  padding: .9rem 1.1rem .5rem;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
  padding: .5rem 1rem 1rem;
}

.social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .85rem .3rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  font-size: .67rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all .18s ease;
  touch-action: manipulation;
}
.social-item .social-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
@media (hover: hover) {
  .social-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
    border-color: transparent;
    color: var(--text-dark);
  }
}
.social-item:active { transform: scale(.94); }

/* ════════════════════════════════════════════════════════════════════════════
   PASSWORD CHANGE MODAL
   ════════════════════════════════════════════════════════════════════════════ */
.pw-form-group {
  text-align: left;
  margin-bottom: .85rem;
}
.pw-form-group label {
  display: block;
  font-size: .73rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .3rem;
}
.pw-form-group input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  background: #fafbfc;
  color: var(--text-dark);
}
.pw-form-group input:focus {
  border-color: var(--brand-navy);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── Base mobile (tout écran ≤ 480px) ──────────────────────────────────────── */
@media (max-width: 480px) {

  /* ── Profile page ── */
  body.profile-bg { background: var(--client-color); }

  .profile-page {
    max-width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .profile-header {
    padding: 2.8rem 1.25rem 3.5rem;
    border-radius: 0;
  }

  .profile-photo,
  .photo-placeholder {
    width: 100px;
    height: 100px;
  }

  .profile-header-name {
    font-size: 1.35rem;
  }

  .profile-header-company {
    font-size: .85rem;
  }

  .profile-body {
    padding: 1.4rem 1rem 1.25rem;
    background: #f0f4f8;
    border-radius: 0;
  }

  /* Bouton "Ajouter aux contacts" full-width, bien visible */
  .btn-add-contact {
    font-size: 1rem;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,.22);
  }

  /* Contact links — cibles tactiles généreuses */
  .contact-link {
    padding: 1rem 1rem;
    gap: .8rem;
    min-height: 56px;
  }

  .contact-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .contact-link-label { font-size: .65rem; }
  .contact-link-value { font-size: .92rem; }

  /* Social grid : 3 colonnes compactes */
  .social-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    padding: .5rem .75rem .9rem;
  }

  .social-item {
    padding: .75rem .25rem;
    border-radius: 10px;
    font-size: .65rem;
  }

  .social-item .social-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  /* QR code card */
  .qr-card {
    padding: 1.2rem 1rem;
  }

  .qr-code-wrap canvas,
  .qr-code-wrap img {
    max-width: 160px;
  }

  /* Footer brand */
  .profile-footer {
    padding: 1.25rem 1rem 1.75rem;
    background: #f0f4f8;
  }
}

/* ─── Très petits écrans (iPhone SE, 320px) ────────────────────────────────── */
@media (max-width: 360px) {
  .profile-header-name { font-size: 1.2rem; }

  .profile-photo,
  .photo-placeholder { width: 90px; height: 90px; }

  .social-grid {
    gap: .35rem;
    padding: .4rem .6rem .8rem;
  }

  .social-item { padding: .65rem .2rem; }

  .social-item .social-icon { width: 36px; height: 36px; }

  .contact-link { padding: .9rem .75rem; }
}

/* ─── Admin — header mobile ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .admin-header .container {
    flex-wrap: wrap;
    gap: .5rem .75rem;
    padding: .75rem 1rem;
  }

  .admin-logo { flex: 1; }

  .admin-header-right {
    width: 100%;
    justify-content: flex-end;
    gap: .4rem;
  }

  /* Cacher le tag Martinique sur mobile */
  .admin-header-tag { display: none; }

  /* Boutons header plus compacts */
  .btn-logout {
    padding: .55rem .75rem;
    font-size: .75rem;
    min-height: 40px;
  }
}

/* ─── Admin — grille et formulaire mobile ───────────────────────────────────── */
@media (max-width: 680px) {
  .admin-main { padding: 1.25rem 0 2.5rem; }

  .container { padding: 0 .9rem; }

  .admin-grid { gap: 1.1rem; }

  .admin-card-body { padding: 1.1rem 1rem; }

  .admin-card-header { padding: .9rem 1rem; }

  /* Formulaire — rangées en colonne unique */
  .form-row { grid-template-columns: 1fr; gap: 0; }

  /* Inputs plus hauts pour le tactile */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"] {
    padding: .7rem .85rem;
    font-size: .95rem;
  }

  /* Bouton submit pleine hauteur */
  .btn-primary { min-height: 52px; font-size: 1rem; }

  /* Client list items — compacts mais lisibles */
  .client-item { padding: .7rem .9rem; gap: .55rem; }

  .client-id { display: none; } /* Masquer l'ID en mobile pour gagner de la place */

  .client-actions { gap: .15rem; }

  .btn-icon { width: 40px; height: 40px; }

  /* Links list */
  .link-item { flex-wrap: wrap; gap: .4rem; }

  .link-type { min-width: 100%; }

  .link-value { width: 100%; }

  .btn-link-delete { margin-left: auto; }

  /* Stats table — scroll horizontal */
  .stats-section { margin-top: 1.1rem; }

  /* Photo upload row */
  .photo-row { flex-wrap: wrap; }
  .photo-row input[type="url"] { width: 100%; }
}

/* ─── Admin — très petits écrans ───────────────────────────────────────────── */
@media (max-width: 400px) {
  .admin-logo-name { font-size: 1rem; }
  .admin-logo-sub  { display: none; }

  .btn-label { display: none; } /* Icônes seules sous 400px */
  .btn-logout { padding: .55rem .6rem; }
}

/* ─── Modales — plein écran sur mobile ─────────────────────────────────────── */
@media (max-width: 480px) {
  .modal-overlay { padding: 0; align-items: flex-end; }

  .modal {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .auth-card {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 2rem 1.5rem 2.5rem;
  }

  .auth-overlay { align-items: flex-end; padding: 0; }
}

/* ─── Scroll fluide sur mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  html { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
  * { -webkit-tap-highlight-color: transparent; }
}
