/* ═══════════════════════════════════════════════════════════════════════════
   MAGIC TOOLBOX DESIGN SYSTEM
   Editorial aesthetic inspired by similarwebGeography
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');

:root {
    /* ─────────────────────────────────────────────────────────────────────────
       CORE COLORS - Editorial palette
       ───────────────────────────────────────────────────────────────────────── */
    --ink: #0d0d0d;
    --paper: #fafaf8;
    --cream: #f5f4f0;
    --stone: #e8e6e1;
    --slate: #64635e;
    --graphite: #3d3c38;

    /* ─────────────────────────────────────────────────────────────────────────
       ACCENT COLORS
       ───────────────────────────────────────────────────────────────────────── */
    --accent: #1a73e8;
    --accent-soft: rgba(26, 115, 232, 0.08);
    --kernel: #8fa998;
    --kernel-soft: rgba(143, 169, 152, 0.12);
    --success: #0d9488;
    --success-soft: rgba(13, 148, 136, 0.1);
    --warning: #dc6b2f;
    --warning-soft: rgba(220, 107, 47, 0.1);
    --danger: #c53030;
    --danger-soft: rgba(197, 48, 48, 0.1);
    --salesforce: #0176d3;
    --salesforce-soft: rgba(1, 118, 211, 0.08);

    /* ─────────────────────────────────────────────────────────────────────────
       TYPOGRAPHY
       ───────────────────────────────────────────────────────────────────────── */
    --serif: 'Fraunces', Georgia, serif;
    --mono: 'Geist Mono', 'SF Mono', ui-monospace, monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* ─────────────────────────────────────────────────────────────────────────
       SPACING & SIZING
       ───────────────────────────────────────────────────────────────────────── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 100px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

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

::selection {
    background: var(--kernel);
    color: white;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Topographic background pattern */
.topo-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 10c22 0 40 18 40 40s-18 40-40 40S10 72 10 50 28 10 50 10zm0 10c-16.5 0-30 13.5-30 30s13.5 30 30 30 30-13.5 30-30-13.5-30-30-30zm0 10c11 0 20 9 20 20s-9 20-20 20-20-9-20-20 9-20 20-20z' fill='none' stroke='%23000' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    z-index: -1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

h1, h2, h3, .heading-serif {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

h4, h5, h6 {
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ink);
}

h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    color: var(--graphite);
    margin-bottom: 1rem;
}

.label-mono {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate);
}

.text-muted { color: var(--slate) !important; }
.text-secondary { color: var(--graphite) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   EYEBROW / LABEL COMPONENT
   ═══════════════════════════════════════════════════════════════════════════ */

.eyebrow {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--kernel);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--kernel);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
    background: white;
    border: 1px solid var(--stone);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: var(--slate);
}

.card-body {
    padding: 2rem;
}

.card-header {
    padding: 1.25rem 2rem;
    background: var(--cream);
    border-bottom: 1px solid var(--stone);
}

.card-header h5 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.125rem;
}

.card-title {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.card-text {
    font-size: 0.875rem;
    color: var(--slate);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

/* Tool Cards */
.tool-card {
    border: 1px solid var(--stone);
    border-radius: var(--radius-lg);
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kernel);
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover {
    border-color: var(--kernel);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card.salesforce::before {
    background: var(--salesforce);
}

.tool-card.danger::before {
    background: var(--danger);
}

.tool-card.danger:hover {
    border-color: var(--danger);
}

/* Platform Cards (legacy support) */
.platform-card {
    border: 1px solid var(--stone);
    border-radius: var(--radius-lg);
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.platform-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kernel);
    opacity: 0;
    transition: opacity 0.3s;
}

.platform-card:hover {
    border-color: var(--slate);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.platform-card:hover::before {
    opacity: 1;
}

.salesforce-card::before {
    background: var(--salesforce);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

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

/* Primary - Ink/Dark */
.btn-primary {
    background: var(--ink);
    color: white;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: var(--graphite);
    color: white;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Kernel Green */
.btn-kernel {
    background: var(--kernel);
    color: white;
    box-shadow: 0 4px 14px rgba(143, 169, 152, 0.4);
}

.btn-kernel:hover {
    background: #7a9485;
    color: white;
    box-shadow: 0 8px 24px rgba(143, 169, 152, 0.5);
}

/* Salesforce */
.btn-salesforce {
    background: var(--salesforce);
    color: white;
    box-shadow: 0 4px 14px rgba(1, 118, 211, 0.3);
}

.btn-salesforce:hover {
    background: #0163b5;
    color: white;
    box-shadow: 0 8px 24px rgba(1, 118, 211, 0.4);
}

/* Success */
.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.btn-success:hover {
    background: #0b8076;
    color: white;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px rgba(197, 48, 48, 0.3);
}

.btn-danger:hover {
    background: #a82828;
    color: white;
    box-shadow: 0 8px 24px rgba(197, 48, 48, 0.4);
}

/* Warning */
.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: 0 4px 14px rgba(220, 107, 47, 0.3);
}

.btn-warning:hover {
    background: #c55c25;
    color: white;
    box-shadow: 0 8px 24px rgba(220, 107, 47, 0.4);
}

/* Secondary / Outline */
.btn-secondary {
    background: white;
    color: var(--ink);
    border: 1px solid var(--stone);
}

.btn-secondary:hover {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--slate);
    border: 1px solid var(--stone);
}

.btn-outline-secondary:hover {
    background: var(--cream);
    color: var(--ink);
    border-color: var(--slate);
}

/* Sizes */
.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Disabled */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate);
    margin-bottom: 0.75rem;
}

.form-control,
.form-select,
textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    font-family: var(--sans);
    font-size: 1rem;
    border: 1px solid var(--stone);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--ink);
    transition: all 0.2s;
}

.form-control:hover,
.form-select:hover,
textarea:hover {
    border-color: var(--slate);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
    background: white;
}

.form-control::placeholder,
textarea::placeholder {
    color: var(--slate);
}

.form-text {
    font-size: 0.75rem;
    color: var(--slate);
    margin-top: 0.5rem;
}

.form-text a {
    color: var(--kernel);
    text-decoration: none;
}

.form-text a:hover {
    text-decoration: underline;
}

/* Checkboxes */
.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--stone);
    border-radius: 4px;
    transition: all 0.2s;
}

.form-check-input:checked {
    background-color: var(--ink);
    border-color: var(--ink);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--graphite);
}

/* Input Groups */
.input-group-text {
    background: var(--cream);
    border: 1px solid var(--stone);
    color: var(--slate);
    border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-family: var(--mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate);
    background: var(--cream);
    border-bottom: 1px solid var(--stone);
}

.table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--stone);
    font-size: 0.875rem;
}

.table tbody td:first-child {
    font-family: var(--mono);
    font-weight: 500;
}

.table tbody tr:hover td {
    background: var(--cream);
}

/* Table Card Wrapper */
.table-card {
    background: white;
    border: 1px solid var(--stone);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.table-title {
    font-family: var(--serif);
    font-size: 1.25rem;
}

.table-container {
    max-height: 500px;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.bg-primary,
.badge-default {
    background: var(--cream) !important;
    color: var(--graphite) !important;
}

.bg-success,
.badge-success {
    background: var(--success-soft) !important;
    color: var(--success) !important;
}

.bg-danger,
.badge-error {
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
}

.bg-warning {
    background: var(--warning-soft) !important;
    color: var(--warning) !important;
}

.bg-info {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
}

.bg-secondary {
    background: var(--cream) !important;
    color: var(--slate) !important;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pill.success {
    background: var(--success-soft);
    color: var(--success);
}

.status-pill.error {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-pill.pending {
    background: var(--cream);
    color: var(--slate);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: var(--danger-soft);
    border: 1px solid rgba(197, 48, 48, 0.2);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-soft);
    border: 1px solid rgba(220, 107, 47, 0.2);
    color: #92400e;
}

.alert-success {
    background: var(--success-soft);
    border: 1px solid rgba(13, 148, 136, 0.2);
    color: var(--success);
}

.alert-info {
    background: var(--accent-soft);
    border: 1px solid rgba(26, 115, 232, 0.2);
    color: var(--accent);
}

/* Flash Messages */
.alert-flash {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 300px;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
    background: white;
    border-right: 1px solid var(--stone);
    min-height: 100vh;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--stone);
    background: white;
    position: sticky;
    top: 0;
    z-index: 1021;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    background: var(--ink);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.25rem;
}

.sidebar-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--ink);
    margin: 0;
}

.sidebar-subtitle {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate);
    margin-top: 0.25rem;
}

.sidebar-heading {
    padding: 1.5rem 1.5rem 0.5rem;
    font-family: var(--mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate);
}

.sidebar .nav-link {
    color: var(--graphite);
    padding: 0.75rem 1.5rem;
    margin: 0.125rem 0;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 2px solid transparent;
    text-decoration: none;
}

.sidebar .nav-link:hover {
    background: var(--cream);
    color: var(--ink);
    border-left-color: var(--stone);
}

.sidebar .nav-link.active {
    background: var(--cream);
    color: var(--ink);
    font-weight: 600;
    border-left-color: var(--ink);
}

.sidebar .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Category icon colors */
.icon-data-quality { color: var(--danger); }
.icon-diagnostics { color: var(--accent); }
.icon-account-mgmt { color: var(--salesforce); }
.icon-sourcing { color: var(--success); }
.icon-utilities { color: var(--slate); }
.icon-portal { color: #8b5cf6; }

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════ */

.main-content {
    background: var(--paper);
    min-height: 100vh;
    padding: 3rem;
    position: relative;
}

/* Section Header - Editorial Style */
.section-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: end;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--stone);
}

.section-content {
    max-width: 500px;
}

.section-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0;
}

.section-title em {
    font-style: italic;
    color: var(--kernel);
}

.section-desc {
    font-size: 1rem;
    color: var(--graphite);
    margin-top: 1rem;
    max-width: 400px;
}

/* Section Icon */
.section-icon {
    width: 100px;
    height: 100px;
    position: relative;
}

.section-icon-ring {
    position: absolute;
    border: 1px solid var(--stone);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}

.section-icon-ring:nth-child(1) { inset: 0; animation-delay: 0s; }
.section-icon-ring:nth-child(2) { inset: 15px; animation-delay: 0.5s; }
.section-icon-ring:nth-child(3) { inset: 30px; animation-delay: 1s; }

.section-icon-center {
    position: absolute;
    inset: 35px;
    background: var(--ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

/* Platform Icons */
.platform-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: var(--ink);
}

.platform-icon.salesforce {
    background: var(--salesforce);
}

.platform-icon.success {
    background: var(--success);
}

.platform-icon.danger {
    background: var(--danger);
}

.platform-icon.warning {
    background: var(--warning);
}

.platform-icon.purple {
    background: #8b5cf6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROGRESS & LOADING
   ═══════════════════════════════════════════════════════════════════════════ */

.progress-card {
    background: white;
    border: 1px solid var(--stone);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

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

.progress-title {
    font-family: var(--serif);
    font-size: 1.25rem;
}

.progress-count {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--kernel);
}

.progress-track {
    height: 4px;
    background: var(--cream);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--ink);
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease;
}

/* Bootstrap Progress Override */
.progress {
    height: 4px;
    border-radius: 2px;
    background-color: var(--cream);
    overflow: hidden;
}

.progress .progress-bar {
    background: var(--ink);
}

/* Log/Console Output */
.progress-log {
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 2;
    color: var(--slate);
}

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

.log-item.success { color: var(--success); }
.log-item.error { color: var(--danger); }

/* Status Messages */
#statusMessages {
    max-height: 300px;
    overflow-y: auto;
    background: var(--ink);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.8;
}

/* Spinner */
.spinner-border {
    color: var(--ink);
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-spinner.active {
    display: block;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   FILE UPLOAD
   ═══════════════════════════════════════════════════════════════════════════ */

.upload-area {
    border: 2px dashed var(--stone);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--ink);
    background: var(--cream);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--cream);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--slate);
    transition: all 0.3s;
}

.upload-area:hover .upload-icon {
    background: var(--ink);
    color: white;
    transform: scale(1.1);
}

.upload-title {
    font-family: var(--serif);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    font-size: 0.85rem;
    color: var(--slate);
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--success-soft);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.file-selected-icon {
    width: 40px;
    height: 40px;
    background: var(--success);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-selected-name {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CODE BLOCKS
   ═══════════════════════════════════════════════════════════════════════════ */

.code-block,
pre,
code {
    font-family: var(--mono);
}

pre, .code-block {
    background: var(--ink);
    color: #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    overflow-x: auto;
}

code {
    background: var(--cream);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--graphite);
}

pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCORDION / DETAILS
   ═══════════════════════════════════════════════════════════════════════════ */

.info-accordion {
    background: white;
    border: 1px solid var(--stone);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.info-accordion summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--ink);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-accordion summary::-webkit-details-marker {
    display: none;
}

.info-accordion summary::before {
    content: '\F282';
    font-family: 'bootstrap-icons';
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.info-accordion[open] summary::before {
    transform: rotate(90deg);
}

.info-accordion .accordion-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--graphite);
    font-size: 0.9rem;
}

.info-accordion code {
    background: var(--cream);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--stone);
    padding: 1.5rem 2rem;
}

.modal-title {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--ink);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--stone);
    padding: 1rem 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BACK BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate);
    text-decoration: none;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.back-button:hover {
    color: var(--ink);
    text-decoration: none;
}

.back-button i {
    font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOOL CONTAINER (for standalone pages)
   ═══════════════════════════════════════════════════════════════════════════ */

.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--stone);
}

.tool-icon {
    width: 72px;
    height: 72px;
    background: var(--ink);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.tool-icon.salesforce {
    background: var(--salesforce);
}

.tool-icon.success {
    background: var(--success);
}

.tool-icon.danger {
    background: var(--danger);
}

.tool-header h1 {
    font-family: var(--serif);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.tool-header p {
    font-size: 1.1rem;
    color: var(--graphite);
    max-width: 500px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Mobile Sidebar Toggle */
.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1050;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ink);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    font-size: 1.25rem;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
}

.sidebar-mobile-toggle:hover {
    transform: scale(1.1);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1040;
        transition: left 0.3s ease;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-mobile-toggle {
        display: flex;
    }

    .main-content {
        padding: 2rem 1.5rem;
    }

    .section-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .section-icon {
        display: none;
    }

    .tool-container {
        padding: 2rem 1rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideUp 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAT BLOCKS (for metrics display)
   ═══════════════════════════════════════════════════════════════════════════ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    border: 1px solid var(--stone);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
}

.stat-block {
    padding: 2rem;
    position: relative;
    transition: background 0.3s;
    border-right: 1px solid var(--stone);
}

.stat-block:last-child {
    border-right: none;
}

.stat-block:hover {
    background: var(--cream);
}

.stat-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink);
}

.stat-value {
    font-family: var(--serif);
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.stat-subtext {
    font-size: 0.8rem;
    color: var(--slate);
}

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

    .stat-block {
        border-right: none;
        border-bottom: 1px solid var(--stone);
    }

    .stat-block:last-child {
        border-bottom: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

.bg-cream { background: var(--cream); }
.bg-paper { background: var(--paper); }
.border-stone { border-color: var(--stone) !important; }
.text-kernel { color: var(--kernel) !important; }
.text-salesforce { color: var(--salesforce) !important; }

/* Gap utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.gap-5 { gap: 2rem; }
