/* ==========================================================================
   DYNMO QR STUDIO - DARK MODERN DESIGN SYSTEM
   Theme: Deep Obsidian Slate with Radiant Solar Amber & Emerald Accents
   Features: Live Interactive QR Preview, Real-Time Analytics, Ultra-Clean UI
   ========================================================================== */

:root {
    --bg-main: #090d16;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-surface-subtle: #1a2333;
    --bg-dark: #070a10;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --border-focus: #f97316;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --text-inverse: #090d16;

    --brand-primary: #f97316;
    --brand-primary-hover: #ea580c;
    --brand-amber: #fbbf24;
    --brand-blue: #38bdf8;
    --brand-emerald: #34d399;
    --brand-purple: #a78bfa;
    --brand-rose: #fb7185;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 2px 8px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 6px 16px -4px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 8px 25px -4px rgba(249, 115, 22, 0.35);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(at 100% 0%, rgba(249, 115, 22, 0.08) 0px, transparent 45%),
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.06) 0px, transparent 40%),
        radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.8) 0px, transparent 50%);
    background-attachment: fixed;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.app-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.75rem;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
    gap: 1.25rem;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-stats-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    padding: 6px 14px;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-width: 85px;
}

.stat-pill.highlight {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.35);
}

.stat-pill.highlight .stat-num {
    color: var(--brand-primary);
}

.stat-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.stat-lbl {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px -4px rgba(249, 115, 22, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==========================================================================
   GLOBAL ANALYTICS DASHBOARD KPI ROW
   ========================================================================== */
.analytics-summary-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

.kpi-subtext {
    font-size: 0.72rem;
    color: var(--text-subtle);
}

.kpi-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.kpi-icon-wrap.orange { background: rgba(249, 115, 22, 0.15); color: var(--brand-primary); }
.kpi-icon-wrap.blue { background: rgba(56, 189, 248, 0.15); color: var(--brand-blue); }
.kpi-icon-wrap.green { background: rgba(52, 211, 153, 0.15); color: var(--brand-emerald); }
.kpi-icon-wrap.purple { background: rgba(167, 139, 250, 0.15); color: var(--brand-purple); }

/* ==========================================================================
   CREATOR STUDIO PANEL & INTERACTIVE GRID
   ========================================================================== */
.creator-studio-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.panel-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.panel-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.studio-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.25rem;
    align-items: start;
}

@media (max-width: 980px) {
    .studio-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   STUDIO STEP TABS
   ========================================================================== */
.studio-tabs {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.tab-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
}

.tab-btn.active {
    background: var(--bg-surface-elevated);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.tab-btn.active .tab-step {
    background: var(--brand-primary);
    color: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FORM CONTROLS & INPUTS (DARK)
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
}

.req { color: var(--brand-primary); }
.opt { color: var(--text-subtle); font-weight: normal; font-size: 0.72rem; }

.form-group input[type="text"] {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: #ffffff;
    transition: all 0.15s ease;
}

.form-group input[type="text"]:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0.8;
}

.input-with-icon input {
    padding-left: 2.4rem !important;
    width: 100%;
}

.slug-preview-box {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.slug-preview-box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.slug-prefix {
    background: var(--bg-dark);
    padding: 0.75rem 0.85rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    border-right: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.slug-preview-box input {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0.75rem 1rem !important;
    box-shadow: none !important;
    width: 100%;
    color: #ffffff;
}

/* Design Grid in Tab 2 */
.design-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .design-grid {
        grid-template-columns: 1fr;
    }
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker-row input[type="color"] {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 2px;
}

.color-swatches {
    display: flex;
    gap: 6px;
}

.swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.swatch:hover {
    transform: scale(1.15);
}

.segmented-control {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}

.seg-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.seg-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.seg-item span {
    width: 100%;
    text-align: center;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.seg-item input:checked + span {
    background: var(--bg-surface-elevated);
    color: #ffffff;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Logo Preset Selector */
.logo-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.logo-btn {
    padding: 6px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.15s ease;
}

.logo-btn:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}

.logo-btn.active {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
}

.custom-logo-upload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.file-upload-label {
    cursor: pointer;
}

/* Export Options in Tab 3 */
.export-options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.export-card {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.export-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.export-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.btn-group-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
}

.btn-secondary.highlight {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.4);
    color: var(--brand-primary);
}

.btn-link {
    color: var(--brand-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
}

/* Studio Action Buttons */
.studio-actions-bar {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.btn-primary-large {
    flex: 1;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s ease;
}

.btn-primary-large:hover {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px -4px rgba(249, 115, 22, 0.45);
}

.btn-secondary-large {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.btn-secondary-large:hover {
    color: #ffffff;
    border-color: var(--border-hover);
}

/* ==========================================================================
   LIVE PREVIEW STICKY CARD (DARK)
   ========================================================================== */
.preview-card-sticky {
    position: sticky;
    top: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.preview-card-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-live {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-emerald);
    background: rgba(52, 211, 153, 0.15);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.badge-type {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--brand-primary);
    background: rgba(249, 115, 22, 0.15);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.qr-canvas-holder {
    width: 256px;
    height: 256px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 12px;
    overflow: hidden;
}

.qr-canvas-holder canvas, .qr-canvas-holder svg {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.preview-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
}

.preview-meta h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-link-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-dark);
    padding: 4px 8px 4px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    max-width: 100%;
}

.preview-link-text {
    font-size: 0.72rem;
    font-family: monospace;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy-sm {
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s;
}

.btn-copy-sm:hover {
    color: var(--brand-primary);
}

.destination-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 100%;
}

.dest-preview-text {
    color: var(--brand-blue);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-quick-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-preview-action {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.btn-preview-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--brand-primary);
}

/* ==========================================================================
   DYNAMIC QR CODES MANAGEMENT LIST & CARDS (DARK)
   ========================================================================== */
.management-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title-group h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.section-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.list-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 280px;
}

.list-search-wrapper svg {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.list-search-wrapper input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem 0.65rem 2.4rem;
    font-size: 0.85rem;
    color: #ffffff;
    transition: all 0.15s ease;
}

.list-search-wrapper input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* QR Cards Grid */
.qr-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 480px) {
    .qr-cards-grid {
        grid-template-columns: 1fr;
    }
}

.qr-card-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.2s ease;
    position: relative;
}

.qr-card-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.qr-card-item.paused {
    opacity: 0.65;
    background: rgba(17, 24, 39, 0.5);
}

.qr-card-top {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.qr-card-thumb-wrap {
    width: 72px;
    height: 72px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.qr-card-thumb-wrap canvas {
    max-width: 100%;
    max-height: 100%;
}

.qr-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.qr-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.qr-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(52, 211, 153, 0.15);
    color: var(--brand-emerald);
}

.status-badge.paused {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.qr-card-date {
    font-size: 0.7rem;
    color: var(--text-subtle);
}

/* Destination Target Row with inline Edit button */
.qr-dest-box {
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dest-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dest-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-quick-edit-link {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: opacity 0.15s;
}

.btn-quick-edit-link:hover {
    opacity: 0.8;
}

.dest-url-value {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--brand-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.dest-url-value:hover {
    text-decoration: underline;
}

/* Dynamic Redirect URL Row */
.qr-redirect-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}

.redirect-slug-text {
    font-size: 0.72rem;
    font-family: monospace;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* QR Card Footer Stats & Actions */
.qr-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.85rem;
    gap: 0.5rem;
}

.scan-counter-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(249, 115, 22, 0.15);
    color: var(--brand-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: var(--radius-full);
}

.card-actions-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-action-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.btn-action-icon:hover {
    background: var(--bg-surface-elevated);
    color: #ffffff;
}

.btn-action-icon.danger:hover {
    background: rgba(251, 113, 133, 0.15);
    color: var(--brand-rose);
}

/* ==========================================================================
   MODALS & OVERLAYS (DARK)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-card.modal-large {
    max-width: 750px;
}

.modal-card.modal-print-card {
    max-width: 480px;
}

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.modal-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

.btn-close {
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.15s;
}

.btn-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-info-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.preview-mini-redirect {
    background: var(--bg-dark);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--border-subtle);
}

.preview-mini-redirect code {
    font-family: monospace;
    color: var(--brand-primary);
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-dark);
}

/* Analytics Modal Content */
.analytics-grid-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.analytics-stat-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.analytics-stat-card h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.breakdown-bar-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 2px;
}

.breakdown-bar {
    height: 100%;
    background: var(--brand-primary);
    border-radius: var(--radius-full);
}

.timeline-chart-holder {
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.timeline-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 110px;
    padding-top: 15px;
}

.timeline-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: 4px;
}

.bar-fill {
    width: 100%;
    max-width: 24px;
    background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
    border-radius: 4px 4px 0 0;
    min-height: 3px;
    transition: height 0.3s ease;
}

.col-date {
    font-size: 0.6rem;
    color: var(--text-subtle);
    white-space: nowrap;
}

.recent-scans-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.recent-scans-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-weight: 600;
}

.recent-scans-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

/* Print Stand Card View */
.print-sheet {
    padding: 2rem;
    display: flex;
    justify-content: center;
    background: #0f172a;
}

.print-card-frame {
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.print-brand {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.print-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
}

.print-qr-wrapper {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-instruction {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.print-link {
    font-size: 0.7rem;
    font-family: monospace;
    color: #64748b;
}

@media print {
    body * {
        visibility: hidden;
    }
    .print-sheet, .print-sheet * {
        visibility: visible;
    }
    .print-sheet {
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        background: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .no-print {
        display: none !important;
    }
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Empty State / Loading State */
.loading-state, .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    gap: 0.75rem;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(249, 115, 22, 0.15);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-zoom {
    animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; }

/* Footer */
.main-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-brand {
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
}

/* ==========================================================================
   AUTHENTICATION STYLES (HEADER & MODAL)
   ========================================================================== */
.header-auth-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}

.btn-auth-signup {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%) !important;
    color: #090d16 !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    padding: 8px 16px !important;
    border-radius: var(--radius-sm) !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.35) !important;
    transition: all 0.15s ease !important;
}

.btn-auth-signup:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.5) !important;
}

.auth-switch-link-wrap {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 6px;
}

.auth-switch-link-wrap a {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.auth-switch-link-wrap a:hover {
    color: #fbbf24;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px 5px 8px;
    border-radius: var(--radius-full);
}

.user-avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.user-name-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
}

.btn-signout {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-signout:hover {
    color: var(--brand-rose);
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.2);
}

/* Auth Modal Card */
.modal-auth-card {
    max-width: 440px;
}

.auth-tabs-row {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
    width: 260px;
}

.auth-tab-btn {
    flex: 1;
    text-align: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.auth-tab-btn.active {
    background: var(--bg-surface-elevated);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.auth-alert {
    background: rgba(251, 113, 133, 0.15);
    border: 1px solid rgba(251, 113, 133, 0.3);
    color: var(--brand-rose);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.auth-pass-field, .auth-email-field {
    background: var(--bg-surface-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1rem !important;
    color: #ffffff !important;
    width: 100%;
    transition: all 0.15s ease;
}

.auth-pass-field:focus, .auth-email-field:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2) !important;
}

.auth-unauthenticated-banner {
    grid-column: 1 / -1;
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auth-unauthenticated-banner h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.auth-unauthenticated-banner p {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 460px;
}
