:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --sidebar-bg: #0c1222;
    --sidebar-hover: #1a2332;
    --body-bg: #f4f6f9;
    --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--body-bg);
    color: #0f172a;
    line-height: 1.6;
}

.landing-nav {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #134e4a 50%, #0d9488 100%);
    color: #fff;
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.feature-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}
.btn-brand {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.25);
}
.btn-brand:hover { color: #fff; opacity: .92; }
.btn-outline-brand {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    border-radius: 10px;
}
.btn-outline-brand:hover { background: var(--primary); color: #fff; }

.admin-wrap { display: flex; min-height: 100vh; }
.sidebar {
    width: 268px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0a0f1a 100%);
    color: #94a3b8;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.sidebar-brand { padding: 24px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sidebar-brand h1 { font-size: 18px; font-weight: 700; color: #fff; margin: 0; }
.sidebar-brand small { color: #64748b; font-size: 12px; }
.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-nav .nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
    padding: 8px 12px 4px;
    font-weight: 600;
}
.sidebar-nav .nav-link {
    color: #94a3b8;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all .15s;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, .35);
}
.sidebar-footer { padding: 16px; border-top: 1px solid #1e293b; }
.main-content { margin-left: 268px; flex: 1; min-width: 0; }
.topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e8ecf1;
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
}
.page-body { padding: 28px 32px 40px; }
.page-title { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.page-subtitle { color: #64748b; font-size: 14px; margin-top: 4px; }

.card-modern {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}
.card-modern .card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px;
    font-weight: 600;
}
.table-modern { margin: 0; }
.table-modern thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 600;
    padding: 12px 16px;
}
.table-modern tbody td { padding: 14px 16px; vertical-align: middle; }
.table-modern tbody tr:hover { background: #f8fafc; }

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
.stat-card .stat-value { font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.stat-card .stat-label { color: #64748b; font-size: 13px; }

.filter-bar {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.pagination-wrap {
    background: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 14px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.pagination { margin: 0; }
.page-link { border-radius: 8px !important; margin: 0 2px; }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 50% at 20% 20%, rgba(13, 148, 136, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 85% 70%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 24px;
}
.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 24px 64px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(15, 23, 42, 0.06);
}
.form-control, .form-select {
    border-radius: 10px;
    border-color: #e2e8f0;
    padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
}
.alert-modern { border: none; border-radius: 10px; }

.hero-mockup { background: rgba(255,255,255,.08); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12); }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.mock-row { background: rgba(255,255,255,.06); padding: 8px 12px; border-radius: 8px; }

.workflow-step { display: flex; gap: 16px; margin-bottom: 20px; align-items: flex-start; }
.workflow-num { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

.pricing-card { background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: var(--card-shadow); position: relative; border: 2px solid transparent; }
.pricing-popular { border-color: var(--primary); transform: scale(1.02); }
.pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 16px; border-radius: 20px; }
.pricing-amount { font-size: 36px; font-weight: 800; color: var(--primary-dark); }
.pricing-amount small { font-size: 16px; font-weight: 500; color: #64748b; }
.pricing-features li { padding: 6px 0; border-bottom: 1px solid #f1f5f9; }

.ai-feature-card { border-left: 3px solid var(--primary); }
.cta-section { background: linear-gradient(135deg, #0f766e, #0d9488); }

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .pricing-popular { transform: none; }
    .mobile-menu-btn { line-height: 1; text-decoration: none; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .5);
        z-index: 150;
    }
    .sidebar-overlay.show { display: block; }
}

/* Tom Select — searchable dropdowns */
.ts-wrapper.form-select,
.ts-wrapper.single {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    min-height: auto;
}
.ts-wrapper .ts-control {
    min-height: 38px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    box-shadow: none;
}
.ts-wrapper.focus .ts-control {
    border-color: var(--primary, #0d9488);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
}
.ts-dropdown {
    border-radius: 8px;
    border-color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}
.ts-dropdown .dropdown-input {
    border: none;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 8px 12px;
    font-size: 14px;
}
.ts-dropdown .option.active {
    background: rgba(13, 148, 136, .1);
    color: #0f766e;
}

/* ── Usage guide (collapsible) ── */
.usage-guide {
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fbff;
    overflow: hidden;
}

.usage-guide-toggle {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    color: #0f172a;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.usage-guide-toggle::-webkit-details-marker {
    display: none;
}

.usage-guide-toggle:hover {
    background: #eef5ff;
}

.usage-guide-chevron {
    transition: transform .2s ease;
    color: #64748b;
}

.usage-guide[open] .usage-guide-chevron {
    transform: rotate(180deg);
}

.usage-guide-body {
    padding: 0 16px 14px;
    border-top: 1px solid #e2e8f0;
}

.usage-guide-steps {
    margin: 12px 0 0;
    padding-left: 1.2rem;
    color: #334155;
    font-size: 14px;
    line-height: 1.55;
}

.usage-guide-steps li + li {
    margin-top: 6px;
}

.usage-guide-tips {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.usage-guide-tip {
    font-size: 13px;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.usage-guide-tip i {
    color: #f59e0b;
}
