/* ============================================================
   Linkorilla — Layout CSS
   Sidebar/app shell, settings layout, link show page,
   auth layout, tag/folder, plan/subscription components.
   !! DO NOT modify this file when rewriting app.css !!
   ============================================================ */

/* ============================================================
   APP SHELL — sidebar layout
   ============================================================ */
.app-body { background: var(--stripe-navy); }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--stripe-navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.01em;
}
.sidebar-brand:hover { text-decoration: none; color: #fff; }

.sidebar-brand-icon {
  width: 28px;
  height: 28px;
  background: var(--stripe-purple);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 1rem .75rem .25rem;
}

.sidebar-section-label {
  font-size: .68rem;
  font-weight: 600;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 .5rem;
  margin-bottom: .35rem;
}

.sidebar-nav {
  padding: .5rem .75rem;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .15rem;
  transition: background .15s, color .15s;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(99,91,255,.25);
  color: #fff;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--stripe-purple);
  border-radius: 0 2px 2px 0;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .75;
}
.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon { opacity: 1; }

.sidebar-footer {
  padding: .75rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: .875rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.sidebar-logout:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ---- App Main ---- */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--stripe-bg);
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--stripe-border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: .75rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }

.topbar-workspace {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--stripe-bg);
  border: 1px solid var(--stripe-border);
  border-radius: var(--radius-sm);
  padding: .3rem .75rem;
}

.topbar-user {
  font-size: .8rem;
  color: var(--text-secondary);
}

/* ---- Page content ---- */
.container {
  max-width: 100%;
  padding: 2rem 2.5rem;
}

/* ---- Flash messages ---- */
.flash-wrapper { padding: 0 2.5rem; }
.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.flash-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid #A3D9B1; }
.flash-error   { background: var(--danger-bg);  color: var(--danger-fg);  border: 1px solid #F7B4C7; }
.flash-warning { background: var(--warning-bg); color: var(--warning-fg); border: 1px solid #F5D87A; }
.flash-info    { background: var(--info-bg);    color: var(--info-fg);    border: 1px solid #93C5FD; }

/* ============================================================
   SETTINGS LAYOUT — vertical sidebar + content
   ============================================================ */
.settings-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.settings-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 1.5rem);
}

.settings-sidebar-title {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 .75rem;
  margin-bottom: .75rem;
}

.settings-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .1rem;
  transition: background .15s, color .15s;
}
.settings-nav-link:hover { background: var(--stripe-border); color: var(--text-primary); text-decoration: none; }
.settings-nav-link.active { background: rgba(99,91,255,.1); color: var(--stripe-purple); font-weight: 600; }
.settings-nav-link .pro-chip {
  font-size: .65rem;
  font-weight: 700;
  background: rgba(99,91,255,.15);
  color: var(--stripe-purple);
  border-radius: 99px;
  padding: .1rem .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.settings-content {
  flex: 1;
  min-width: 0;
}

/* Legacy tabs — kept for any remaining horizontal tab use */
.settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--stripe-border);
}

.tab {
  padding: .6rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text-primary); text-decoration: none; }
.tab.active { color: var(--stripe-purple); border-bottom-color: var(--stripe-purple); font-weight: 600; }

/* ============================================================
   LINK SHOW — full dashboard
   ============================================================ */
.link-show-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; }
.link-show-breadcrumb { font-size: .78rem; color: var(--text-muted); margin-bottom: .2rem; }
.breadcrumb-link { color: var(--text-muted); }
.breadcrumb-link:hover { color: var(--stripe-purple); text-decoration: none; }
.breadcrumb-sep { margin: 0 .3rem; color: var(--text-muted); }
.link-show-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.link-show-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .35rem; }
.link-show-header-actions { display: flex; gap: .5rem; flex-shrink: 0; }

.period-selector { display: flex; gap: .25rem; align-items: center; }
.period-btn {
  padding: .3rem .7rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--stripe-border);
  transition: all .15s;
}
.period-btn.active { background: var(--stripe-navy); color: #fff; border-color: var(--stripe-navy); }
.period-btn:hover:not(.active) { background: var(--stripe-bg); color: var(--text-primary); text-decoration: none; }

.link-config-grid { display: grid; grid-template-columns: 1fr 330px; gap: 1.5rem; align-items: start; }
.link-config-left { display: flex; flex-direction: column; gap: 1.5rem; }
.link-config-right { display: flex; flex-direction: column; gap: 1.5rem; }

.slug-display { display: flex; align-items: center; gap: .5rem; background: var(--stripe-bg); border: 1px solid var(--stripe-border); border-radius: var(--radius-sm); padding: .45rem .75rem; }
.slug-display code { flex: 1; font-family: monospace; font-size: .85rem; color: var(--text-secondary); }
.btn-copy-inline { background: none; border: 1px solid var(--stripe-border); border-radius: var(--radius-sm); cursor: pointer; padding: .15rem .4rem; font-size: .8rem; color: var(--text-muted); }
.btn-copy-inline:hover { background: var(--stripe-bg); color: var(--text-primary); }

/* Live Preview */
.link-live-preview { padding: 1.25rem; }
.link-live-preview h3 { font-size: .85rem; font-weight: 600; margin-bottom: .75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; padding: 0; }
.preview-browser-bar { background: var(--stripe-bg); border-radius: var(--radius) var(--radius) 0 0; border: 1px solid var(--stripe-border); padding: .45rem .75rem; display: flex; align-items: center; gap: .65rem; }
.preview-dots { display: flex; gap: 5px; }
.preview-dots span { width: 9px; height: 9px; border-radius: 50%; display: block; }
.preview-dots span:nth-child(1) { background: #FF5F56; }
.preview-dots span:nth-child(2) { background: #FFBD2E; }
.preview-dots span:nth-child(3) { background: #27C93F; }
.preview-url-bar { font-size: .75rem; color: var(--text-secondary); background: #fff; border: 1px solid var(--stripe-border); border-radius: var(--radius-sm); padding: .2rem .6rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.preview-destination { border: 1px solid var(--stripe-border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: .75rem; background: #fff; }
.preview-dest-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; margin-bottom: .2rem; }
.preview-dest-url { font-size: .875rem; font-weight: 600; }
.preview-dest-path { font-size: .75rem; color: var(--text-muted); }
.preview-stats-row { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; font-size: .78rem; color: var(--text-muted); }

/* QR config card */
.qr-config-card { padding: 1.25rem; }
.qr-config-card h2 { font-size: .85rem; font-weight: 600; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); padding: 0; }
.qr-preview-box { display: flex; justify-content: center; margin-bottom: .875rem; }
.qr-preview-box img { border-radius: var(--radius); border: 1px solid var(--stripe-border); }
.qr-url-display { text-align: center; font-size: .72rem; color: var(--text-muted); word-break: break-all; margin-bottom: .875rem; }
.qr-color-pickers { background: var(--stripe-bg); border-radius: var(--radius); padding: .75rem; margin-bottom: .875rem; border: 1px solid var(--stripe-border); }
.qr-download-actions { display: flex; flex-direction: column; gap: .4rem; }

/* Danger Zone */
.dns-record-box { background: var(--stripe-navy); border-radius: var(--radius); overflow: hidden; margin-bottom: .75rem; }
.dns-record-box table { margin: 0; }
.dns-record-box th { background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); }
.dns-record-box td { border-color: rgba(255,255,255,.08); color: #e2e8f0; }
.danger-zone { padding: 1.25rem; border: 1px solid #F7B4C7 !important; background: #FFFBFC !important; box-shadow: none !important; }
.danger-zone h3 { font-size: .875rem; font-weight: 600; color: var(--danger-fg); margin-bottom: .5rem; padding: 0; }
.danger-zone p { font-size: .8rem; color: var(--text-muted); margin-bottom: .875rem; }

/* Analytics 3-col */
.analytics-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

/* Link dashboard old grid (fallback) */
.link-dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; }
.qr-side-card { padding: 1.25rem; }
.qr-side-card h2 { font-size: .875rem; margin-bottom: 1rem; font-weight: 600; padding: 0; }
.qr-side-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }

/* ============================================================
   TAG / FOLDER
   ============================================================ */
.tag-badge { background: #EDE9FE; color: #6D28D9; font-size: .7rem; padding: .15rem .45rem; border-radius: 99px; font-weight: 500; }
.tag-filter-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .75rem 0 .875rem; }
.tag-filter-label { font-size: .78rem; color: var(--text-secondary); font-weight: 600; margin-right: .1rem; }
.tag-pill { border: 1px solid var(--stripe-border); background: #fff; color: var(--text-secondary); font-size: .78rem; padding: .25rem .7rem; border-radius: 99px; cursor: pointer; transition: all .15s; font-family: inherit; }
.tag-pill.active { background: var(--stripe-navy); color: #fff; border-color: var(--stripe-navy); }
.tag-pill:hover:not(.active) { background: var(--stripe-bg); border-color: #C8D0DC; }

/* ============================================================
   DASHBOARD ACCORDION
   ============================================================ */
.folder-accordion { border: 1px solid var(--stripe-border); border-radius: var(--radius-lg); margin-bottom: .75rem; background: #fff; box-shadow: var(--stripe-shadow); overflow: hidden; }
.folder-accordion-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  cursor: pointer;
  background: #fff;
  font-weight: 600;
  font-size: .875rem;
  list-style: none;
  user-select: none;
  transition: background .15s;
}
.folder-accordion-header::-webkit-details-marker { display: none; }
.folder-accordion[open] > .folder-accordion-header { border-bottom: 1px solid var(--stripe-border); }
.folder-accordion-header:hover { background: var(--stripe-bg); }
.folder-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.folder-accordion-name { flex: 1; }
.folder-accordion-count { background: var(--stripe-bg); color: var(--text-muted); font-size: .72rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--stripe-border); font-weight: 600; }
.folder-accordion-body { padding: 0; }
.folder-accordion-body .table td:first-child { padding-left: 1.25rem; }
.folder-accordion-body .table td:last-child { padding-right: 1.25rem; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar { background: var(--stripe-border); border-radius: 99px; height: 5px; margin-top: .5rem; overflow: hidden; }
.progress-fill { background: var(--stripe-purple); height: 100%; border-radius: 99px; transition: width .4s ease; }

/* ============================================================
   SETTINGS — subscription/billing
   ============================================================ */
.plan-info-row { display: flex; gap: 1.5rem; align-items: flex-start; }
.plan-badge { padding: .4rem 1.2rem; border-radius: 99px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.plan-badge-pro  { background: linear-gradient(135deg, var(--stripe-purple), #8B5CF6); color: #fff; }
.plan-badge-free { background: var(--stripe-bg); color: var(--text-secondary); border: 1px solid var(--stripe-border); }
.plan-details { flex: 1; font-size: .875rem; }
.subscription-actions { display: flex; flex-direction: column; }
.subscription-action-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--stripe-border); }
.subscription-action-row:last-child { border-bottom: none; }
.subscription-action-row > div { flex: 1; }
.subscription-action-row strong { font-size: .875rem; display: block; margin-bottom: .2rem; }
.subscription-action-row p { font-size: .8rem; color: var(--text-muted); margin: 0; }

/* ============================================================
   BADGES (layout-specific)
   ============================================================ */
.badge-pro     { background: rgba(99,91,255,.12); color: var(--stripe-purple); }
.badge-success { background: var(--success-bg); color: var(--success-fg); }

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-body {
  background: var(--stripe-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.auth-container {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 15px 35px rgba(0,0,0,.2), 0 5px 15px rgba(0,0,0,.1);
}

.auth-logo {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--stripe-navy);
  text-decoration: none;
  margin-bottom: 1.75rem;
  text-align: center;
  letter-spacing: -.03em;
}
.auth-logo span { color: var(--stripe-purple); }
.auth-logo:hover { text-decoration: none; color: var(--stripe-navy); }

.auth-footer { margin-top: 1.25rem; text-align: center; font-size: .875rem; color: var(--text-muted); }
.auth-footer a { color: var(--stripe-purple); }

h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.25rem; letter-spacing: -.02em; }

/* ============================================================
   RESPONSIVE — layout classes only
   ============================================================ */
@media (max-width: 1000px) {
  .link-config-grid { grid-template-columns: 1fr; }
  .link-dashboard-grid { grid-template-columns: 1fr; }
  .analytics-grid-3 { grid-template-columns: 1fr; }
  .subscription-action-row { flex-direction: column; align-items: flex-start; }
  .plan-info-row { flex-direction: column; }
  .settings-sidebar { width: 180px; }
}

@media (max-width: 820px) {
  .settings-layout { flex-direction: column; }
  .settings-sidebar { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: .25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--stripe-border); }
  .settings-sidebar-title { width: 100%; }
  .settings-nav-link { padding: .4rem .65rem; font-size: .8rem; }
}

@media (max-width: 768px) {
  /* Sidebar collassa a 60px — solo icone */
  .sidebar { width: 60px; overflow: hidden; }
  .sidebar-brand span:not(.sidebar-brand-icon) { display: none; }
  .sidebar-brand { justify-content: center; }
  .sidebar-brand-icon { flex-shrink: 0; }
  .sidebar-section-label { display: none; }
  .sidebar-link { justify-content: center; padding: .55rem; gap: 0; }
  .sidebar-link span:not(.sidebar-icon) { display: none; }
  .sidebar-logout { justify-content: center; padding: .55rem; gap: 0; }
  .sidebar-logout span:not(.sidebar-icon) { display: none; }
  .app-main { margin-left: 60px; }
  .container { padding: 1.5rem 1rem; }
  .topbar { padding: 0 1rem; }
  .flash-wrapper { padding: 0 1rem; }
}

@media (max-width: 640px) {
  .link-show-header { flex-direction: column; }
}
