/* --- WYSLINK PROFESSIONAL DESIGN SYSTEM v2.0 --- */
:root {
    --primary: #4f46e5;
    --primary-alt: #6366f1;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --bg-main: #fcfdfe;
    --bg-white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #eef2f6;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.03);
    --shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.08);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --safe-bottom: env(safe-area-inset-bottom);
}

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background-color: var(--bg-main); 
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* --- REUSABLE UI ELEMENTS --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.9rem 2rem; border-radius: var(--radius-md);
    font-weight: 700; text-decoration: none; cursor: pointer; border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem; gap: 10px;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.3); }

.btn-secondary { background: white; color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-main); }

.glass-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.badge {
    padding: 6px 14px; border-radius: 50px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
}
.badge-nfc { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.badge-qr { background: rgba(14, 165, 233, 0.1); color: var(--secondary); }

/* --- LANDING PAGE (index.php) --- */
.nav-landing {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 6%; position: fixed; top: 0; width: 100%; z-index: 1000;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.logo-container { display: flex; flex-direction: column; text-decoration: none; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: 'Outfit'; font-size: 1.6rem; font-weight: 900; color: var(--text-main); letter-spacing: -1px; line-height: 1; }
.logo-icon { color: var(--primary); font-size: 1.4rem; }
.logo-text-link { color: var(--primary); }
.logo-by { font-size: 0.6rem; color: var(--text-muted); font-weight: 800; margin-left: 31px; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; }

.hero { 
    padding: 10rem 6% 6rem; display: flex; align-items: center; gap: 5rem; 
    max-width: 1440px; margin: 0 auto; 
}
.hero-content { flex: 1; }
.hero-content h1 { 
    font-family: 'Outfit'; font-size: clamp(2.8rem, 5vw, 4.5rem); 
    line-height: 1; margin-bottom: 1.5rem; color: var(--text-main); letter-spacing: -0.04em;
}
.hero-content p { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 580px; }

.hero-visual { flex: 1.1; position: relative; }
.hero-visual img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem; padding: 6rem 6%; 
}
.feature-card {
    background: white; padding: 3.5rem 2.5rem; border-radius: var(--radius-lg);
    border: 1px solid var(--border); transition: 0.3s;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-8px); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1.5rem; }

.landing-nav-actions { display: flex; gap: 0.7rem; align-items: center; justify-content: flex-end; }
.nav-client-btn {
    min-width: 170px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-alt) 100%);
    box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.55);
}
.landing-hero-v2 { padding-top: 9rem; }
.landing-hero-badge { margin-bottom: 1.2rem; display: inline-block; }
.hero-highlight {
    color: var(--primary);
    text-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.6rem; }
.hero-kpis { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.hero-kpi {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.7rem 0.9rem;
    min-width: 130px;
}
.hero-kpi-value { display: block; font-family: 'Outfit'; font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.hero-kpi-label { display: block; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.hero-floating-card {
    position: absolute;
    right: -12px;
    bottom: -20px;
    width: min(320px, 92%);
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.1rem;
}
.hero-floating-title { font-family: 'Outfit'; font-weight: 800; margin-bottom: 0.5rem; }
.hero-floating-card ul { list-style: none; padding: 0; margin: 0; }
.hero-floating-card li { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.hero-floating-card li:last-child { margin-bottom: 0; }

.landing-proof-strip {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 6% 2.2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}
.proof-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
}
.proof-item strong {
    display: block;
    font-family: 'Outfit';
    font-size: 1.05rem;
    line-height: 1.25;
}
.proof-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.68rem;
    font-weight: 800;
}

.landing-workflow,
.landing-capabilities,
.landing-cta-final {
    padding: 5rem 6%;
}
.landing-workflow { background: #ffffff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-section-head { text-align: center; margin-bottom: 2rem; }
.landing-section-head h2 {
    font-family: 'Outfit';
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: -0.02em;
}
.landing-section-head p { color: var(--text-muted); margin-top: 0.6rem; }

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}
.workflow-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.1rem;
}
.workflow-step {
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary);
    background: #eef2ff;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.55rem;
}
.workflow-item h3 { font-family: 'Outfit'; margin-bottom: 0.35rem; }
.workflow-item p { color: var(--text-muted); font-size: 0.9rem; }

.landing-capabilities { background: #fcfdff; }
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}
.capability-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.05rem;
}
.capability-card h3 { font-family: 'Outfit'; font-size: 1.05rem; margin-bottom: 0.35rem; }
.capability-card p { color: var(--text-muted); font-size: 0.9rem; }

.landing-use-cases {
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 5rem 6%;
}
.use-cases-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto 1.3rem;
}
.use-case-card {
    flex: 1 1 280px;
    max-width: 370px;
    background: #f8fbff;
    border: 1px solid #e5edf8;
    border-radius: 16px;
    padding: 1rem 1.05rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.use-case-card:hover {
    transform: translateY(-4px);
    border-color: #c7d7ff;
    box-shadow: 0 12px 25px -18px rgba(37, 99, 235, 0.45);
}
.use-case-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 0.6rem;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 0.95rem;
}
.use-case-card h3 {
    font-family: 'Outfit';
    font-size: 1.02rem;
    margin-bottom: 0.45rem;
}
.use-case-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.landing-region-block {
    max-width: 1200px;
    margin: 0.6rem auto 0;
    background: #f6f7ff;
    border: 1px solid #dfe3ff;
    border-radius: 18px;
    padding: 1rem;
    text-align: center;
}
.landing-region-block h3 {
    font-family: 'Outfit';
    margin-bottom: 0.3rem;
}
.landing-region-block p {
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}
.region-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}
.region-chips span {
    border-radius: 999px;
    border: 1px solid #ced6ff;
    background: #ffffff;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
}

.landing-cta-final { background: #ffffff; border-top: 1px solid var(--border); }
.landing-cta-box {
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(130deg, #f6f7ff 0%, #eef8ff 100%);
    border: 1px solid #dde8ff;
    border-radius: 24px;
    padding: 2rem 1.5rem;
}
.landing-cta-box h2 { font-family: 'Outfit'; font-size: clamp(1.6rem, 3.3vw, 2.3rem); letter-spacing: -0.02em; }
.landing-cta-box p { color: var(--text-muted); margin: 0.8rem auto 1.2rem; max-width: 700px; }
.landing-cta-actions { justify-content: center; }

.landing-seo-faq {
    background: #fcfdff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 4rem 6%;
}
.faq-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.9rem;
}
.faq-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.05rem;
}
.faq-item h3 {
    font-family: 'Outfit';
    font-size: 1rem;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}
.faq-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.landing-footer {
    padding: 3rem 6%;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
}
.landing-footer-brand {
    transform: scale(0.9);
    transform-origin: left;
}
.footer-credit-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.35rem;
}
.landing-footer-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.landing-footer-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.landing-footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.landing-footer-links .footer-support-link {
    color: var(--primary);
    font-weight: 700;
}

@media (max-width: 900px) {
    .landing-nav-actions .btn { padding: 0.75rem 1rem; font-size: 0.85rem; }
    .nav-client-btn { min-width: 150px; }
    .hero { padding: 7.5rem 5% 3rem; flex-direction: column; gap: 1.8rem; }
    .hero-visual { width: 100%; }
    .hero-floating-card { position: relative; right: auto; bottom: auto; margin: 0.8rem auto 0; width: 100%; }
    .landing-proof-strip { padding: 0 5% 1.8rem; grid-template-columns: 1fr; }
    .landing-features-main { padding: 3.2rem 5%; }
    .landing-workflow, .landing-capabilities, .landing-use-cases, .landing-cta-final, .landing-seo-faq { padding: 3.2rem 5%; }
    .landing-footer { padding: 2.4rem 5%; }
}

@media (max-width: 640px) {
    .nav-landing { padding: 1rem 4%; }
    .landing-nav-actions { gap: 0.45rem; }
    .landing-nav-actions .btn { padding: 0.65rem 0.8rem; font-size: 0.8rem; }
    .nav-client-btn { min-width: 128px; }
    .hero-content h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
    .hero-content p { font-size: 1rem; }
    .hero-kpis { gap: 0.5rem; }
    .hero-kpi { min-width: calc(50% - 0.3rem); flex: 1 1 calc(50% - 0.3rem); }
    .use-case-card { flex-basis: 100%; max-width: 100%; }
    .landing-footer { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
    .landing-footer-brand { transform: scale(1); }
    .landing-footer-links { gap: 0.8rem; flex-wrap: wrap; }
}

/* --- LOGIN PAGE (login.php) --- */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top left, #f8fafc, #f1f5f9); padding: 1.5rem;
}
.auth-card {
    width: 100%; max-width: 440px; background: white; padding: 3rem 2.5rem;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    animation: modalIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
@media (max-width: 480px) {
    .auth-card { padding: 2.5rem 1.5rem; }
}

/* --- ADMIN DASHBOARD (admin.php) --- */
.admin-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px; background: white; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: fixed; 
    top: 0; left: 0; height: 100vh; z-index: 1000;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-header { padding: 2rem; border-bottom: 1px solid var(--border); }
.sidebar-menu { flex: 1; padding: 1.5rem 1rem; }

.menu-item {
    display: flex; align-items: center; gap: 12px; padding: 0.85rem 1.2rem;
    color: var(--text-muted); text-decoration: none; border-radius: 12px;
    margin-bottom: 0.4rem; font-weight: 600; transition: 0.2s;
}
.menu-item:hover, .menu-item.active { background: #f1f5f9; color: var(--primary); }
.menu-item.active { background: var(--primary); color: white; box-shadow: 0 8px 15px -4px rgba(79, 70, 229, 0.3); }

.main-content { margin-left: 250px; flex: 1; padding: 2rem 4%; width: calc(100% - 250px); }

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}

.stats-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 1.5rem; margin-bottom: 2.5rem; width: 100%;
}
.stat-card {
    background: white; border: 1px solid var(--border); padding: 1.25rem;
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; justify-content: center;
    transition: transform 0.2s ease;
}
.stat-card.bg-total { background: #f0f7ff; border-color: #d0e7ff; }
.stat-card.bg-total .value { color: #2563eb; }
.stat-card.bg-nfc { background: #f5f3ff; border-color: #e0e7ff; }
.stat-card.bg-nfc .value { color: #4f46e5; }
.stat-card.bg-qr { background: #ecfdf5; border-color: #d1fae5; }
.stat-card.bg-qr .value { color: #059669; }

.stat-card:active { transform: scale(0.98); }
.stat-card .label { color: var(--text-muted); font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.4rem; opacity: 0.8; }
.stat-card .value { font-family: 'Outfit'; font-size: 2rem; font-weight: 800; color: var(--text-main); line-height: 1.1; }

.data-card {
    background: white; border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: visible; box-shadow: var(--shadow-sm); margin-bottom: 2.5rem;
    width: 100%;
    position: relative;
}
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}
.quick-action-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: #fbfdff;
}
.quick-action-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 800;
}
.quick-action-value {
    font-family: 'Outfit';
    font-size: 1.6rem;
    line-height: 1.1;
    margin-top: 0.2rem;
}
.quick-action-list {
    margin: 0;
    padding-left: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.quick-action-list li {
    margin-bottom: 0.25rem;
}
.filter-chip {
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
}
.filter-chip.active {
    background: #eef2ff;
    color: var(--primary);
    border-color: #c7d2fe;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
}
.status-active { background: #e7f9ef; color: #057a46; }
.status-low { background: #fff7e6; color: #a16207; }
.status-inactive { background: #f3f4f6; color: #475569; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 1.2rem 1.5rem; background: #fafbfc; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; }
td { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }

.dashboard-card .card-header {
    padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); 
    font-weight: 800; font-family: 'Outfit'; font-size: 0.9rem; color: var(--text-main);
}

/* TABLE TO CARDS (Only for Complex Data) */
/* Responsive adjustments handled in unified media query below */

/* FORMS */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.6rem; font-weight: 700; font-size: 0.85rem; }
.input-control {
    width: 100%; padding: 0.85rem 1.2rem; border-radius: 12px; border: 1px solid var(--border);
    outline: none; transition: 0.2s; font-size: 0.95rem;
}
.input-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }

/* BADGES & CHIPS */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 50px; font-size: 0.7rem; font-weight: 800; }
.badge-type { padding: 4px 10px; border-radius: 8px; font-size: 0.65rem; font-weight: 800; border: 1px solid transparent; }
.badge-type.nfc { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.badge-type.qr { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }

.s-badge { font-size: 0.6rem; font-weight: 900; padding: 2px 6px; border-radius: 4px; margin-right: 5px; }
.s-badge.nfc { background: var(--primary); color: white; }
.s-badge.qr { background: var(--secondary); color: white; }

.btn-icon-sm { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px solid var(--border); color: var(--text-main); cursor: pointer; transition: 0.2s; text-decoration: none; }
.btn-danger-lite { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }
.btn-copy { 
    border-radius: 8px; background: #ffffff; color: var(--primary); 
    cursor: pointer; padding: 6px 10px; font-size: 0.9rem;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    flex-shrink: 0;
}
.btn-copy:active { background: #f8fafc; }

/* CARD OPTIONS DROPDOWN */
.card-options { position: relative; }
.card-options.menu-open { z-index: 1200; }
.btn-more {
    background: #f1f5f9; border: none; color: var(--text-main);
    width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
    font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}
.options-menu {
    position: absolute; right: 0; top: 44px; background: white;
    border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    min-width: 180px; z-index: 1100; opacity: 0; pointer-events: none;
    transform: translateY(-10px); transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.options-menu.active { opacity: 1; pointer-events: all; transform: translateY(0); }
.options-menu button {
    width: 100%; padding: 12px 16px; border: none; background: transparent;
    text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--text-main);
    cursor: pointer; display: block; border-bottom: 1px solid #f8fafc;
}
.options-menu button:last-child { border-bottom: none; }
.options-menu button:hover { background: #f8fafc; }
.options-menu .menu-danger { color: #e11d48 !important; }
/* NEW PRO ACTION HEADERS */
.card-action-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.card-title { font-family: 'Outfit'; font-size: 1.1rem; font-weight: 800; color: var(--text-main); }
.action-tools { display: flex; gap: 0.8rem; align-items: center; flex: 1; justify-content: flex-end; }

.search-wrapper { position: relative; flex: 1; max-width: 300px; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.8rem; pointer-events: none; }
.search-input {
    width: 100%; padding: 0.7rem 1rem 0.7rem 2.5rem; border-radius: 12px;
    border: 1px solid var(--border); background: #f8fafc; font-size: 0.9rem;
    transition: 0.3s;
}
.search-input:focus { background: white; border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.05); }

.btn-icon-only {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; border: 1px solid var(--border); background: white; color: var(--text-main);
    cursor: pointer; transition: 0.2s; font-size: 1rem;
}
.btn-icon-only:hover { background: #f1f5f9; color: var(--primary); }

/* LINKS GRID SYSTEM */
.client-links-body { padding: 1.5rem 2rem; }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

/* LINK CARD LAYOUT (Tarjetas y Enlaces) */
.link-item-card { min-width: 0; }
.link-item-top { gap: 0.8rem; }
.link-item-meta { min-width: 0; flex: 1 1 auto; }
.link-item-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 0 1 52%;
    min-width: 160px;
}
.link-action-btn {
    padding: 0.36rem 0.62rem !important;
    font-size: 0.76rem !important;
    line-height: 1.15 !important;
    border-radius: 10px !important;
}
.link-channel-row { gap: 0.55rem; }
.link-copy-btn {
    padding: 0.32rem 0.62rem !important;
    font-size: 0.74rem !important;
    border-radius: 10px !important;
}
.link-destination { word-break: break-word; }

/* MOBILE MENU TOGGLE BASE */
.mobile-nav-toggle {
    display: none; position: fixed; top: 1.2rem; right: 1.2rem; z-index: 2100;
    width: 50px; height: 50px; background: var(--primary); color: white;
    border-radius: 14px; border: none; font-size: 1.4rem; 
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease;
}
.mobile-nav-toggle:active { transform: scale(0.9); }

.sidebar-close {
    display: none; position: absolute; top: 1.2rem; right: 1.2rem;
    background: #f1f5f9; border: none; font-size: 1.8rem; color: var(--text-main);
    cursor: pointer; padding: 0.2rem; width: 40px; height: 40px; border-radius: 10px;
    z-index: 1001; line-height: 1;
}

/* --- UNIFIED MOBILE & TABLET EXPERIENCE (PWA) --- */
@media (max-width: 1024px) {
    .sidebar { display: none !important; }
    
    .main-content { 
        margin-left: 0 !important; 
        width: 100% !important; 
        padding: 1rem 0.8rem 8rem !important; 
        max-width: 100% !important;
        box-sizing: border-box !important;
        background: #f8fafc !important; 
    }

    /* CENTERED STATS & HEADERS */
    .page-header { 
        display: block !important;
        text-align: center !important;
        background: transparent !important;
        padding: 1.5rem 0.5rem !important;
        border: none !important;
    }
    .page-header h1 { width: 100%; text-align: center !important; font-size: 1.8rem; margin-bottom: 0.5rem; }

    .stats-grid { 
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.2rem !important;
        width: 100% !important;
        margin: 0 auto 2.5rem auto !important;
    }
    
    .stat-card {
        width: 100% !important;
        max-width: 480px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 2.5rem 1.5rem !important;
        border-radius: 24px !important;
        background: #ffffff !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.06) !important;
        border: 1px solid #f1f5f9 !important;
    }
    .stat-card .label { margin-bottom: 0.5rem; font-weight: 800; opacity: 0.7; }
    .stat-card .value { font-size: 2.8rem !important; font-weight: 900 !important; }

    /* TABLE TO CARDS (FIXING OVERLAPS DEFINITIVELY) */
    #analyticsTable thead, #summaryTable thead, #cardMetricsTable thead, #stockTable thead, #userTable thead { display: none !important; }

    #analyticsTable tr, #summaryTable tr, #cardMetricsTable tr, #stockTable tr, #userTable tr {
        display: flex !important;
        flex-direction: column !important;
        padding: 1.5rem !important;
        background: #ffffff !important;
        margin-bottom: 1.5rem !important;
        border-radius: 20px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.04) !important;
        border: 1px solid #f1f5f9 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    #analyticsTable td, #summaryTable td, #cardMetricsTable td, #stockTable td, #userTable td {
        display: block !important;
        position: static !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid #f8fafc !important;
        width: 100% !important;
        text-align: left !important;
        min-height: auto !important;
    }
    #analyticsTable td:last-child, #summaryTable td:last-child, #cardMetricsTable td:last-child, #stockTable td:last-child, #userTable td:last-child {
        border-bottom: none !important;
    }
    
    /* NO ABSOLUTE POSITIONING - LABEL ABOVE CONTENT */
    #analyticsTable td:before, #summaryTable td:before, #cardMetricsTable td:before, #stockTable td:before, #userTable td:before {
        content: attr(data-label) !important;
        display: block !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        font-weight: 800 !important;
        color: var(--primary) !important;
        font-size: 0.65rem !important;
        text-transform: uppercase !important;
        margin-bottom: 6px !important;
        opacity: 0.9 !important;
        text-align: left !important;
    }

    /* SPECIFIC TOOLS CENTERING */
    .card-action-header { 
        flex-direction: column !important; 
        align-items: center !important; 
        text-align: center !important;
        gap: 1.2rem !important;
    }
    .action-tools { width: 100% !important; justify-content: center !important; }
    .search-wrapper { max-width: none !important; width: 100% !important; }

    .client-links-body { padding: 1rem !important; }
    .links-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
    .link-item-top {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.7rem !important;
    }
    .link-item-actions {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
    }
    .link-action-btn {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: 120px;
    }
    .link-channel-row {
        flex-wrap: wrap !important;
        align-items: center !important;
    }
    .link-channel-left { min-width: 92px; }
    .link-channel-actions {
        display: flex;
        gap: 0.35rem;
        margin-left: auto;
    }
    .link-copy-btn { flex: 0 0 auto; }

    /* PWA BOTTOM NAV */
    .bottom-nav { 
        display: flex !important; 
        position: fixed; bottom: 0; left: 0; right: 0;
        background: rgba(255,255,255,0.98); backdrop-filter: blur(20px);
        border-top: 1px solid var(--border); z-index: 2000;
        padding: 0.8rem 0.5rem calc(0.8rem + var(--safe-bottom));
        justify-content: space-around;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
    }
    .bottom-nav-item {
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        color: var(--text-muted); text-decoration: none; font-size: 0.65rem; font-weight: 700; flex: 1;
    }
    .bottom-nav-item i { font-size: 1.3rem; }
    .bottom-nav-item.active { color: var(--primary); }
    
    .mobile-nav-toggle { display: none !important; }
}

@media (max-width: 520px) {
    .link-action-btn {
        flex: 1 1 100%;
        min-width: 0;
    }
    .link-channel-row {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .link-channel-actions {
        margin-left: 0;
        width: 100%;
    }
    .link-channel-actions .link-copy-btn {
        flex: 1 1 auto;
        width: 100%;
    }
}

.bottom-nav { display: none; }



/* MODALS */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center;
    padding: 1.5rem; z-index: 2000;
}
.modal-overlay.open { display: flex; }
.modal-window {
    background: white; width: 100%; max-width: 500px; border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem; position: relative; animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh; overflow-y: auto;
}
.app-toast {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 2400;
    background: #0f172a;
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
    font-size: 0.86rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    max-width: min(90vw, 360px);
}
.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.app-toast.success {
    background: linear-gradient(135deg, #0f766e, #0ea5e9);
}
.app-toast.error {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* TABS SYSTEM */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s ease; }
/* LEGAL PAGES */
.legal-page { padding: 6rem 6% 10rem; background: #fff; }
.legal-container { max-width: 900px; margin: 0 auto; color: var(--text-main); line-height: 1.8; }
.legal-container h1 { font-family: 'Outfit'; font-size: 3rem; margin-bottom: 3rem; color: var(--text-main); }
.legal-container h2 { font-family: 'Outfit'; font-size: 1.5rem; margin-top: 3rem; margin-bottom: 1rem; color: var(--primary); font-weight: 800; }
.legal-container p { margin-bottom: 1.5rem; color: var(--text-muted); }
.legal-container ul { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.legal-container li { margin-bottom: 0.5rem; color: var(--text-muted); }

/* --- REDIRECT & LOADING PAGES --- */
.redirect-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top left, #f8fafc, #f1f5f9); padding: 2rem;
    text-align: center;
}
.redirect-card {
    width: 100%; max-width: 480px; background: white; padding: 4rem 3rem;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    animation: modalIn 0.5s ease;
}
.redirect-scanner {
    position: relative; width: 100px; height: 100px; margin: 0 auto 2.5rem;
    display: flex; align-items: center; justify-content: center;
}
.scanner-circle {
    position: absolute; inset: 0; border: 4px solid #f1f5f9; border-radius: 50%;
}
.scanner-line {
    position: absolute; width: 100%; height: 4px; background: var(--primary);
    top: 50%; transform: translateY(-50%); border-radius: 4px;
    animation: scan 2s ease-in-out infinite; box-shadow: 0 0 15px var(--primary);
}
@keyframes scan {
    0%, 100% { top: 20%; opacity: 0.2; }
    50% { top: 80%; opacity: 1; }
}
.scanner-icon { font-size: 2.5rem; z-index: 2; }
.scanner-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
    z-index: 2;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    padding: 8px;
}
.scanner-icon-combo {
    z-index: 2;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.scanner-icon-combo i {
    font-size: 2.3rem;
    color: #0f172a;
}
.scanner-tech-badge {
    position: absolute;
    right: -18px;
    top: -12px;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 3px 7px;
    border: 1px solid transparent;
    line-height: 1;
}
.scanner-tech-badge.nfc {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #c7d2fe;
}
.scanner-tech-badge.qr {
    background: #ecfeff;
    color: #0891b2;
    border-color: #a5f3fc;
}
.section-tag {
    display: table; padding: 6px 16px; background: #eeeffe; color: var(--primary);
    border-radius: 50px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 1rem;
}
.redirect-progress {
    width: 100%; height: 6px; background: #f1f5f9; border-radius: 10px; overflow: hidden;
    margin: 2rem 0;
}
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%; transition: width 3s cubic-bezier(0.1, 0, 0.4, 1);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
