/* Complete CSS rewrite with optimized styles matching the design image exactly */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@400;500;600;700&family=Roboto:wght@400;500;600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #f5f5f5;
  color: #000000;
  min-height: 100vh;
  scroll-behavior: smooth;
}

.top-header {
  width: 100%;
  background: #f0f0f0;
  color: #000000;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  flex-wrap: nowrap;
}

.top-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.top-header-brand:hover {
  opacity: 0.8;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: "Inter", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #000000;
}

.brand-tagline {
  font-size: 12px;
  color: #6b6b6b;
  letter-spacing: 0.5px;
}

.top-header-search {
  flex: 1;
  min-width: 250px;
  max-width: 650px;
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.top-header-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.account-details {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.2;
}

.account-name {
  font-weight: 600;
}

.account-role {
  font-size: 13px;
  color: #4c5b52;
}

.logout-button {
  padding: 10px 24px;
  border-radius: 20px;
  border: none;
  background: #1e5540;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.logout-button:hover {
  background: #164230;
}

.container {
  display: flex;
  min-height: calc(100vh - 190px);
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 310px;
  background-color: #ffffff;
  padding: 28px 24px;
  flex-shrink: 0;
  border-right: 1px solid #e5e5e5;
}

.sidebar-title {
  font-family: "Inter", sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
}

.sidebar-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #6b6b6b;
  margin-bottom: 28px;
  line-height: 1.5;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-label {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  display: block;
  margin-bottom: 8px;
}

.filter-input,
.filter-select {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #000000;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
  border-color: #1e5540;
}

.filter-input::placeholder {
  color: #9a9a9a;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.filter-group-half {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.filter-group-half .filter-label {
  height: 20px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-label-wrap {
  white-space: normal !important;
  height: 40px !important;
  min-height: 40px;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
}

.filter-input-small,
.filter-select-small {
  width: 100%;
  height: 35px;
  padding: 0 8px;
  border: 2px solid #e9e9e9;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #9a9a9a;
  background-color: #ffffff;
  outline: none;
}

.quick-scenarios-title {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #6b6b6b;
  margin-bottom: 12px;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-scenarios {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-scenarios .filter-select {
  color: #000000;
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

.btn-apply {
  flex: 1;
  height: 40px;
  background-color: #1e5540;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-apply:hover {
  background-color: #164230;
}

.btn-reset {
  flex: 1;
  height: 40px;
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-reset:hover {
  background-color: #f5f5f5;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  background-color: #f5f5f5;
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 48px;
  border: none;
  border-radius: 20px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #000000;
  background-color: #ffffff;
  outline: none;
  transition: box-shadow 0.2s ease;
}

.search-input::placeholder {
  color: #9a9a9a;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(30, 85, 64, 0.1);
}
/* End search header styles */

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-family: "Inter", sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 6px;
}

.page-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #6b6b6b;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px 22px;
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card-primary {
  background: #1e5540;
  border: none;
}

.stat-card-secondary {
  background: #ffffff;
  border: 2px solid #e0e0e0;
}

.stat-icon {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 52px;
  height: 48px;
}

.stat-icon svg {
  width: 100%;
  height: 100%;
}

.stat-icon img,
.stat-icon-dark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stat-icon-dark {
  position: absolute;
  top: 13px;
  right: 20px;
  width: 50px;
  height: 54px;
  color: #000000;
}

.stat-icon-dark svg {
  width: 100%;
  height: 100%;
}

.stat-title {
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 16px;
  max-width: 180px;
  line-height: 1.3;
}

.stat-title-dark {
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #000000;
  margin-bottom: 16px;
  max-width: 180px;
  line-height: 1.3;
}

.stat-value {
  font-family: "Inter", sans-serif;
  font-size: 48px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
  margin-top: auto;
}

.stat-value-dark {
  font-family: "Inter", sans-serif;
  font-size: 48px;
  font-weight: 600;
  color: #000000;
  line-height: 1;
  margin-top: auto;
}

.stat-value-large {
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #000000;
  line-height: 1.2;
  margin-top: auto;
}

/* ==================== DATA SECTION ==================== */
.data-section {
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 18px 24px;
  background: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
}

.btn-select-all {
  margin-left: 12px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #10472b;
  background: transparent;
  border: 1px solid #10472b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-select-all:hover {
  background: #10472b;
  color: #fff;
}

.btn-select-all:active {
  transform: scale(0.98);
}

.selected-count {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #000000;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.checkbox-main {
  width: 22px;
  height: 22px;
  border: 2px solid #000000;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secondary {
  height: 44px;
  padding: 0 20px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-primary {
  height: 44px;
  padding: 0 20px;
  background: #1e5540;
  border: none;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #164230;
}

.data-header-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==================== DATA TABLE ==================== */
.data-table {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 24px;
  flex: 1;
}

.table-header {
  display: grid;
  grid-template-columns: 28px 2fr 2fr 1fr 1fr 1fr 1.5fr 0.8fr;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e5e5e5;
  margin-bottom: 18px;
}

.table-cell {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-cell-checkbox {
  width: 40px;
  text-align: left;
}

.table-row {
  border-bottom: 1px solid #f0f0f0;
}

.checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid #000000;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 14px;
}

.company-name {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
}

.company-details {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #6b6b6b;
  line-height: 1.5;
}

.okved-text {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #000000;
  line-height: 1.4;
}

.status-badge,
.status-badge-yes {
  display: inline-block;
  padding: 6px 14px;
  background: #d4f4dd;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #1e5540;
  margin-bottom: 6px;
}

.update-time {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #6b6b6b;
  line-height: 1.4;
  text-align: center;
}

/* ==================== FOOTER ==================== */
.footer {
  width: 100%;
  background-color: #0d3320;
  color: #ffffff;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
}

.footer-left,
.footer-center,
.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
}

.footer-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* ==================== RESPONSIVE ==================== */

/* --- Small desktop / tablet landscape (≤ 1400px) --- */
@media (max-width: 1400px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e9e9e9;
  }

  .main-content {
    padding: 25px;
  }
}

/* --- Tablet (≤ 1024px) --- */
@media (max-width: 1024px) {
  .top-header {
    padding: 16px 24px;
    gap: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar-title {
    font-size: 22px;
  }

  .page-title {
    font-size: 24px;
  }

  .data-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .data-header-buttons {
    flex-direction: column;
  }

  .data-header-buttons .btn-primary,
  .data-header-buttons .btn-secondary {
    width: 100%;
  }

  .filters-and-tools {
    flex-direction: column;
  }

  .active-filters,
  .data-tools {
    min-width: 0;
    width: 100%;
  }

  .data-tools {
    justify-content: flex-start;
  }

  #live-search {
    min-width: 0;
  }

  .data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table table {
    min-width: 760px;
  }
}

/* --- Tablet portrait (≤ 900px) --- */
@media (max-width: 900px) {
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
  }

  .top-header-brand {
    width: 100%;
  }

  .top-header-account {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .top-header-search {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 18px 20px;
  }
}

/* --- Phones (≤ 768px) --- */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    min-height: 130px;
    padding: 16px;
  }

  .stat-title,
  .stat-title-dark {
    font-size: 15px;
    max-width: 140px;
  }

  .stat-value,
  .stat-value-dark {
    font-size: 28px;
  }

  .stat-value-large {
    font-size: 20px;
  }

  .stat-icon,
  .stat-icon-dark {
    width: 36px;
    height: 36px;
    top: 12px;
    right: 12px;
  }

  .sidebar {
    padding: 20px 15px;
  }

  .sidebar-title {
    font-size: 20px;
  }

  .sidebar-subtitle {
    font-size: 12px;
  }

  .filter-label {
    font-size: 13px;
  }

  .filter-input,
  .filter-select {
    height: 36px;
    font-size: 13px;
  }

  .main-content {
    padding: 20px 15px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .data-section {
    padding: 20px 15px;
  }

  .data-table {
    padding: 12px;
  }

  .modal-panel {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .messages {
    right: 12px;
    left: 12px;
    top: 12px;
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    top: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    font-size: 13px;
  }

  .company-tooltip {
    min-width: 0;
    max-width: calc(100vw - 24px);
  }
}

/* --- Small phones (≤ 480px) --- */
@media (max-width: 480px) {
  .top-header {
    padding: 12px 16px;
    gap: 12px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .top-header-account .account-details {
    display: none;
  }

  .top-header-account .account-avatar {
    width: 40px;
    height: 40px;
  }

  .logout-button {
    padding: 8px 16px;
    font-size: 13px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 110px;
  }

  .filter-row {
    flex-direction: column;
    gap: 16px;
  }

  .filter-actions {
    flex-direction: column;
  }

  .page-title {
    font-size: 20px;
  }

  .selected-count {
    font-size: 14px;
    flex-wrap: wrap;
  }

  .btn-select-all {
    margin-left: 0;
  }

  .pagination {
    gap: 4px;
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  #live-search {
    height: 42px;
    font-size: 14px;
  }

  .data-table table {
    min-width: 680px;
  }

  .footer-content {
    padding: 15px 12px;
  }

  .footer-icon {
    width: 24px;
    height: 24px;
  }
}

/* ==================== APPLICATION ENHANCEMENTS ==================== */
.messages {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  padding: 16px 20px;
  padding-right: 40px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  animation: slideIn 0.25s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-text {
  flex: 1;
}

.message-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 4px 8px;
  transition: opacity 0.2s ease;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.message-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.message.message-hidden {
  animation: slideOut 0.25s ease forwards;
}

.message-success {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.message-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.message-info {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #075985;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.filters-and-tools {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.active-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 300px;
}

.active-filters-title {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  color: #000000;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e9e9e9;
  font-size: 13px;
  font-weight: 500;
  color: #000000;
}

.chip-muted {
  color: #9a9a9a;
  border-style: dashed;
}

.data-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 300px;
  justify-content: flex-end;
}

#live-search {
  flex: 1;
  min-width: 240px;
  height: 48px;
  border: 2px solid #e9e9e9;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 15px;
  font-family: "Inter", sans-serif;
}

.hint {
  font-size: 13px;
  color: #9a9a9a;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table thead th {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #000000;
  padding: 12px 8px;
  border-bottom: 3px solid #e9e9e9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: left;
}

/* Чекбокс */
.data-table thead th:nth-child(1),
.data-table tbody td:nth-child(1) {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  text-align: left;
  padding: 12px 4px;
}

/* Компания */
.data-table thead th:nth-child(2),
.data-table tbody td:nth-child(2) {
  width: 28%;
  min-width: 0;
}

/* ОКВЭД */
.data-table thead th:nth-child(3),
.data-table tbody td:nth-child(3) {
  width: 12%;
  min-width: 0;
}

/* Выручка */
.data-table thead th:nth-child(4),
.data-table tbody td:nth-child(4) {
  width: 12%;
  min-width: 0;
  text-align: left;
}

/* Налоги */
.data-table thead th:nth-child(5),
.data-table tbody td:nth-child(5) {
  width: 12%;
  min-width: 0;
  text-align: left;
}

/* кол-во сотр. */
.data-table thead th:nth-child(6),
.data-table tbody td:nth-child(6) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: left;
  white-space: normal;
  text-transform: none;
  line-height: 1.3;
}

/* Аккредитация */
.data-table thead th:nth-child(7),
.data-table tbody td:nth-child(7) {
  width: 15%;
  min-width: 0;
  text-align: left;
}

/* УСН */
.data-table thead th:nth-child(8),
.data-table tbody td:nth-child(8) {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  text-align: left;
}

.data-table tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.5;
  text-align: left;
}

.table-cell-checkbox {
  width: 40px;
  text-align: left;
}

.row-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid #000000;
  border-radius: 4px;
  cursor: pointer;
}

.table-cell .company-name {
  font-family: "Roboto", sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #000000;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.table-cell .company-details {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: #9a9a9a;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.table-cell .okved-text {
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
}

.status-badge {
  display: inline-block;
  padding: 7px 18px;
  background: #b3f092;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #0d3521;
}

.status-badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge-muted {
  background: #f5f5f5;
  color: #9a9a9a;
}

.status-badge-yes {
  display: inline-block;
  padding: 7px 18px;
  background: #b3f092;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #0d3521;
}

.update-time {
  font-size: 14px;
  color: #9a9a9a;
  margin-top: 6px;
  text-align: left;
}

details summary {
  padding: 8px 14px;
  background: #e9e9e9;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

details summary::-webkit-details-marker {
  display: none;
}

details ul {
  list-style: none;
  padding-left: 0;
  margin-top: 12px;
}

details li {
  padding: 6px 0;
  color: #6c6c6c;
  font-size: 14px;
}

.selection-note {
  font-size: 13px;
  color: #9a9a9a;
  margin-top: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-panel {
  position: relative;
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
  width: min(480px, calc(100% - 40px));
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.modal-summary {
  padding: 14px 16px;
  border: 1px dashed #e9e9e9;
  border-radius: 12px;
  color: #6c6c6c;
  font-size: 14px;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-control {
  display: block;
  margin-bottom: 18px;
}

.form-control span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-control select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9e9e9;
  border-radius: 12px;
  font-size: 15px;
}

.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-ghost {
  border: 2px solid #e9e9e9;
  background: transparent;
  color: #000000;
}

.btn-ghost:hover {
  background-color: #f5f5f5;
  border-color: #d6d6d6;
}

.btn-link {
  color: #10472b;
  font-weight: 600;
  text-decoration: none;
}

.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5500;
}

.toast {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid #e9e9e9;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  max-width: 360px;
  position: relative;
}

.toast-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.pagination-btn {
  min-width: 42px;
  height: 42px;
  border: 2px solid #e9e9e9;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #000000;
  background: #ffffff;
}

.pagination-btn.active {
  background: linear-gradient(180deg, #10472b 0%, #23774e 100%);
  color: #ffffff;
  border-color: transparent;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== COMPANY TOOLTIP ==================== */
.company-tooltip {
  position: fixed;
  background: #ffffff;
  border: 2px solid #e9e9e9;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  max-width: 400px;
  min-width: 300px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.company-tooltip.tooltip-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.tooltip-header {
  border-bottom: 2px solid #e9e9e9;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.tooltip-header h5 {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.tooltip-inn {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: #9a9a9a;
  margin: 0;
}

.tooltip-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.tooltip-label {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: #4c5b52;
  flex-shrink: 0;
  min-width: 140px;
}

.tooltip-row span:not(.tooltip-label) {
  font-family: "Inter", sans-serif;
  color: #000000;
  text-align: right;
  word-break: break-word;
}

.company-name {
  cursor: pointer;
  position: relative;
}
