:root {
  --bg:#0f141a;
  --panel:#151c24;
  --text:#dbe4ee;
  --muted:#9fb0c3;
  --accent:#4ea1ff;
  --ok:#34d399;
  --err:#ef4444;
  --card:#18222c;
}

*{box-sizing:border-box}

body.dark{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

a{
  color:var(--text);
  text-decoration:none;
}

.sidebar{
  position:fixed;
  left:0;top:0;bottom:0;
  width:220px;
  background:var(--panel);
  padding:18px;
  overflow:auto;
}

.brand{
  font-weight:800;
  line-height:1.1;
  margin-bottom:20px;
}

.sidebar nav a{
  display:block;
  padding:10px 12px;
  border-radius:10px;
  color:var(--muted);
  margin-bottom:4px;
}

.sidebar nav a:hover{
  background:#1e2935;
  color:var(--text);
}

.topbar{
  position:fixed;
  left:220px; right:0; top:0;
  height:56px;
  background:var(--panel);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  border-bottom:1px solid #203040;
}

.content{
  margin-left:220px;
  padding:80px 24px 40px;
}

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:12px;
  margin-bottom:16px;
}

.card{
  background:var(--card);
  padding:14px;
  border-radius:14px;
  border:1px solid #223346;
}

.table{
  width:100%;
  border-collapse:collapse;
}

.table th,.table td{
  padding:10px;
  border-bottom:1px solid #223346;
  vertical-align:top;
}

.table-wrap{
  background:var(--card);
  border-radius:14px;
  border:1px solid #223346;
  overflow:auto;
}

.table tr:hover td{
  background:#1b2530;
  transition:0.2s;
}

.btn{
  background:#243241;
  border:1px solid #334a63;
  color:var(--text);
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
}

.btn.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#001a31;
}

.btn.small{
  padding:6px 10px;
  font-size:14px;
  border-radius:8px;
}

.btn.edit{
  background:#2b3c50;
  border-color:#38516a;
}

.btn.edit:hover{
  background:#31465e;
}

.btn.danger{
  background:#3b1f24;
  border-color:#5a2c33;
  color:#ff6b6b;
}

.btn.danger:hover{
  background:#512a30;
}

.btn.warn{
  background:#4a3a15;
  border-color:#6b4f1e;
  color:#ffd166;
}

.btn.warn:hover{
  background:#5b461a;
}

.toolbar{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

.toolbar input{
  max-width:260px;
}

input,select,textarea{
  width:100%;
  padding:8px;
  border-radius:10px;
  border:1px solid #2a3b4f;
  background:#0c1218;
  color:var(--text);
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.login .card{
  max-width:340px;
  margin:0 auto;
}

.flashwrap{
  margin-bottom:8px;
}

.flash{
  padding:8px 12px;
  border-radius:10px;
}

.flash.info{
  background:#19324a;
}

.flash.error{
  background:#4a1922;
}

.muted{color:var(--muted)}
.ok{color:var(--ok)}
.err{color:var(--err)}

.bell{
  font-size:22px;
  cursor:pointer;
  padding:6px 10px;
  border-radius:8px;
  transition:0.25s;
  color:var(--text);
  margin-left:10px;
}

.bell:hover{
  background:#1e2935;
}

.bell.active{
  color:#ffd166;
  text-shadow:0 0 8px rgba(255,209,102,0.8);
  animation:pulseBell 1.2s infinite;
}

@keyframes pulseBell{
  0%{transform:scale(1);opacity:1}
  50%{transform:scale(1.15);opacity:.8}
  100%{transform:scale(1);opacity:1}
}

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
}

.modal.hidden{display:none}

.modal-box{
  background:var(--panel);
  padding:16px;
  border-radius:14px;
  min-width:340px;
  border:1px solid #223346;
}

.modal-title{
  font-weight:700;
  margin-bottom:8px;
}

.modal-actions{
  text-align:right;
  margin-top:10px;
}

.modal-content label{
  display:block;
  margin:6px 0 4px;
  font-size:14px;
  color:var(--muted);
}

.modal-content input{
  margin-bottom:6px;
}

img{max-width:100%;height:auto}

details > summary { list-style:none; display:inline-block; }
details > summary::-webkit-details-marker{ display:none; }

.alert-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 0;
  border-bottom:1px solid #223346;
}

.alert-item:last-child{
  border-bottom:none;
}

.alert-item b{
  color:#ffd166;
  font-size:15px;
}

.children-header span{
  font-weight:600;
}

.child-row input{
  font-size:13px;
}
/* ============================================================
   ГЛОБАЛЬНОЕ ВЫРАВНИВАНИЕ ВСЕХ ТАБЛИЦ
   ============================================================ */

.table {
    table-layout: fixed;
    width: 100%;
}

.table th, 
.table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 10px 12px;
}

/* Тонкая граница между строками */
.table tr {
    border-bottom: 1px solid #3a4a5a;
}

/* -------------------------------------------
   УНИВЕРСАЛЬНАЯ СЕТКА ДЛЯ 6-ТИ КОЛОНОК
   (Клиенты, Дни рождения)
   ------------------------------------------- */
.table.cols-6 th:nth-child(1),
.table.cols-6 td:nth-child(1) { width: 26%; }

.table.cols-6 th:nth-child(2),
.table.cols-6 td:nth-child(2) { width: 16%; text-align:center; }

.table.cols-6 th:nth-child(3),
.table.cols-6 td:nth-child(3) { width: 14%; text-align:center; }

.table.cols-6 th:nth-child(4),
.table.cols-6 td:nth-child(4) { width: 10%; text-align:center; }

.table.cols-6 th:nth-child(5),
.table.cols-6 td:nth-child(5) { width: 14%; text-align:center; }

.table.cols-6 th:nth-child(6),
.table.cols-6 td:nth-child(6) { width: 20%; text-align:center; }

/* -------------------------------------------
   СЕТКА ДЛЯ 5 КОЛОНОК  
   (Акции / Промо / Бонусы)
   ------------------------------------------- */
.table.cols-5 th:nth-child(1),
.table.cols-5 td:nth-child(1) { width: 30%; }

.table.cols-5 th:nth-child(2),
.table.cols-5 td:nth-child(2) { width: 12%; text-align:center; }

.table.cols-5 th:nth-child(3),
.table.cols-5 td:nth-child(3) { width: 18%; text-align:center; }

.table.cols-5 th:nth-child(4),
.table.cols-5 td:nth-child(4) { width: 20%; text-align:center; }

.table.cols-5 th:nth-child(5),
.table.cols-5 td:nth-child(5) { width: 20%; text-align:center; }

/* -------------------------------------------
   СЕТКА ДЛЯ 7 КОЛОНОК
   (Історія розсилок Telegram Bot)
   ------------------------------------------- */
.table.cols-7 th:nth-child(1),
.table.cols-7 td:nth-child(1) { width: 8%; text-align:center; }

.table.cols-7 th:nth-child(2),
.table.cols-7 td:nth-child(2) { width: 12%; }

.table.cols-7 th:nth-child(3),
.table.cols-7 td:nth-child(3) { width: 14%; }

.table.cols-7 th:nth-child(4),
.table.cols-7 td:nth-child(4) { width: 30%; }

.table.cols-7 th:nth-child(5),
.table.cols-7 td:nth-child(5) { width: 12%; text-align:center; }

.table.cols-7 th:nth-child(6),
.table.cols-7 td:nth-child(6) { width: 9%; text-align:center; }

.table.cols-7 th:nth-child(7),
.table.cols-7 td:nth-child(7) { width: 15%; text-align:center; }

