/* ==========================================================================
   2BLOVER BRAND DESIGN SYSTEM & DASHBOARD STYLES
   ========================================================================== */

:root {
  /* Brand 2BLOVER Palette */
  --pink: #c54869;
  --pink-dark: #aa3456;
  --pink-light: #fbe2dc;
  --pink-subtle: #fff2eb;
  --pink-gradient: linear-gradient(135deg, #ed4082 0%, #c54869 60%, #aa3456 100%);
  
  --blue-accent: #0d97d2;
  --blue-light: #e0f2fe;
  
  --ink: #402b25;
  --ink-light: #5a423b;
  --muted: #796e68;
  
  --paper: #fffcf8;
  --paper-card: #ffffff;
  --blush: #fcebe5;
  --soft-gradient: linear-gradient(115deg, #fff0e9 0%, #fce9e4 100%);
  
  --line: #edddd5;
  --line-soft: #f6ebe4;
  
  --font: 'Nunito', ui-rounded, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 99px;
  
  --shadow-soft: 0 8px 30px rgba(98, 67, 42, 0.06);
  --shadow-card: 0 4px 20px rgba(98, 67, 42, 0.05);
  --shadow-hover: 0 12px 36px rgba(197, 72, 105, 0.16);
  --shadow-dialog: 0 25px 80px rgba(64, 43, 37, 0.25);
  
  --transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
}
::-webkit-scrollbar-thumb {
  background: #e3cdc3;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}

/* Utilities */
.hidden {
  display: none !important;
}
.req {
  color: #e11d48;
}
.text-center {
  text-align: center;
}

/* --------------------------------------------------------------------------
   BUTTONS & COMMON INPUTS
   -------------------------------------------------------------------------- */
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  transition: var(--transition);
}
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  background: var(--pink);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(197, 72, 105, 0.25);
  border: 1px solid var(--pink);
  transition: var(--transition);
}
.button:hover {
  background: var(--pink-dark);
  border-color: var(--pink-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.button:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   LOGIN SCREEN
   -------------------------------------------------------------------------- */
.login-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #ffffff 0%, #fff2eb 55%, #fcebe5 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  padding: 44px 38px;
  box-shadow: 0 20px 60px rgba(98, 67, 42, 0.12);
  text-align: center;
  animation: modalScaleIn 0.3s ease;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.login-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.login-brand span {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #ed4082;
  line-height: 1;
}
.login-brand b {
  color: var(--blue-accent);
}

.login-header h2 {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 6px;
}
.login-header p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 26px;
}

.login-form .form-group {
  text-align: left;
  margin-bottom: 18px;
}
.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 6px;
}

.input-icon-box {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-box i {
  position: absolute;
  left: 14px;
  color: #a89d96;
  font-size: 1rem;
}
.input-icon-box input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffcf9;
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}
.input-icon-box input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(197, 72, 105, 0.15);
  background: #ffffff;
}

.btn-submit-login {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  font-size: 1rem;
}

.login-footer-hint {
  margin-top: 18px;
  font-size: 0.8rem;
  color: #9d918a;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 252, 248, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  min-height: 70px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #ed4082;
  line-height: 1.05;
}
.brand-name b {
  color: var(--blue-accent);
}
.brand-tagline {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f6f0ea;
  padding: 4px;
  border-radius: var(--radius-pill);
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-light);
  white-space: nowrap;
}
.nav-tab:hover {
  background: #ede3dc;
  color: var(--pink-dark);
}
.nav-tab.active {
  background: var(--pink);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(197, 72, 105, 0.28);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logged-user-badge {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--blush);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid #f6d8ce;
}
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.btn-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* --------------------------------------------------------------------------
   MAIN CONTAINER & CARDS
   -------------------------------------------------------------------------- */
.main-content {
  max-width: 1360px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}

.card-head-title {
  margin-bottom: 22px;
}
.card-head-title h2,
.card-head-title h3 {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.card-head-title h2 i,
.card-head-title h3 i {
  color: var(--pink);
}
.card-head-title p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   SHORTEN FORM
   -------------------------------------------------------------------------- */
.quick-shorten-bar {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  background: var(--soft-gradient);
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid #f4ded5;
}

.quick-shorten-bar .form-group {
  margin-bottom: 0;
}
.quick-shorten-bar .flex-url {
  flex: 3;
}
.quick-shorten-bar .flex-slug {
  flex: 2;
}
.quick-shorten-bar .flex-btn {
  flex: 0 0 auto;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 6px;
}
.invisible-label {
  visibility: hidden;
}

.input-box-btn {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 3px 4px 3px 14px;
  transition: var(--transition);
}
.input-box-btn:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(197, 72, 105, 0.15);
}
.input-box-btn input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  font-size: 0.95rem;
}
.btn-ghost-fetch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: #fbf1ec;
  color: var(--pink-dark);
  font-size: 0.82rem;
  font-weight: 700;
}
.btn-ghost-fetch:hover {
  background: var(--pink);
  color: #ffffff;
}

.input-prefix-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 3px 6px 3px 12px;
  transition: var(--transition);
}
.input-prefix-box:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(197, 72, 105, 0.15);
}
.input-prefix {
  font-size: 0.85rem;
  font-weight: 700;
  color: #9d8c84;
  white-space: nowrap;
  user-select: none;
}
.input-prefix-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 6px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}
.btn-random-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.95rem;
}
.btn-random-icon:hover {
  background: var(--blush);
  color: var(--pink);
}

.btn-submit-shorten {
  min-height: 46px;
  padding: 10px 28px;
}

/* OG CUSTOMIZATION SECTION */
.og-customization-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.og-custom-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 32px;
  align-items: start;
}

.subsection-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.subsection-title i {
  color: var(--pink);
}

.og-form-fields .form-group {
  margin-bottom: 16px;
}
.og-form-fields input[type="text"],
.og-form-fields input[type="url"],
.og-form-fields textarea,
.og-form-fields input[type="datetime-local"],
.og-form-fields select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffcf9;
  color: var(--ink);
  font-size: 0.93rem;
  outline: none;
  transition: var(--transition);
}
.og-form-fields input:focus,
.og-form-fields textarea:focus,
.og-form-fields select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(197, 72, 105, 0.15);
  background: #ffffff;
}

.image-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-light);
}
.radio-label input {
  accent-color: var(--pink);
}

.banner-auto-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fdf6f3;
  border: 1px dashed #f2c7b8;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--pink-dark);
}
.btn-sm-action {
  background: #ffffff;
  border: 1px solid #ebd0c4;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pink);
  white-space: nowrap;
}
.btn-sm-action:hover {
  background: var(--pink);
  color: #ffffff;
}

.file-upload-zone {
  position: relative;
  border: 2px dashed #f0c5b5;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: #fff9f6;
  cursor: pointer;
  transition: var(--transition);
}
.file-upload-zone:hover {
  border-color: var(--pink);
  background: #fff2ed;
}
.file-upload-zone i {
  font-size: 1.8rem;
  color: var(--pink);
  display: block;
  margin-bottom: 6px;
}
.file-upload-zone span {
  font-size: 0.85rem;
  color: var(--muted);
}
.file-upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-status {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #15803d;
}

.advanced-settings {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.advanced-settings summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  user-select: none;
}
.advanced-settings summary:hover {
  color: var(--pink);
}
.advanced-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   PREVIEW COLUMN & SOCIAL CARDS
   -------------------------------------------------------------------------- */
.og-preview-column {
  background: #fffdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.preview-header-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.preview-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-toggles {
  display: flex;
  gap: 6px;
  background: #f4eee9;
  padding: 3px;
  border-radius: var(--radius-pill);
}
.btn-toggle-preview {
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.btn-toggle-preview.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ZALO CARD */
.preview-zalo-card {
  background: #f4f6f8;
  padding: 16px;
  border-radius: 14px;
}
.zalo-bubble {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  border: 1px solid #eef0f3;
}
.zalo-media {
  aspect-ratio: 1.91;
  width: 100%;
  overflow: hidden;
  background: #faf6f3;
}
.zalo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zalo-content {
  padding: 12px 14px;
}
.zalo-content h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zalo-content p {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zalo-domain {
  font-size: 0.72rem;
  color: #9ca3af;
  text-transform: lowercase;
}

/* FACEBOOK CARD */
.preview-facebook-card {
  background: #f0f2f5;
  padding: 16px;
  border-radius: 14px;
}
.fb-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #ced0d4;
}
.fb-media {
  aspect-ratio: 1.91;
  width: 100%;
  overflow: hidden;
  background: #faf6f3;
}
.fb-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-content {
  padding: 10px 14px;
  background: #f0f2f5;
}
.fb-domain {
  font-size: 0.72rem;
  color: #65676b;
  text-transform: uppercase;
  font-weight: 600;
}
.fb-content h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #050505;
  line-height: 1.3;
  margin: 2px 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-content p {
  font-size: 0.8rem;
  color: #65676b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* QR & ACTION PANEL */
.preview-actions-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.qr-thumbnail-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mini-qrcode {
  width: 60px;
  height: 60px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  display: grid;
  place-items: center;
}
.mini-qrcode img, .mini-qrcode canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 6px;
}
.qr-info-text strong {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
}
.qr-info-text span {
  font-size: 0.78rem;
  color: var(--muted);
}
.preview-btns {
  display: flex;
  gap: 8px;
}
.btn-pill-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--pink-subtle);
  color: var(--pink-dark);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid #f6d8ce;
}
.btn-pill-sub:hover {
  background: var(--pink);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   LINKS TABLE
   -------------------------------------------------------------------------- */
.links-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.links-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.links-header-title h3 {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ink);
  margin: 0;
}
.count-pill {
  background: var(--blush);
  color: var(--pink-dark);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.links-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box i {
  position: absolute;
  left: 14px;
  color: #a3958e;
  font-size: 0.9rem;
}
.search-box input {
  padding: 8px 14px 8px 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fffdfa;
  outline: none;
  font-size: 0.88rem;
  width: 250px;
  transition: var(--transition);
}
.search-box input:focus {
  border-color: var(--pink);
  width: 290px;
  background: #ffffff;
}

.btn-icon-round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-light);
  background: #ffffff;
}
.btn-icon-round:hover {
  background: var(--blush);
  color: var(--pink);
  border-color: #f6d8ce;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.links-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.links-table th {
  padding: 12px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--line-soft);
  background: #faf6f2;
}
.links-table th:first-child {
  border-radius: 12px 0 0 12px;
}
.links-table th:last-child {
  border-radius: 0 12px 12px 0;
}

.links-table td {
  padding: 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.links-table tr:hover td {
  background: #fffcf9;
}

.slug-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slug-link {
  font-weight: 800;
  color: var(--pink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.slug-link:hover {
  color: var(--pink-dark);
  text-decoration: underline;
}
.created-time {
  font-size: 0.75rem;
  color: #9d8e87;
}

.orig-url-cell {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}
.orig-url-cell a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.title-og-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-og-thumb {
  width: 44px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  background: #f8ebe4;
  flex-shrink: 0;
}
.title-og-info {
  max-width: 220px;
}
.title-og-info strong {
  display: block;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title-og-info span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clicks-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: #eef8ff;
  color: #0369a1;
  font-weight: 800;
  font-size: 0.85rem;
}

/* SWITCH TOGGLE */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #10b981;
}
input:checked + .slider:before {
  transform: translateX(18px);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.btn-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  background: #f7f1ec;
}
.btn-action:hover {
  background: var(--pink);
  color: #ffffff;
}
.btn-action-del:hover {
  background: #ef4444;
  color: #ffffff;
}

.loading-td {
  text-align: center;
  padding: 40px 0 !important;
  color: var(--muted);
}
.spinner-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* PAGINATION */
.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.pagination-info {
  font-size: 0.85rem;
  color: var(--muted);
}
.pagination-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-page {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-number {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 6px;
}

/* --------------------------------------------------------------------------
   TAB 2: ANALYTICS
   -------------------------------------------------------------------------- */
.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-card);
}
.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.pink-icon { background: #ffe8ee; color: var(--pink); }
.blue-icon { background: #e0f2fe; color: var(--blue-accent); }
.green-icon { background: #dcfce7; color: #16a34a; }
.purple-icon { background: #f3e8ff; color: #9333ea; }

.metric-body {
  display: flex;
  flex-direction: column;
}
.metric-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.metric-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.15;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1.7fr 1.3fr;
  gap: 24px;
}
.chart-card {
  margin-bottom: 0;
}
.chart-header {
  margin-bottom: 18px;
}
.chart-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.chart-wrapper {
  position: relative;
  height: 300px;
}
.pie-wrapper {
  height: 280px;
}

/* --------------------------------------------------------------------------
   TAB 3: USERS
   -------------------------------------------------------------------------- */
.users-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
}
.user-form .form-group {
  margin-bottom: 16px;
}
.user-form input,
.user-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffcf9;
  outline: none;
  font-size: 0.93rem;
}
.user-form input:focus,
.user-form select:focus {
  border-color: var(--pink);
  background: #ffffff;
}
.btn-submit-user {
  width: 100%;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   MODALS / DIALOGS
   -------------------------------------------------------------------------- */
.custom-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 0;
  background: #ffffff;
  color: var(--ink);
  width: min(540px, calc(100% - 32px));
  box-shadow: var(--shadow-dialog);
  margin: auto;
}
.custom-dialog::backdrop {
  background: rgba(64, 43, 37, 0.45);
  backdrop-filter: blur(8px);
}
body:has(dialog[open]) {
  overflow: hidden;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.dialog-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.dialog-header h3 i {
  color: var(--pink);
}
.btn-close-dialog {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.btn-close-dialog:hover {
  background: var(--blush);
  color: var(--pink);
}

.dialog-body {
  padding: 24px;
}
.modal-qr-canvas {
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
  padding: 10px;
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 18px;
  display: grid;
  place-items: center;
}
.modal-qr-canvas img, .modal-qr-canvas canvas {
  width: 100% !important;
  height: 100% !important;
}

.modal-link-url {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pink);
  margin-bottom: 20px;
  word-break: break-all;
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.btn-outline-modal {
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #faf6f2;
  font-weight: 700;
  color: var(--ink);
}
.btn-outline-modal:hover {
  background: #eee5de;
}

.input-disabled {
  background: #f1ece7 !important;
  color: #7d726b !important;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.app-footer {
  margin-top: 50px;
  border-top: 1px solid var(--line-soft);
  padding: 24px;
  background: #faf6f2;
}
.footer-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 18px;
}
.footer-links a:hover {
  color: var(--pink);
}

/* --------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(64, 43, 37, 0.18);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 700;
  animation: slideToast 0.3s ease;
}
.toast-success i { color: #10b981; }
.toast-error i { color: #ef4444; }
.toast-info i { color: var(--blue-accent); }

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes modalScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .og-custom-grid {
    grid-template-columns: 1fr;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .analytics-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .users-layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .quick-shorten-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .quick-shorten-bar .flex-btn {
    margin-top: 6px;
  }
  .btn-submit-shorten {
    width: 100%;
  }
  .analytics-metrics-grid {
    grid-template-columns: 1fr;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}

/* USER ROLE BADGES */
.badge-admin {
  background: #fdf2f2 !important;
  color: var(--pink-dark) !important;
  border: 1px solid #fed7d7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge-editor {
  background: #f0f7ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge-self {
  font-size: 0.78rem;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

