:root {
  --brand-primary: #0d3b66;
  --brand-primary-dark: #082848;
  --brand-accent: #ee964b;
  --brand-accent-dark: #d97e2e;
  --brand-light: #f4f7fb;
  --brand-text: #1d2939;
  --brand-muted: #667085;
  --brand-border: #e4e9f2;
  --danger: #d92d20;
  --success: #079455;
  --warn: #b54708;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--brand-text);
  background: #fff;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

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

/* Header */
.topbar {
  background: var(--brand-primary-dark);
  color: rgba(255,255,255,0.85);
  font-size: .875rem;
  padding: .35rem 0;
}
.topbar a { color: rgba(255,255,255,0.85); }
.topbar a:hover { color: #fff; text-decoration: none; }

.site-header {
  background: var(--brand-primary);
  color: #fff;
}
.site-header .navbar-brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.site-header .navbar-brand small { font-weight: 400; opacity: .8; }
.site-header .nav-link { color: rgba(255,255,255,0.9) !important; font-weight: 500; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: #fff !important; }
.site-header .nav-link.active { box-shadow: inset 0 -3px 0 var(--brand-accent); }

.lang-switch a {
  display: inline-block;
  padding: 0 .4rem;
  color: rgba(255,255,255,0.7) !important;
}
.lang-switch a.active { color: #fff !important; font-weight: 700; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  color: #fff;
  padding: 4rem 0 3rem;
}
.hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.hero .lead { color: rgba(255,255,255,0.85); }

/* Quick action cards */
.qcard {
  border: 1px solid var(--brand-border);
  border-radius: .75rem;
  padding: 1.25rem;
  background: #fff;
  height: 100%;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  display: flex;
  flex-direction: column;
}
.qcard:hover {
  border-color: var(--brand-accent);
  box-shadow: 0 6px 18px rgba(13, 59, 102, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}
.qcard .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand-light);
  color: var(--brand-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: .75rem;
}
.qcard h3 { font-size: 1.1rem; margin: 0 0 .25rem; color: var(--brand-text); }
.qcard p { color: var(--brand-muted); font-size: .9rem; margin: 0; }

/* Section */
.section { padding: 3rem 0; }
.section-title { font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.01em; }
.section-light { background: var(--brand-light); }

/* News card */
.news-card { border: 1px solid var(--brand-border); border-radius: .75rem; overflow: hidden; height: 100%; background: #fff; }
.news-card .news-cover { background: var(--brand-light); aspect-ratio: 16/9; background-size: cover; background-position: center; }
.news-card .news-body { padding: 1rem 1.1rem 1.2rem; }
.news-card h3 { font-size: 1.05rem; line-height: 1.3; margin: .25rem 0 .5rem; }
.news-card .news-date { color: var(--brand-muted); font-size: .8rem; }
.pinned { display: inline-block; padding: 2px 8px; font-size: .7rem;
          background: var(--brand-accent); color: #fff; border-radius: 4px; margin-right: .5rem; }

/* Tables */
.table-clean th { font-weight: 600; color: var(--brand-text); border-bottom: 2px solid var(--brand-border) !important; }
.table-clean td { vertical-align: middle; }

/* Forms */
.form-control:focus, .form-select:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 .2rem rgba(238, 150, 75, 0.15); }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-primary-dark); border-color: var(--brand-primary-dark); }
.btn-accent { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.btn-accent:hover { background: var(--brand-accent-dark); border-color: var(--brand-accent-dark); color: #fff; }

.form-card {
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: .75rem;
  padding: 1.5rem 1.5rem 1rem;
}

/* Outage row */
.outage-row.emergency { border-left: 4px solid var(--danger); }
.outage-row.planned { border-left: 4px solid var(--brand-primary); }

/* Status badges via Bootstrap classes already */

/* Footer */
.site-footer {
  background: var(--brand-primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}
.site-footer h5 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; color: rgba(255,255,255,0.6); }

/* Sidebar (cabinet/admin) */
.side-nav { background: #fff; border: 1px solid var(--brand-border); border-radius: .5rem; padding: .5rem; }
.side-nav .nav-link { color: var(--brand-text); border-radius: .35rem; }
.side-nav .nav-link.active { background: var(--brand-primary); color: #fff !important; }
.side-nav .nav-link:hover:not(.active) { background: var(--brand-light); }

/* Stats */
.stat-card {
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: .5rem;
  padding: 1.25rem;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--brand-primary); line-height: 1; }
.stat-card .stat-label { color: var(--brand-muted); font-size: .85rem; margin-top: .35rem; }

/* Disabled (billing-coming-soon) overlay */
.coming-soon {
  opacity: .65; pointer-events: none; position: relative;
}
.coming-soon::after {
  content: "Скоро";
  position: absolute; top: .5rem; right: .75rem;
  background: var(--warn); color: #fff;
  font-size: .7rem; padding: 2px 8px; border-radius: 4px;
}

/* Utilities */
.text-muted-2 { color: var(--brand-muted); }
.divider { border: none; border-top: 1px solid var(--brand-border); margin: 1.25rem 0; }
