/* =========================================================
   APP SMART LINK
   ========================================================= */

.smart-link-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.smart-link-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.smart-link-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.smart-link-card-header h3 {
  margin: 0;
  font-size: 22px;
}

.smart-link-card-header span {
  font-size: 14px;
  color: var(--muted);
}

.smart-link-create {
  padding: 20px 22px;
  display: flex;
  justify-content: flex-start;
}

.smart-link-form-wrap {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

.smart-link-form-wrap.open {
  max-height: 1200px;
  opacity: 1;
}

.smart-link-form {
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.smart-link-form-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.smart-link-form-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.smart-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.smart-link-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.smart-link-field--full {
  grid-column: 1 / -1;
}

.smart-link-field span {
  font-size: 13px;
  color: var(--muted);
}

.smart-link-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-sizing: border-box;
}

.smart-link-field input[readonly] {
  color: #cbd5e1;
}

.smart-link-result {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.smart-link-result-label {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.smart-link-result-url {
  font-size: 15px;
  font-weight: 700;
  word-break: break-word;
  color: #fff;
}

.smart-link-form-actions {
  display: flex;
  justify-content: flex-start;
}

.smart-link-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 16px;
}

.smart-link-stat-card {
  padding: 18px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.smart-link-stat-card.is-primary {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(124, 58, 237, 0.12));
  border-color: rgba(124, 58, 237, 0.28);
}

.smart-link-stat-card.is-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(34, 197, 94, 0.12));
  border-color: rgba(34, 197, 94, 0.28);
}

.smart-link-stat-label {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.smart-link-stat-card strong {
  font-size: 28px;
  color: #fff;
}

.smart-link-table-wrap {
  overflow-x: auto;
}

.smart-link-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
}

.smart-link-table thead th {
  padding: 16px 18px;
  text-align: left;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.smart-link-table tbody td {
  padding: 18px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.smart-link-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.smart-link-table tbody tr:last-child td {
  border-bottom: none;
}

.smart-link-table-title {
  font-weight: 600;
  color: #fff;
}

.smart-link-url-cell {
  max-width: 280px;
  color: #cbd5e1;
  word-break: break-word;
}

.smart-link-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #34d399;
  font-size: 13px;
  font-weight: 600;
}

.smart-link-actions {
  display: flex;
  gap: 8px;
}

.smart-link-action-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.smart-link-empty {
  padding: 22px;
  color: var(--muted);
  font-size: 14px;
}

/* =========================================================
   TABLE ALIGN FIX (НОВЫЙ ПРАВИЛЬНЫЙ)
   ========================================================= */

.smart-link-table th:not(:nth-child(1)):not(:nth-child(2)),
.smart-link-table td:not(:nth-child(1)):not(:nth-child(2)) {
  text-align: center;
}

.smart-link-actions {
  justify-content: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1180px) {
  .smart-link-stats {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 960px) {
  .smart-link-grid {
    grid-template-columns: 1fr;
  }

  .smart-link-stats {
    grid-template-columns: 1fr 1fr;
  }

  .smart-link-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .smart-link-card-header {
    padding: 18px 16px;
  }

  .smart-link-create {
    padding: 16px;
  }

  .smart-link-form {
    padding: 0 16px 16px;
  }

  .smart-link-stats {
    grid-template-columns: 1fr;
  }

  .smart-link-stat-card strong {
    font-size: 24px;
  }
}