/* ============================================
   Energokotel PlanIt CMS - Custom Styles
   Bootstrap 5 overrides and custom components
   ============================================ */

:root {
  --ek-primary: #0d9488;
  --ek-primary-dark: #0f766e;
  --ek-primary-light: #ccfbf1;
  --ek-sidebar-width: 260px;
  --ek-header-height: 60px;
}

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  background-color: #f8f9fa;
  color: #1e293b;
}

/* ---- Utility ---- */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ---- Bootstrap overrides ---- */
.btn-primary {
  background-color: var(--ek-primary);
  border-color: var(--ek-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--ek-primary-dark);
  border-color: var(--ek-primary-dark);
}
.btn-outline-primary {
  color: var(--ek-primary);
  border-color: var(--ek-primary);
}
.btn-outline-primary:hover {
  background-color: var(--ek-primary);
  border-color: var(--ek-primary);
  color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ek-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
}
.badge-primary {
  background-color: var(--ek-primary);
  color: #fff;
}

/* ---- Overlay / Zat ---- */
.zat {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1040;
  display: none;
}

/* ---- Error Message Modal ---- */
.SmmErorMessege {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1050;
  display: none;
}
.error-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  min-width: 360px;
  max-width: 480px;
  overflow: hidden;
}
.error-modal-header {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.error-modal-body {
  padding: 16px 20px;
  color: #64748b;
  line-height: 1.6;
}
.error-modal-footer {
  padding: 12px 20px;
  text-align: right;
  border-top: 1px solid #e2e8f0;
}

/* ---- Authorization / Login ---- */
.Authorization {
  display: none;
}
.Authorization .input-group-text {
  border-right: 0;
}
.Authorization .form-control {
  border-left: 0;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--ek-sidebar-width);
  height: 100vh;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  height: var(--ek-header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
}
.sidebar-brand img {
  height: 32px;
}
.sidebar-brand h5 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.sidebar-nav .nav-section {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 12px 12px 6px;
}
.sidebar-nav .nav-item {
  margin-bottom: 2px;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: #475569;
  font-weight: 400;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.15s ease;
  gap: 10px;
}
.sidebar-nav .nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sidebar-nav .nav-link.active {
  background: var(--ek-primary-light);
  color: var(--ek-primary-dark);
  font-weight: 500;
}
.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ek-primary-light);
  color: var(--ek-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}
.sidebar-user .user-name {
  font-weight: 500;
  font-size: 0.85rem;
  color: #0f172a;
}
.sidebar-user .user-role {
  font-size: 0.75rem;
  color: #94a3b8;
}
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 1029;
  display: none;
}

/* ---- Header ---- */
.main-header {
  height: var(--ek-header-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  gap: 16px;
}
.main-header .page-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.main-header .header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.85rem;
}
.btn-menu-toggle {
  display: none;
  border: none;
  background: none;
  padding: 6px;
  font-size: 1.3rem;
  color: #64748b;
  cursor: pointer;
}

/* ---- Main Layout ---- */
.main-wrapper {
  margin-left: var(--ek-sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}
.main-content {
  padding: 24px;
}

/* ---- Stats Cards ---- */
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* ---- Table ---- */
.table-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.table-toolbar .btn {
  font-size: 0.8rem;
}
.table-responsive {
  max-height: calc(100vh - 280px);
  overflow: auto;
}
.table-container table {
  margin-bottom: 0;
  font-size: 0.8rem;
}
.table-container thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  padding: 10px 12px;
  white-space: nowrap;
  z-index: 10;
}
.table-container tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-container tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}
.table-container tbody tr:hover {
  background: #f8fafc;
}
.table-container tbody tr.selected {
  background: var(--ek-primary-light);
}

/* Filter row in table */
.table-container thead .filter-row th {
  background: #fff;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
}
.table-container thead .filter-row input,
.table-container thead .filter-row select {
  font-size: 0.75rem;
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 100%;
  background: #f8fafc;
}
.table-container thead .filter-row input:focus,
.table-container thead .filter-row select:focus {
  border-color: var(--ek-primary);
  outline: none;
  background: #fff;
}

/* ---- Pagination ---- */
.table-pagination {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #64748b;
}
.table-pagination .pagination {
  margin: 0;
}

/* ---- Edit Panel (Right side panel) ---- */
.OpenFormIzmZay {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  height: 100vh;
  background: #fff;
  z-index: 1050;
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  display: none;
  overflow: hidden;
}
.OpenFormIzmZay.show-flex {
  display: flex !important;
  flex-direction: column;
}
.OpenFormIzmZay .panel-header {
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.OpenFormIzmZay .panel-header h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.OpenFormIzmZay .panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.OpenFormIzmZay .panel-body .form-section {
  margin-bottom: 24px;
}
.OpenFormIzmZay .panel-body .form-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.OpenFormIzmZay .panel-body .mb-3 label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #475569;
}
/* Legacy support for old block structure */
.OpenFormIzmZay .OpenFormIzmZay-TopMenuPanel {
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.OpenFormIzmZay .OpenFormIzmZay-TopMenuPanel h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.OpenFormIzmZay .OpenFormIzmZay-TopMenuPanel button {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 6px;
}
.OpenFormIzmZay .OpenFormIzmZay-TopMenuPanel button.btn-primary {
  background: var(--ek-primary) !important;
  color: #fff !important;
  border: none;
}
.OpenFormIzmZay .OpenFormIzmZay-TopMenuPanel button.btn-primary:hover {
  background: var(--ek-primary-dark) !important;
}
.OpenFormIzmZay .OpenFormIzmZay-TopMenuPanel svg {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: 0.2s;
  opacity: 0.6;
}
.OpenFormIzmZay .OpenFormIzmZay-TopMenuPanel svg:hover {
  opacity: 1;
}
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px;
}
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block {
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block p {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 6px;
}
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block input,
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block select,
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block input:focus,
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block select:focus,
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block textarea:focus {
  border-color: var(--ek-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* ---- Add Application Panel ---- */
.OpenAddZay {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  height: 100vh;
  background: #fff;
  z-index: 1050;
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  display: none;
  overflow: hidden;
}
.OpenAddZay.show-flex {
  display: flex !important;
  flex-direction: column;
}
.OpenAddZay .OpenAddZay-TopMenuPanel {
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.OpenAddZay .OpenAddZay-TopMenuPanel h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.OpenAddZay .OpenAddZay-TopMenuPanel button {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: var(--ek-primary);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.OpenAddZay .OpenAddZay-TopMenuPanel button:hover {
  background: var(--ek-primary-dark);
}
.OpenAddZay .OpenAddZay-TopMenuPanel svg {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: 0.2s;
  opacity: 0.6;
}
.OpenAddZay .OpenAddZay-TopMenuPanel svg:hover {
  opacity: 1;
}
.OpenAddZay .OpenAddZay-ConsolIzm {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px;
}
.OpenAddZay .OpenAddZay-ConsolIzm .block {
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.OpenAddZay .OpenAddZay-ConsolIzm .block p {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 6px;
}
.OpenAddZay .OpenAddZay-ConsolIzm .block input,
.OpenAddZay .OpenAddZay-ConsolIzm .block select,
.OpenAddZay .OpenAddZay-ConsolIzm .block textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.OpenAddZay .OpenAddZay-ConsolIzm .block input:focus,
.OpenAddZay .OpenAddZay-ConsolIzm .block select:focus,
.OpenAddZay .OpenAddZay-ConsolIzm .block textarea:focus {
  border-color: var(--ek-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* ---- Anketa (Full Details View) ---- */
.Anketa {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #f8f9fa;
  z-index: 1045;
  overflow-y: auto;
  display: none;
}
.Anketa .name {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.Anketa .name h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.Anketa .name p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}
.Anketa .name button {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.Anketa .name button:hover {
  background: var(--ek-primary);
  color: #fff;
  border-color: var(--ek-primary);
}
.Anketa .razdel {
  max-width: 1200px;
  margin: 24px auto 8px;
  padding: 10px 20px;
  background: var(--ek-primary-light);
  border-radius: 8px;
  text-align: center;
}
.Anketa .razdel p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ek-primary-dark);
  margin: 0;
}
.Anketa .block {
  max-width: 1200px;
  margin: 8px auto;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.Anketa .block p {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  margin: 0;
  min-width: 200px;
}
.Anketa .block input,
.Anketa .block select,
.Anketa .block textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.Anketa .block input:focus,
.Anketa .block select:focus,
.Anketa .block textarea:focus {
  border-color: var(--ek-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}
.Anketa .PlanShema,
.Anketa .PlanShemaTrubo {
  max-width: 1200px;
  margin: 16px auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}
.Anketa .PlanShema .ImgShema,
.Anketa .PlanShemaTrubo .ImgShemaTrubo {
  max-width: 100%;
  margin: 16px auto;
  text-align: center;
}
.Anketa .PlanShema .ImgShema img,
.Anketa .PlanShemaTrubo .ImgShemaTrubo img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.Anketa .PlanShema .block,
.Anketa .PlanShemaTrubo .block {
  max-width: 100%;
  margin: 8px 0;
}
.Anketa .PlanShema .KommentPlan,
.Anketa .PlanShemaTrubo .KommentPlan {
  margin: 16px 0;
}
.Anketa .PlanShema .KommentPlan p,
.Anketa .PlanShemaTrubo .KommentPlan p {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 8px;
}
.Anketa .PlanShema .KommentPlan textarea,
.Anketa .PlanShemaTrubo .KommentPlan textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.85rem;
}
.Anketa .blocktextarea {
  max-width: 1200px;
  margin: 8px auto;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.Anketa .blocktextarea p {
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 8px;
}
.Anketa .blocktextarea textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.85rem;
}

/* ---- Context Menu ---- */
.MenuZayavki {
  position: fixed;
  z-index: 1060;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 6px;
  min-width: 180px;
  display: none;
}
.MenuZayavki button,
.MenuZayavki a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
}
.MenuZayavki button:hover,
.MenuZayavki a:hover {
  background: #f1f5f9;
}
.MenuZayavki .text-danger:hover {
  background: #fef2f2;
}

/* ---- Status Badges ---- */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}
.status-main { background: #dbeafe; color: #1e40af; }
.status-reserve { background: #fef3c7; color: #92400e; }
.status-active { background: #d1fae5; color: #065f46; }
.status-montage { background: #ede9fe; color: #5b21b6; }

/* ---- Upload Pages ---- */
.upload-container {
  max-width: 600px;
  margin: 60px auto;
  padding: 40px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  text-align: center;
}
.upload-container h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.upload-container p {
  color: #64748b;
  margin-bottom: 24px;
}
.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 40px 20px;
  background: #f8fafc;
  transition: all 0.2s;
}
.upload-zone:hover {
  border-color: var(--ek-primary);
  background: var(--ek-primary-light);
}
.upload-zone i {
  font-size: 2.5rem;
  color: #94a3b8;
  margin-bottom: 12px;
}
.upload-zone input[type="file"] {
  display: block;
  margin: 12px auto;
}
.upload-zone.drag-over {
  border-color: var(--ek-primary);
  background: var(--ek-primary-light);
}
.upload-zone .file-list {
  text-align: left;
}
.upload-zone .file-item {
  font-size: 13px;
}

/* Sort & filter icons in table headers */
.sort-icon, .filter-icon {
  cursor: pointer;
  opacity: 0.5;
  margin-left: 4px;
  transition: opacity 0.2s;
}
.sort-icon:hover, .filter-icon:hover {
  opacity: 1;
}

/* Export buttons */
.export-buttons {
  display: flex;
  gap: 4px;
}

/* Theme toggle */
.theme-toggle {
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  transition: all 0.2s;
}
.theme-toggle:hover {
  background: #f1f5f9;
  color: #0d9488;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .btn-menu-toggle {
    display: block;
  }
  .OpenFormIzmZay,
  .OpenAddZay {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }
  .stat-card {
    padding: 14px;
  }
  .Anketa .block {
    flex-direction: column;
    align-items: flex-start;
  }
  .Anketa .block p {
    min-width: auto;
  }
}

/* ---- Phone inputs ---- */
.phone-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.phone-mask {
  font-family: 'Inter', monospace;
  letter-spacing: 0.5px;
}
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block .phone-mask {
  margin-bottom: 8px;
}
.OpenFormIzmZay .OpenFormIzmZay-ConsolIzm .block .phone-mask:last-of-type {
  margin-bottom: 0;
}

/* ---- Legacy table header filters ---- */
/* Hide the old filter popup divs by default */
[class^="ParametrPoisk"] {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 8px;
  min-width: 220px;
}
[class^="ParametrPoisk"] input,
[class^="ParametrPoisk"] select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.8rem;
  outline: none;
  margin-bottom: 4px;
}
[class^="ParametrPoisk"] input:focus,
[class^="ParametrPoisk"] select:focus {
  border-color: var(--ek-primary);
}
[class^="ParametrPoisk"] svg {
  width: 28px;
  height: 28px;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 4px;
}

/* Table header cells */
.table-container thead th {
  position: relative;
}
.table-container thead th > p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  display: inline;
}
/* SVG icons in table headers — filter/sort buttons */
.table-container thead th > svg {
  width: 20px;
  height: 20px;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 2px;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.table-container thead th > svg:hover {
  opacity: 1;
}

/* Table header inline styles override */
.table-container thead th > p[style] {
  width: auto !important;
}

/* Ensure table a tags don't break layout */
.table-container tbody td a {
  color: inherit;
  text-decoration: none;
}
.table-container tbody td a:hover {
  color: var(--ek-primary);
}

/* Old Header class (now unused but prevent breakage) */
.Header { display: none; }
.Main { }
.Main-Menu { display: none; }
.tablica { }
#MainPanelLeftMenu { display: none; }
.area { display: none; }
.circles { display: none; }

/* ---- Print ---- */
@media print {
  .sidebar, .main-header, .table-toolbar, .table-pagination {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0;
  }
}
