@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ═══════════════════════════════════════════════════════════════
   BASE COLOR SYSTEM — Default: Indigo/Violet (Home page)
   Each page overrides via body.page-* classes
   ═══════════════════════════════════════════════════════════════ */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --primary-glare: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.25);
    --primary-subtle: rgba(99, 102, 241, 0.06);

    --secondary-color: #64748b;
    --accent-color: #14b8a6;

    --bg-color: #f8fafc;
    --app-bg: radial-gradient(ellipse at top left, #ffffff 0%, #f1f5f9 50%, #e8ecf4 100%);

    --card-bg: rgba(255, 255, 255, 0.92);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.5);

    --text-main: #0f172a;
    --text-light: #475569;
    --text-muted: #94a3b8;

    --border-color: rgba(226, 232, 240, 0.8);
    --border-strong: #cbd5e1;

    --success-color: #10b981;
    --danger-color: #ef4444;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
    --shadow-glow: 0 8px 30px var(--primary-glare);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ═══════════════ PAGE-SPECIFIC COLOR OVERRIDES ═══════════════ */

.page-generator {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-gradient: linear-gradient(135deg, #3b82f6, #06b6d4);
    --primary-glare: rgba(59, 130, 246, 0.15);
    --primary-glow: rgba(59, 130, 246, 0.25);
    --primary-subtle: rgba(59, 130, 246, 0.06);
}

.page-barcode {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-gradient: linear-gradient(135deg, #10b981, #14b8a6);
    --primary-glare: rgba(16, 185, 129, 0.15);
    --primary-glow: rgba(16, 185, 129, 0.25);
    --primary-subtle: rgba(16, 185, 129, 0.06);
}

.page-sale {
    --primary-color: #f43f5e;
    --primary-dark: #e11d48;
    --primary-gradient: linear-gradient(135deg, #f43f5e, #f97316);
    --primary-glare: rgba(244, 63, 94, 0.15);
    --primary-glow: rgba(244, 63, 94, 0.25);
    --primary-subtle: rgba(244, 63, 94, 0.06);
}

.page-manual {
    --primary-color: #f59e0b;
    --primary-dark: #d97706;
    --primary-gradient: linear-gradient(135deg, #f59e0b, #eab308);
    --primary-glare: rgba(245, 158, 11, 0.15);
    --primary-glow: rgba(245, 158, 11, 0.25);
    --primary-subtle: rgba(245, 158, 11, 0.06);
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL RESET & BASE
   ═══════════════════════════════════════════════════════════════ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    background: var(--bg-color);
    background-image: var(--app-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.logo {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER & NAVIGATION — Premium Glassmorphism
   ═══════════════════════════════════════════════════════════════ */

.main-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 20px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
}

.header-top {
    padding: 18px 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

.logo {
    font-weight: 900;
    font-size: 28px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.logo::before {
    content: '\f02c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    -webkit-text-fill-color: initial;
    font-size: 24px;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.header-nav {
    padding: 0 32px;
    display: flex;
    justify-content: center;
    background: rgba(248, 250, 252, 0.3);
}

nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 14px 18px;
    position: relative;
    transition: var(--transition);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px 3px 0 0;
    transition: var(--transition);
    opacity: 0;
}

nav a:hover {
    color: var(--primary-color);
    background: var(--primary-subtle);
}

nav a:hover::after,
nav a.active::after {
    width: 70%;
    opacity: 1;
}

nav a.active {
    color: var(--primary-color);
    background: var(--primary-subtle);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER — Dark Premium
   ═══════════════════════════════════════════════════════════════ */

.main-footer {
    background: linear-gradient(180deg, #0c1222 0%, #0f172a 100%);
    color: #e2e8f0;
    padding: 64px 32px 44px;
    margin-top: auto;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.main-footer::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, var(--primary-subtle), transparent);
    pointer-events: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    position: relative;
    z-index: 1;
}

.main-footer .logo {
    -webkit-text-fill-color: #fff;
    font-size: 30px;
    filter: drop-shadow(0 0 20px var(--primary-glow));
}

.main-footer .logo::before {
    color: #fff;
}

.footer-links {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
}

/* Near Expiry Badge */
.near-expiry-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 8px;
    cursor: help;
}

.footer-links a:hover::after {
    width: 100%;
}

.main-footer p {
    color: #475569;
    font-size: 14px;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE HERO — Premium Animated Design
   ═══════════════════════════════════════════════════════════════ */

.landing-hero {
    text-align: center;
    padding: 100px 24px 70px;
    position: relative;
    overflow: hidden;
}

/* Animated gradient orb background */
.landing-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, var(--primary-glare) 0%, transparent 65%);
    z-index: -1;
    pointer-events: none;
    animation: orbPulse 8s ease-in-out infinite alternate;
}

.landing-hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: orbFloat 10s ease-in-out infinite alternate;
}

@keyframes orbPulse {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.7;
    }

    100% {
        transform: translateX(-50%) scale(1.15);
        opacity: 1;
    }
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-40px, -30px);
    }
}

.landing-hero h1 {
    font-size: 60px;
    font-weight: 900;
    margin-bottom: 24px;
    color: var(--text-main);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.landing-hero h1 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.landing-hero .subtitle {
    font-size: 20px;
    max-width: 640px;
    margin: 0 auto 48px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   STATS BAR — Landing page
   ═══════════════════════════════════════════════════════════════ */

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    max-width: 800px;
    margin: 0 auto 64px;
    padding: 32px 40px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 36px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   FEATURE GRID — Cards with per-module accent colors
   ═══════════════════════════════════════════════════════════════ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto 90px;
    padding: 0 24px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: var(--radius-xl);
    padding: 40px 32px 36px;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    transition: var(--transition);
}

/* Per-module accent colors on feature cards */
.feature-card[data-accent="generator"]::before {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    height: 4px;
}

.feature-card[data-accent="barcode"]::before {
    background: linear-gradient(90deg, #10b981, #14b8a6);
    height: 4px;
}

.feature-card[data-accent="sale"]::before {
    background: linear-gradient(90deg, #f43f5e, #f97316);
    height: 4px;
}

.feature-card[data-accent="calendar"]::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    height: 4px;
}

.feature-card[data-accent="schedule"]::before {
    background: linear-gradient(90deg, #06b6d4, #0ea5e9);
    height: 4px;
}

.feature-card[data-accent="inventory"]::before {
    background: linear-gradient(90deg, #64748b, #94a3b8);
    height: 4px;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg), 0 0 40px var(--primary-subtle);
    border-color: rgba(226, 232, 240, 0.3);
}

.feature-card:hover::before {
    height: 5px;
}

.feature-card[data-accent="generator"]:hover {
    box-shadow: var(--shadow-lg), 0 10px 40px rgba(59, 130, 246, 0.12);
}

.feature-card[data-accent="barcode"]:hover {
    box-shadow: var(--shadow-lg), 0 10px 40px rgba(16, 185, 129, 0.12);
}

.feature-card[data-accent="sale"]:hover {
    box-shadow: var(--shadow-lg), 0 10px 40px rgba(244, 63, 94, 0.12);
}

.feature-card[data-accent="calendar"]:hover {
    box-shadow: var(--shadow-lg), 0 10px 40px rgba(139, 92, 246, 0.12);
}

.feature-card[data-accent="schedule"]:hover {
    box-shadow: var(--shadow-lg), 0 10px 40px rgba(6, 182, 212, 0.12);
}

.feature-icon {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 24px;
    transition: var(--transition);
    position: relative;
}

/* Per-module icon colors */
.feature-card[data-accent="generator"] .feature-icon {
    color: #3b82f6;
}

.feature-card[data-accent="barcode"] .feature-icon {
    color: #10b981;
}

.feature-card[data-accent="sale"] .feature-icon {
    color: #f43f5e;
}

.feature-card[data-accent="calendar"] .feature-icon {
    color: #8b5cf6;
}

.feature-card[data-accent="schedule"] .feature-icon {
    color: #06b6d4;
}

.feature-card[data-accent="inventory"] .feature-icon {
    color: #64748b;
}

.feature-card[data-accent="generator"]:hover .feature-icon {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.feature-card[data-accent="barcode"]:hover .feature-icon {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.feature-card[data-accent="sale"]:hover .feature-icon {
    background: linear-gradient(135deg, #f43f5e, #f97316);
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 25px rgba(244, 63, 94, 0.3);
}

.feature-card[data-accent="calendar"]:hover .feature-icon {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.feature-card[data-accent="schedule"]:hover .feature-icon {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3);
}

.feature-card[data-accent="inventory"]:hover .feature-icon {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 25px rgba(100, 116, 139, 0.3);
}

.feature-card h2 {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-light);
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   APP CONTAINERS & HERO SECTIONS
   ═══════════════════════════════════════════════════════════════ */

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px 80px;
    width: 100%;
}

.hero-section {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-subtle) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-section h1 {
    font-size: 42px;
    margin: 0 0 12px;
    font-weight: 800;
}

.hero-section h1 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-light);
    font-size: 17px;
    margin: 0 auto 32px;
    max-width: 600px;
}

/* ═══════════════════════════════════════════════════════════════
   UPLOAD AREA
   ═══════════════════════════════════════════════════════════════ */

@keyframes dash {
    to {
        stroke-dashoffset: -20;
    }
}

.upload-area {
    background: var(--card-bg);
    border: 2px dashed var(--text-muted);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-xl);
    border: 2px dashed var(--primary-color);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.upload-area:hover,
.upload-area.dragover {
    background: #f8fafc;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), 0 0 30px var(--primary-subtle);
    border-color: transparent;
}

.upload-area:hover::before,
.upload-area.dragover::before {
    opacity: 1;
}

.upload-icon {
    font-size: 56px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    display: inline-block;
    transition: var(--transition);
}

.upload-area:hover .upload-icon {
    transform: scale(1.12) translateY(-4px);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.upload-label span {
    color: var(--primary-color);
    font-weight: 700;
    position: relative;
}

.upload-label span::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.upload-area:hover .upload-label span::after {
    transform: scaleX(1);
}

.upload-label small {
    color: var(--text-muted);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

#fileInput {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    max-width: 700px;
    margin: 0 auto;
}

.empty-state i {
    font-size: 56px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   APP TOOLBAR
   ═══════════════════════════════════════════════════════════════ */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

#searchInput {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: #f8fafc;
    color: var(--text-main);
    outline: none;
}

#searchInput:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-glare);
}

.result-badge {
    background: var(--primary-subtle);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    border: 1px solid var(--primary-glare);
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS WRAPPER
   ═══════════════════════════════════════════════════════════════ */

.settings-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    margin-right: 20px;
    background: var(--primary-subtle);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    border: 1px solid var(--primary-glare);
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item label {
    font-size: 13px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: var(--text-light);
}

.setting-item input,
.setting-item select {
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: #fff;
    outline: none;
    transition: var(--transition);
    min-width: 60px;
}

.setting-item input:focus,
.setting-item select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glare);
}

/* ═══════════════════════════════════════════════════════════════
   TABLE DESIGN
   ═══════════════════════════════════════════════════════════════ */

.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.table-header {
    background: linear-gradient(135deg, var(--primary-subtle), rgba(241, 245, 249, 0.8));
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-row {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: var(--primary-subtle);
}

.table-row.selected {
    background: var(--primary-subtle);
    border-left: 3px solid var(--primary-color);
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 3fr 1.5fr 1.5fr 1fr 1.5fr 1.5fr 1fr;
    align-items: center;
    padding: 16px 20px;
    gap: 16px;
}

/* Specific grids */
.barcode-app .table-header,
.barcode-app .table-row {
    grid-template-columns: 4fr 3fr 3fr 1fr;
}

.sale-app .table-header,
.sale-app .table-row {
    grid-template-columns: 3fr 2fr 2fr 2fr 1fr;
}

.col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.col.sale-price-col {
    font-weight: 700;
    color: var(--danger-color);
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px var(--primary-glare);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-strong);
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 15px;
    display: inline-block;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-subtle);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-strong);
    background: #fff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    font-size: 14px;
}

.btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-subtle);
    transform: scale(1.05);
}

.btn-icon.selected {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glare);
}

.btn-icon.selected:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-text:hover {
    background: var(--primary-subtle);
}

.btn-text.text-danger {
    color: var(--danger-color);
}

.btn-text.text-danger:hover {
    background: rgba(239, 68, 68, 0.06);
}

.btn-page {
    background: #fff;
    border: 1px solid var(--border-strong);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
    background: var(--primary-subtle);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.page-info {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
}

/* ═══════════════════════════════════════════════════════════════
   ACTION BAR — Sticky Bottom
   ═══════════════════════════════════════════════════════════════ */

.action-bar {
    position: sticky;
    bottom: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 20px 32px;
    margin-top: 32px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    flex-wrap: wrap;
    gap: 20px;
}

.selection-info {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.selection-count {
    background: var(--primary-gradient);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 8px var(--primary-glare);
}

.selection-actions {
    display: flex;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   SALE DISCOUNT INPUT
   ═══════════════════════════════════════════════════════════════ */

.discount-input {
    width: 70px;
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.discount-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glare);
}

/* ═══════════════════════════════════════════════════════════════
   MANUAL PAGE — Layout Utilities
   ═══════════════════════════════════════════════════════════════ */

.manual-container {
    background: transparent;
    padding-top: 20px;
}

.instructions-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.step {
    background: var(--card-bg);
    padding: 36px 32px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-number {
    position: absolute;
    top: -16px;
    left: -16px;
    width: 64px;
    height: 64px;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 28px;
    box-shadow: 0 8px 20px var(--primary-glare);
    transform: rotate(-5deg);
}

.step-content {
    margin-top: 16px;
}

.step-content h3 {
    margin-top: 0;
    color: var(--text-main);
    font-size: 20px;
}

.column-list {
    padding-left: 20px;
    margin: 16px 0;
}

.column-list li {
    margin-bottom: 8px;
    color: var(--text-light);
}

.column-list code {
    background: var(--primary-subtle);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    color: var(--primary-color);
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid var(--primary-glare);
}

.info-box {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid #bbf7d0;
    margin-bottom: 48px;
    position: relative;
    overflow: hidden;
}

.info-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(180deg, var(--success-color), #14b8a6);
}

.info-box h3 {
    margin-top: 0;
    color: #166534;
    font-size: 22px;
}

.info-box ul {
    color: #15803d;
}

.manual-section {
    margin-bottom: 64px;
}

.manual-section h2 {
    color: var(--text-main);
    font-size: 28px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.manual-section h2 i {
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}

/* Manual section icons get colors per module */
.manual-section:nth-child(1) h2 i {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.manual-section:nth-child(2) h2 i {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.manual-section:nth-child(3) h2 i {
    background: linear-gradient(135deg, #f43f5e, #f97316);
}

.manual-section:nth-child(4) h2 i {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.manual-section:nth-child(5) h2 i {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}

/* Manual section in manual-container context */
.manual-container .manual-section:nth-of-type(1) h2 i {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.manual-container .manual-section:nth-of-type(2) h2 i {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.manual-container .manual-section:nth-of-type(3) h2 i {
    background: linear-gradient(135deg, #f43f5e, #f97316);
}

.manual-container .manual-section:nth-of-type(4) h2 i {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.manual-container .manual-section:nth-of-type(5) h2 i {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

.app {
    animation: fadeSlideIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered entrance for feature cards */
.feature-card {
    animation: cardEntrance 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.feature-card:nth-child(1) {
    animation-delay: 0.05s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.15s;
}

.feature-card:nth-child(4) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(5) {
    animation-delay: 0.25s;
}

.feature-card:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    .table-header,
    .table-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .col:nth-child(2),
    .col:nth-child(3),
    .col:nth-child(4) {
        display: none;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .selection-actions {
        justify-content: center;
    }

    .main-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .header-nav nav {
        gap: 4px;
    }

    nav a {
        font-size: 13px;
        padding: 10px 12px;
    }

    .landing-hero h1 {
        font-size: 38px;
    }

    .landing-hero .subtitle {
        font-size: 17px;
    }

    .stats-bar {
        gap: 24px;
        padding: 24px;
    }

    .stat-number {
        font-size: 28px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PDF STYLES (PRESERVED — DO NOT MODIFY)
   ═══════════════════════════════════════════════════════════════ */

.pdf-container {
    width: 210mm;
    margin: 0 auto;
}

.page {
    width: 210mm;
    height: 297mm;
    padding: 10mm 12mm;
    background: #fff;
    position: relative;
    page-break-after: always;
    box-sizing: border-box;
}

.labels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, 44mm);
    gap: 2mm;
    align-content: start;
}

.label-card {
    border: 1px solid #1a237e;
    border-radius: 4px;
    padding: 0;
    page-break-inside: avoid;
    height: 44mm;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.label-header {
    background: #f5f5f5;
    color: #1a237e;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.2;
    padding: 3mm 4mm;
    border-bottom: 0.5px solid #e0e0e0;
    min-height: 14mm;
    display: flex;
    align-items: center;
}

.label-content {
    padding: 2mm 4mm;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Barcode specific styles */
.barcode-card .label-header {
    min-height: 12mm;
    font-size: 16px;
    font-weight: 800;
    padding: 3mm 4mm;
    background: #eef2ff;
    color: #1e1b4b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.barcode-content {
    align-items: center;
    justify-content: center;
    padding: 2mm 4mm;
}

.barcode-svg,
.barcode-canvas {
    max-width: 100%;
    height: auto;
    max-height: 25mm;
}

/* Sale card styles */
.sale-card {
    position: relative;
    overflow: hidden;
    border: 2px solid #ef4444 !important;
}

.sale-badge {
    background: #ef4444;
    color: white;
    font-weight: 800;
    text-align: center;
    padding: 2mm 0;
    font-size: 14px;
    letter-spacing: 1px;
}

.sale-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 1mm 4mm;
}

.original-price {
    font-size: 14px;
    color: #64748b;
    text-decoration: line-through;
    margin-bottom: 1mm;
}

.discount-tag {
    background: #fee2e2;
    color: #ef4444;
    font-weight: 700;
    padding: 1mm 3mm;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 2mm;
}

.sale-price {
    font-size: 24px;
    font-weight: 900;
    color: #ef4444;
}

.sale-footer {
    padding: 2mm 4mm;
    font-size: 10px;
    color: #64748b;
    border-top: 1px solid #fee2e2;
    display: flex;
    justify-content: space-between;
}

/* New Sale Label Design */
.sale-page {
    width: 210mm;
    height: 297mm;
    padding: 10mm;
    background: #fff;
    position: relative;
    page-break-after: always;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.sale-labels-grid {
    display: grid;
    gap: 2mm;
    align-content: start;
    flex: 1;
}

.sale-card-new {
    border: 2px solid #e11d48;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    page-break-inside: avoid;
    box-sizing: border-box;
    margin: 0.5mm;
}

.sale-badge-new {
    background: #e11d48;
    color: white;
    font-weight: 900;
    text-align: center;
    padding: 3px 0;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.sale-card-content {
    padding: 1.5mm 3mm;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    overflow: hidden;
}

.sale-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
    margin-bottom: 1mm;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sale-prices {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

.sale-old-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

.sale-new-price {
    font-size: 26px;
    font-weight: 900;
    color: #e11d48;
    line-height: 1;
}

.sale-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1mm;
    padding-bottom: 1mm;
}

.sale-discount {
    background: #ffe4e6;
    color: #e11d48;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.sale-sku {
    font-size: 9px;
    color: #94a3b8;
    font-weight: 600;
}

.label-price {
    text-align: center;
    color: #283593;
    font-weight: 800;
    font-size: 24px;
    margin: 2mm 0;
}

.label-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2mm;
    color: #37474f;
    font-size: 9px;
}

/* ═══════════════════════════════════════════════════════════════
   DISABLED FEATURE CARD & LINKS
   ═══════════════════════════════════════════════════════════════ */

a.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
    filter: grayscale(1);
    text-decoration: none;
}

.header-nav nav a.disabled::after {
    display: none;
}

.header-nav nav a.disabled:hover {
    color: var(--text-light) !important;
    background: transparent !important;
}

.feature-card.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.feature-card.disabled:hover::before {
    background: var(--border-color);
    height: 4px;
}

.feature-card.disabled:hover .feature-icon {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #64748b;
    transform: none;
    box-shadow: none;
}