/* DOLG UI — B+ (lighter surface) */

:root{
  --bg:#0b0b0d;
  --text:#e6e6e6;
  --muted:rgba(230,230,230,.70);
  --gold:#d4af37;
  --gold2:#f1d37a;

  /* Lighter surfaces */
  --surface: rgba(10,10,12,.28);          /* lighter than before */
  --border: rgba(212,175,55,.14);
  --shadow: 0 14px 40px rgba(0,0,0,.35);
}

*{box-sizing:border-box;}
html,body{height:100%;}

body{
  margin:0;
  color:var(--text) !important;
  font-family:"Segoe UI", Arial, sans-serif !important;
  background: var(--bg) !important;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,.70)),
    url("/static/img/hero_bg.png");
  background-size: cover;
  background-position: center;
  z-index:-2;
}

body::after{ content:none !important; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px 24px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--gold);
  font-weight:700;
}
.brand img{
  width:34px;
  height:34px;
  object-fit:contain;
}

.nav{
  display:flex;
  gap:22px;
  align-items:center;
}
.hello{ color: rgba(255,255,255,.82); text-decoration: none; }
.hello:hover{ text-decoration: underline; text-decoration-color: rgba(227, 184, 86, .55); }
.hello b{ color: var(--gold); font-weight:800; }

.logout{
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
}
.logout:hover{ background: rgba(0,0,0,.35); text-decoration:none; }
.nav a{
  color:var(--gold);
  text-decoration:none;
  font-weight:600;
}
.nav a:hover{ color: var(--gold2); text-decoration: underline; }

.container{
  width:min(1100px, calc(100% - 48px));
  margin:0 auto;
  /* Add inner horizontal padding so content doesn't stick to the glass border */
  padding: 38px 24px 60px;
  position:relative;
}
.container::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  z-index:-1;
}

/* News page: no big "glass" panel, only the news blocks themselves */
.container.news-container{
  width:100%;
  margin:0;
  padding: 0;
}
.container.news-container::before{ display:none; }

/* Headings */
h1{ color: var(--gold); margin: 0 0 16px; font-size: 36px; }
h2{ color: var(--gold); margin: 22px 0 12px; font-size: 24px; }
h3{ color: var(--gold); margin: 18px 0 10px; font-size: 18px; }

.panel{
  background: transparent;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 16px;
}
.panel + .panel{ margin-top:14px; }

a{ color: var(--gold); }
a:hover{ color: var(--gold2); }

button, .btn{
  background: rgba(200,24,24,.92);
  color:#fff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 9px 12px;
}
button:hover, .btn:hover{ filter: brightness(1.06); }

input, select, textarea{
  background: rgba(0,0,0,.32);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 9px 10px;
}
textarea{ width:100%; }

table{
  width:100%;
  border-collapse: collapse;
  border-radius: 14px;
  overflow:hidden;
}
th, td{
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 10px 10px;
}
th{ color: var(--muted); font-weight:600; }

tr:hover td{ background: rgba(212,175,55,.05); }

/* --- Tables (unified) --- */
.tbl{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow:hidden;
}
.tbl thead th{
  background: rgba(0,0,0,.24);
  color: rgba(230,230,230,.78);
  font-weight:700;
  letter-spacing:.2px;
}
.tbl th, .tbl td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tbl tbody tr:last-child td{ border-bottom: none; }
.tbl tbody tr:hover td{ background: rgba(212,175,55,.06); }
.td-right{ text-align:right; }
.td-nowrap{ white-space:nowrap; }
.td-center{ text-align:center; }
.td-date{ white-space:nowrap; overflow-wrap:normal; word-break:normal; }

/* wrapper to prevent tables from pushing cards wider */
.table-scroll{ width:100%; overflow-x:auto; }
.table-scroll .tbl{ min-width: 520px; }

/* --- Forms (unified) --- */
.form-compact textarea{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
  min-height: 220px;
}
.form-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top: 12px;
}
.form-inline{ display:inline; }
.help{ color: rgba(230,230,230,.62); font-size: 12px; }


.muted{ color: var(--muted); }

@media (max-width: 640px){
  .container{ width: calc(100% - 24px); padding: 22px 14px 34px; }
  h1{ font-size: 28px; }
}


/* --- Layout helpers --- */
.container--left{
  width:min(1400px, calc(100% - 24px));
  margin:0 0 0 12px;          /* shift further to the left */
  /* Remove top/bottom "air" around the news block (user requested: fully) */
  padding: 0 0 0;
}
@media (max-width: 640px){
  .container--left{ margin:0 auto; }
}

.layout-2col{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap:22px;
  align-items:start;
}
@media (max-width: 980px){
  .layout-2col{ grid-template-columns: 1fr; }
}

/* --- Surfaces --- */
.surface-lite{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 16px;
}

/* --- Buttons --- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(212,175,55,.22);
  background: rgba(0,0,0,.30);
  color: var(--text);
  text-decoration:none;
  font-weight:600;
}
.btn:hover{ border-color: rgba(212,175,55,.38); }
.btn-ghost{
  background: transparent;
}

.btn-danger{
  background: rgba(200,24,24,.85);
  border-color: rgba(200,24,24,.35);
}
.btn-danger:hover{ filter: brightness(1.08); }

/* --- News --- */
.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin: 0 0 18px;
}
.page-title{
  margin:0;
  font-size: 34px;
  letter-spacing:.3px;
}
.news-item{ margin-bottom: 18px; }
.news-top{ display:flex; justify-content:space-between; gap:12px; }
.news-title{ color: var(--gold); font-weight:800; font-size: 20px; margin:0 0 4px 0; }
.news-meta{ color: rgba(230,230,230,.62); font-size: 12px; }
.news-cover{
  width:100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  margin: 12px 0 12px;
}
.news-body{
  white-space: pre-wrap;
  line-height: 1.5;
  color: rgba(230,230,230,.92);
}

.news-gallery{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 640px){
  .news-gallery{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.news-thumb{
  display:block;
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
}
.news-thumb img{
  width:100%;
  height: 120px;
  object-fit: cover;
  display:block;
}

.news-files{ margin-top: 12px; }
.news-files-title{ color: var(--gold); font-weight:700; margin-bottom:6px; }
.news-files-list{ margin:0; padding-left: 18px; }
.news-files-list a{ color: var(--text); }

.news-empty{ padding:18px; color: rgba(230,230,230,.85); }

/* --- Side column --- */
.side-block{ margin-bottom: 18px; }
.side-title{ color: var(--gold); font-weight:800; margin-bottom:10px; }
.side-links{ display:flex; flex-direction:column; gap:8px; }
.side-links a{ color: rgba(230,230,230,.92); text-decoration:none; }
.side-links a:hover{ color: var(--gold2); }

/* --- Hierarchy --- */
.hier-list{
  list-style:none;
  margin:0;
  padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,.10);
}
.hier-node{ margin: 10px 0; }
.hier-rank{ color: var(--gold); font-weight: 800; }
.hier-members{ margin: 8px 0 0; padding-left: 18px; }
.hier-callsign{ color: rgba(230,230,230,.95); }
.hier-status{ color: rgba(230,230,230,.62); margin-left: 6px; }
.hier-note{ color: rgba(230,230,230,.62); margin-left: 6px; }

.hier-manage-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items:start;
}
@media (max-width: 980px){
  .hier-manage-grid{ grid-template-columns: 1fr; }
}
.form-compact{
  display:grid;
  gap: 10px;
}
.form-compact input,
.form-compact select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
}

.news-wrap{
  max-width: 920px;
}

/* --- Dashboard --- */
.dash-grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items:start;
}
@media (max-width: 980px){
  .dash-grid{ grid-template-columns: 1fr; }
}

.dash-hero{
  padding: 18px 18px;
}
.dash-hero-title{
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  margin: 0 0 6px;
}
.dash-hero-sub{ color: rgba(230,230,230,.88); }

.dash-actions{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 760px){
  .dash-actions{ grid-template-columns: 1fr; }
}

.dash-action{
  text-decoration:none;
  color: var(--text);
  padding: 14px 14px;
  display:block;
  transition: transform .08s ease, border-color .08s ease;
}
.dash-action:hover{
  transform: translateY(-1px);
  border-color: rgba(212,175,55,.30);
}
.dash-action-title{ font-weight: 900; color: var(--gold); margin-bottom:6px; }
.dash-action-sub{ color: rgba(230,230,230,.72); font-size: 13px; line-height:1.35; }

.dash-side-block{ margin-bottom: 18px; }
.dash-side-title{ color: var(--gold); font-weight: 900; margin-bottom: 10px; }
.dash-news-list{ display:grid; gap: 10px; }
.dash-news-row{
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,.18);
}
.dash-news-name{ font-weight: 800; color: rgba(230,230,230,.95); margin-bottom:4px; }
.dash-news-meta{ color: rgba(230,230,230,.62); font-size: 12px; }

/* ---------- Documents hub ---------- */
.docs-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px){
  .docs-grid{ grid-template-columns: 1fr; }
}
.doc-card{
  display:block;
  padding: 16px 16px;
  border-radius: 14px;
  border: 1px solid rgba(208, 170, 50, .18);
  background: rgba(18,18,18,.28);
  box-shadow: 0 10px 34px rgba(0,0,0,.35);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.doc-card:hover{
  transform: translateY(-1px);
  border-color: rgba(208, 170, 50, .33);
  background: rgba(18,18,18,.34);
}
.doc-title{ font-weight: 900; color: var(--gold); margin-bottom: 6px; }
.doc-sub{ color: rgba(230,230,230,.74); font-size: 13px; line-height: 1.35; }


/* Back link (inside pages, not in topbar) */
.backlink{
  display:inline-block;
  margin: 10px 0 18px;
  color: var(--muted);
  text-decoration:none;
  font-size:14px;
}
.backlink:hover{ color: var(--gold2); text-decoration: underline; }

/* Slightly tighter page head (used in "Состав" etc.) */
.page-head--tight{ margin-top: 6px; margin-bottom: 12px; }

/* Members grouping */
.unit-head{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin: 6px 0 10px; }
.unit-title{ font-weight: 900; letter-spacing:.3px; color: rgba(230,230,230,.95); }
.unit-sub{ color: rgba(230,230,230,.55); font-size: 12px; }

/* Members table: tighter grid, no redundant columns */
.members-table{ table-layout: fixed; }
.members-table th, .members-table td{ vertical-align: middle; }
.members-table .col-callsign{ width: 28%; }
.members-table .col-rank{ width: 22%; }
.members-table .col-role{ width: 50%; }
.members-table td{ overflow:hidden; text-overflow: ellipsis; }
.members-table td.td-left a{ color: var(--gold); text-decoration:none; font-weight:800; }
.members-table td.td-left a:hover{ color: var(--gold2); text-decoration: underline; }

/* Table alignment helpers */
.tbl-center th, .tbl-center td{ text-align:center; }
.tbl-center th.td-left, .tbl-center td.td-left{ text-align:left; }


.w-100{ width:100%; max-width:680px; }


/* --- Fields / alerts --- */
.field{ display:grid; gap:6px; }
.row{ display:flex; gap:16px; flex-wrap:wrap; align-items:flex-start; }
.alert-error{ border-color: rgba(255,90,90,.35) !important; }


/* --- Small utilities --- */
.w-420{ width:100%; max-width:420px; }
.w-240{ width:100%; max-width:240px; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.25);
  color:var(--muted);
  font-size:12px;
  line-height:1.2;
}
.w-520{ width:100%; max-width:520px; }
.w-120{ max-width:120px; }
.w-220{ max-width:220px; }
.hr{ border:0; border-top:1px solid rgba(255,255,255,.08); margin:16px 0; }
.btn-sm{ padding:6px 10px; border-radius:10px; }
.alert-ok{ border-color: rgba(124,252,0,.25) !important; }

/* --- Spacing utilities --- */
.mb-16{ margin-bottom:16px; }
.mb-14{ margin-bottom:14px; }
.mt-10{ margin-top:10px; }
.mt-12{ margin-top:12px; }
.mt-14{ margin-top:14px; }

/* --- Flex helpers (compact, used in member card etc.) --- */
.row{ display:flex; gap:16px; flex-wrap:wrap; align-items:flex-start; }
.gap-12{ gap:12px; }
.gap-14{ gap:14px; }
.flex-1{ flex:1; }
.min-240{ min-width:240px; }
.min-260{ min-width:260px; }

/* --- Member card --- */
.avatar{
  width:92px;
  height:92px;
  border-radius:16px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.10);
}
.avatar-lg{
  width:132px;
  height:132px;
  border-radius:18px;
}

/* bigger avatar for member profile header */
.avatar-xl{
  width:190px;
  height:190px;
  border-radius:22px;
}

/* keep avatar + meta in one line on desktop */
.member-card .row{
  flex-wrap: nowrap;
}
@media (max-width: 920px){
  .member-card .row{ flex-wrap: wrap; }
}

.tbl-fixed{
  table-layout: fixed;
}
.tbl-fixed th, .tbl-fixed td{
  overflow-wrap: anywhere;
}

/* tighter tables inside member side panel */
.member-side .tbl th, .member-side .tbl td{
  padding: 10px 10px;
  font-size: 13px;
  line-height: 1.25;
}
.member-side .tbl thead th{
  font-size: 12px;
}
.kpi{ font-size:18px; font-weight:800; }
.kpi-sub{ font-weight:700; }
.pre{ white-space:pre-wrap; }
.section-title{ margin:0 0 10px; }

/* --- Empty state --- */
.empty-state{
  padding: 18px;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(0,0,0,.14);
}
.empty-title{ font-weight:900; color: rgba(230,230,230,.92); margin-bottom:6px; }
.empty-sub{ color: rgba(230,230,230,.68); font-size: 13px; line-height:1.35; }

/* ----- REPORT EDITOR ----- */
.editor-toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.editor-toolbar .btn{
  padding: 6px 10px;
  line-height: 1;
}
.editor-toolbar .tool-sep{
  width: 1px;
  height: 22px;
  background: rgba(212,175,55,.25);
  display: inline-block;
  margin: 0 4px;
}
.editor{
  min-height: 340px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color: rgba(245,245,245,.92);
  outline: none;
}
.editor:focus{
  border-color: rgba(212,175,55,.35);
  box-shadow: 0 0 0 2px rgba(212,175,55,.12);
}
.editor a{ color: rgba(212,175,55,.95); }

/* --- Footer --- */
.site-footer{
  width:min(1100px, calc(100% - 48px));
  margin: 16px auto 28px;
}
.site-footer-inner{
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.site-footer-copy{
  color: rgba(230,230,230,.78);
  font-size: 13px;
  line-height: 1.4;
}
.site-footer-disclaimer{
  margin-top: 10px;
  color: rgba(230,230,230,.86);
}
.site-footer-disclaimer summary{
  cursor: pointer;
  color: var(--gold);
  font-weight: 700;
  list-style: none;
}
.site-footer-disclaimer summary::-webkit-details-marker{ display:none; }
.site-footer-disclaimer-text{
  margin-top: 8px;
  color: rgba(230,230,230,.78);
  font-size: 13px;
  line-height: 1.45;
}
