*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portal-back {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
}
.portal-back:hover { color: #2563eb; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon { font-size: 2rem; }

.brand-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.tagline {
  font-size: 0.75rem;
  color: #64748b;
}

.main-container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

.shorten-hero-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
  margin-bottom: 32px;
}

.shorten-hero-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  text-align: center;
}

.shorten-hero-card .subtitle {
  color: #64748b;
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 28px;
}

.url-input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .url-input-container {
    flex-direction: column;
  }
}

.url-input-container input {
  flex: 1;
  padding: 14px 18px;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s;
}

.url-input-container input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.custom-slug-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.custom-slug-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.badge-pro-inline {
  background: #fef3c7;
  color: #d97706;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.slug-input-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
}

.domain-prefix {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.9rem;
  padding-right: 4px;
}

.slug-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 600;
}

.result-card {
  margin-top: 24px;
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.result-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.short-link-href {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e40af;
  text-decoration: none;
  word-break: break-all;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.btn-copy {
  background: #0f172a;
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-qr {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Dashboard */
.links-dashboard {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.dashboard-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.btn-refresh {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.table-responsive {
  overflow-x: auto;
}

.links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.links-table th {
  text-align: left;
  padding: 12px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
}

.links-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.badge-clicks {
  background: #ecfdf5;
  color: #059669;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 20px;
}

.action-btns {
  display: flex;
  gap: 6px;
}

.btn-table-action {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-table-action.delete {
  color: #ef4444;
}

/* Mini modal */
.mini-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.mini-modal {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.btn-primary-sm {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 14px;
  cursor: pointer;
}

.app-footer {
  text-align: center;
  padding: 32px;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 40px;
  border-top: 1px solid #e2e8f0;
}
