/* ============================================================
   LinkRapido — style.css
   Tema: Escuro · Acento azul elétrico #4361EE
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0d0d1a;
  --surface:    #161627;
  --surface2:   #1e1e35;
  --border:     #2a2a45;
  --text:       #e2e8f0;
  --muted:      #94a3b8;
  --primary:    #4361ee;
  --primary-dk: #3451d1;
  --success:    #06d6a0;
  --warning:    #f7b730;
  --danger:     #ef476f;
  --secondary:  #475569;
  --sidebar-w:  240px;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
}

html { font-size: 15px; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; }

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--muted); }
.gradient-text { background: linear-gradient(135deg, #4361ee, #7b2fbe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-muted { color: var(--muted); font-size: .85rem; }

/* ── LAYOUT ────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.p0   { padding: 0 !important; }
.gap-sm { gap: .5rem; }
.flex-row { display: flex; align-items: center; }

/* ── NAVBAR ────────────────────────────────────────────────── */
.navbar { position: sticky; top: 0; z-index: 100; background: rgba(13,13,26,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: .9rem 1.5rem; }
.nav-logo { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: var(--muted); font-weight: 500; transition: color .2s; }
.nav-link:hover { color: var(--text); }

/* ── HERO ──────────────────────────────────────────────────── */
.hero { position: relative; padding: 6rem 0 4rem; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% -20%, #4361ee22, transparent); pointer-events: none; }
.hero-content { position: relative; text-align: center; }
.hero-badge { display: inline-block; background: #4361ee22; color: var(--primary); border: 1px solid #4361ee55; border-radius: 999px; padding: .35rem 1rem; font-size: .8rem; font-weight: 600; margin-bottom: 1.5rem; }
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.15; margin-bottom: 1rem; }
.hero-sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 2.5rem; }

/* ── SHORTEN CARD ─────────────────────────────────────────── */
.shorten-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; max-width: 700px; margin: 0 auto; box-shadow: var(--shadow); }
.shorten-form { margin-top: 1rem; }
.form-row { display: flex; gap: .75rem; }
.form-row .form-input { flex: 1; }
.form-extras { margin-top: 1rem; }
.form-hint { color: var(--muted); font-size: .78rem; display: block; margin-top: .3rem; }
.result-box { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; }
.result-header { margin-bottom: .75rem; }
.result-link-row { display: flex; gap: .5rem; margin-bottom: .75rem; }
.result-input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: .6rem .8rem; border-radius: 7px; font-size: .9rem; cursor: pointer; }
.result-extras { display: flex; gap: .5rem; margin-bottom: .75rem; }
.qr-preview { text-align: right; }
.qr-preview img { border-radius: 8px; border: 2px solid var(--border); }

/* ── FEATURES ──────────────────────────────────────────────── */
.features { padding: 4rem 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: border-color .2s, transform .2s; }
.feature-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: .4rem; color: var(--text); }
.feature-card p { font-size: .85rem; }

/* ── FOOTER ────────────────────────────────────────────────── */
.footer { text-align: center; padding: 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.25rem; border-radius: 8px; font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; border: none; transition: background .2s, opacity .2s, transform .1s; line-height: 1; }
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; }
.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: #4361ee18; }
.btn-ghost     { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface2); }
.btn-success   { background: var(--success); color: #fff; }
.btn-warning   { background: var(--warning); color: #000; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }
.btn-xs { padding: .25rem .55rem; font-size: .75rem; border-radius: 5px; }
.btn-block { width: 100%; }

/* ── FORMS ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--text); }
.label-link { font-weight: 400; color: var(--primary); }
.form-input { width: 100%; background: var(--surface2); border: 1.5px solid var(--border); color: var(--text); padding: .7rem .9rem; border-radius: 8px; font-family: inherit; font-size: .9rem; outline: none; transition: border-color .2s; }
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--muted); }
.form-input-lg { font-size: 1rem; padding: .85rem 1rem; }
.form-input-sm { font-size: .85rem; padding: .55rem .8rem; }
.form-check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .85rem; }
.form-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input-pw { position: relative; }
.input-pw .form-input { padding-right: 2.8rem; }
.pw-toggle { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .6; }
.pw-toggle:hover { opacity: 1; }
.input-prefix { display: flex; }
.input-prefix span { background: var(--border); color: var(--muted); padding: .7rem .8rem; border-radius: 8px 0 0 8px; border: 1.5px solid var(--border); white-space: nowrap; font-size: .85rem; }
.input-prefix .form-input { border-radius: 0 8px 8px 0; border-left: none; }

/* ── ALERTS ────────────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-radius: 8px; font-size: .88rem; margin-bottom: 1.25rem; }
.alert-success { background: #06d6a022; border: 1px solid #06d6a055; color: var(--success); }
.alert-danger   { background: #ef476f22; border: 1px solid #ef476f55; color: var(--danger); }
.alert-warning  { background: #f7b73022; border: 1px solid #f7b73055; color: var(--warning); }
.alert-info     { background: #4361ee22; border: 1px solid #4361ee55; color: var(--primary); }
.alert a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ── BADGES ────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.4; }
.badge-success   { background: #06d6a022; color: var(--success); }
.badge-danger    { background: #ef476f22; color: var(--danger); }
.badge-warning   { background: #f7b73022; color: var(--warning); }
.badge-info      { background: #4361ee22; color: var(--primary); }
.badge-secondary { background: var(--surface2); color: var(--muted); }

/* ── AUTH PAGES ────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2.5rem 2rem; box-shadow: var(--shadow); }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo a { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.auth-title { text-align: center; font-size: 1.5rem; margin-bottom: .4rem; color: var(--text); }
.auth-sub { text-align: center; font-size: .85rem; margin-bottom: 1.75rem; }
.auth-footer { text-align: center; font-size: .85rem; margin-top: 1.25rem; color: var(--muted); }
.auth-admin { background: linear-gradient(135deg, #0d0d1a 60%, #1a0010); }
.admin-badge { text-align: center; background: #ef476f22; color: var(--danger); border: 1px solid #ef476f55; border-radius: 8px; padding: .4rem .8rem; font-size: .8rem; font-weight: 600; margin-bottom: 1rem; }

/* ── PANEL LAYOUT ──────────────────────────────────────────── */
.panel-page { display: flex; min-height: 100vh; background: var(--bg); }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 200; transition: transform .3s; overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.25rem .75rem; border-bottom: 1px solid var(--border); }
.sidebar-logo a { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.sidebar-close { display: none; background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.sidebar-user { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: #fff; flex-shrink: 0; }
.sidebar-name { font-size: .88rem; font-weight: 600; color: var(--text); }
.sidebar-role { font-size: .75rem; color: var(--muted); }
.sidebar-nav { padding: .75rem .75rem; flex: 1; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: .6rem .85rem; border-radius: 8px; color: var(--muted); font-size: .88rem; font-weight: 500; transition: background .15s, color .15s; margin-bottom: .15rem; }
.nav-item:hover, .nav-item.active { background: #4361ee18; color: var(--text); }
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-item-danger:hover { background: #ef476f18; color: var(--danger); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-divider { height: 1px; background: var(--border); margin: .5rem 0; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; }

/* Main */
.panel-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.panel-topbar { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-admin { border-bottom-color: #ef476f44; }
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-user { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.topbar-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: #fff; }
.panel-content { padding: 1.75rem 2rem; flex: 1; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.75rem; gap: 1rem; flex-wrap: wrap; }
.page-header h1 { margin-bottom: .2rem; }
.page-header p { font-size: .88rem; margin: 0; }

/* ── CARDS ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-header h3 { margin: 0; }
.card-body { padding: 1.25rem; }

/* ── STATS GRID ────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stats-grid-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--muted); }

/* ── DASH GRID ─────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }

/* ── TABLES ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table thead th { padding: .75rem 1rem; border-bottom: 2px solid var(--border); text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.table tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface2); }
.table tbody tr.row-flagged td { background: #ef476f0a; }
.short-link { color: var(--primary); font-weight: 600; font-size: .85rem; }
.link-title { font-weight: 600; font-size: .88rem; color: var(--text); }
.link-orig { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.action-btns { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ── PAGINATION ────────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; padding: 1rem 1.25rem; flex-wrap: wrap; }
.page-btn { padding: .35rem .75rem; border-radius: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); transition: all .15s; }
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── SEARCH ROW ────────────────────────────────────────────── */
.search-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.search-row .form-input { flex: 1; min-width: 180px; }

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 999; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: var(--shadow); animation: modalIn .2s ease; }
.modal-sm { max-width: 400px; }
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(-10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state { padding: 3rem 1rem; text-align: center; }
.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state p { color: var(--muted); margin-bottom: 1rem; }

/* ── BARS ──────────────────────────────────────────────────── */
.bar-item { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; font-size: .83rem; }
.bar-label { width: 80px; flex-shrink: 0; color: var(--text); }
.bar-track { flex: 1; background: var(--surface2); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 999px; transition: width .5s ease; }
.bar-pct   { width: 36px; text-align: right; color: var(--muted); flex-shrink: 0; }

/* ── TOAST ─────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--surface); border: 1px solid var(--border); padding: .75rem 1.25rem; border-radius: 8px; font-size: .88rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: all .3s; z-index: 9999; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--success); color: var(--success); }
.toast-danger  { border-color: var(--danger); color: var(--danger); }
.toast-info    { border-color: var(--primary); color: var(--primary); }

/* ── QUICK FORM ────────────────────────────────────────────── */
.quick-form .btn { margin-top: .5rem; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.open { display: block; }
  .panel-main { margin-left: 0; }
  .hamburger { display: block; }
  .panel-content { padding: 1.25rem 1rem; }
  .form-row { flex-direction: column; }
  .form-row-2 { grid-template-columns: 1fr; }
  .stats-grid, .stats-grid-5 { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .result-link-row { flex-direction: column; }
  .result-extras { flex-wrap: wrap; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .action-btns { flex-wrap: nowrap; }
}
@media (max-width: 480px) {
  .stats-grid, .stats-grid-5 { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.7rem; }
  .shorten-card { padding: 1.25rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
}
