/* ============================
   LINKVAULT — STYLES
   ============================ */

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

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --bg4: #222230;
  --border: #2a2a3a;
  --border2: #383850;
  --text: #e8e8f0;
  --text2: #9090a8;
  --text3: #606078;
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --accent-glow: rgba(108,92,231,0.2);
  --green: #00d68f;
  --red: #ff4757;
  --yellow: #ffa502;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: 'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --sidebar-w: 240px;
}

html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--accent2); text-decoration: none; }
input, select, textarea { font-family: var(--font); }
button { cursor: pointer; font-family: var(--font); }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }

/* ============================
   AUTH
   ============================ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-bg {
  position: fixed; inset: 0; pointer-events: none;
}
.auth-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.15;
}
.orb1 { width: 500px; height: 500px; background: #6c5ce7; top: -100px; left: -100px; }
.orb2 { width: 400px; height: 400px; background: #a29bfe; bottom: -80px; right: 100px; animation: float 8s ease-in-out infinite; }
.orb3 { width: 300px; height: 300px; background: #00d68f; top: 50%; left: 60%; animation: float 10s ease-in-out infinite reverse; }

@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-30px)} }

.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow), 0 0 80px rgba(108,92,231,0.08);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }

.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.logo-icon { font-size: 28px; color: var(--accent); }
.logo-text { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--text); }

.auth-card h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--text2); margin-bottom: 28px; }

.auth-divider { text-align: center; position: relative; margin: 20px 0; }
.auth-divider::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px; background:var(--border); }
.auth-divider span { background: var(--bg2); padding: 0 12px; color: var(--text3); position: relative; z-index: 1; font-size: 12px; }

.auth-switch { margin-top: 20px; text-align: center; color: var(--text2); font-size: 13px; }
.auth-error { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ============================
   FORMS
   ============================ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text2); font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 14px; transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder, textarea::placeholder { color: var(--text3); }
.required { color: var(--red); }

/* ============================
   BUTTONS
   ============================ */
.btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { background: #7d6ef0; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,92,231,0.35); }
.btn-secondary {
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg4); border-color: var(--border2); color: var(--text); }
.btn-danger {
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 10px 20px; font-size: 14px; font-weight: 600;
}
.btn-google {
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.2s;
}
.btn-google:hover { background: var(--bg4); border-color: var(--border2); }
.full { width: 100%; justify-content: center; }

kbd {
  background: rgba(255,255,255,0.1); border-radius: 4px;
  padding: 2px 6px; font-size: 11px; font-family: var(--font-mono);
}

/* ============================
   APP LAYOUT
   ============================ */
.app { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto; flex-shrink: 0;
  transition: width 0.25s;
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px 16px;
}
.sidebar-logo { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle { background: none; border: none; color: var(--text2); font-size: 18px; }

.workspace-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; margin: 0 8px 12px;
  background: var(--bg3); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.ws-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.ws-info { display: flex; flex-direction: column; min-width: 0; }
.ws-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-plan { font-size: 11px; color: var(--green); font-weight: 500; }

.btn-create-link {
  margin: 0 8px 16px; width: calc(100% - 16px);
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); padding: 10px 16px;
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.btn-create-link:hover { background: #7d6ef0; }

.sidebar-nav { flex: 1; padding: 0 8px; }
.sidebar-bottom { padding: 8px; border-top: 1px solid var(--border); margin-top: auto; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  color: var(--text2); font-size: 13px; font-weight: 500;
  margin-bottom: 2px; transition: all 0.15s; position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent2); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--accent);
  color: #fff; border-radius: 10px; padding: 1px 7px;
  font-size: 11px; font-weight: 700;
}

.usage-widget {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin: 8px 0;
}
.usage-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; color: var(--text2); }
.usage-bar { height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.usage-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 2px; transition: width 0.5s; }
.usage-reset { font-size: 11px; color: var(--text3); margin-top: 6px; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; margin-top: 4px;
}
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #6c5ce7, #00d68f); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-info span:first-child { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email-small { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { background: none; border: none; color: var(--text3); font-size: 16px; padding: 4px; transition: color 0.2s; }
.btn-logout:hover { color: var(--red); }

/* ============================
   MAIN CONTENT
   ============================ */
.main-content { flex: 1; overflow-y: auto; background: var(--bg); }

.section { padding: 32px; display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.section-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.section-header h1 { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.section-sub { color: var(--text2); margin-top: 4px; }
.section-actions { display: flex; align-items: center; gap: 12px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 14px;
}
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 200px; }
.search-box input::placeholder { color: var(--text3); }

/* ============================
   LINKS TABLE
   ============================ */
.links-table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.links-table { width: 100%; border-collapse: collapse; }
.links-table th {
  padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text3); background: var(--bg3); border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.links-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.links-table tr:last-child td { border-bottom: none; }
.links-table tr:hover td { background: rgba(255,255,255,0.02); }

.link-cell { display: flex; flex-direction: column; gap: 2px; }
.link-short { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--accent2); }
.link-nickname { font-size: 12px; color: var(--text2); }
.link-dest { font-size: 12px; color: var(--text3); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clicks-badge { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.status-badge.active { background: rgba(0,214,143,0.12); color: var(--green); }
.status-badge.inactive { background: rgba(255,71,87,0.12); color: var(--red); }

.row-actions { display: flex; gap: 6px; }
.row-actions button {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 9px; font-size: 12px;
  color: var(--text2); transition: all 0.15s;
}
.row-actions button:hover { background: var(--bg4); color: var(--text); }
.row-actions .btn-del:hover { background: rgba(255,71,87,0.1); border-color: var(--red); color: var(--red); }

.empty-row td { padding: 60px 20px; }
.empty-state { text-align: center; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { color: var(--text2); margin-bottom: 16px; }

/* ============================
   STATS / TRAFFIC
   ============================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  text-align: center; transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-icon { font-size: 28px; margin-bottom: 10px; }
.stat-value { font-family: var(--font-display); font-size: 36px; font-weight: 800; color: var(--accent2); }
.stat-label { color: var(--text2); font-size: 13px; margin-top: 4px; }

.traffic-chart-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.traffic-chart-wrap h3 { font-family: var(--font-display); margin-bottom: 20px; font-size: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 120px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-fill { width: 100%; background: linear-gradient(180deg, var(--accent), #a29bfe); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.5s; }
.bar-label { font-size: 11px; color: var(--text3); }
.bar-value { font-size: 11px; color: var(--text2); font-weight: 600; }

/* ============================
   USERS
   ============================ */
.users-list { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #a29bfe); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-detail { display: flex; align-items: center; gap: 10px; flex: 1; }
.user-role-badge { padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.user-role-badge.owner { background: rgba(108,92,231,0.2); color: var(--accent2); }
.user-role-badge.admin { background: rgba(255,165,2,0.15); color: var(--yellow); }
.user-role-badge.editor { background: rgba(0,214,143,0.12); color: var(--green); }
.user-email-text { color: var(--text3); font-size: 13px; flex: 1; }
.user-status { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.user-status.active { background: rgba(0,214,143,0.12); color: var(--green); }
.user-status.pending { background: rgba(255,165,2,0.15); color: var(--yellow); }

/* ============================
   DOMAINS
   ============================ */
.domains-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.domain-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.default-domain { border-color: var(--accent); }
.domain-icon { font-size: 20px; }
.domain-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.domain-name { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.domain-tag { background: rgba(108,92,231,0.2); color: var(--accent2); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.domain-status { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.domain-status.active { background: rgba(0,214,143,0.12); color: var(--green); }

.domain-instructions { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.domain-instructions h3 { margin-bottom: 16px; font-family: var(--font-display); }
.domain-instructions ol { padding-left: 20px; color: var(--text2); line-height: 2; }
code { font-family: var(--font-mono); background: var(--bg4); padding: 2px 8px; border-radius: 4px; color: var(--accent2); }

/* ============================
   BULK IMPORT
   ============================ */
.bulk-import-wrap { display: grid; gap: 20px; }
.bulk-drop-zone {
  background: var(--bg2); border: 2px dashed var(--border);
  border-radius: var(--radius-lg); padding: 48px;
  text-align: center; transition: all 0.2s;
}
.bulk-drop-zone:hover { border-color: var(--accent); background: var(--bg3); }
.drop-icon { font-size: 48px; margin-bottom: 12px; }
.drop-sub { color: var(--text3); margin: 8px 0; }
.bulk-template { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.bulk-template h3 { margin-bottom: 14px; font-family: var(--font-display); }
.code-block { font-family: var(--font-mono); font-size: 13px; background: var(--bg4); border-radius: var(--radius); padding: 16px; color: var(--accent2); line-height: 1.8; margin-bottom: 14px; }
.bulk-preview { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }

/* ============================
   SETTINGS
   ============================ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 20px; }
.settings-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.settings-card h3 { font-family: var(--font-display); font-size: 16px; margin-bottom: 20px; }
.danger-zone { border-color: rgba(255,71,87,0.3); }
.license-info { text-align: center; }
.license-badge { background: rgba(0,214,143,0.12); color: var(--green); padding: 8px 20px; border-radius: var(--radius); font-weight: 700; font-size: 16px; margin-bottom: 16px; display: inline-block; }
.license-info p { color: var(--text2); margin: 6px 0; font-size: 13px; }

/* ============================
   INTEGRATIONS
   ============================ */
.integrations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.integration-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: border-color 0.2s; }
.integration-card:hover { border-color: var(--border2); }
.int-logo { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.fb-logo { background: #1877f2; color: #fff; }
.tt-logo { background: #000; color: #fff; font-style: italic; }
.ga-logo { background: #e8710a; color: #fff; }
.gtm-logo { background: #8ab4f8; color: #fff; }
.wh-logo { background: #6c5ce7; color: #fff; }
.sl-logo { background: #4a154b; color: #fff; }
.em-logo { background: #ea4335; color: #fff; }
.zap-logo { background: #ff4a00; color: #fff; }
.integration-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.integration-card p { color: var(--text2); font-size: 12px; margin-bottom: 14px; }

/* ============================
   AFFILIATE
   ============================ */
.affiliate-hero { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 28px; }
.affiliate-stat { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; }
.aff-value { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--accent2); }
.aff-label { color: var(--text2); font-size: 13px; margin-top: 4px; }
.affiliate-link-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.affiliate-link-box label { display: block; margin-bottom: 10px; color: var(--text2); font-size: 13px; font-weight: 500; }
.copy-row { display: flex; gap: 10px; }
.copy-row input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); font-family: var(--font-mono); font-size: 13px; outline: none; }
.affiliate-how { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.affiliate-how h3 { font-family: var(--font-display); margin-bottom: 20px; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 16px; }
.how-step { text-align: center; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.how-step p { font-size: 13px; color: var(--text2); }

/* ============================
   CREATE LINK MODAL
   ============================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
  animation: fadeOverlay 0.2s ease;
}
@keyframes fadeOverlay { from{opacity:0} to{opacity:1} }

.link-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 90%; max-width: 700px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow), 0 0 100px rgba(108,92,231,0.15);
  animation: slideUp 0.25s ease;
}

.link-modal-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.link-modal-header h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; flex: 1; }
.link-modal-tabs { display: flex; gap: 4px; background: var(--bg3); border-radius: 8px; padding: 3px; }
.tab-btn { background: none; border: none; padding: 6px 14px; border-radius: 6px; font-size: 13px; color: var(--text2); transition: all 0.15s; }
.tab-btn.active { background: var(--bg4); color: var(--text); }
.link-modal-actions { display: flex; gap: 8px; }

.link-modal-body { overflow-y: auto; padding: 24px; flex: 1; }

.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text3); margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.option-group { margin-bottom: 16px; }
.option-label { font-size: 13px; color: var(--text2); font-weight: 500; margin-bottom: 10px; }

.targeting-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.target-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; font-size: 13px; color: var(--text2); transition: all 0.15s; }
.target-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent2); }

.multi-select { height: 120px; }
.device-targets { display: grid; gap: 10px; }

.toggle-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.toggle-option:last-child { border-bottom: none; }
.opt-desc { font-size: 12px; color: var(--text3); margin-top: 2px; }

.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--bg4);
  border-radius: 22px; cursor: pointer; transition: 0.3s;
  border: 1px solid var(--border);
}
.slider:before {
  content: ''; position: absolute; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text3);
  left: 2px; top: 2px; transition: 0.3s;
}
input:checked + .slider { background: var(--accent); border-color: var(--accent); }
input:checked + .slider:before { transform: translateX(18px); background: #fff; }

.toggle-sub { padding: 12px 0; }
.toggle-sub input, .toggle-sub select, .toggle-sub textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 14px; outline: none; margin-bottom: 8px;
}

.toggle-row { display: flex; align-items: center; gap: 12px; }

.slug-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slug-row select, .slug-row input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  color: var(--text); font-size: 13px; outline: none;
}
.slug-row select { min-width: 140px; }
.slug-row input[type="text"] { flex: 1; }
.slug-row input[type="hidden"] { display: none; }
.domain-prefix {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  color: var(--text2); font-size: 13px; font-family: var(--font-mono);
}
.slug-sep { color: var(--text3); font-size: 18px; }

.link-preview-bar {
  margin-top: 10px; padding: 8px 14px;
  background: var(--bg4); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 13px; color: var(--accent2);
}

.qr-preview-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qr-placeholder {
  width: 80px; height: 80px; background: var(--bg3);
  border: 1px dashed var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text3); text-align: center; padding: 8px;
}
#qr-canvas { width: 80px; height: 80px; border-radius: var(--radius); }
.qr-btn { padding: 7px 14px; font-size: 12px; }

.utm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.utm-grid input {
  width: 100%; padding: 8px 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); outline: none;
}
#og-title, #og-description, #og-image { margin-bottom: 8px; }

.exp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
textarea { font-family: var(--font); background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); outline: none; resize: vertical; width: 100%; }

.rotate-url-row { display: flex; gap: 8px; margin-bottom: 8px; }
.rotate-url-row input { flex: 1; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); outline: none; }
.rotate-url-row button { background: var(--accent); color: #fff; border: none; border-radius: var(--radius); width: 32px; font-size: 18px; }

/* ============================
   PRICING MODAL
   ============================ */
.pricing-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  width: 90%; max-width: 480px; position: relative;
  animation: slideUp 0.3s ease;
}
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text2); font-size: 18px; }
.pricing-header { text-align: center; margin-bottom: 24px; }
.pricing-header h2 { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.pricing-header p { color: var(--text2); }

.pricing-card-featured {
  background: linear-gradient(135deg, rgba(108,92,231,0.1), rgba(162,155,254,0.05));
  border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 28px;
  text-align: center; position: relative;
}
.pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 4px 16px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.pricing-price { display: flex; align-items: flex-start; justify-content: center; gap: 4px; margin: 16px 0 8px; }
.currency { font-size: 24px; font-weight: 700; color: var(--accent2); margin-top: 8px; }
.amount { font-family: var(--font-display); font-size: 72px; font-weight: 800; color: var(--text); line-height: 1; }
.period { font-size: 14px; color: var(--text2); align-self: flex-end; margin-bottom: 12px; }
.pricing-desc { color: var(--text2); margin-bottom: 20px; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-features li { padding: 6px 0; color: var(--text2); font-size: 13px; border-bottom: 1px solid var(--border); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-btn { font-size: 16px; padding: 14px; }
.pricing-note { font-size: 12px; color: var(--text3); margin-top: 12px; }

/* ============================
   SMALL MODALS
   ============================ */
.small-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  width: 90%; max-width: 400px; animation: slideUp 0.25s ease;
}
.small-modal h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.confirm-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  width: 90%; max-width: 380px; animation: slideUp 0.25s ease;
}
.confirm-card h3 { font-family: var(--font-display); margin-bottom: 10px; }
.confirm-card p { color: var(--text2); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ============================
   TOAST
   ============================ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px;
  color: var(--text); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); animation: slideUp 0.25s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--green); background: rgba(0,214,143,0.08); }
.toast.error { border-color: var(--red); background: rgba(255,71,87,0.08); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar .logo-text, .sidebar .ws-info, .sidebar .nav-item span:not(.nav-icon), .sidebar .user-info, .sidebar .btn-logout, .sidebar .ws-name, .sidebar .ws-plan, .usage-widget { display: none; }
  .btn-create-link span:last-child { display: none; }
  .btn-create-link { justify-content: center; padding: 10px; }
  .section { padding: 16px; }
  .section-header { flex-direction: column; }
  .section-actions { width: 100%; }
  .affiliate-hero { grid-template-columns: 1fr; }
  .utm-grid { grid-template-columns: 1fr; }
  .exp-row { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
