/* assets/style.css
   Дизайн сайта СНТ: планы работ + бюджет.
   Цветовая палитра и типографика перенесены из прототипа. */


  @import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

  html, body { max-width: 100%; overflow-x: hidden; }

  #snt-root {
    --paper: #F7F1E7;
    --paper-2: #EFE4D2;
    --ink: #2B241F;
    --ink-soft: #6B6154;
    --pine: #6E2430;
    --pine-light: #8a3a4787;
    --wood: #3F5233;
    --sun: #E0A845;
    --brick: #B5502F;
    --line: #DCD3BE;
    --white: #FFFDF8;

    font-family: 'Inter', sans-serif;
    color: var(--ink);
    background: var(--paper);
    min-height: 100%;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
  }
  #snt-root * { box-sizing: border-box; }
  #snt-root .mono { font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em; }
  #snt-root .serif { font-family: 'Fraunces', serif; }

  /* ---------- header ---------- */
  #snt-root .hero {
    position: relative;
    padding: 40px 24px 32px;
    background:
      radial-gradient(ellipse at 15% 0%, rgba(224,168,69,0.18), transparent 55%),
      linear-gradient(180deg, var(--pine) 0%, #253c30 100%);
    color: var(--white);
    overflow: hidden;
  }
  #snt-root .hero-fence {
    position: absolute; inset: 0; opacity: 0.08; pointer-events: none;
    background-image: repeating-linear-gradient(90deg, var(--white) 0 2px, transparent 2px 34px);
  }
  #snt-root .hero-branch {
    position: absolute; top: 14px; right: 20px; width: 64px; height: 64px; opacity: 0.9; pointer-events: none;
  }
  @media (max-width: 640px) { #snt-root .hero-branch { width: 44px; height: 44px; top: 10px; right: 14px; } }
  #snt-root .hero-inner { position: relative; max-width: 960px; margin: 0 auto; }
  #snt-root .eyebrow {
    font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--sun); margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
  }
  #snt-root .eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--sun); display: inline-block; }
  #snt-root .site-title {
    font-family: 'Fraunces', serif; font-size: clamp(28px, 5vw, 42px); font-weight: 600;
    margin: 0 0 6px; line-height: 1.05; background: none; border: none; color: var(--white);
    width: 100%; outline: none; padding: 0;
  }
  #snt-root .site-sub { color: rgba(255,255,255,0.72); font-size: 15px; max-width: 60ch; }

  #snt-root .hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
  #snt-root .btn {
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; cursor: pointer;
    border-radius: 3px; padding: 10px 16px; border: 1px solid transparent; transition: all 0.15s ease;
  }
  #snt-root .btn-sun { background: var(--sun); color: #2b2005; }
  #snt-root .btn-sun:hover { background: #e5b256; }
  #snt-root .btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.35); }
  #snt-root .btn-ghost:hover { border-color: rgba(255,255,255,0.7); }
  #snt-root .btn-pine { background: var(--pine); color: var(--white); }
  #snt-root .btn-pine:hover { background: #3a5c49; }
  #snt-root .btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
  #snt-root .btn-outline:hover { border-color: var(--wood); color: var(--wood); }
  #snt-root .btn-danger { background: transparent; color: var(--brick); border-color: rgba(181,80,47,0.35); }
  #snt-root .btn-danger:hover { background: rgba(181,80,47,0.08); }
  #snt-root .btn:disabled { opacity: 0.45; cursor: not-allowed; }

  #snt-root .badge {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 3px 9px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
  }
  #snt-root .badge-board { background: rgba(224,168,69,0.24); color: #7a5209; border: 1px solid rgba(224,168,69,0.5); }
  #snt-root .badge-viewer { background: rgba(255,255,255,0.16); color: var(--white); border: 1px solid rgba(255,255,255,0.35); }
  #snt-root .badge-guest { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.25); }

  /* ---------- tabs ---------- */
  #snt-root .tabs {
    display: flex; gap: 4px; max-width: 960px; margin: 0 auto; padding: 0 24px;
    border-bottom: 1px solid var(--line); background: var(--paper);
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  #snt-root .tabs::-webkit-scrollbar { display: none; }
  #snt-root .tab {
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; padding: 14px 6px;
    background: none; border: none; cursor: pointer; color: var(--ink-soft);
    border-bottom: 2px solid transparent; margin-bottom: -1px; margin-right: 18px;
    flex: 0 0 auto; white-space: nowrap;
  }
  #snt-root .tab.active { color: var(--pine); border-bottom-color: var(--wood); }

  @media (max-width: 640px) {
    #snt-root .tabs { padding: 0 16px; gap: 0; }
    #snt-root .tab { font-size: 13px; padding: 12px 4px; margin-right: 14px; }
  }

  #snt-root .container { max-width: 960px; margin: 0 auto; padding: 28px 24px 80px; }

  /* ---------- summary strip ---------- */
  #snt-root .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 28px; }
  #snt-root .stat {
    background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 16px;
  }
  #snt-root .stat-num { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; color: var(--pine); }
  #snt-root .stat-label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

  /* ---------- board columns ---------- */
  #snt-root .board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; min-width: 0; }
  @media (max-width: 760px) { #snt-root .board { grid-template-columns: 1fr; } }
  #snt-root .col { min-width: 0; }
  #snt-root .col-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 2px solid var(--line);
  }
  #snt-root .col-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; }
  #snt-root .col-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-soft); }
  #snt-root .col.planned .col-head { border-bottom-color: var(--wood); }
  #snt-root .col.progress .col-head { border-bottom-color: var(--sun); }
  #snt-root .col.done .col-head { border-bottom-color: var(--pine); }

  #snt-root .card {
    background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 14px;
    margin-bottom: 12px; position: relative; overflow-wrap: break-word; word-break: break-word;
  }
  #snt-root .card-cat {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--wood); margin-bottom: 6px; display: block;
  }
  #snt-root .card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
  #snt-root .card-desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
  #snt-root .card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-soft); }
  #snt-root .card-meta b { color: var(--ink); font-weight: 600; }
  #snt-root .card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  #snt-root .icon-btn {
    background: none; border: 1px solid var(--line); border-radius: 3px; padding: 5px 8px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-soft);
  }
  #snt-root .icon-btn:hover { border-color: var(--wood); color: var(--wood); }
  #snt-root .empty-col { font-size: 13px; color: var(--ink-soft); font-style: italic; padding: 10px 0; }

  /* ---------- budget tab ---------- */
  #snt-root .bud-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  #snt-root .bud-name { font-weight: 600; font-size: 14px; }
  #snt-root .bud-cat { font-size: 12px; color: var(--ink-soft); }
  #snt-root .bud-bars { display: flex; flex-direction: column; gap: 4px; width: 220px; }
  #snt-root .bud-bar-track { background: var(--paper-2); border-radius: 3px; height: 8px; overflow: hidden; }
  #snt-root .bud-bar-fill { height: 100%; background: var(--wood); }
  #snt-root .bud-bar-fill.actual { background: var(--pine); }
  #snt-root .bud-nums { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-soft); text-align: right; }

  #snt-root .total-box {
    background: var(--pine); color: var(--white); border-radius: 5px; padding: 20px 22px; margin-bottom: 24px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  }
  #snt-root .total-item .stat-num { color: var(--sun); }
  #snt-root .total-item .stat-label { color: rgba(255,255,255,0.65); }

  /* ---------- modal ---------- */
  #snt-root .overlay {
    position: fixed; inset: 0; background: rgba(38,48,43,0.55); display: flex; align-items: center; justify-content: center;
    padding: 20px; z-index: 50;
  }
  #snt-root .modal {
    background: var(--white); border-radius: 6px; padding: 26px; max-width: 460px; width: 100%;
    max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  }
  #snt-root .modal h3 { font-family: 'Fraunces', serif; margin: 0 0 4px; font-size: 20px; }
  #snt-root .modal .sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
  #snt-root label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 5px; text-transform: uppercase; letter-spacing: 0.04em; }
  #snt-root label:first-of-type { margin-top: 0; }
  #snt-root input, #snt-root select, #snt-root textarea {
    width: 100%; font-family: 'Inter', sans-serif; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line);
    border-radius: 3px; background: var(--paper); color: var(--ink);
  }
  #snt-root input:focus, #snt-root select:focus, #snt-root textarea:focus { outline: 2px solid var(--wood); outline-offset: 1px; }
  #snt-root textarea { resize: vertical; min-height: 60px; }
  #snt-root .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  #snt-root .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
  #snt-root .error-text { color: var(--brick); font-size: 12.5px; margin-top: 6px; }
  #snt-root .hint { font-size: 12px; color: var(--ink-soft); margin-top: 10px; background: var(--paper-2); padding: 10px 12px; border-radius: 4px; }

  #snt-root .loading-wrap { display: flex; align-items: center; justify-content: center; min-height: 220px; color: var(--ink-soft); font-size: 14px; }
  #snt-root .footer-note { text-align: center; font-size: 12px; color: var(--ink-soft); padding: 20px 24px 40px; }

  /* ---------- contractors ---------- */
  #snt-root .contractor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
  #snt-root .contractor-card {
    background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 16px;
    position: relative;
  }
  #snt-root .contractor-card.inactive { opacity: 0.55; }
  #snt-root .contractor-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 17px; margin-bottom: 4px; }
  #snt-root .contractor-contact { font-size: 13px; color: var(--ink-soft); margin-bottom: 2px; }
  #snt-root .contractor-notes { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  #snt-root .contractor-stats { display: flex; gap: 16px; margin-top: 12px; }
  #snt-root .contractor-stat-num { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 15px; color: var(--pine); }
  #snt-root .contractor-stat-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

  /* ---------- members table ---------- */
  #snt-root .members-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
  #snt-root .members-toolbar label {
    margin: 0; text-transform: none; font-weight: normal; font-size: 14px; color: var(--ink-soft);
  }
  #snt-root .filter-select { width: auto; }
  #snt-root .member-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
  #snt-root .member-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
  #snt-root .member-table th {
    text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--ink-soft); padding: 10px 12px; border-bottom: 2px solid var(--line);
    white-space: nowrap;
  }
  #snt-root .member-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
  #snt-root .member-table tr:last-child td { border-bottom: none; }
  #snt-root .member-table a { color: var(--pine); text-decoration: none; }
  #snt-root .member-table a:hover { text-decoration: underline; }
  #snt-root .member-address { max-width: 220px; }
  #snt-root .pay-badge {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 3px 9px; border-radius: 20px; white-space: nowrap; display: inline-block;
  }
  #snt-root .pay-paid { background: rgba(63,82,51,0.14); color: var(--wood); }
  #snt-root .pay-partial { background: rgba(224,168,69,0.22); color: #7a5209; }
  #snt-root .pay-unpaid { background: rgba(181,80,47,0.1); color: var(--brick); }
  #snt-root .pay-na { background: var(--paper-2); color: var(--ink-soft); }
  #snt-root .pay-sub { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }
  #snt-root .fee-block { background: var(--paper-2); border-radius: 4px; padding: 12px 14px 4px; margin-bottom: 14px; }

  /* ---------- documents ---------- */
  #snt-root .document-card {
    background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 16px;
    margin-bottom: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  }
  #snt-root .document-main { flex: 1 1 280px; min-width: 0; }
  #snt-root .document-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; margin: 4px 0 4px; }
  #snt-root .document-meta { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
  #snt-root .document-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
  #snt-root .document-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; }
  #snt-root .document-actions .btn { white-space: nowrap; }

  /* ---------- news ---------- */
  #snt-root .news-card {
    background: var(--white); border: 1px solid var(--line); border-radius: 5px;
    margin-bottom: 18px; overflow: hidden;
  }
  #snt-root .news-image-thumb {
    display: block; max-width: 280px; width: 100%; max-height: 190px; object-fit: cover;
    border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; margin-top: 14px;
    transition: opacity 0.15s ease;
  }
  #snt-root .news-image-thumb:hover { opacity: 0.82; }
  #snt-root .news-body { padding: 18px 20px; }
  #snt-root .news-meta { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 6px; }
  #snt-root .news-title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; margin: 0 0 10px; }
  #snt-root .news-content { font-size: 14.5px; line-height: 1.6; color: var(--ink); white-space: pre-line; }
  #snt-root .news-attachments { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
  #snt-root .news-attachment {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--pine);
    text-decoration: none; border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; width: fit-content;
  }
  #snt-root .news-attachment:hover { border-color: var(--wood); color: var(--wood); }
  #snt-root .news-attachment-size { color: var(--ink-soft); }
  #snt-root .news-current-file { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
  #snt-root .news-current-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
  #snt-root .news-attachment-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line);
  }
  #snt-root .news-attachment-row a { color: var(--pine); text-decoration: none; }
  #snt-root .news-attachment-row a:hover { text-decoration: underline; }

  /* ---------- image lightbox ---------- */
  #snt-root .lightbox-overlay {
    background: rgba(20,24,20,0.92); padding: 24px; align-items: center; justify-content: center;
  }
  #snt-root .lightbox-image {
    max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  }
  #snt-root .lightbox-close {
    position: fixed; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3); color: var(--white);
    font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  #snt-root .lightbox-close:hover { background: rgba(255,255,255,0.22); }

  /* ---------- year bar ---------- */
  #snt-root .year-bar {
    display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap;
  }
  #snt-root .year-bar label {
    margin: 0; text-transform: none; font-weight: 600; font-size: 14px; color: var(--ink); letter-spacing: 0;
  }
  #snt-root .year-bar select {
    width: auto; font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px;
    padding: 6px 10px; border-color: var(--wood); color: var(--pine);
  }

  /* ---------- category breakdown table ---------- */
  #snt-root .cat-breakdown { margin-top: 28px; }
  #snt-root .cat-breakdown h3 { font-family: 'Fraunces', serif; font-size: 17px; margin: 0 0 12px; }

  /* ---------- print ---------- */
  @media print {
    #snt-root .hero-actions,
    #snt-root .tabs,
    #snt-root .year-bar #btn-print,
    #snt-root .card-actions,
    #snt-root .btn,
    #snt-root #btn-add-task,
    #snt-root #btn-add-contractor,
    #snt-root #btn-add-news,
    #snt-root #btn-add-member,
    #snt-root #btn-add-user,
    #snt-root #btn-add-property,
    #snt-root .footer-note,
    #snt-root #tab-news,
    #snt-root #tab-contractors,
    #snt-root #tab-members,
    #snt-root #tab-documents,
    #snt-root #tab-property,
    #snt-root #tab-users,
    #snt-root #modal-root { display: none !important; }
    #snt-root .hero { background: none !important; color: var(--ink) !important; }
    #snt-root .hero-fence { display: none; }
    #snt-root .hero-branch { display: none; }
    #snt-root .site-sub, #snt-root .eyebrow { color: var(--ink-soft) !important; }
    #snt-root #tab-plans, #snt-root #tab-contractors { display: none !important; }
    #snt-root #tab-budget { display: block !important; }
    #snt-root #year-context { display: block !important; }
    #snt-root #stats { display: grid !important; }
  }
