/* NFC Demo Styles */
.nfc-demo-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nfc-demo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 0;
}

.nfc-icon-large {
    width: 160px;
    height: 160px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    animation: pulse 2s infinite;
}

.nfc-icon-large i {
    font-size: 4rem;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); }
}

.nfc-demo-main h1 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.nfc-demo-main p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
}

.nfc-demo-footer {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.nfc-demo-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* NFC Scan Success Icon */
.nfc-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo {
    font-size: 2rem;
}

.login-logo p {
    color: var(--text-secondary);
    margin-top: 8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.login-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: 0.2s;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-btn {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.demo-login-note {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    background: var(--hover-bg);
    border-radius: 10px;
}

.demo-login-note p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.demo-login-note strong {
    color: var(--accent-primary);
}

/* Short URL Landing Page */
.landing-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.landing-main {
    padding: 60px 0;
    text-align: center;
}

.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px;
    max-width: 600px;
    margin: 0 auto;
}

.product-image {
    width: 200px;
    height: 200px;
    background: var(--hover-bg);
    border-radius: 16px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image i {
    font-size: 4rem;
    color: var(--accent-primary);
}

.product-card h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.product-card .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 24px;
}

.product-card .description {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.btn-cta {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.success-message i {
    font-size: 1.2rem;
}

/* Demo Entry Page Styles */
.demo-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.demo-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

.demo-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-logo .logo-icon {
    width: 32px;
    height: 32px;
}

.demo-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demo-badge {
    background: var(--bg-accent);
    color: var(--accent-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-main {
    flex: 1;
    padding: 40px 0;
}

.demo-header {
    text-align: center;
    margin-bottom: 48px;
}

.demo-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.demo-header h1 i {
    color: var(--accent-primary);
    margin-right: 12px;
}

.demo-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.demo-flows {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

.flow-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    gap: 24px;
    transition: 0.3s;
    cursor: pointer;
}

.flow-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.flow-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-secondary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flow-icon i {
    font-size: 2rem;
    color: white;
}

.flow-content {
    flex: 1;
}

.flow-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.flow-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.btn-demo {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    font-family: inherit;
}

.btn-demo:hover {
    transform: translateY(-2px);
}

.btn-demo.btn-primary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-demo.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

.btn-demo.btn-outline:hover {
    background: var(--accent-primary);
    color: white;
}

.demo-info {
    margin-bottom: 40px;
}

.info-card {
    background: var(--hover-bg);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.info-card i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.demo-footer {
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.demo-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.demo-footer a:hover {
    color: var(--accent-secondary);
}

/* Demo Panel Styles - Matching actual panel-app/css/panel.css */

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.01);
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --hover-bg: #f1f5f9;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-dark: #312e81;
    --bg-accent: #eef2ff;
    --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #7c3aed 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --shadow-xs: 0 0.5px 1px rgba(0,0,0,0.02);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
    --shadow-2xl: 0 25px 30px -5px rgba(0,0,0,0.12);
    --shadow-accent-sm: 0 2px 4px -1px rgba(99, 102, 241, 0.05);
    --shadow-accent-md: 0 4px 6px -1px rgba(99, 102, 241, 0.1);
    --shadow-accent-lg: 0 6px 8px -1px rgba(99, 102, 241, 0.15);
    --shadow-accent-xl: 0 8px 10px -1px rgba(99, 102, 241, 0.2);
}

.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
    --input-bg: #334155;
    --modal-bg: #1e293b;
    --hover-bg: #334155;
    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;
    --accent-dark: #c7d2fe;
    --bg-accent: #312e81;
    --shadow-xs: 0 0.5px 1px rgba(0,0,0,0.08);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5), 0 10px 10px -5px rgba(0,0,0,0.3);
    --shadow-2xl: 0 25px 30px -5px rgba(0,0,0,0.6);
    --shadow-accent-sm: 0 2px 4px -1px rgba(129, 140, 248, 0.1);
    --shadow-accent-md: 0 4px 6px -1px rgba(129, 140, 248, 0.15);
    --shadow-accent-lg: 0 6px 8px -1px rgba(129, 140, 248, 0.2);
    --shadow-accent-xl: 0 8px 10px -1px rgba(129, 140, 248, 0.25);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

/* App Body */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--hover-bg) 100%);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.user-badge i {
    color: var(--accent-primary);
}

.theme-toggle {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--hover-bg) 100%);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    border-color: var(--accent-secondary);
    background: linear-gradient(135deg, var(--bg-accent) 0%, var(--hover-bg) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px) rotate(0deg);
}

.theme-toggle i {
    font-size: 1.1rem;
    transition: transform 0.25s ease;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-family: inherit;
}

.logout-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    box-shadow: var(--shadow-md), 0 0 20px rgba(220, 38, 38, 0.15);
    transform: translateY(-2px);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--hover-bg) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    background: rgba(0,0,0,0.02);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: linear-gradient(90deg, var(--hover-bg) 0%, transparent 100%);
    color: var(--text-primary);
}

.nav-item:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    opacity: 0.5;
}

.nav-item.active {
    background: linear-gradient(90deg, var(--bg-accent) 0%, transparent 100%);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 500;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.nav-item i {
    width: 20px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-item:hover i {
    transform: translateY(-2px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--hover-bg) 100%);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.content-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.content-header p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* ===== CAMPAIGN CARDS ===== */
.campaigns-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.campaign-card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.campaign-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.campaign-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.campaign-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.campaign-status {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.campaign-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.campaign-slug {
    background: var(--hover-bg);
    padding: 10px 14px;
    border-radius: 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
}

.campaign-slug i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.campaign-url {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
}

.campaign-url i {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.campaign-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.campaign-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.2);
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.btn-edit:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* ===== LINKS TABLE ===== */
.links-container {
    background: var(--bg-secondary);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.links-container:hover {
    box-shadow: var(--card-shadow-hover);
}

.link-card {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.link-card:last-child {
    border-bottom: none;
}

.link-card:hover {
    background: linear-gradient(90deg, var(--hover-bg) 0%, transparent 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.link-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-secondary);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.3);
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.short-url-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    font-family: monospace;
}

.link-stats {
    display: flex;
    gap: 1rem;
    margin-left: 1rem;
}

.clicks-badge {
    background: var(--bg-accent);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== ANALYTICS ===== */
.analytics-container {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.analytics-placeholder {
    text-align: center;
    padding: 3rem;
}

.analytics-placeholder i {
    font-size: 4rem;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.analytics-placeholder h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.analytics-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--hover-bg);
    padding: 1.25rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ===== SETTINGS ===== */
.settings-section {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.settings-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section h3 i {
    color: var(--accent-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input:disabled {
    background: var(--hover-bg);
    color: var(--text-secondary);
}

.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    box-shadow: var(--shadow-md);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--modal-bg);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: 0.3s;
    box-shadow: var(--shadow-2xl);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
    font-family: inherit;
}

.btn-cancel:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.success i {
    color: #10b981;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .sidebar { width: 200px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
    .app-body { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
    .sidebar-nav { display: flex; overflow-x: auto; padding: 0 1rem; }
    .nav-item { padding: 1rem 1.25rem; white-space: nowrap; }
    .campaigns-container { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* ===== GRAFANA CONTAINER ===== */
.grafana-container {
    background: var(--bg-secondary);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    min-height: 500px;
}

.grafana-placeholder {
    text-align: center;
    padding: 4rem 2rem;
}

.grafana-placeholder i {
    font-size: 4rem;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    display: block;
}

.grafana-placeholder h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.grafana-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.grafana-frame {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 8px;
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ===== SETTINGS CARD ===== */
.settings-card {
    background: var(--hover-bg);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item.column {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.setting-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.setting-value {
    font-weight: 500;
    color: var(--text-primary);
}

.email-edit-container {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 300px;
}

.email-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
}

.email-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-icon {
    padding: 10px 14px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--accent-dark);
}

.api-key-display {
    font-family: monospace;
    background: var(--hover-bg);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.settings-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-title i {
    color: var(--accent-primary);
}

/* ===== SIDEBAR NAV BOTTOM ===== */
.sidebar-nav-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    background: rgba(0,0,0,0.02);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--hover-bg);
    padding: 1.25rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Theme toggle switch */
.theme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.theme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* ===== CAMPAIGN CARD FULL ===== */
.campaign-card {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.campaign-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.campaign-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.campaign-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.campaign-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.campaign-status {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.campaign-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.campaign-slug {
    background: var(--hover-bg);
    padding: 10px 14px;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.campaign-slug-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.campaign-slug-code {
    font-family: monospace;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.campaign-slug-code:hover {
    text-decoration: underline;
}

.campaign-url {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.campaign-arrow {
    color: var(--accent-primary);
}

.campaign-long-url {
    color: var(--text-secondary);
    text-decoration: none;
    word-break: break-all;
}

.campaign-long-url:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.campaign-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.campaign-tag {
    background: var(--bg-accent);
    color: var(--accent-primary);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.campaign-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.campaign-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.campaign-stat i {
    color: var(--accent-primary);
}

.campaign-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.campaign-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== COMPACT VIEW ===== */
.links-list {
    background: var(--bg-secondary);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.link-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    transition: all 0.2s ease;
}

.link-item:last-child {
    border-bottom: none;
}

.link-item:hover {
    background: var(--hover-bg);
}

.link-item.inactive {
    opacity: 0.6;
}

.link-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}

.link-item.inactive .link-status-dot {
    background: #ef4444;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
}

.link-title:hover {
    color: var(--accent-primary);
}

.link-url {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-url:hover {
    color: var(--accent-primary);
}

.link-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.link-clicks {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.link-code {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.link-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 8px 10px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

/* ===== GRAFANA PANEL ===== */
.grafana-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--hover-bg);
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-title i {
    color: var(--accent-primary);
}

.panel-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.chart-area {
    padding: 1.25rem;
}

.chart-svg {
    width: 100%;
    height: 200px;
}

.grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 4;
}

.chart-line {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 3;
}

.chart-area-fill {
    fill: url(#chartGradient);
    opacity: 0.3;
}

.data-point {
    fill: var(--accent-primary);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.grafana-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grafana-panel.small .panel-content {
    padding: 1rem;
}

.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.pie-chart {
    width: 120px;
    height: 120px;
}

.pie-legend {
    width: 100%;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: var(--text-primary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.grafana-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.grafana-table th,
.grafana-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.grafana-table th {
    background: var(--hover-bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grafana-table tbody tr:hover {
    background: var(--hover-bg);
}

.grafana-table td code {
    background: var(--hover-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent-primary);
}

.source-tag {
    background: var(--accent-primary);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.top-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.top-item:last-child {
    border-bottom: none;
}

.top-name {
    color: var(--text-primary);
}

.top-value {
    font-weight: 600;
    color: var(--accent-primary);
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100px;
    padding-top: 1rem;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bar {
    width: 30px;
    background: var(--gradient-secondary);
    border-radius: 4px 4px 0 0;
    min-height: 10px;
}

.bar-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
