/* ============================================================
   NetTools – Global Stylesheet (vollständig)
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables – Dark (Standard) ---------- */
:root {
    --bg-primary:     #0f1117;
    --bg-secondary:   #161b27;
    --bg-card:        #1a2035;
    --bg-hover:       #1e2540;
    --border:         #2a3147;
    --border-focus:   #3b82f6;
    --accent:         #3b82f6;
    --accent-hover:   #2563eb;
    --accent-light:   rgba(59,130,246,0.08);
    --accent-medium:  rgba(59,130,246,0.15);
    --text-primary:   #e8eaf0;
    --text-secondary: #8892a4;
    --text-muted:     #5a6478;
    --success:        #22c55e;
    --success-light:  rgba(34,197,94,0.1);
    --success-border: rgba(34,197,94,0.3);
    --warning:        #f59e0b;
    --warning-light:  rgba(245,158,11,0.1);
    --warning-border: rgba(245,158,11,0.3);
    --danger:         #ef4444;
    --danger-light:   rgba(239,68,68,0.1);
    --danger-border:  rgba(239,68,68,0.3);
    --info:           #06b6d4;
    --info-light:     rgba(6,182,212,0.1);
    --info-border:    rgba(6,182,212,0.3);
    --purple:         #a855f7;
    --purple-light:   rgba(168,85,247,0.1);
    --purple-border:  rgba(168,85,247,0.3);
    --radius:         10px;
    --radius-sm:      6px;
    --radius-lg:      14px;
    --radius-xl:      20px;
    --shadow:         0 4px 24px rgba(0,0,0,0.4);
    --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
    --shadow-accent:  0 4px 20px rgba(59,130,246,0.2);
    --transition:     0.18s ease;
    --transition-slow:0.3s ease;
    --navbar-height:  56px;
    --sidebar-width:  220px;
}

/* ---------- CSS Variables – Light ---------- */
[data-theme="light"] {
    --bg-primary:     #f1f5f9;
    --bg-secondary:   #ffffff;
    --bg-card:        #ffffff;
    --bg-hover:       #f8fafc;
    --border:         #e2e8f0;
    --border-focus:   #3b82f6;
    --accent:         #3b82f6;
    --accent-hover:   #2563eb;
    --accent-light:   rgba(59,130,246,0.07);
    --accent-medium:  rgba(59,130,246,0.12);
    --text-primary:   #1e293b;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --success:        #16a34a;
    --success-light:  rgba(22,163,74,0.08);
    --success-border: rgba(22,163,74,0.25);
    --warning:        #d97706;
    --warning-light:  rgba(217,119,6,0.08);
    --warning-border: rgba(217,119,6,0.25);
    --danger:         #dc2626;
    --danger-light:   rgba(220,38,38,0.08);
    --danger-border:  rgba(220,38,38,0.25);
    --info:           #0891b2;
    --info-light:     rgba(8,145,178,0.08);
    --info-border:    rgba(8,145,178,0.25);
    --purple:         #9333ea;
    --purple-light:   rgba(147,51,234,0.08);
    --purple-border:  rgba(147,51,234,0.25);
    --shadow:         0 4px 24px rgba(0,0,0,0.08);
    --shadow-sm:      0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg:      0 8px 40px rgba(0,0,0,0.12);
    --shadow-accent:  0 4px 20px rgba(59,130,246,0.15);
}

/* ============================================================
   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, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14px;
    transition: background var(--transition-slow), color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

button { font-family: inherit; }

input, select, textarea { font-family: inherit; }

ul, ol { list-style: none; }

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
    transition: background var(--transition);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--navbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background var(--transition-slow), border-color var(--transition-slow);
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    white-space: nowrap;
}

.navbar-brand:hover { color: var(--text-primary); }

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 16px 10px 32px;
    overflow-y: auto;
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    transition: background var(--transition-slow), border-color var(--transition-slow);
}

.sidebar-section {
    margin-bottom: 22px;
}

.sidebar-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 8px;
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.sidebar-link:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-medium);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-link .icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(8px);
    animation: fadeSlideIn 0.3s ease forwards;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-accent);
}

.card-flat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.card-header .card-title { margin-bottom: 0; }

.card-body { }

.card-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------- Card Variants ---------- */
.card-success {
    border-color: var(--success-border);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--success-light) 100%);
}

.card-warning {
    border-color: var(--warning-border);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--warning-light) 100%);
}

.card-danger {
    border-color: var(--danger-border);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--danger-light) 100%);
}

.card-info {
    border-color: var(--info-border);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--info-light) 100%);
}

.card-accent {
    border-color: var(--border-focus);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-light) 100%);
}

/* ============================================================
   INPUTS
   ============================================================ */

.input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-card);
}

.input:hover:not(:focus) {
    border-color: var(--text-muted);
}

.input::placeholder {
    color: var(--text-muted);
}

.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.input-lg {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius);
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-group .input { flex: 1; }

.input-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.input-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.input-error {
    font-size: 0.72rem;
    color: var(--danger);
    margin-top: 4px;
}

select.input {
    cursor: pointer;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892a4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

textarea.input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ---------- Checkbox & Radio ---------- */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.checkbox-label:hover,
.radio-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition),
        box-shadow var(--transition),
        opacity var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition);
}

.btn:hover::after { background: rgba(255,255,255,0.05); }

.btn:active {
    transform: scale(0.97);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-light);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Variants */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover { filter: brightness(1.1); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover { filter: brightness(1.1); }

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-warning:hover { filter: brightness(1.1); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent-light);
}

/* Sizes */
.btn-xs  { padding: 3px 8px;   font-size: 0.72rem; }
.btn-sm  { padding: 5px 12px;  font-size: 0.78rem; }
.btn-lg  { padding: 12px 22px; font-size: 0.95rem; border-radius: var(--radius); }
.btn-xl  { padding: 14px 28px; font-size: 1rem;    border-radius: var(--radius); }

.btn-icon { padding: 8px; }
.btn-icon-sm { padding: 5px; }

.btn-full { width: 100%; }

/* Loading state */
.btn-loading {
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success-border);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning-border);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger-border);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
    border-color: var(--info-border);
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
    border-color: rgba(59,130,246,0.3);
}

.badge-purple {
    background: var(--purple-light);
    color: var(--purple);
    border-color: var(--purple-border);
}

.badge-neutral {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-color: var(--border);
}

.badge-lg {
    padding: 4px 12px;
    font-size: 0.78rem;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

thead tr {
    background: var(--bg-primary);
}

th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
}

tr:last-child td { border-bottom: none; }

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover td {
    background: var(--accent-light);
}

.table-mono td {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.78rem;
}

/* ============================================================
   TABS
   ============================================================ */

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    font-family: inherit;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    outline: none;
}

.tab:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   SPINNER & LOADING
   ============================================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.loading-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--border) 0%,
        var(--bg-hover) 50%,
        var(--border) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress-wrap {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.progress-bar {
    height: 100%;
    border-radius: 20px;
    transition: width 0.6s ease;
    background: var(--accent);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: shimmer 1.5s ease infinite;
}

.progress-bar-success  { background: var(--success); }
.progress-bar-warning  { background: var(--warning); }
.progress-bar-danger   { background: var(--danger); }

/* ============================================================
   INFO ROWS
   ============================================================ */

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    font-size: 0.84rem;
    transition: background var(--transition);
}

.info-row:last-child { border-bottom: none; }

.info-row:hover {
    background: var(--accent-light);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: var(--radius-sm);
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    flex-shrink: 0;
    min-width: 140px;
    font-weight: 500;
}

.info-value {
    text-align: right;
    word-break: break-all;
    font-size: 0.84rem;
}

/* ============================================================
   CODE & PRE
   ============================================================ */

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.8em;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--accent);
}

pre {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.78rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.7;
    color: var(--text-primary);
}

pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* ============================================================
   EXPORT BAR
   ============================================================ */

.export-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    align-items: center;
}

.export-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 4px;
}

/* ============================================================
   ALERTS / NOTICE BOXES
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    border: 1px solid transparent;
    margin-bottom: 14px;
    line-height: 1.5;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.alert-success {
    background: var(--success-light);
    border-color: var(--success-border);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning-border);
    color: var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger);
}

.alert-info {
    background: var(--info-light);
    border-color: var(--info-border);
    color: var(--info);
}

.alert-neutral {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-secondary);
}

/* ============================================================
   TOOL CARDS (INDEX PAGE)
   ============================================================ */

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition:
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(59,130,246,0.18);
    color: inherit;
}

.tool-card:active { transform: translateY(-1px); }

.tool-icon {
    font-size: 1.7rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: border-color var(--transition), background var(--transition);
}

.tool-card:hover .tool-icon {
    border-color: var(--accent);
    background: var(--accent-light);
}

.tool-info { flex: 1; min-width: 0; }

.tool-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-desc {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.tool-category-label {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

/* ============================================================
   HISTORY ITEMS
   ============================================================ */

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 8px;
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition);
}

.history-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   STAT BOXES
   ============================================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    text-align: center;
    transition: border-color var(--transition);
}

.stat-box:hover { border-color: var(--accent); }

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-box-success .stat-value { color: var(--success); }
.stat-box-warning .stat-value { color: var(--warning); }
.stat-box-danger  .stat-value { color: var(--danger); }
.stat-box-info    .stat-value { color: var(--info); }
.stat-box-accent  .stat-value { color: var(--accent); }

/* ============================================================
   SCORE CIRCLE
   ============================================================ */

.score-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 1.4rem;
    font-weight: 800;
    border: 3px solid var(--border);
    flex-shrink: 0;
}

.score-circle.score-a { border-color: var(--success); color: var(--success); }
.score-circle.score-b { border-color: #84cc16;        color: #84cc16; }
.score-circle.score-c { border-color: var(--warning);  color: var(--warning); }
.score-circle.score-d { border-color: #f97316;         color: #f97316; }
.score-circle.score-f { border-color: var(--danger);   color: var(--danger); }

/* ============================================================
   TOOLTIPS (CSS only)
   ============================================================ */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    white-space: nowrap;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 999;
    font-weight: 500;
}

[data-tooltip]:hover::before { opacity: 1; }

/* ============================================================
   MAP PLACEHOLDER
   ============================================================ */

.map-box {
    width: 100%;
    height: 180px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-top: 12px;
    gap: 8px;
}

/* ============================================================
   CHIP / TAG
   ============================================================ */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 500;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: default;
    transition: border-color var(--transition), background var(--transition);
}

.chip:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

/* ============================================================
   COPY BUTTON
   ============================================================ */

.copy-btn {
    font-size: 0.72rem;
    padding: 2px 8px;
    cursor: pointer;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    transition: all var(--transition);
    font-family: inherit;
    font-weight: 600;
}

.copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 16px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

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

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

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

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

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

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.8); }
    60%  { opacity: 1; transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Animation Utility Classes */
.anim-fade-in       { animation: fadeIn 0.3s ease forwards; }
.anim-slide-in-up   { animation: slideInUp 0.3s ease forwards; }
.anim-slide-in-right{ animation: slideInRight 0.3s ease forwards; }
.anim-bounce-in     { animation: bounceIn 0.4s ease forwards; }
.anim-pulse         { animation: pulse 2s ease infinite; }
.anim-spin          { animation: spin 1s linear infinite; }

/* Staggered animation delays */
.delay-1  { animation-delay: 0.05s; }
.delay-2  { animation-delay: 0.1s; }
.delay-3  { animation-delay: 0.15s; }
.delay-4  { animation-delay: 0.2s; }
.delay-5  { animation-delay: 0.25s; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Colors */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.text-danger    { color: var(--danger) !important; }
.text-info      { color: var(--info) !important; }
.text-accent    { color: var(--accent) !important; }
.text-purple    { color: var(--purple) !important; }

/* Font weight */
.fw-normal   { font-weight: 400; }
.fw-medium   { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold     { font-weight: 700; }
.fw-black    { font-weight: 800; }

/* Font size */
.fs-xs  { font-size: 0.7rem; }
.fs-sm  { font-size: 0.78rem; }
.fs-md  { font-size: 0.88rem; }
.fs-lg  { font-size: 1rem; }
.fs-xl  { font-size: 1.2rem; }
.fs-2xl { font-size: 1.5rem; }

/* Text align */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Display */
.d-none    { display: none; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-inline  { display: inline; }
.d-inline-flex { display: inline-flex; }

/* Flex */
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap     { flex-wrap: wrap; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

/* Gap */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* Margin */
.mt-1 { margin-top:    4px; }  .mt-2 { margin-top:    8px; }
.mt-3 { margin-top:   12px; }  .mt-4 { margin-top:   16px; }
.mt-5 { margin-top:   20px; }  .mt-6 { margin-top:   24px; }
.mb-1 { margin-bottom: 4px; }  .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom:12px; }  .mb-4 { margin-bottom:16px; }
.mb-5 { margin-bottom:20px; }  .mb-6 { margin-bottom:24px; }
.ml-1 { margin-left:   4px; }  .ml-2 { margin-left:   8px; }
.mr-1 { margin-right:  4px; }  .mr-2 { margin-right:  8px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.p-1  { padding:  4px; }  .p-2  { padding:  8px; }
.p-3  { padding: 12px; }  .p-4  { padding: 16px; }
.pt-1 { padding-top:  4px; }  .pt-2 { padding-top:  8px; }
.pt-3 { padding-top: 12px; }  .pt-4 { padding-top: 16px; }

/* Width / Height */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.w-auto  { width: auto; }
.min-w-0 { min-width: 0; }

/* Border radius */
.rounded    { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Text */
.truncate   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.break-all  { word-break: break-all; }
.break-word { overflow-wrap: break-word; }
.uppercase  { text-transform: uppercase; }
.lowercase  { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.no-select  { user-select: none; -webkit-user-select: none; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-help    { cursor: help; }

/* Opacity */
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow    { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Border */
.border          { border: 1px solid var(--border); }
.border-top      { border-top: 1px solid var(--border); }
.border-bottom   { border-bottom: 1px solid var(--border); }
.border-success  { border-color: var(--success-border) !important; }
.border-warning  { border-color: var(--warning-border) !important; }
.border-danger   { border-color: var(--danger-border)  !important; }
.border-accent   { border-color: var(--accent) !important; }

/* Background */
.bg-primary   { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-card      { background: var(--bg-card); }
.bg-success   { background: var(--success-light); }
.bg-warning   { background: var(--warning-light); }
.bg-danger    { background: var(--danger-light); }
.bg-info      { background: var(--info-light); }
.bg-accent    { background: var(--accent-light); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }

/* Z-index */
.z-10  { z-index: 10; }
.z-50  { z-index: 50; }
.z-100 { z-index: 100; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    :root {
        --sidebar-width: 190px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main {
        max-width: 100vw;
        padding: 16px;
    }

    .input-group {
        flex-wrap: wrap;
    }

    .input-group .btn {
        width: 100%;
        justify-content: center;
    }

    .info-label {
        min-width: 100px;
    }

    .navbar {
        padding: 0 14px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    table {
        font-size: 0.78rem;
    }

    th, td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 14px;
    }

    .card-title {
        font-size: 0.92rem;
    }

    .tool-card {
        padding: 12px;
    }

    .tool-icon {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        gap: 0;
    }

    .tab {
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    .btn { padding: 8px 12px; }
    .btn-sm { padding: 4px 10px; }

    .export-bar { gap: 6px; }
    .export-bar .btn { font-size: 0.74rem; padding: 4px 9px; }
}

@media (max-width: 360px) {
    .navbar-brand { font-size: 0.95rem; }
    .main { padding: 12px; }
    .card { padding: 12px; }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    .navbar,
    .sidebar,
    .export-bar,
    .btn { display: none !important; }

    .main {
        max-width: 100%;
        padding: 0;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }

    body {
        background: #fff;
        color: #000;
    }
}
