:root {
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    /* Use site / Bootstrap theme colors (do not override with custom blues) */
    --primary: var(--bs-primary, #0d6efd);
    --accent: var(--accent-color, var(--bs-primary, #0d6efd));
    --border: #e0e5ec;
    --text-main: #2d3748;
    --text-muted: #718096;
    --code-bg: #f1f3f5;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Sidebar (Bootstrap collapse) */
.sidebar .nav-link {
    color: var(--nav-color, var(--text-main));
    font-weight: 500;
    padding: 0.65rem 0.7rem;
    border-radius: 10px;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #f1f5f9;
    color: var(--accent-color, var(--nav-hover-color, var(--nav-color, var(--text-main))));
    font-weight: 600;
}
.sidebar .nav-item .collapse .nav-link,
.sidebar .nav-item .collapsing .nav-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.45rem 0.9rem;
    /* Avoid any "font-size tween" feeling during collapse expand */
    transition: none;
}
.sidebar .nav-item .collapse .nav-link:hover {
    color: var(--accent-color, var(--nav-hover-color, var(--nav-color, var(--text-main))));
    font-weight: 600;
}

/* Smooth bold-on-hover for both items and sub-items */
.sidebar .nav-link {
    transition: background-color 0.2s ease, color 0.2s ease, font-weight 0.2s ease;
}
.sidebar .nav-link[data-bs-toggle="collapse"] .bi-caret-down-fill {
    transition: transform 0.3s ease;
}
.sidebar .nav-link[data-bs-toggle="collapse"]:not(.collapsed) .bi-caret-down-fill {
    transform: rotate(180deg);
}

/* ---------------- Tools landing + sidebar UX ---------------- */

.tool-tile {
    display: block;
    height: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 14px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tool-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(10, 25, 47, 0.08);
    border-color: color-mix(in srgb, var(--bs-primary, #0d6efd), var(--border) 70%);
}
.tool-tile .tool-tile-title {
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
    font-size: 1.03rem;
}
.tool-tile .tool-tile-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0;
}
.tool-tile .tool-tile-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    background: color-mix(in srgb, var(--bs-primary, #0d6efd), transparent 92%);
    color: var(--bs-primary, #0d6efd);
}

.tool-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.tool-row + .tool-row {
    margin-top: 10px;
}
.tool-row .tool-row-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bs-primary, #0d6efd), transparent 92%);
    color: var(--bs-primary, #0d6efd);
}
.tool-row .tool-row-body {
    flex: 1 1 auto;
    min-width: 0;
}
.tool-row .tool-row-title {
    font-weight: 700;
    margin: 0;
    font-size: 0.98rem;
}
.tool-row .tool-row-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 2px 0 0 0;
}
.tool-row .tool-row-action {
    flex: 0 0 auto;
}


/* Card Styling: Soft shadows and crisp borders */
.bd.shadow {
    background: var(--bg-card);
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    padding: 1.5rem !important;
}

/* Inputs: Clean and focused */
.form-control,
.form-select {
    border: 1px solid var(--border);
    background-color: #fff;
    color: var(--text-main);
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 97, 242, 0.1);
}

/* High-tech Field Rows */
#isoField {
    background: #fff;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    padding: 6px 10px;
    gap: 10px;
    transition: background 0.2s ease;
}

#isoField:hover {
    background: #fbfcfe;
}

/* Result Area: Monospace font for data integrity */
.tech-box {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background-color: var(--code-bg);
    border: 1px solid var(--border);
    font-size: 13px;
    color: #1a202c;
}

/* Typography */
h1 {
    font-weight: 700;
    color: #1a202c;
    font-size: 1.75rem;
}

h2 {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.monospace {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}