@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Microsoft Fluent / Power BI inspired ── */
:root {
  --bg:        #f3f2f1;
  --surface:   #ffffff;
  --surface2:  #faf9f8;
  --border:    #e1dfdd;
  --border2:   #edebe9;

  --text:      #201f1e;
  --text2:     #605e5c;
  --muted:     #a19f9d;

  --blue:      #0078d4;
  --blue-dark: #005a9e;
  --blue-bg:   #eff6fc;
  --blue-mid:  #d0e8f8;

  --teal:      #038387;
  --green:     #107c10;
  --orange:    #d83b01;
  --purple:    #5c2d91;
  --yellow:    #ffb900;

  --nav-bg:    #201f1e;
  --nav-text:  #d2d0ce;

  --radius:    4px;
  --radius-md: 8px;
  --shadow-sm: 0 1.6px 3.6px rgba(0,0,0,.132), 0 .3px .9px rgba(0,0,0,.108);
  --shadow-md: 0 3.2px 7.2px rgba(0,0,0,.132), 0 .6px 1.8px rgba(0,0,0,.108);
  --shadow-lg: 0 6.4px 14.4px rgba(0,0,0,.132), 0 1.2px 3.6px rgba(0,0,0,.108);

  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Cascadia Code', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; min-height: 100vh; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue-dark); }

/* ══════════════════════════════════════
   ШАПКА
══════════════════════════════════════ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; gap: 16px;
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-icon {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; fill: white; }
.logo-text { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.1px; }
.logo-sep { color: var(--muted); font-weight: 300; }
.logo-sub { font-size: 12px; color: var(--muted); }

.header-search {
  flex: 1; max-width: 320px;
  display: flex; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface2);
}
.header-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.header-search input {
  flex: 1; height: 32px; border: none; background: transparent;
  padding: 0 10px; font-family: var(--font); font-size: 13px; color: var(--text); outline: none;
}
.header-search input::placeholder { color: var(--muted); }
.header-search button {
  width: 36px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.header-search button:hover { background: var(--border2); color: var(--text); }
.header-time { font-family: var(--mono); font-size: 12px; color: var(--muted); flex-shrink: 0; }

/* ══════════════════════════════════════
   НАВИГАЦИЯ — горизонтальная плитка
══════════════════════════════════════ */
.site-nav { background: var(--nav-bg); border-bottom: 1px solid #323130; }
.nav-inner {
  display: flex; flex-wrap: nowrap; overflow-x: auto;
  max-width: 1200px; margin: 0 auto; padding: 0 12px;
  gap: 2px; scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-inner a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 14px;
  color: var(--nav-text); text-decoration: none;
  font-size: 11px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  min-width: 72px;
}
.nav-inner a:hover { color: white; background: rgba(255,255,255,0.08); text-decoration: none; }
.nav-inner a.active { color: white; border-bottom-color: var(--blue); }
.nav-inner a.active .nav-icon { color: #4da6ff; }

.nav-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: #9d9b99;
}
.nav-icon svg { width: 18px; height: 18px; fill: currentColor; }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.content-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.main-grid {
  display: grid;
  grid-template-columns: 200px 1fr 210px;
  gap: 16px;
  padding: 16px 0 40px;
  align-items: start;
}

/* ══════════════════════════════════════
   ВИДЖЕТ (сайдбар)
══════════════════════════════════════ */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.widget-header {
  padding: 8px 12px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text2);
  border-bottom: 1px solid var(--border2);
  background: var(--surface2);
  display: flex; align-items: center; gap: 6px;
}
.widget-header svg { width: 13px; height: 13px; fill: var(--blue); flex-shrink: 0; }
.widget-body { padding: 10px 12px; }

/* Таблица ссылок */
.links-table { width: 100%; border-collapse: collapse; }
.links-table th { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 4px 4px 6px; border-bottom: 1px solid var(--border2); text-align: left; }
.links-table td { padding: 3px 4px; }
.links-table a { font-size: 12px; font-weight: 500; color: var(--blue); text-decoration: none; }
.links-table a:hover { text-decoration: underline; }

/* Формы в сайдбаре */
.wf-label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); margin-bottom: 3px; }
.wf-input {
  width: 100%; height: 30px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 0 8px;
  font-family: var(--font); font-size: 13px; color: var(--text);
  outline: none; transition: border-color 0.1s, box-shadow 0.1s;
  margin-bottom: 7px;
}
.wf-input:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.wf-input::placeholder { color: var(--muted); }
.wf-btn {
  width: 100%; height: 30px;
  background: var(--blue); border: none; border-radius: var(--radius);
  color: white; font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.1s;
}
.wf-btn:hover { background: var(--blue-dark); }
.wf-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); margin: 5px 0; }
.wf-check input { accent-color: var(--blue); }
.wf-link { font-size: 11px; text-align: center; margin-top: 5px; }

/* Архив */
.archive-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; border-bottom: 1px solid var(--border2);
  font-size: 13px; color: var(--blue); text-decoration: none;
}
.archive-link:hover { color: var(--blue-dark); }
.archive-link span { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* Статус */
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--green); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ══════════════════════════════════════
   ГЛАВНАЯ — КАРТОЧКИ НОВОСТЕЙ
══════════════════════════════════════ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 2px solid var(--blue);
  margin-bottom: 14px;
}
.section-title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.section-title svg { width: 16px; height: 16px; fill: var(--blue); }
.section-more { font-size: 12px; font-weight: 500; color: var(--blue); }

.greeting-bar {
  background: var(--blue-bg); border: 1px solid var(--blue-mid);
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: 13px; color: var(--text2); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.greeting-bar svg { width: 18px; height: 18px; fill: var(--blue); flex-shrink: 0; }

.news-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 18px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: default;
}
.news-card:hover { box-shadow: var(--shadow-md); border-color: #c8c6c4; }

.news-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.news-date {
  font-size: 11px; font-weight: 600; font-family: var(--mono);
  background: var(--blue-bg); color: var(--blue);
  padding: 1px 8px; border-radius: 2px;
}
.news-author { font-size: 12px; color: var(--muted); }

.news-title { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 7px; color: var(--text); }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a:hover { color: var(--blue); }

.news-body { font-size: 13px; color: var(--text2); line-height: 1.65; }
.news-body a { color: var(--blue); }
.news-body code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 2px; color: var(--teal); border: 1px solid var(--border); }

.news-footer { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border2); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.news-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 8px; border-radius: 2px; background: var(--bg); border: 1px solid var(--border); color: var(--text2); text-decoration: none; transition: all 0.1s; }
.tag:hover { background: var(--blue-bg); border-color: var(--blue-mid); color: var(--blue); text-decoration: none; }
.read-more { font-size: 12px; font-weight: 600; color: var(--blue); }

/* ── Пагинация ── */
.pagination { display: flex; gap: 4px; margin-top: 14px; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 13px; color: var(--text2);
  text-decoration: none; background: var(--surface); transition: all 0.1s;
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pagination .current { background: var(--blue); color: white; border-color: var(--blue); }

/* ══════════════════════════════════════
   СТРАНИЦЫ
══════════════════════════════════════ */
.page-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}
.page-card h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.page-card h2 svg { width: 20px; height: 20px; fill: var(--blue); }
.page-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 18px 0 7px; display: flex; align-items: center; gap: 6px; }
.page-card h3 svg { width: 14px; height: 14px; fill: var(--blue); }
.page-card p { font-size: 14px; color: var(--text2); margin-bottom: 10px; }
.page-card ul { padding-left: 18px; margin-bottom: 10px; }
.page-card li { font-size: 14px; color: var(--text2); margin-bottom: 3px; }

/* Тарифы */
.tariff-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 14px 0; }
.tariff-table th { background: var(--bg); color: var(--text2); padding: 9px 14px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 2px solid var(--blue); }
.tariff-table td { padding: 10px 14px; border-bottom: 1px solid var(--border2); color: var(--text2); }
.tariff-table tr:hover td { background: var(--blue-bg); }
.tariff-badge { font-size: 11px; font-weight: 700; color: var(--green); }

/* Формы обратной связи */
.fb-form { display: flex; flex-direction: column; gap: 13px; }
.fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.fb-group { display: flex; flex-direction: column; gap: 4px; }
.fb-group label { font-size: 12px; font-weight: 600; color: var(--text2); }
.fb-group input, .fb-group textarea {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 7px 10px;
  font-family: var(--font); font-size: 14px; color: var(--text); outline: none;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.fb-group input:focus, .fb-group textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.fb-group input::placeholder, .fb-group textarea::placeholder { color: var(--muted); }
.fb-group textarea { resize: vertical; min-height: 120px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: var(--radius); border: none;
  font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.1s, box-shadow 0.1s; text-decoration: none;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; color: white; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; fill: currentColor; }

/* Уведомления */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; display: flex; align-items: flex-start; gap: 8px; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #dff6dd; border: 1px solid #a7e3a5; color: var(--green); }
.alert-error   { background: #fde7e9; border: 1px solid #f5c0c5; color: var(--orange); }
.alert-info    { background: var(--blue-bg); border: 1px solid var(--blue-mid); color: var(--blue); }
.alert a { color: inherit; font-weight: 600; }

/* Гостевая */
.gb-entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 8px; }
.gb-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.gb-name { font-weight: 600; font-size: 13px; }
.gb-date { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.gb-text { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* Ресурсы */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; margin: 12px 0; }
.res-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 12px; text-align: center;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, border-color 0.15s;
}
.res-card:hover { box-shadow: var(--shadow-md); border-color: #c8c6c4; }
.res-card a { font-weight: 600; font-size: 13px; display: block; margin-bottom: 3px; }
.res-card p { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════
   ПОДВАЛ
══════════════════════════════════════ */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 8px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; flex-wrap: wrap; gap: 8px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { font-size: 12px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--blue); text-decoration: underline; }
.footer-copy { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════
   ADMIN
══════════════════════════════════════ */
.admin-bar { background: #323130; border-bottom: 1px solid #484644; font-family: var(--mono); font-size: 11px; padding: 5px 0; position: sticky; top: 0; z-index: 200; }
.admin-bar-inner { display: flex; align-items: center; justify-content: space-between; }
.admin-links { display: flex; gap: 4px; }
.admin-bar a { color: #c8c6c4; text-decoration: none; padding: 2px 8px; border-radius: 2px; transition: all 0.1s; }
.admin-bar a:hover { background: #484644; color: white; }
.admin-page { background: #f3f2f1; min-height: 100vh; padding: 40px 20px; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.admin-card h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.admin-input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font-family: var(--font); font-size: 14px; color: var(--text); outline: none; margin-bottom: 10px; }
.admin-input:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.admin-btn { background: var(--blue); color: white; border: none; border-radius: var(--radius); padding: 7px 18px; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; }
.admin-btn:hover { background: var(--blue-dark); }

/* ══════════════════════════════════════
   АДАПТИВНОСТЬ
══════════════════════════════════════ */
@media (max-width: 860px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar-left, .sidebar-right { display: none; }
  .fb-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .header-time { display: none; }
  .logo-sub { display: none; }
  .header-search { max-width: 180px; }
}

/* Async action spinner */
.btn.is-loading { cursor: wait; opacity: .78; }
.cp-spinner { display:inline-block; width:12px; height:12px; margin-right:7px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; vertical-align:-2px; animation: cp-spin .7s linear infinite; }
@keyframes cp-spin { to { transform: rotate(360deg); } }
