/* ═══════════════════════════════════════════════
   ГНПП «Объединение Коммунар» — Main Stylesheet
   ═══════════════════════════════════════════════ */

:root {
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #0f1528;
  --bg-card:       #131929;
  --bg-card-hover: #182035;
  --accent:        #00bcd4;
  --accent-light:  #4dd9f0;
  --accent-dim:    rgba(0, 188, 212, 0.15);
  --text-primary:  #e8eaf0;
  --text-secondary:#8a9bb5;
  --text-muted:    #4a5a72;
  --border:        rgba(0, 188, 212, 0.2);
  --border-hover:  rgba(0, 188, 212, 0.5);
  --danger:        #e53935;
  --danger-dim:    rgba(229, 57, 53, 0.15);
  --success:       #00c853;
  --radius:        6px;
  --radius-lg:     10px;
  --shadow:        0 4px 24px rgba(0, 0, 0, 0.4);
  --transition:    0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-light); }

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 72px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 188, 212, 0.4));
}

.site-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-transform: uppercase;
}

.site-title span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.nav-link:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ─── Section ────────────────────────────────────── */
.section {
  margin-bottom: 64px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

/* ═══════════════════════════════════════════════
   DOCUMENTS
   ═══════════════════════════════════════════════ */
.documents-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.doc-item:hover { border-color: var(--border-hover); }
.doc-item.open   { border-color: var(--accent); }

.doc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.doc-header:hover { background: var(--bg-card-hover); }

.doc-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.doc-title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.doc-date {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.doc-arrow {
  color: var(--accent);
  font-size: 13px;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.doc-item.open .doc-arrow { transform: rotate(90deg); }

.doc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
  opacity: 0;
}
.doc-item.open .doc-body {
  max-height: 300px;
  opacity: 1;
}

.doc-body-inner {
  padding: 0 20px 20px 54px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doc-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
  align-self: flex-start;
}
.btn-download:hover {
  background: var(--accent-light);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 188, 212, 0.4);
}

.docs-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ═══════════════════════════════════════════════
   CONTACTS
   ═══════════════════════════════════════════════ */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.contact-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.contact-row:last-child { margin-bottom: 0; }

.contact-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.contact-label {
  color: var(--text-muted);
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.contact-value {
  color: var(--text-primary);
}

.contact-value a {
  color: var(--accent);
}
.contact-value a:hover { color: var(--accent-light); }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 13px;
}

.footer-admin-link {
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.footer-admin-link:hover {
  opacity: 1;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,188,212,0.08) 0%, transparent 60%),
              var(--bg-primary);
}

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

.login-logo img {
  height: 64px;
  filter: drop-shadow(0 0 16px rgba(0,188,212,0.5));
}

.login-logo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text-primary);
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,188,212,0.12);
}
.form-input::placeholder { color: var(--text-muted); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  width: 100%;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,188,212,0.35);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(229,57,53,0.3);
  font-size: 13px;
  padding: 6px 12px;
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 13px;
  padding: 8px 16px;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error {
  background: var(--danger-dim);
  border: 1px solid rgba(229,57,53,0.3);
  color: #ff7070;
}
.alert-success {
  background: rgba(0,200,83,0.12);
  border: 1px solid rgba(0,200,83,0.3);
  color: #69f0ae;
}

/* ═══════════════════════════════════════════════
   ADMIN PAGE
   ═══════════════════════════════════════════════ */
.admin-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.admin-header-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 66px;
  gap: 16px;
}

.admin-badge {
  background: var(--accent-dim);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
}

.admin-main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 36px 24px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.panel-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-card-body {
  padding: 24px;
}

/* Table */
.docs-table-wrap {
  overflow-x: auto;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.docs-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.docs-table tr:last-child td { border-bottom: none; }

.docs-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.docs-table .td-num {
  color: var(--text-muted);
  font-size: 12px;
  width: 40px;
}

.docs-table .td-desc {
  color: var(--text-secondary);
  font-size: 12px;
  max-width: 200px;
}

.docs-table .td-date {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.file-link {
  color: var(--accent);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.file-link:hover { color: var(--accent-light); }

.table-empty {
  text-align: center;
  padding: 36px;
  color: var(--text-muted);
}

/* Upload form */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.file-input-wrap {
  position: relative;
}

.file-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.file-input-label:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.file-input-icon { font-size: 28px; }
.file-input-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.file-input-hint {
  font-size: 11px;
  color: var(--text-muted);
}

input[type="file"] { display: none; }

.file-selected {
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: none;
}
.file-selected.show { display: block; }

.upload-progress {
  display: none;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.upload-progress.show { display: block; }
.upload-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .admin-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-header { padding: 0 16px; }
  .header-inner {
    flex-direction: column;
    justify-content: center;
    height: auto;
    padding: 14px 0;
    gap: 10px;
  }
  .logo-link { flex-direction: column; gap: 8px; }
  .site-title { text-align: center; font-size: 15px; }
  .header-nav { margin-left: 0; }

  .main-content { padding: 28px 16px; }

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

  .section-title { font-size: 18px; }

  .login-card { padding: 24px; }

  .admin-header { padding: 0 16px; }
  .admin-main { padding: 20px 16px; }
  .panel-card-body { padding: 16px; }

  .docs-table .td-desc { display: none; }
}

@media (max-width: 480px) {
  .site-title { font-size: 13px; }
  .logo-img { height: 40px; }
}

/* ─── Spinner ─────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-accent {
  border-color: rgba(0,188,212,0.2);
  border-top-color: var(--accent);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Skeleton loader ────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Utility ────────────────────────────────── */
.ml-auto { margin-left: auto; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
