/* =============================================
   main.css v7 — правильный мобильный UX
============================================= */
:root {
  --color-bg:           #f0f2f7;
  --color-surface:      #ffffff;
  --color-border:       #e2e6ef;
  --color-text:         #1a1d23;
  --color-text-muted:   #6b7280;
  --color-primary:      #3b6ef0;
  --color-primary-light:#eef2fd;
  --color-primary-hover:#2554d4;
  --color-danger:       #dc2626;
  --color-danger-hover: #b91c1c;
  --color-success:      #16a34a;
  --color-warning:      #d97706;
  --color-info:         #0891b2;
  --radius:             12px;
  --radius-sm:          8px;
  --shadow:             0 1px 4px rgba(0,0,0,.07);
  --shadow-md:          0 4px 20px rgba(0,0,0,.13);
  --sidebar-w:          220px;
  --topbar-h:           52px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
[data-theme="dark"] {
  --color-bg:    #111318;
  --color-surface: #1e2028;
  --color-border:  #2e3038;
  --color-text:    #e8eaf0;
  --color-text-muted: #9ca3af;
  --color-primary: #4f7ef5;
  --color-primary-light: #1e2540;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{font-size:16px;-webkit-text-size-adjust:100%;}
body{font-family:var(--font);background:var(--color-bg);color:var(--color-text);line-height:1.5;min-height:100vh;}

/* =============================================
   TOPBAR — всегда видим (и desktop и mobile)
   На десктопе тонкий, на мобильном полный
============================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 400;
  height: var(--topbar-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-weight: 700; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Гамбургер */
.btn-hamburger {
  width: 36px; height: 36px;
  border: none; background: none;
  cursor: pointer; border-radius: var(--radius-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--color-text); border-radius: 2px;
  transition: .25s;
}
.btn-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-hamburger.open span:nth-child(2) { opacity: 0; }
.btn-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Кнопка темы */
.btn-theme {
  width: 34px; height: 34px; border: none; background: none;
  cursor: pointer; border-radius: var(--radius-sm);
  font-size: 17px; display: flex; align-items: center;
  justify-content: center; color: var(--color-text-muted);
  -webkit-tap-highlight-color: transparent;
}

/* =============================================
   APP LAYOUT
============================================= */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* =============================================
   SIDEBAR — drawer на мобильном, fixed на десктопе
============================================= */
.sidebar {
  width: var(--sidebar-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden; /* не даём sidebar растянуться */
  /* Desktop: просто column в flex */
}

.sidebar-user-block {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar-user-name  { font-weight: 700; font-size: 13px; line-height: 1.3; }
.sidebar-user-role  { font-size: 11px; color: var(--color-text-muted); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  /* Скроллится только список навигации, bottom всегда виден */
  min-height: 0;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--color-text-muted);
  padding: 6px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--color-text-muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
  transition: background .15s, color .15s;
  position: relative; min-height: 40px; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover, .nav-item:active { background: var(--color-bg); color: var(--color-text); }
.nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary); font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--color-primary); border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--color-danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 20px; min-width: 18px; text-align: center;
}
.nav-divider { border: none; border-top: 1px solid var(--color-border); margin: 6px 0; }
.sidebar-bottom {
  padding: 8px 8px 12px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-surface);
  /* Прижат к нижней границе, не прячется при длинном меню */
}

/* =============================================
   MAIN CONTENT
============================================= */
.app-content {
  flex: 1; min-width: 0;
  overflow-y: auto;
  display: flex; flex-direction: column;
}

/* =============================================
   MOBILE: drawer behaviour
============================================= */
@media (max-width: 768px) {
  /* Sidebar становится drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-md);
    width: 270px;
    /* Перекрывает topbar сверху */
  }
  .sidebar.open { transform: translateX(0); }

  /* Overlay */
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 490;
  }
  .sidebar-overlay.visible { display: block; }
}
@media (min-width: 769px) {
  /* Desktop: sidebar всегда виден */
  .sidebar-overlay { display: none !important; }
  .btn-hamburger   { display: none; }
  /* Гамбургер не нужен на десктопе */
  .sidebar {
    height: 100%; /* Высота по родителю app-body */
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: calc(100vh - var(--topbar-h));
  }
}

/* =============================================
   PAGE WRAP
============================================= */
.page-wrap {
  padding: 20px 20px 100px;
  max-width: 920px; width: 100%;
}
@media (max-width: 768px) {
  .page-wrap { padding: 14px 12px 120px; }
}

/* =============================================
   LOGIN
============================================= */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius); padding:34px 30px; width:100%; max-width:420px; box-shadow:var(--shadow-md); }
.login-logo { font-size:36px; text-align:center; margin-bottom:8px; }
.login-title { text-align:center; font-size:20px; font-weight:700; }
.login-sub { text-align:center; color:var(--color-text-muted); font-size:13px; margin-bottom:24px; }
.login-hint { margin-top:16px; font-size:12px; color:var(--color-text-muted); text-align:center; line-height:1.6; }
.login-hint code { background:var(--color-bg); padding:1px 5px; border-radius:4px; }

/* =============================================
   SUPERVISOR 3-COL
============================================= */
.sv-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sv-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sv-col-workers {
  width: 210px; flex-shrink: 0;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  background: var(--color-bg);
  display: flex; flex-direction: column;
}
.sv-col-shifts {
  width: 230px; flex-shrink: 0;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  background: var(--color-surface);
  display: flex; flex-direction: column;
}
.sv-col-detail {
  flex: 1; min-width: 0;
  overflow-y: auto;
  padding: 18px 20px 80px;
  background: var(--color-bg);
}
.sv-col-head {
  padding: 10px 13px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 5;
  background: inherit; flex-shrink: 0;
}
.sv-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}
.sv-controls .btn {
  flex: 1;
  min-width: 120px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .sv-wrapper { overflow: visible; }
  .sv-layout { flex-direction: column; overflow: visible; }
  .sv-col-workers {
    width: 100%; border-right: none;
    border-bottom: 1px solid var(--color-border);
    /* Без max-height — список производителей полностью виден */
    flex-shrink: 0;
  }
  .sv-col-shifts {
    width: 100%; border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 280px; flex-shrink: 0;
  }
  .sv-col-detail { padding: 14px 12px 80px; }
  .sv-controls {
    /* На мобильном — прилипает к верху над списком */
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .sv-controls .btn {
    min-width: 0;
    font-size: 12px;
    padding: 8px 6px;
  }
}

/* =============================================
   WORKER CARD / SHIFT ROW
============================================= */
.worker-card {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; text-decoration: none; color: var(--color-text);
  border-bottom: 1px solid var(--color-border); transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}
.worker-card:hover, .worker-card:active { background: var(--color-surface); }
.worker-card-active { background: var(--color-primary-light) !important; }
.worker-avatar { width:32px; height:32px; border-radius:50%; background:var(--color-primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0; }
.worker-name { font-weight:600; font-size:13px; line-height:1.3; }
.worker-meta { font-size:11px; color:var(--color-text-muted); }

.shift-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 13px; text-decoration: none; color: var(--color-text);
  border-bottom: 1px solid var(--color-border); transition: background .12s; gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.shift-row:hover, .shift-row:active { background: var(--color-bg); }
.shift-row-active { background: var(--color-primary-light) !important; }
.shift-row-date   { font-weight:700; font-size:13px; }
.shift-row-station{ font-size:12px; color:var(--color-text-muted); }

/* Supervisor detail */
.sv-shift-header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.sv-shift-header h2 { font-size:17px; font-weight:700; }
.shift-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.detail-block { margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--color-border); }
.detail-block:last-child { border-bottom:none; }
.detail-block-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--color-text-muted); margin-bottom:10px; display:flex; align-items:center; gap:6px; }
.shift-map { border-radius:var(--radius); border:1px solid var(--color-border); margin-bottom:14px; }

/* =============================================
   SHIFT CARDS (worker dashboard)
============================================= */
.dashboard-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap:wrap; gap:10px; }
.shift-cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:11px; }
@media (max-width:500px) { .shift-cards-grid { grid-template-columns:1fr; } }

.shift-card { display:block; text-decoration:none; color:var(--color-text); background:var(--color-surface); border:1.5px solid var(--color-border); border-radius:var(--radius); padding:13px; transition:box-shadow .15s; position:relative; -webkit-tap-highlight-color:transparent; }
.shift-card:active { opacity:.9; }
.shift-card.sc-open     { border-left:4px solid var(--color-info); }
.shift-card.sc-review   { border-left:4px solid var(--color-warning); }
.shift-card.sc-approved { border-left:4px solid var(--color-success); }
.shift-card.sc-revision { border-left:4px solid var(--color-danger); }
.shift-card-urgent { background:#fff8f8; }
[data-theme="dark"] .shift-card-urgent { background:#2a1818; }

.shift-card-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:5px; }
.shift-card-status { display:flex; align-items:center; gap:5px; }
.shift-status-icon  { font-size:15px; }
.shift-status-label { font-size:11px; font-weight:600; color:var(--color-text-muted); }
.shift-card-date    { font-size:11px; color:var(--color-text-muted); }
.today-badge { background:#dbeafe; color:#1e40af; font-size:10px; font-weight:700; padding:1px 6px; border-radius:20px; }
.shift-card-station { font-size:14px; font-weight:700; margin-bottom:2px; }
.shift-card-time    { font-size:12px; margin-bottom:9px; color:var(--color-text-muted); }
.shift-card-indicators { display:flex; gap:5px; flex-wrap:wrap; align-items:center; padding-top:8px; border-top:1px solid var(--color-border); }
.ind { font-size:15px; opacity:.2; }
.ind-green { opacity:1; }
.ind-blue  { opacity:1; filter:hue-rotate(200deg); }
.ind-red   { opacity:1; font-size:12px; color:var(--color-danger); font-weight:700; }
.shift-card-notice { margin-top:7px; font-size:11px; font-weight:600; color:var(--color-danger); background:#fee2e2; padding:3px 7px; border-radius:5px; display:inline-block; }

/* Shift sub-tabs */
.shift-sub-tabs { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.shift-sub-tab { padding:6px 13px; border:1px solid var(--color-border); border-radius:20px; background:var(--color-bg); color:var(--color-text-muted); font-size:12px; font-weight:600; cursor:pointer; transition:.15s; white-space:nowrap; min-height:32px; -webkit-tap-highlight-color:transparent; }
.shift-sub-tab:hover,.shift-sub-tab:active { border-color:var(--color-primary); color:var(--color-primary); }
.shift-sub-tab.active { background:var(--color-primary); color:#fff; border-color:var(--color-primary); }

/* =============================================
   ACCORDION
============================================= */
.accordion { display:flex; flex-direction:column; gap:8px; }
.accordion-item { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.accordion-item.acc-active { border-color:var(--color-primary); }
.accordion-item.acc-locked { opacity:.6; }
.accordion-item.acc-done   { border-color:var(--color-success); }
.accordion-header { width:100%; display:flex; align-items:center; gap:9px; padding:13px 12px; cursor:pointer; border:none; background:none; color:var(--color-text); font-size:13px; font-weight:600; text-align:left; min-height:48px; transition:background .12s; -webkit-tap-highlight-color:transparent; }
.accordion-header:hover:not(:disabled),.accordion-header:active:not(:disabled) { background:var(--color-bg); }
.accordion-header:disabled { cursor:not-allowed; }
.acc-num   { font-size:10px; font-weight:700; color:var(--color-text-muted); min-width:20px; }
.acc-title { flex:1; }
.acc-arrow { font-size:12px; color:var(--color-text-muted); transition:transform .2s; margin-left:auto; }
.accordion-item.open .acc-arrow { transform:rotate(180deg); }
.acc-ind { font-size:10px; font-weight:700; padding:2px 6px; border-radius:20px; }
.acc-ind.ind-green { background:#d1fae5; color:#065f46; opacity:1; }
.acc-ind.ind-blue  { background:#dbeafe; color:#1e40af; opacity:1; }
.acc-ind.ind-red   { background:#fee2e2; color:#991b1b; opacity:1; }
.accordion-body { display:none; padding:13px; border-top:1px solid var(--color-border); animation:fadeIn .15s ease; }
.accordion-item.open .accordion-body { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(-3px);}to{opacity:1;transform:none;} }

/* =============================================
   SECTION CARD
============================================= */
.section-card { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius); padding:15px; margin-bottom:12px; box-shadow:var(--shadow); }
.section-card-title { font-size:14px; font-weight:700; margin-bottom:11px; display:flex; align-items:center; gap:8px; }
.tab-group-label { font-size:11px; font-weight:700; color:var(--color-text-muted); text-transform:uppercase; letter-spacing:.4px; padding:5px 0 4px; border-bottom:1px solid var(--color-border); margin-bottom:7px; margin-top:10px; }
.tab-group-label:first-child { margin-top:0; }

/* =============================================
   FORMS
============================================= */
.form-group { margin-bottom:13px; }
.form-group label { display:block; font-size:12px; font-weight:600; margin-bottom:5px; color:var(--color-text-muted); }
.form-input,
input[type="text"],input[type="password"],input[type="file"],select,textarea {
  width:100%; padding:10px 12px;
  border:1px solid var(--color-border); border-radius:var(--radius-sm);
  background:var(--color-bg); color:var(--color-text);
  font-size:15px; font-family:var(--font);
  transition:border-color .15s,box-shadow .15s;
  -webkit-appearance:none; appearance:none; line-height:1.4;
}
/* Мобильный: крупный шрифт в полях чтобы iOS не зумил */
@media (max-width:768px) {
  .form-input,input[type="text"],input[type="password"],select,textarea { font-size:16px; }
}
input[type="file"] { padding:9px 11px; font-size:14px; cursor:pointer; }
.form-input:focus,input[type="text"]:focus,input[type="password"]:focus,select:focus,textarea:focus {
  outline:none; border-color:var(--color-primary);
  box-shadow:0 0 0 3px rgba(59,110,240,.15);
}
textarea { resize:vertical; min-height:80px; }
.form-row { display:flex; gap:10px; flex-wrap:wrap; }
.flex-1 { flex:1; min-width:100px; }
.flex-2 { flex:2; min-width:150px; }
.req { color:var(--color-danger); }
@media (max-width:480px) {
  .form-row { flex-direction:column; }
  .flex-1,.flex-2 { flex:none; width:100%; }
}

/* =============================================
   BUTTONS
============================================= */
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap:6px; padding:10px 16px; border-radius:var(--radius-sm);
  font-size:14px; font-weight:600; font-family:var(--font);
  border:none; cursor:pointer; transition:.15s;
  white-space:nowrap; min-height:44px; text-decoration:none;
  -webkit-tap-highlight-color:transparent;
}
@media (max-width:768px) { .btn { min-height:48px; } }
.btn-primary   { background:var(--color-primary); color:#fff; }
.btn-primary:hover,.btn-primary:active   { background:var(--color-primary-hover); }
.btn-danger    { background:var(--color-danger); color:#fff; }
.btn-danger:hover,.btn-danger:active     { background:var(--color-danger-hover); }
.btn-success   { background:var(--color-success); color:#fff; }
.btn-warning   { background:var(--color-warning); color:#fff; }
.btn-secondary { background:var(--color-bg); color:var(--color-text); border:1px solid var(--color-border); }
.btn-secondary:hover,.btn-secondary:active { background:var(--color-border); }
.btn-full { width:100%; }
.btn-sm   { padding:7px 13px; font-size:13px; min-height:36px; }
.btn-xs   { padding:4px 9px; font-size:12px; min-height:28px; }
.mt-2     { margin-top:8px; }

/* Finish bar */
.finish-bar { position:fixed; bottom:0; left:0; right:0; z-index:300; background:var(--color-surface); border-top:1px solid var(--color-border); padding:10px 14px; box-shadow:0 -4px 14px rgba(0,0,0,.09); }
.finish-bar form { max-width:860px; margin:0 auto; }
.btn-finish { width:100%; min-height:50px; font-size:15px; }

/* =============================================
   ALERTS & BADGES
============================================= */
.alert { padding:9px 12px; border-radius:var(--radius-sm); font-size:13px; margin-bottom:12px; }
.alert-error   { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.alert-success { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }
.alert-info    { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
.hidden { display:none !important; }

.badge { display:inline-block; font-size:11px; font-weight:600; padding:2px 7px; border-radius:20px; }
.badge-ok      { background:#d1fae5; color:#065f46; }
.badge-warn    { background:#fef3c7; color:#92400e; }
.badge-err     { background:#fee2e2; color:#991b1b; }
.badge-info    { background:#dbeafe; color:#1e40af; }
.badge-neutral { background:var(--color-bg); color:var(--color-text-muted); }
.badge-lg      { font-size:13px; padding:4px 11px; }
.badge-urgency-normal   { background:#f3f4f6; color:#374151; }
.badge-urgency-urgent   { background:#fef3c7; color:#92400e; }
.badge-urgency-critical { background:#fee2e2; color:#991b1b; }
.badge-status-open     { background:#dbeafe; color:#1e40af; }
.badge-status-review   { background:#fef3c7; color:#92400e; }
.badge-status-approved { background:#d1fae5; color:#065f46; }
.badge-status-revision { background:#fee2e2; color:#991b1b; }

/* =============================================
   MISC
============================================= */
.text-muted { color:var(--color-text-muted); }
.text-sm    { font-size:12px; }
.divider    { border:none; border-top:1px solid var(--color-border); margin:8px 0; }
.page-title { font-size:18px; font-weight:700; margin-bottom:16px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.empty-state { text-align:center; padding:48px 20px; color:var(--color-text-muted); }
.empty-icon  { font-size:38px; margin-bottom:10px; }

.photo-preview { max-width:150px; max-height:120px; border-radius:var(--radius-sm); border:1px solid var(--color-border); object-fit:cover; margin-top:6px; display:block; }
.photo-row { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.thumb    { width:60px; height:60px; object-fit:cover; border-radius:6px; border:1px solid var(--color-border); }
.thumb-lg { width:96px; height:78px; object-fit:cover; border-radius:var(--radius-sm); }
.photo-grid { display:flex; gap:10px; flex-wrap:wrap; }
.photo-grid a { display:flex; flex-direction:column; align-items:center; gap:3px; font-size:11px; color:var(--color-text-muted); text-decoration:none; }

.shift-info { display:flex; flex-direction:column; gap:9px; }
.info-row   { font-size:13px; }
.info-row b { color:var(--color-text-muted); font-weight:500; }
.plan-content { font-size:13px; line-height:1.7; white-space:pre-wrap; }

.report-card { background:var(--color-bg); border:1px solid var(--color-border); border-radius:var(--radius-sm); padding:10px; margin-bottom:9px; }
.report-text { font-size:13px; margin-bottom:5px; line-height:1.6; }
.report-time { font-size:11px; color:var(--color-text-muted); margin-bottom:6px; }
.report-photos { display:flex; gap:5px; flex-wrap:wrap; margin-top:6px; }

.remarks-feed { display:flex; flex-direction:column; gap:9px; }
.remark-card  { background:var(--color-bg); border-left:3px solid var(--color-warning); border-radius:var(--radius-sm); padding:10px; }
.remark-card.status-resolved { border-left-color:var(--color-success); opacity:.85; }
.remark-header { display:flex; gap:6px; align-items:center; margin-bottom:5px; flex-wrap:wrap; }
.remark-author { font-weight:600; font-size:12px; }
.remark-date   { font-size:11px; color:var(--color-text-muted); flex:1; min-width:50px; }
.remark-status { font-size:10px; font-weight:600; padding:2px 6px; border-radius:20px; background:#fef3c7; color:#92400e; white-space:nowrap; }
.remark-card.status-resolved .remark-status { background:#d1fae5; color:#065f46; }
.remark-text   { font-size:13px; line-height:1.5; }
.fix-block     { margin-top:8px; padding:8px 10px; background:#d1fae5; border-radius:var(--radius-sm); border-left:3px solid var(--color-success); }
[data-theme="dark"] .fix-block { background:#052e16; }
.fix-label   { font-size:11px; font-weight:700; color:var(--color-success); margin-bottom:3px; }
.fix-comment { font-size:12px; line-height:1.5; }

.supply-list { list-style:none; display:flex; flex-direction:column; gap:6px; }
.supply-item { display:flex; align-items:center; gap:9px; padding:7px 10px; border-radius:var(--radius-sm); background:var(--color-bg); font-size:13px; }
.supply-item.received { color:var(--color-text-muted); }
.supply-item input[type="checkbox"] { flex-shrink:0; width:16px; height:16px; }

.file-list { list-style:none; display:flex; flex-direction:column; gap:6px; }
.file-item { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.file-link { color:var(--color-primary); text-decoration:none; font-size:13px; }
.file-link:hover { text-decoration:underline; }
.file-date { font-size:11px; color:var(--color-text-muted); flex-shrink:0; }

.vor-item { margin-bottom:5px; }
.vor-item a { color:var(--color-primary); font-size:13px; }
.mat-request-row { display:flex; align-items:center; gap:7px; padding:5px 0; border-bottom:1px solid var(--color-border); font-size:13px; flex-wrap:wrap; }
.mat-name { flex:1; min-width:70px; }

.geo-status { font-size:12px; margin-top:6px; min-height:18px; line-height:1.5; }
.geo-ok      { color:var(--color-success); }
.geo-err     { color:var(--color-danger); }
.geo-loading { color:var(--color-info); }

/* =============================================
   ADMIN
============================================= */
.admin-section { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius); padding:16px; margin-bottom:14px; box-shadow:var(--shadow); }
.admin-section h2 { font-size:15px; font-weight:700; margin-bottom:12px; }
.section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; flex-wrap:wrap; gap:8px; }
.section-header h2 { margin-bottom:0; }
.table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.data-table { width:100%; border-collapse:collapse; font-size:13px; min-width:380px; }
.data-table th { text-align:left; padding:7px 10px; border-bottom:2px solid var(--color-border); font-size:11px; font-weight:700; text-transform:uppercase; color:var(--color-text-muted); white-space:nowrap; }
.data-table td { padding:8px 10px; border-bottom:1px solid var(--color-border); vertical-align:middle; }
.data-table tr:last-child td { border-bottom:none; }
.role-form   { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.role-select { padding:4px 8px; height:auto; font-size:12px; width:auto; min-width:130px; flex:1; }

/* =============================================
   MODAL
============================================= */
.modal-overlay { position:fixed; inset:0; z-index:600; background:rgba(0,0,0,.5); display:flex; align-items:flex-end; justify-content:center; }
@media (min-width:600px) { .modal-overlay { align-items:center; padding:20px; } }
.modal-box { background:var(--color-surface); border-radius:var(--radius) var(--radius) 0 0; width:100%; max-width:520px; max-height:92vh; overflow-y:auto; box-shadow:var(--shadow-md); }
@media (min-width:600px) { .modal-box { border-radius:var(--radius); } }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--color-border); position:sticky; top:0; background:var(--color-surface); z-index:1; }
.modal-header h3 { font-size:15px; font-weight:700; }
.modal-close { font-size:22px; background:none; border:none; cursor:pointer; color:var(--color-text-muted); width:30px; height:30px; display:flex; align-items:center; justify-content:center; border-radius:6px; -webkit-tap-highlight-color:transparent; }
.modal-close:hover { background:var(--color-bg); }
.modal-box form { padding:16px; }
.modal-footer { display:flex; gap:8px; justify-content:flex-end; padding-top:4px; }

/* =============================================
   ПЛАН РАБОТ — пункты с чекбоксами
============================================= */
.plan-card { }
.plan-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.plan-progress-wrap { text-align:center; flex-shrink:0; }
.plan-progress-bar { width:80px; height:6px; background:var(--color-border); border-radius:3px; overflow:hidden; margin-bottom:3px; }
.plan-progress-fill { height:100%; background:var(--color-success); border-radius:3px; transition:width .3s ease; }
.plan-progress-label { font-size:11px; color:var(--color-text-muted); font-weight:600; }

.plan-items-list { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.plan-item { background:var(--color-bg); border:1px solid var(--color-border); border-radius:var(--radius-sm); padding:10px 12px; transition:border-color .15s; }
.plan-item-done { border-color:var(--color-success); background:#f0fdf4; }
[data-theme="dark"] .plan-item-done { background:#052e16; }
.plan-item-row { display:flex; align-items:center; gap:10px; }
.plan-checkbox { width:18px; height:18px; flex-shrink:0; cursor:pointer; accent-color:var(--color-success); }
.plan-item-text { flex:1; font-size:14px; line-height:1.4; }
.plan-item-done .plan-item-text { color:var(--color-text-muted); text-decoration:line-through; }
.plan-item-done-note { font-size:12px; color:var(--color-success); margin-top:5px; padding-left:28px; font-style:italic; }

.plan-item-confirm { margin-top:10px; padding-top:10px; border-top:1px solid var(--color-border); }
.confirm-btns { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }

/* Plan item inputs (supervisor modal) */
.plan-item-input-row { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.plan-item-input { flex:1; }

/* =============================================
   СДАЧА ОБЪЕКТА
============================================= */
.handover-item { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--color-border); flex-wrap:wrap; }
.handover-item:last-child { border-bottom:none; }
.handover-item a { color:var(--color-primary); font-size:13px; text-decoration:none; flex:1; min-width:0; }
.handover-item a:hover { text-decoration:underline; }
.badge-handover-pending  { background:#fef3c7; color:#92400e; }
.badge-handover-approved { background:#d1fae5; color:#065f46; }
.badge-handover-rejected { background:#fee2e2; color:#991b1b; }

/* ── Карточка открытого замечания с формой устранения ── */
.remark-card-open {
  border-left: 4px solid var(--color-danger) !important;
}
.remark-card-open .section-card-title { color: var(--color-danger); }

/* =============================================
   PWA INSTALL BANNER
============================================= */
.pwa-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  padding: 12px 16px;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}
.pwa-banner-icon {
  width: 48px; height: 48px;
  border-radius: 12px; flex-shrink: 0;
}
.pwa-banner-text { flex: 1; min-width: 0; }
.pwa-banner-title { font-weight: 700; font-size: 14px; }
.pwa-banner-sub   { font-size: 12px; color: var(--color-text-muted); }
.pwa-banner-close {
  width: 28px; height: 28px; border: none; background: none;
  font-size: 20px; cursor: pointer; color: var(--color-text-muted);
  flex-shrink: 0; border-radius: 6px; display: flex;
  align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.pwa-banner-close:hover { background: var(--color-bg); }

/* ── Offline indicator dot in topbar ── */
.online-ind {
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent; flex-shrink: 0;
  transition: background .3s;
}
.online-ind.online  { background: var(--color-success); }
.online-ind.offline { background: var(--color-danger); }

/* Standalone mode — добавляем safe area padding снизу */
@media all and (display-mode: standalone) {
  .finish-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .topbar     { padding-top: env(safe-area-inset-top); }
}

/* ── Логотип в сайдбаре ─────────────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: contain;
  background: #fff;
}
.sidebar-brand-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: .5px;
}

/* ── Логотип на странице логина ─────────────────────────────────────────── */
.login-logo img {
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

/* ── Дата плана ────────────────────────────────────────────────────────── */
.plan-date-badge {
  display: inline-flex; align-items: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}

/* ── Прогресс-бар полного выполнения ───────────────────────────────────── */
.plan-progress-complete { background: var(--color-success) !important; }

/* ── Детали выполненного пункта ─────────────────────────────────────────── */
.plan-item-done-details {
  padding: 6px 0 4px 28px;
}

/* ── Фото в форме плана ─────────────────────────────────────────────────── */
.plan-photo-inputs { display: flex; flex-direction: column; gap: 6px; }
.plan-photo-inputs input[type=file] { font-size: 13px; }

/* ── Фильтр "Возвращены с замечанием" в sub-tabs ─────────────────────── */
.shift-sub-tab[data-filter="revision"].active {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

/* ── sv-controls redesign ─────────────────────────────────────────────── */
.sv-controls-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--color-text-muted);
  align-self: center; flex-shrink: 0; white-space: nowrap;
}
.sv-action-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 8px 14px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: var(--color-surface);
  cursor: pointer; transition: all .15s; min-width: 64px;
  -webkit-tap-highlight-color: transparent;
  color: var(--color-text);
}
.sv-action-btn:hover:not(:disabled) {
  background: var(--color-primary-light); border-color: var(--color-primary);
  color: var(--color-primary);
}
.sv-action-btn:disabled { opacity: .4; cursor: not-allowed; }
.sv-action-icon { font-size: 18px; line-height: 1; }
.sv-action-label { font-size: 11px; font-weight: 600; white-space: nowrap; }

/* ── file input ────────────────────────────────────────────────────────── */
.form-input-file {
  display: block; width: 100%; padding: 8px 10px;
  border: 1px dashed var(--color-border); border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; background: var(--color-bg);
  color: var(--color-text);
}
.form-input-file:hover { border-color: var(--color-primary); }

/* ── Кнопки координат объекта ──────────────────────────────────────────── */
.station-coords-btn {
  font-size: 14px; padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid;
  white-space: nowrap;
}
.btn-coords-ok {
  background: #d1fae5; color: #065f46;
  border-color: #6ee7b7;
}
.btn-coords-ok:hover { background: #a7f3d0; }

.btn-coords-missing {
  background: #fee2e2; color: #991b1b;
  border-color: #fca5a5;
}
.btn-coords-missing:hover { background: #fecaca; }

.btn-coords-reset {
  padding: 4px 8px; font-size: 13px;
  background: transparent; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--color-text-muted);
}
.btn-coords-reset:hover { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ── Раскрываемые записи о работе ─────────────────────────────────────── */
.reports-list { display: flex; flex-direction: column; gap: 8px; }

.report-card-collapsible {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}
.report-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.report-card-header:hover { background: var(--color-bg); }
.report-card-meta { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.report-time-badge { font-size: 11px; color: var(--color-text-muted); flex-shrink: 0; }
.report-preview { font-size: 13px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.report-has-photo { font-size: 14px; flex-shrink: 0; }
.rcoll-arrow { font-size: 12px; color: var(--color-text-muted); flex-shrink: 0; transition: transform .2s; }

.report-card-body {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease, padding .25s;
  padding: 0 12px;
}
.rcoll-open .report-card-body {
  max-height: 600px;
  padding: 0 12px 12px;
}
.rcoll-open .rcoll-arrow { transform: rotate(180deg); }
.rcoll-open .report-card-header { border-bottom: 1px solid var(--color-border); }

/* ── Причины возврата смены на доработку ──────────────────────────────── */
.revision-reasons {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
[data-theme="dark"] .revision-reasons {
  background: #1c1008;
  border-color: #92400e;
}
.revision-reasons-title {
  font-weight: 700;
  font-size: 13px;
  color: #c2410c;
  margin-bottom: 10px;
}
.revision-remark-item {
  background: var(--color-surface);
  border-left: 3px solid #f97316;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.revision-remark-item:last-child { margin-bottom: 0; }
.revision-remark-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.revision-remark-author { font-weight: 600; font-size: 12px; color: var(--color-primary); }
.revision-remark-date   { font-size: 11px; color: var(--color-text-muted); }
.revision-remark-text   { font-size: 13px; line-height: 1.5; }

/* ── Кнопка Заявки в sv-controls ───────────────────────────────────────── */
.sv-btn-requests { position: relative; }
.sv-action-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; border-radius: 8px;
  font-size: 10px; font-weight: 700; line-height: 16px;
  text-align: center; padding: 0 4px;
}
.sv-badge-critical { background: var(--color-danger); color: #fff; }
.sv-badge-urgent   { background: #f59e0b; color: #fff; }

/* ── Модал заявок ───────────────────────────────────────────────────────── */
.req-filters {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.req-stats {
  display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap;
  font-size: 13px;
}
.req-stat-critical { color: var(--color-danger); }
.req-stat-urgent   { color: #d97706; }

.req-table-wrap {
  max-height: 400px; overflow-y: auto;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.req-table { width: 100%; border-collapse: collapse; }
.req-table th {
  position: sticky; top: 0; background: var(--color-bg);
  padding: 8px 12px; font-size: 12px; font-weight: 700;
  text-align: left; border-bottom: 2px solid var(--color-border);
  z-index: 1;
}
.req-table td { padding: 8px 12px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.req-table tr:last-child td { border-bottom: none; }

.req-critical td:first-child { border-left: 3px solid var(--color-danger); }
.req-urgent   td:first-child { border-left: 3px solid #f59e0b; }
.req-normal   td:first-child { border-left: 3px solid var(--color-success); }

.req-row.hidden { display: none; }

.btn-delete-station {
  padding: 4px 8px; font-size: 14px;
  background: transparent; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--color-text-muted);
}
.btn-delete-station:hover { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ── Supply modal tabs ──────────────────────────────────────────────────── */
.supply-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 14px;
}
.supply-tab {
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border: none; border-bottom: 3px solid transparent;
  background: none; cursor: pointer; color: var(--color-text-muted);
  position: relative; -webkit-tap-highlight-color: transparent;
  transition: color .15s;
}
.supply-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.supply-tab:hover  { color: var(--color-primary); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--color-danger); color: #fff;
  font-size: 11px; font-weight: 700; padding: 0 4px;
  margin-left: 5px; vertical-align: middle;
}

/* ── Pending requests list ──────────────────────────────────────────────── */
.pending-requests-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 240px; overflow-y: auto;
  padding: 2px;
}
.pending-req-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--color-surface);
}
.pending-req-item:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.pending-req-item input[type=radio] { margin-top: 2px; flex-shrink: 0; }
.pending-req-content { flex: 1; min-width: 0; }
.pending-req-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.pending-req-qty { color: var(--color-text-muted); font-size: 13px; }

/* ── Карточки заявок у worker ──────────────────────────────────────────── */
.mat-req-pending {
  border-left: 3px solid #f59e0b;
  padding-left: 10px !important;
}
.mat-req-fulfilled-card {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--color-surface);
}
.mat-req-fulfilled-card:last-child { margin-bottom: 0; }
.mat-req-what, .mat-req-answer {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 6px; margin-bottom: 8px;
}
.mat-req-what  { padding-bottom: 8px; border-bottom: 1px dashed var(--color-border); }
.mat-req-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--color-text-muted);
  flex-basis: 100%;
}
.mat-req-row-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.mat-req-note {
  font-size: 13px; color: var(--color-text-muted);
  font-style: italic; margin-top: 6px; line-height: 1.5;
}

/* ── Карточки заявок (modal-requests) ──────────────────────────────────── */
.req-cards-list { display:flex; flex-direction:column; gap:8px; max-height:420px; overflow-y:auto; padding:2px 0; }
.req-card { display:flex; border-radius:var(--radius-sm); border:1px solid var(--color-border); background:var(--color-surface); }
.req-card-left { width:5px; flex-shrink:0; }
.req-left-critical { background:var(--color-danger); }
.req-left-urgent   { background:#f59e0b; }
.req-left-normal   { background:var(--color-success); }
.req-card-body { flex:1; padding:10px 12px; min-width:0; }
.req-card-top  { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; flex-wrap:wrap; margin-bottom:4px; }
.req-card-material { font-weight:600; font-size:14px; }
.req-card-qty  { color:var(--color-text-muted); font-size:13px; }
.req-card-meta { font-size:12px; color:var(--color-text-muted); margin-bottom:4px; }
.req-card-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--color-text-muted); }
.req-answer-block { margin-top:8px; padding-top:8px; border-top:1px dashed var(--color-border); }

/* ── Карточки поставок у worker ─────────────────────────────────────────── */
.supply-card {
  border:1px solid var(--color-border); border-radius:var(--radius-sm);
  background:var(--color-surface); margin-bottom:10px; overflow:hidden;
}
.supply-card:last-child { margin-bottom:0; }
.supply-card-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px; cursor:pointer; user-select:none;
  -webkit-tap-highlight-color:transparent; transition:background .15s;
}
.supply-card-header:hover { background:var(--color-bg); }
.supply-card-meta { flex:1; min-width:0; }
.supply-card-title { font-weight:600; font-size:14px; display:block; margin-bottom:3px; }
.supply-card-body {
  max-height:0; overflow:hidden;
  transition:max-height .25s ease, padding .2s;
  padding:0 12px;
}
.supply-card.open .supply-card-body { max-height:400px; padding:0 12px 12px; }
.supply-card.open .rcoll-arrow { transform:rotate(180deg); }
.supply-card.open .supply-card-header { border-bottom:1px solid var(--color-border); }

/* ── История (универсальные карточки) ──────────────────────────────────── */
.hist-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 380px; overflow-y: auto; padding: 2px 0;
}
.hist-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--color-surface);
  transition: border-color .15s;
}
.hist-card:hover { border-color: var(--color-primary); }
.hist-card-top {
  display: flex; gap: 10px; align-items: flex-start;
}
.hist-title {
  font-weight: 600; font-size: 13px; margin-bottom: 4px;
}
.hist-meta {
  font-size: 12px; color: var(--color-text-muted); line-height: 1.6;
}
.hist-badge {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px;
}

/* ── Пункты плана в истории ────────────────────────────────────────────── */
.plan-items-preview {
  margin-top: 6px; padding: 6px 10px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
}
.plan-item-preview-row {
  font-size: 12px; color: var(--color-text); line-height: 1.8;
}
