/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Syne:wght@400;600;700;800&display=swap');

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

:root {
  --bg: #080C10;
  --bg2: #0D1117;
  --bg3: #131A22;
  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --cyan: #00D4FF;
  --cyan-dim: rgba(0,212,255,0.12);
  --cyan-glow: rgba(0,212,255,0.3);
  --gold: #FFB830;
  --gold-dim: rgba(255,184,48,0.12);
  --gold-glow: rgba(255,184,48,0.25);
  --green: #00C896;
  --green-dim: rgba(0,200,150,0.1);
  --red: #FF4757;
  --red-dim: rgba(255,71,87,0.1);
  --text: #E8EFF7;
  --text2: #8899A6;
  --text3: #4A5568;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
  --bg: #F5F7FA;
  --bg2: #FFFFFF;
  --bg3: #E8ECF1;
  --surface: rgba(0,0,0,0.03);
  --surface2: rgba(0,0,0,0.06);
  --border: rgba(0,0,0,0.1);
  --border2: rgba(0,0,0,0.15);
  --text: #1A1A2E;
  --text2: #4A5568;
  --text3: #718096;
  --white: #1A1A2E;
}

html { scroll-behavior: smooth; }
body { font-family: 'Space Grotesk', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; transition: background 0.3s ease, color 0.3s ease; }
body::before { content: ''; position: fixed; inset: 0; background-image: linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; z-index: 0; }
.view { display: none; position: relative; z-index: 1; }
.view.active { display: block; }
.hidden { display: none !important; }
h1, h2, h3, .logo, .nav-logo { font-family: 'Syne', sans-serif; }
h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.gold { color: var(--gold); font-style: normal; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.btn-primary, .btn-create, .btn-sec, .btn-admin, .btn-login, .btn-logout, .btn-backup, .btn-restore, .btn-clear, .btn-excel {
  border: none; padding: 10px 22px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: var(--transition); font-family: 'Space Grotesk', sans-serif; font-size: 14px; letter-spacing: 0.3px;
}
.btn-primary { background: linear-gradient(135deg, var(--cyan), #0099CC); color: var(--bg); box-shadow: 0 0 20px var(--cyan-glow); }
.btn-primary:hover { box-shadow: 0 0 35px var(--cyan-glow); transform: translateY(-1px); }
.btn-create { background: linear-gradient(135deg, var(--green), #009970); color: var(--bg); }
.btn-create:hover { transform: translateY(-1px); }
.btn-sec { background: var(--surface2); border: 1px solid var(--border2); color: var(--text2); }
.btn-sec:hover { background: var(--surface); border-color: var(--cyan); color: var(--cyan); }
.btn-admin { background: transparent; border: 1px solid var(--cyan); color: var(--cyan); padding: 7px 16px; font-size: 13px; }
.btn-admin:hover { background: var(--cyan-dim); }
.btn-logout { background: transparent; border: 1px solid rgba(255,71,87,0.35); color: rgba(255,71,87,0.7); }
.btn-logout:hover { background: rgba(255,71,87,0.1); border-color: var(--red); color: var(--red); }
.btn-login { width: 100%; background: linear-gradient(135deg, var(--cyan), #0099CC); color: var(--bg); margin-top: 10px; }
.btn-link { background: none; border: none; color: var(--text3); cursor: pointer; margin-top: 14px; font-size: 13px; transition: var(--transition); }
.btn-link:hover { color: var(--text2); }
.btn-excel { background: linear-gradient(135deg, #1a7f3a, #0d5c2a); color: white; }
.btn-excel:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(26,127,58,0.4); }
.btn-backup { background: linear-gradient(135deg, var(--cyan), #0099CC); color: var(--bg); }
.btn-restore { background: linear-gradient(135deg, var(--gold), #cc8f00); color: var(--bg); }
.btn-clear { background: linear-gradient(135deg, var(--red), #c0392b); color: white; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; padding: 5px 8px; border-radius: 6px; transition: var(--transition); opacity: 0.7; }
.btn-icon:hover { background: var(--surface2); opacity: 1; }

input, select, textarea { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-family: 'Space Grotesk', sans-serif; font-size: 14px; color: var(--text); width: 100%; transition: var(--transition); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); background: rgba(0,212,255,0.04); box-shadow: 0 0 0 3px rgba(0,212,255,0.08); }
input.error { border-color: var(--red); background: var(--red-dim); }
input.valid { border-color: var(--green); background: var(--green-dim); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.8px; }
.section { padding: 60px 5%; }
.section-center { text-align: center; margin-bottom: 32px; }
.gray-bg { background: var(--bg2); }
footer { background: var(--bg2); border-top: 1px solid var(--border); color: var(--text3); text-align: center; padding: 28px; font-size: 13px; }
nav { background: rgba(8,12,16,0.85); backdrop-filter: blur(20px); padding: 0 5%; display: flex; justify-content: space-between; align-items: center; height: 68px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-logo { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: var(--white); letter-spacing: -0.5px; }
.nav-logo span { color: var(--cyan); }
.hero { background: var(--bg); padding: 80px 5% 90px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -120px; left: -100px; width: 600px; height: 600px; background: radial-gradient(circle, rgba(0,212,255,0.07) 0%, transparent 70%); pointer-events: none; }
.hero-content { max-width: 580px; position: relative; z-index: 2; }
h1 { color: var(--white); font-size: clamp(30px, 5vw, 50px); font-weight: 800; line-height: 1.1; margin-bottom: 18px; letter-spacing: -1px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--cyan-dim); border: 1px solid rgba(0,212,255,0.2); color: var(--cyan); font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 20px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.hero-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero-desc { color: var(--text2); margin: 16px 0 28px; font-size: 16px; line-height: 1.7; }
.calc-card, .form-card, .admin-card, .wa-settings, .wa-broadcast, .chart-card, .backup-section { background: var(--bg2); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; border: 1px solid var(--border); }
.calc-result { background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,200,150,0.06)); border: 1px solid rgba(0,212,255,0.15); border-radius: var(--radius); padding: 20px; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 20px; gap: 8px; }
.calc-result div span { font-family: 'Syne', sans-serif; font-size: 20px; color: var(--cyan); font-weight: 700; display: block; margin-bottom: 4px; text-shadow: 0 0 20px var(--cyan-glow); }
.success { background: var(--green-dim); border: 1px solid rgba(0,200,150,0.2); color: var(--green); padding: 12px 16px; border-radius: var(--radius-sm); text-align: center; margin-top: 14px; font-weight: 500; }
.login-wrap { min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 0 60px rgba(0,212,255,0.07); }
.login-logo { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; color: var(--white); margin-bottom: 6px; }
.login-logo span { color: var(--cyan); }
.admin-nav { background: rgba(8,12,16,0.9); backdrop-filter: blur(20px); height: 58px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.admin-tabs { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; }
.tab { background: none; border: none; padding: 14px 18px; cursor: pointer; color: var(--text3); border-bottom: 2px solid transparent; font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 500; transition: var(--transition); }
.tab:hover { color: var(--text2); }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-panel { display: none; padding: 20px; }
.tab-panel.active { display: block; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar input { flex: 2; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: rgba(0,212,255,0.04); color: var(--text2); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text); }
.data-table tr:hover td { background: rgba(0,212,255,0.03); }
.sortable-header { cursor: pointer; user-select: none; transition: var(--transition); }
.sortable-header:hover { background: rgba(0,212,255,0.1); color: var(--cyan); }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; position: relative; overflow: hidden; transition: var(--transition); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.stat-card .value { font-family: 'Syne', sans-serif; font-size: 26px; color: var(--cyan); font-weight: 700; text-shadow: 0 0 20px var(--cyan-glow); display: block; }
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.wa-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius-sm); margin: 14px 0; }
.wa-status .dot { width: 10px; height: 10px; border-radius: 50%; }
.wa-status .dot.on { background: #25D366; box-shadow: 0 0 8px #25D366; }
.wa-status .dot.off { background: var(--text3); }
.wa-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(6px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-inner { background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 900px; max-height: 90vh; overflow-y: auto; }
.modal-inner-contract { max-width: 870px; } /* чуть шире для A4 */
.modal-header { background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,200,150,0.05)); border-bottom: 1px solid var(--border); padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; }
.modal-header .close { background: none; border: none; color: var(--text3); font-size: 22px; cursor: pointer; }
.modal-body { padding: 24px; }
.progress-bar { background: var(--surface); border-radius: 20px; height: 8px; overflow: hidden; margin: 14px 0; }
.progress-fill { background: linear-gradient(90deg, var(--cyan), var(--green)); height: 100%; transition: width 0.4s ease; }
.payments-table th, .payments-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.status-paid { color: var(--green); font-weight: 600; }
.status-overdue { color: var(--red); font-weight: 600; }
/* ====== ДОГОВОР — стили для экрана, PDF и печати ====== */
.contract-body {
  padding: 0;
  background: #d0d0d0;
  overflow-y: auto;
}

/* Лист A4 с официальными полями */
.contract-paper {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14pt;
  line-height: 1.5;
  color: #000;
  background: white;
  /* Официальные поля: лево 30мм, право 15мм, верх 20мм, низ 20мм */
  width: 210mm;
  min-height: 297mm;
  margin: 20px auto;
  padding: 20mm 15mm 20mm 30mm;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  box-sizing: border-box;
}

.contract-header { margin-bottom: 16pt; }

.contract-title {
  font-size: 14pt;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 6pt 0;
}

.contract-number {
  font-size: 14pt;
  text-align: center;
  margin: 0 0 14pt 0;
}

.contract-city-date {
  display: flex;
  justify-content: space-between;
  font-size: 14pt;
  margin: 0 0 14pt 0;
}

.contract-section { margin-bottom: 10pt; }

.contract-section-title {
  font-size: 14pt;
  font-weight: bold;
  text-align: left;
  margin: 14pt 0 6pt 0;
}

.contract-text {
  font-size: 14pt;
  line-height: 1.5;
  text-align: justify;
  text-indent: 35.4pt; /* красная строка 1.25 см */
  margin: 0 0 6pt 0;
}

.contract-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10pt 0;
  font-size: 11pt;
}

.contract-table th,
.contract-table td {
  border: 1px solid #000;
  padding: 4pt 6pt;
  text-align: center;
  font-family: 'Times New Roman', Times, serif;
  font-size: 11pt;
}

.total-row {
  text-align: right;
  font-size: 13pt;
  font-weight: bold;
  margin: 8pt 0;
}

.contract-signatures {
  margin-top: 40pt;
  display: flex;
  justify-content: space-between;
  gap: 30pt;
}

.signature-block { flex: 1; }

.signature-line {
  margin-top: 35pt;
  border-top: 1px solid #000;
  width: 100%;
}

.signature-label {
  font-size: 12pt;
  color: #555;
  margin-top: 4pt;
}

.seller-info {
  margin-top: 20pt;
  font-size: 12pt;
  line-height: 1.6;
  border-top: 1px solid #ccc;
  padding-top: 10pt;
}

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast { min-width: 280px; max-width: 380px; background: var(--bg2); border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); border-left: 3px solid; animation: toastSlideIn 0.3s ease forwards; }
.toast.toast-hide { animation: toastSlideOut 0.3s ease forwards; }
@keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastSlideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-info { border-left-color: var(--cyan); }
.toast-warning { border-left-color: var(--gold); }

/* Confirm Modal */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); z-index: 1100; display: none; align-items: center; justify-content: center; }
.confirm-overlay.open { display: flex; }
.confirm-modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; max-width: 400px; width: 90%; overflow: hidden; }
.confirm-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.confirm-body { padding: 20px 24px; color: var(--text2); }
.confirm-actions { padding: 16px 24px; display: flex; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); }
.confirm-cancel { background: var(--surface); border: 1px solid var(--border); color: var(--text2); padding: 8px 20px; border-radius: var(--radius-sm); cursor: pointer; }
.confirm-confirm { background: linear-gradient(135deg, var(--red), #c0392b); border: none; color: white; padding: 8px 20px; border-radius: var(--radius-sm); cursor: pointer; }

/* Pagination */
#pagination-container { margin-top: 24px; padding: 16px 0; }
.pagination-wrapper { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.pagination-info { color: var(--text2); font-size: 13px; background: var(--surface); padding: 6px 14px; border-radius: 20px; }
.pagination-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.page-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text2); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; min-width: 40px; }
.page-btn.active { background: linear-gradient(135deg, var(--cyan), #0099CC); color: var(--bg); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-size-selector { display: flex; align-items: center; gap: 10px; background: var(--surface); padding: 5px 12px; border-radius: 20px; }

/* How it works */
.how-it-works { background: linear-gradient(135deg, var(--bg2), var(--bg)); }
.steps-container { display: flex; justify-content: center; align-items: stretch; gap: 0; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.step-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 24px; padding: 32px 24px; text-align: center; flex: 1; min-width: 240px; position: relative; transition: var(--transition); opacity: 0; transform: translateY(30px); animation: stepFadeIn 0.6s ease forwards; }
.step-card:nth-child(1) { animation-delay: 0.1s; }
.step-card:nth-child(2) { animation-delay: 0.3s; }
.step-card:nth-child(3) { animation-delay: 0.5s; }
@keyframes stepFadeIn { to { opacity: 1; transform: translateY(0); } }
.step-card:hover { transform: translateY(-8px); border-color: var(--cyan); }
.step-number { position: absolute; top: -12px; left: 20px; background: linear-gradient(135deg, var(--cyan), #0099CC); color: var(--bg); font-size: 14px; font-weight: 800; padding: 4px 12px; border-radius: 20px; }
.step-icon { font-size: 48px; margin-bottom: 20px; }
.step-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.step-desc { color: var(--text2); font-size: 14px; }
.step-tag { display: inline-block; background: var(--surface); border: 1px solid var(--border); color: var(--green); font-size: 11px; padding: 5px 12px; border-radius: 20px; }
.step-arrow { display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--cyan); padding: 0 16px; }

/* FAQ */
.faq-section { background: var(--bg2); }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; opacity: 0; transform: translateX(-20px); animation: faqFadeIn 0.5s ease forwards; }
.faq-item:nth-child(1) { animation-delay: 0.05s; }
.faq-item:nth-child(2) { animation-delay: 0.1s; }
.faq-item:nth-child(3) { animation-delay: 0.15s; }
.faq-item:nth-child(4) { animation-delay: 0.2s; }
.faq-item:nth-child(5) { animation-delay: 0.25s; }
.faq-item:nth-child(6) { animation-delay: 0.3s; }
@keyframes faqFadeIn { to { opacity: 1; transform: translateX(0); } }
.faq-question { display: flex; align-items: center; gap: 14px; padding: 18px 24px; cursor: pointer; background: var(--bg2); }
.faq-question-text { flex: 1; font-weight: 600; }
.faq-toggle { font-size: 24px; color: var(--cyan); transition: transform 0.3s ease; }
.faq-item.active .faq-toggle { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-item.active .faq-answer { max-height: 300px; border-top: 1px solid var(--border); }
.faq-answer p { padding: 20px 24px; color: var(--text2); }

/* Contacts */
.contacts-section { background: linear-gradient(135deg, var(--bg2), var(--bg)); }
.contacts-container { display: flex; gap: 48px; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.contacts-info { flex: 1.2; }
.contacts-map { flex: 0.8; }
.contact-details { margin: 32px 0; display: flex; flex-direction: column; gap: 20px; }
.contact-item { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); opacity: 0; transform: translateX(-20px); animation: contactFadeIn 0.5s ease forwards; }
.contact-item:nth-child(1) { animation-delay: 0.05s; }
.contact-item:nth-child(2) { animation-delay: 0.1s; }
.contact-item:nth-child(3) { animation-delay: 0.15s; }
.contact-item:nth-child(4) { animation-delay: 0.2s; }
.contact-item:nth-child(5) { animation-delay: 0.25s; }
@keyframes contactFadeIn { to { opacity: 1; transform: translateX(0); } }
.contact-icon { font-size: 28px; background: var(--surface); width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 16px; }
.contact-text a, .contact-text span { color: var(--text); text-decoration: none; }
.contact-text a:hover { color: var(--cyan); }
.btn-whatsapp { background: linear-gradient(135deg, #25D366, #128C7E); color: white; padding: 12px 28px; border-radius: 40px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.btn-call { background: var(--surface); border: 1px solid var(--border); color: var(--cyan); padding: 12px 28px; border-radius: 40px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.map-placeholder { background: var(--bg); border: 1px solid var(--border); border-radius: 24px; padding: 32px 24px; text-align: center; }
.map-icon { font-size: 64px; margin-bottom: 20px; }
.map-link { color: var(--cyan); text-decoration: none; }

/* Multi-step form */
.multi-step-form { max-width: 600px; margin: 0 auto; background: var(--bg2); border: 1px solid var(--border); border-radius: 24px; padding: 32px; }
.form-progress { margin-bottom: 32px; }
.progress-steps { display: flex; justify-content: space-between; margin-bottom: 12px; }
.progress-step { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 8px; cursor: pointer; }
.step-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text3); }
.progress-step.active .step-circle { background: var(--cyan); border-color: var(--cyan); color: var(--bg); box-shadow: 0 0 20px var(--cyan-glow); }
.progress-step.completed .step-circle { background: var(--green); border-color: var(--green); color: var(--bg); }
.step-label { font-size: 12px; color: var(--text3); }
.progress-step.active .step-label { color: var(--cyan); }
.progress-bar-fill { background: var(--surface); border-radius: 10px; height: 6px; overflow: hidden; }
.progress-fill-line { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width 0.3s ease; }
.form-step { display: none; animation: stepFade 0.3s ease; }
.form-step.active { display: block; }
@keyframes stepFade { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.step-buttons { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
.btn-next, .btn-back, .btn-submit { padding: 12px 28px; border-radius: 40px; font-weight: 600; cursor: pointer; border: none; }
.btn-next, .btn-submit { background: linear-gradient(135deg, var(--cyan), #0099CC); color: var(--bg); margin-left: auto; }
.btn-back { background: var(--surface); border: 1px solid var(--border); color: var(--text2); }
.step-error { font-size: 11px; color: var(--red); margin-top: 4px; display: block; }
.step-preview { background: var(--surface); border-radius: 16px; padding: 16px; margin-top: 20px; }
.preview-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.confirm-card { background: var(--surface); border-radius: 16px; padding: 20px; }
.confirm-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.confirm-divider { height: 1px; background: var(--border); margin: 12px 0; }
.theme-toggle { background: var(--surface); border: 1px solid var(--border); border-radius: 40px; width: 40px; height: 40px; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.dashboard-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 24px; }
.widget { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.widget-full { grid-column: 1 / -1; }
.widget-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.widget-header h4 { margin: 0; font-size: 14px; color: var(--text2); }
.widget-badge { background: var(--red-dim); color: var(--red); padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.widget-content { padding: 16px; }
.collection-stats { display: flex; justify-content: space-around; margin-top: 16px; text-align: center; }
.collection-stat .value { font-size: 20px; font-weight: 700; display: block; }
.overdue-list { max-height: 300px; overflow-y: auto; }
.overdue-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.overdue-call { background: var(--surface); border: 1px solid var(--border); color: var(--green); padding: 6px 12px; border-radius: 20px; cursor: pointer; }
.backup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.backup-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* Google Sheets Panel */
.gs-panel { border-left: 3px solid #34A853; margin-top: 0; }
.gs-panel .backup-header h3 { color: #34A853; }

/* Mobile */
@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table tr { display: block; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; padding: 16px; }
  .data-table td { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .data-table td::before { content: attr(data-label); font-weight: 600; color: var(--cyan); min-width: 85px; font-size: 12px; text-transform: uppercase; }
  .filter-bar { flex-direction: column; }
  .steps-container { flex-direction: column; gap: 24px; }
  .step-arrow { display: none; }
  .contacts-container { flex-direction: column; }
  .dashboard-widgets { grid-template-columns: 1fr; }
  .pagination-wrapper { flex-direction: column; align-items: stretch; }
}

@media print {
  body * { visibility: hidden; }
  .contract-modal, .contract-modal * { visibility: visible; }
  .contract-modal { position: fixed; top: 0; left: 0; width: 100%; background: white; z-index: 9999; }
  .modal-header, .modal-actions { display: none !important; }
  .contract-body { padding: 0; background: white; }
  .contract-paper {
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 20mm 15mm 20mm 30mm;
    box-shadow: none;
    font-size: 14pt;
  }
}
/* ========== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ФОТО, СПИННЕРА И CSV ========== */

/* Фото клиента (аватар) */
.client-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cyan);
  background: var(--bg3);
  cursor: pointer;
  transition: 0.2s;
}
.client-avatar-img:hover {
  transform: scale(1.05);
  border-color: var(--gold);
}

/* Блок фото в карточке клиента */
.client-photo-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Фото паспорта */
.passport-photo {
  max-width: 200px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: 0.2s;
}
.passport-photo:hover {
  transform: scale(1.02);
  border-color: var(--cyan);
}

/* Превью фото в форме */
.file-preview-img {
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* Спиннер загрузки */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0,212,255,0.3);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Кнопка экспорта в CSV */
.btn-csv {
  background: linear-gradient(135deg, #2c8c5a, #1e6b45);
  color: white;
}
.btn-csv:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(44,140,90,0.4);
}

/* Стили для статусов платежей (дополнительно) */
.status-paid { color: var(--green); font-weight: 600; }
.status-overdue { color: var(--red); font-weight: 600; }
.status-wait { color: var(--text2); }

/* Адаптация для мобильных */
@media (max-width: 640px) {
  .client-photo-block {
    flex-direction: column;
    align-items: center;
  }
  .passport-photo {
    max-width: 100%;
  }
}