/* ── Global Variables ────────────────────────────────── */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --light-2: #f1f5f9;
    --border: #e2e8f0;
    --white: #ffffff;
    --sidebar-width: 270px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    --transition: all 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95) !important;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}
.navbar-brand span { color: var(--primary); }
.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}
.navbar-nav .nav-link:hover { background: var(--light-2); }
.navbar-toggler { border: none; padding: 0.5rem; }
.navbar-toggler:focus { box-shadow: none; }

/* ── Hero Section ───────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 50%, #1e3a8a 100%);
    color: #fff;
    padding: 120px 0 100px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -1px;
}
.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 550px;
    line-height: 1.7;
}
.hero-section .btn {
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: 10px;
    font-size: 1rem;
}
.hero-section .btn-light {
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.hero-section .btn-outline-light {
    border-width: 2px;
}

/* ── Sections ───────────────────────────────────────── */
.section-padding { padding: 100px 0; }
.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    color: var(--dark);
}
.section-subtitle {
    color: var(--gray);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Feature Cards ──────────────────────────────────── */
.feature-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--border);
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}
.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.6rem;
    color: #fff;
}
.feature-card h5 {
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}
.feature-card p {
    color: var(--gray);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* ── Product Cards ──────────────────────────────────── */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}
.product-card.border-primary {
    border-color: var(--primary);
    border-width: 2px;
}
.product-card ul {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}
.product-card .btn { margin-top: auto; }

/* ── Table Card (for product sections) ──────────────── */
.table-card.product-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.table-card.product-section ul {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}
.table-card.product-section .d-flex.gap-2 { margin-top: auto; }

/* ── Pricing Cards ──────────────────────────────────── */
.pricing-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    text-align: left;
    flex-grow: 1;
}
.pricing-card .btn { margin-top: auto; }
.pricing-card.popular {
    border-color: var(--primary);
    position: relative;
    transform: scale(1.02);
}
.pricing-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
}
.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}
.pricing-card.popular:hover {
    transform: scale(1.02) translateY(-6px);
}
.pricing-card h5 {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0.75rem 0 0.5rem;
    letter-spacing: -1px;
}
.pricing-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--gray);
}
.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    text-align: left;
}
.pricing-card ul li {
    padding: 0.5rem 0;
    color: var(--gray);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.pricing-card ul li:last-child { border-bottom: none; }
.pricing-card .btn {
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    border-radius: 10px;
}

/* ── Pricing Toggle ─────────────────────────────────── */
.pricing-toggle .btn-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.pricing-toggle .btn {
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ── How It Works ───────────────────────────────────── */
.step-number {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* ── Auth Pages ─────────────────────────────────────── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    padding: 1rem;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
}
.auth-card h2 {
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.75rem;
}
.auth-card .subtitle {
    color: var(--gray);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
.auth-card .form-control {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
}
.auth-card .btn {
    padding: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    font-size: 1rem;
}

/* ── Dashboard Layout ───────────────────────────────── */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header h5 {
    margin: 0;
    font-weight: 800;
    font-size: 1.15rem;
}
.sidebar-header small {
    opacity: 0.5;
    font-size: 0.8rem;
}
.sidebar-header .badge {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-nav { padding: 0.5rem 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}
.sidebar-nav a.active {
    border-left-color: var(--primary);
    background: rgba(37,99,235,0.1);
}

/* ── Sidebar Dropdown ───────────────────────────────── */
.sidebar-dropdown { margin: 0; }
.sidebar-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.5rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.sidebar-dropdown-header:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.03);
}
.sidebar-dropdown-header .arrow {
    font-size: 0.55rem;
    transition: var(--transition);
}
.sidebar-dropdown.open .sidebar-dropdown-header { color: rgba(255,255,255,0.8); }
.sidebar-dropdown.open .sidebar-dropdown-header .arrow { color: var(--primary); }
.sidebar-dropdown-items { overflow: hidden; }
.sidebar-dropdown-items a {
    padding-left: 2.5rem !important;
    font-size: 0.85rem;
}
.sidebar-dropdown-items .disabled-link {
    color: rgba(255,255,255,0.2) !important;
    cursor: not-allowed !important;
    pointer-events: none;
}
.sidebar-dropdown-items .disabled-link:hover {
    background: transparent !important;
    color: rgba(255,255,255,0.2) !important;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.5rem 1.5rem;
}
.sidebar-logout { color: rgba(255,255,255,0.4) !important; }
.sidebar-logout:hover { color: var(--danger) !important; background: rgba(239,68,68,0.1) !important; }

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
    background: var(--light);
}

/* ── Dashboard Cards ────────────────────────────────── */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}
.stat-info h3 {
    margin: 0;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}
.stat-info p {
    margin: 0;
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ── Tables ─────────────────────────────────────────── */
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.table-card .card-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.table-card .table { margin-bottom: 0; }
.table-card .table th {
    background: var(--light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}
.table-card .table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
.table-card .table tr:last-child td { border-bottom: none; }
.table-card .table tr:hover td { background: var(--light); }

/* ── Badges ─────────────────────────────────────────── */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: capitalize;
}
.badge-available { background: #dcfce7; color: #166534; }
.badge-sold { background: #dbeafe; color: #1e40af; }
.badge-expired { background: #fef3c7; color: #92400e; }
.badge-revoked { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
    font-weight: 600;
    border-radius: 10px;
    transition: var(--transition);
    font-size: 0.9rem;
}
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--secondary); border-color: var(--secondary); }
.btn-success:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); }

/* ── Forms ──────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--dark);
}

/* ── Footer ─────────────────────────────────────────── */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    padding: 4rem 0 2rem;
}
.footer h6 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}
.footer a { color: rgba(255,255,255,0.6); }
.footer a:hover { color: #fff; }
.footer ul li { margin-bottom: 0.5rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ── Sidebar Toggle (Mobile) ────────────────────────── */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    background: var(--dark);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* ── Responsive: Tablet (768px) ─────────────────────── */
@media (max-width: 1024px) {
    .hero-section h1 { font-size: 2.5rem; }
    .section-title { font-size: 1.75rem; }
    .pricing-card { padding: 1.75rem; }
    .pricing-price { font-size: 2rem; }
}

/* ── Responsive: Mobile (768px) ─────────────────────── */
@media (max-width: 768px) {
    /* Hero */
    .hero-section {
        padding: 80px 0 60px;
        text-align: center;
    }
    .hero-section h1 { font-size: 2rem; letter-spacing: -0.5px; }
    .hero-section p { font-size: 1rem; margin: 0 auto 1.5rem; }
    .hero-section .btn { display: block; width: 100%; margin-bottom: 0.75rem; }
    .hero-section .btn:last-child { margin-bottom: 0; }

    /* Sections */
    .section-padding { padding: 60px 0; }
    .section-title { font-size: 1.5rem; }
    .section-subtitle { font-size: 0.95rem; margin-bottom: 2rem; }

    /* Cards */
    .feature-card { padding: 1.5rem; }
    .pricing-card { padding: 1.5rem; }
    .pricing-card.popular { transform: none; }
    .pricing-card.popular:hover { transform: translateY(-4px); }
    .pricing-price { font-size: 2rem; }

    /* Steps */
    .step-number { width: 44px; height: 44px; font-size: 1.1rem; }

    /* Navbar */
    .navbar-collapse { background: var(--white); padding: 1rem; border-radius: 12px; margin-top: 0.5rem; box-shadow: var(--shadow-lg); }
    .navbar-nav .nav-link { padding: 0.75rem 1rem !important; }

    /* Auth */
    .auth-card { padding: 1.75rem; border-radius: 16px; }
    .auth-card h2 { font-size: 1.5rem; }

    /* Dashboard */
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
    .main-content { margin-left: 0; padding: 1rem; padding-top: 3.5rem; }
    .sidebar-toggle { display: block; }

    /* Stat cards */
    .stat-card { padding: 1rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .stat-info h3 { font-size: 1.25rem; }

    /* Tables */
    .table-card .table { font-size: 0.8rem; }
    .table-card .table th, .table-card .table td { padding: 0.5rem 0.75rem; }

    /* Footer */
    .footer { padding: 2.5rem 0 1.5rem; }
    .footer .col-md-4 { margin-bottom: 1.5rem; }
}

/* ── Responsive: Small Mobile (480px) ───────────────── */
@media (max-width: 480px) {
    .hero-section h1 { font-size: 1.75rem; }
    .hero-section p { font-size: 0.9rem; }
    .section-title { font-size: 1.3rem; }
    .pricing-price { font-size: 1.75rem; }
    .pricing-card ul li { font-size: 0.8rem; }
    .auth-card { padding: 1.25rem; }
    .main-content { padding: 0.75rem; padding-top: 3.5rem; }
}

/* ── Utilities ──────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--secondary) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }
