/* ================= THEME VARIABLES ================= */
:root {
    /* Dark theme (default) */
    --bg-deep: #070b14;
    --bg-primary: #0c1120;
    --bg-surface: rgba(18, 26, 44, 0.75);
    --bg-surface-elevated: rgba(22, 32, 54, 0.85);
    --bg-surface-hover: rgba(30, 42, 66, 0.8);
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* Glass effects - increased opacity for better readability */
    --glass-bg: rgba(18, 26, 44, 0.8);
    --glass-bg-strong: rgba(18, 26, 44, 0.95);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-hover: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-inset: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);
    --glass-blur-strong: blur(32px);

    /* Refraction / light effects */
    --refraction: rgba(255, 255, 255, 0.04);
    --refraction-strong: rgba(255, 255, 255, 0.08);
    --refraction-accent: rgba(0, 212, 255, 0.06);

    /* Text */
    --text-primary: #f0f4f8;
    --text-secondary: #8b97a8;
    --text-muted: #5a6577;

    /* Brand colors */
    --primary: #00d4ff;
    --primary-frosted: rgba(0, 212, 255, 0.12);
    --primary-hover: #00b8e6;
    --primary-dark: #0099cc;

    /* Accent colors */
    --accent-warm: #ff6b35;
    --accent-warm-frosted: rgba(255, 107, 53, 0.12);
    --accent-green: #00e676;
    --accent-green-frosted: rgba(0, 230, 118, 0.12);
    --accent-red: #ff4757;
    --accent-red-frosted: rgba(255, 71, 87, 0.12);
    --accent-amber: #ffc107;
    --accent-amber-frosted: rgba(255, 193, 7, 0.12);
    --accent-purple: #a855f7;
    --accent-purple-frosted: rgba(168, 85, 247, 0.12);

    /* Semantic colors */
    --success: #00e676;
    --success-frosted: rgba(0, 230, 118, 0.1);
    --success-border: rgba(0, 230, 118, 0.25);
    --danger: #ff4757;
    --danger-frosted: rgba(255, 71, 87, 0.1);
    --danger-border: rgba(255, 71, 87, 0.25);
    --warning: #ffc107;
    --warning-frosted: rgba(255, 193, 7, 0.1);
    --warning-border: rgba(255, 193, 7, 0.25);
    --info: #00d4ff;
    --info-frosted: rgba(0, 212, 255, 0.1);
    --info-border: rgba(0, 212, 255, 0.25);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.03);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 0 rgba(255, 255, 255, 0.03);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Background gradient mesh */
    --mesh-color-1: rgba(0, 212, 255, 0.06);
    --mesh-color-2: rgba(168, 85, 247, 0.04);
    --mesh-color-3: rgba(255, 107, 53, 0.03);
    --grid-color: rgba(255, 255, 255, 0.015);
}

/* Light theme */
[data-bs-theme="light"] {
    --bg-deep: #e8edf4;
    --bg-primary: #f2f5f9;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-elevated: rgba(255, 255, 255, 0.95);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);
    --bg-overlay: rgba(255, 255, 255, 0.7);

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-bg-strong: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-border-hover: rgba(0, 0, 0, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-inset: inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
    --glass-blur: blur(20px);
    --glass-blur-strong: blur(32px);

    --refraction: rgba(0, 0, 0, 0.02);
    --refraction-strong: rgba(0, 0, 0, 0.04);
    --refraction-accent: rgba(0, 180, 220, 0.06);

    --text-primary: #1a2236;
    --text-secondary: #5a6577;
    --text-muted: #8b97a8;

    --primary: #00a0cc;
    --primary-frosted: rgba(0, 160, 204, 0.1);
    --primary-hover: #008bb8;
    --primary-dark: #0077a0;

    --accent-warm-frosted: rgba(255, 107, 53, 0.1);
    --accent-green-frosted: rgba(0, 200, 100, 0.1);
    --accent-red-frosted: rgba(255, 71, 87, 0.1);
    --accent-amber-frosted: rgba(255, 160, 0, 0.1);
    --accent-purple-frosted: rgba(168, 85, 247, 0.1);

    --success: #00b860;
    --success-frosted: rgba(0, 184, 96, 0.1);
    --success-border: rgba(0, 184, 96, 0.25);
    --danger: #e03a4a;
    --danger-frosted: rgba(224, 58, 74, 0.1);
    --danger-border: rgba(224, 58, 74, 0.25);
    --warning: #e0a000;
    --warning-frosted: rgba(224, 160, 0, 0.1);
    --warning-border: rgba(224, 160, 0, 0.25);
    --info: #00a0cc;
    --info-frosted: rgba(0, 160, 204, 0.1);
    --info-border: rgba(0, 160, 204, 0.25);

    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.6);

    --mesh-color-1: rgba(0, 160, 204, 0.08);
    --mesh-color-2: rgba(168, 85, 247, 0.06);
    --mesh-color-3: rgba(255, 107, 53, 0.05);
    --grid-color: rgba(0, 0, 0, 0.02);
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.3s ease;
}

/* Background gradient mesh */
.app-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 30%, var(--mesh-color-1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 15%, var(--mesh-color-2) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 85%, var(--mesh-color-3) 0%, transparent 45%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-primary) 100%);
}

.app-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

code, pre, .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ================= THEME TOGGLE ================= */
.theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    font-size: 18px;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--glass-border-hover);
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

.theme-toggle:active { transform: scale(0.95); }

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0);
    color: var(--accent-amber);
}

.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-bs-theme="light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-bs-theme="light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* ================= HEADER ================= */
.ipam-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 24px;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-base);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 20px;
    transition: var(--transition-fast);
}

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

.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    transition: var(--transition-base);
}

.header-brand:hover .brand-icon {
    transform: scale(1.05);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.mobile-nav-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Header center - search */
.header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}

.global-search-form { position: relative; }

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
    transition: var(--transition-fast);
    z-index: 2;
}

.global-search-input {
    width: 100%;
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    padding: 8px 16px 8px 40px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    height: 40px;
    transition: var(--transition-base);
}

.global-search-input::placeholder { color: var(--text-secondary); }

.global-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface-elevated);
    box-shadow: 0 0 0 3px var(--primary-frosted);
}

.global-search-input:focus + .search-icon,
.global-search-input:focus ~ .search-icon { color: var(--primary); }

/* Header right */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.header-user:hover {
    border-color: var(--glass-border-hover);
    background: var(--bg-surface-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-role-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--primary-frosted);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--info-border);
}

.btn-header-logout {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-header-logout:hover {
    background: var(--danger-frosted);
    border-color: var(--danger-border);
    color: var(--danger);
}

/* ================= NAV TABS ================= */
.ipam-nav {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 64px;
    z-index: 999;
}

.nav-tabs-custom {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 24px;
    gap: 4px;
    overflow-x: auto;
}

.nav-tab a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.nav-tab a i { font-size: 16px; }

.nav-tab a:hover {
    color: var(--text-primary);
    background: var(--refraction);
}

.nav-tab.active a {
    color: var(--primary);
    background: var(--primary-frosted);
    border: 1px solid var(--info-border);
    font-weight: 600;
}

.nav-tab.active a::after { display: none; }

/* Main content */
.app-main {
    flex: 1;
    padding: 20px 24px;
    padding-bottom: 100px;
}

/* ================= GLASS CARDS ================= */
.glass-card {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass), var(--glass-inset);
    transition: var(--transition-base);
    overflow: hidden;
    position: relative;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glass), var(--glass-inset), 0 0 20px rgba(0,212,255,0.05);
}

.glass-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glass-card-header h6 {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.glass-card-body { padding: 20px; }

/* ================= MODERN CARDS ================= */
.modern-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
    box-shadow: var(--shadow-glass);
}

.modern-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--refraction);
}

.modern-card-header h6 {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-card-body { padding: 20px; }

/* ================= TABLES ================= */
.table-container {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-glass), var(--glass-inset);
    position: relative;
}

.table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
}

.table-modern {
    margin: 0;
    font-size: 13px;
}

.table-modern thead {
    background: var(--bg-surface-elevated);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-modern thead th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-modern tbody td {
    padding: 10px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.table-modern tbody tr { transition: var(--transition-fast); }

.table-modern tbody tr:hover {
    background: var(--refraction-strong);
}

.table-modern tbody tr:last-child td { border-bottom: none; }

/* ================= BADGES ================= */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-success { background: var(--success-frosted); color: var(--success); border-color: var(--success-border); }
.badge-danger { background: var(--danger-frosted); color: var(--danger); border-color: var(--danger-border); }
.badge-warning { background: var(--warning-frosted); color: var(--warning); border-color: var(--warning-border); }
.badge-info { background: var(--info-frosted); color: var(--info); border-color: var(--info-border); }
.badge-neutral { background: var(--refraction-strong); color: var(--text-secondary); border-color: var(--border-color); }
.badge-purple { background: var(--accent-purple-frosted); color: var(--accent-purple); border-color: rgba(168, 85, 247, 0.25); }

/* ================= BUTTONS ================= */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-modern:active { transform: scale(0.96); }

.btn-primary {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: var(--primary-frosted);
    border-color: var(--primary-hover);
}

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

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

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

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

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

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

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

.btn-ghost:hover {
    background: var(--refraction-strong);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.btn-modern-sm { padding: 6px 12px; font-size: 12px; }
.btn-modern-xs { padding: 4px 8px; font-size: 11px; }

/* ================= FORMS ================= */
.form-modern {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.form-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-frosted);
}

.form-control-modern {
    background: var(--bg-surface-elevated) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    transition: var(--transition-fast);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    padding: 10px 14px;
    box-shadow: var(--glass-inset) !important;
    display: block !important;
    width: 100% !important;
}

.form-control-modern:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-frosted), var(--glass-inset) !important;
    outline: none;
}

.form-control-modern::placeholder {
    color: var(--text-muted);
    font-size: 12px;
}

/* Glass input with icon */
.glass-input-wrapper {
    position: relative;
    display: block !important;
    width: 100%;
}

.glass-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
    transition: var(--transition-fast);
}

.glass-input-wrapper input:focus ~ .glass-input-icon,
.glass-input-wrapper select:focus ~ .glass-input-icon {
    color: var(--primary);
}

.glass-input-with-icon {
    padding-left: 38px !important;
    width: 100% !important;
}

/* Glass select dropdown */
.glass-select-wrapper {
    position: relative;
    display: block !important;
    width: 100%;
}

.glass-select-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    pointer-events: none;
    z-index: 1;
}

.glass-select-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
    z-index: 2;
    transition: var(--transition-fast);
}

.glass-select-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 10px;
    pointer-events: none;
    transition: var(--transition-fast);
    z-index: 2;
}

.glass-select-wrapper select:focus ~ .glass-select-icon {
    color: var(--primary);
}

.glass-select-wrapper select:focus ~ .glass-select-arrow {
    color: var(--primary);
    transform: translateY(-50%) rotate(180deg);
}

.glass-select-with-icon {
    padding-left: 32px !important;
    padding-right: 28px !important;
    width: 100% !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer;
}

.glass-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
    transition: var(--transition-fast);
}

.glass-input-wrapper input:focus ~ .glass-input-icon,
.glass-input-wrapper select:focus ~ .glass-input-icon {
    color: var(--primary);
}

.glass-input-with-icon {
    padding-left: 38px !important;
    width: 100%;
}

/* Glass select dropdown */
.glass-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.glass-select-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
    z-index: 2;
    transition: var(--transition-fast);
}

.glass-select-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 10px;
    pointer-events: none;
    transition: var(--transition-fast);
}

.glass-select-wrapper select:focus ~ .glass-select-icon {
    color: var(--primary);
}

.glass-select-with-icon {
    padding-left: 32px !important;
    padding-right: 28px !important;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* Date/time picker glass styling */
input[type="datetime-local"].form-control-modern,
input[type="date"].form-control-modern {
    position: relative;
    cursor: pointer;
}

input[type="datetime-local"].form-control-modern::-webkit-calendar-picker-indicator,
input[type="date"].form-control-modern::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition-fast);
}

input[type="datetime-local"].form-control-modern::-webkit-calendar-picker-indicator:hover,
input[type="date"].form-control-modern::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

[data-bs-theme="light"] input[type="datetime-local"].form-control-modern::-webkit-calendar-picker-indicator,
[data-bs-theme="light"] input[type="date"].form-control-modern::-webkit-calendar-picker-indicator {
    filter: none;
}

.form-select-modern {
    background: var(--bg-surface-elevated) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    transition: var(--transition-fast);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    padding: 10px 14px;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    position: relative;
    display: block !important;
    width: 100% !important;
}

.form-select-modern:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-frosted), var(--glass-inset) !important;
    outline: none;
}

/* Enhanced select wrapper with better visual hierarchy */
.glass-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.glass-select-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    pointer-events: none;
    z-index: 1;
}

.form-select-modern:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-frosted) !important;
    outline: none;
}

/* ================= ANIMATIONS ================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn 0.4s ease both; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease both; }
.animate-slide-in { animation: slideInRight 0.4s ease both; }
.animate-slide-left { animation: slideInLeft 0.4s ease both; }
.animate-scale-in { animation: scaleIn 0.3s ease both; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ================= SEARCH SUGGESTIONS ================= */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    max-height: 360px;
    overflow-y: auto;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.suggestion-item:hover { background: var(--refraction-strong); }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item i { color: var(--primary); font-size: 14px; flex-shrink: 0; }

.suggestion-label {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-sub { color: var(--text-muted); font-size: 11px; flex-shrink: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.suggestion-exact {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--success);
    background: var(--success-frosted);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--success-border);
    flex-shrink: 0;
}

.suggestion-view-all { background: var(--primary-frosted); color: var(--primary); }
.suggestion-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.suggestion-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.suggestion-empty i { font-size: 20px; display: block; margin-bottom: 6px; color: var(--text-muted); }

/* ================= VENDOR BARS ================= */
.vendor-bars-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

.vendor-bars-container::-webkit-scrollbar { width: 6px; }
.vendor-bars-container::-webkit-scrollbar-track { background: transparent; }
.vendor-bars-container::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
.vendor-bars-container::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.vendor-bar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.vendor-bar-item:hover {
    background: var(--refraction-strong);
    border-color: var(--glass-border-hover);
    transform: translateX(4px);
}

.vendor-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: #fff;
}

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

.vendor-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'DM Sans', sans-serif;
}

.vendor-name span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vendor-percentage { font-size: 11px; color: var(--text-muted); }

.vendor-bar-track {
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
}

.vendor-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.vendor-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
    font-family: 'Outfit', sans-serif;
}

/* ================= UPLOAD ZONE ================= */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: var(--transition-base);
    background: var(--bg-surface-elevated);
    position: relative;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-frosted);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-hint i {
    font-size: 32px;
    color: var(--primary);
}

/* ================= PAGE HEADER ================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.page-title i { color: var(--primary); }

.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

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

@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .header-actions { justify-content: flex-start; }
}

/* ================= AUDIT TIMELINE ================= */
.audit-timeline {
    position: relative;
    padding-left: 28px;
}

.audit-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
    border-radius: 1px;
}

.audit-timeline-item {
    position: relative;
    padding: 0 0 20px;
}

.audit-timeline-item:last-child { padding-bottom: 0; }

.audit-timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-surface);
    z-index: 1;
}

.audit-timeline-dot.dot-create { border-color: var(--success); background: var(--success-frosted); }
.audit-timeline-dot.dot-update { border-color: var(--info); background: var(--info-frosted); }
.audit-timeline-dot.dot-delete { border-color: var(--danger); background: var(--danger-frosted); }
.audit-timeline-dot.dot-login { border-color: var(--warning); background: var(--warning-frosted); }
.audit-timeline-dot.dot-failed_login { border-color: var(--danger); background: var(--danger-frosted); }
.audit-timeline-dot.dot-logout { border-color: var(--text-muted); background: var(--bg-surface); }
.audit-timeline-dot.dot-view { border-color: var(--accent-purple); background: var(--accent-purple-frosted); }
.audit-timeline-dot.dot-export { border-color: var(--info); background: var(--info-frosted); }
.audit-timeline-dot.dot-import { border-color: var(--primary); background: var(--primary-frosted); }

.audit-timeline-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: var(--transition-fast);
}

.audit-timeline-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-sm);
}

.audit-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.audit-timeline-action {
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.audit-timeline-action.action-create { color: var(--success); }
.audit-timeline-action.action-update { color: var(--info); }
.audit-timeline-action.action-delete { color: var(--danger); }
.audit-timeline-action.action-login { color: var(--warning); }
.audit-timeline-action.action-failed_login { color: var(--danger); }
.audit-timeline-action.action-logout { color: var(--text-muted); }
.audit-timeline-action.action-view { color: var(--accent-purple); }
.audit-timeline-action.action-export { color: var(--info); }
.audit-timeline-action.action-import { color: var(--primary); }

.audit-timeline-user {
    font-size: 12px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface-elevated);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.audit-timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.audit-timeline-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.audit-timeline-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 11px;
}

.audit-timeline-module {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.audit-timeline-ip {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.audit-changes-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
}

/* ================= STAT CARD LINK ================= */
.stat-card { text-decoration: none !important; }
.stat-card .stat-value { text-decoration: none !important; }

/* ================= MOBILE NAV ================= */
.mobile-nav-list { list-style: none; padding: 0; margin: 0; }
.mobile-nav-list li {
    border-bottom: 1px solid var(--border-color);
}
.mobile-nav-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}
.mobile-nav-list li a:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.mobile-nav-list li.active a { color: var(--primary); background: var(--primary-frosted); }
.mobile-nav-list li a i { font-size: 18px; width: 24px; text-align: center; }

/* ================= FOOTER ================= */
.ipam-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
}

.footer-divider {
    width: 1px;
    height: 14px;
    background: var(--border-color);
    margin: 0 12px;
}

.footer-text {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-clock {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}

.footer-right {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
    .mobile-nav-toggle { display: block; }
    .ipam-nav { display: none; }
    .ipam-nav.mobile-show { display: block; }

    .app-main { padding: 16px; padding-bottom: 80px; }

    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .glass-card-body { padding: 16px; }
    .table-container { overflow-x: auto; }
}

@media (max-width: 576px) {
    .ipam-header { padding: 10px 12px; }
    .header-brand { font-size: 18px; }
    .brand-icon { width: 24px; height: 24px; }
    .header-user { padding: 4px; }
    .user-avatar { width: 28px; height: 28px; font-size: 12px; }
    .user-name { display: none; }
    .header-role-badge { display: none; }
    .btn-header-logout { width: 36px; height: 36px; font-size: 14px; }

    .nav-tab a { padding: 8px 10px; font-size: 11px; gap: 6px; }
    .nav-tab a i { font-size: 14px; }

    h1 { font-size: 22px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }

    .btn-modern { padding: 6px 12px; font-size: 12px; }
    .btn-modern-sm { padding: 4px 8px; font-size: 11px; }

    .ipam-footer { padding: 12px 16px; }
}

/* ================= UTILITY ================= */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.bg-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-heading { font-family: 'Outfit', sans-serif; }

.glass-card-border-warning { border-color: var(--warning-border); }
.glass-card-border-success { border-color: var(--success-border); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================= REFERENCE GRID ================= */
.reference-grid {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.reference-header {
    display: grid;
    grid-template-columns: 80px 1fr 80px 80px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reference-row {
    display: grid;
    grid-template-columns: 80px 1fr 80px 80px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}

.reference-row:hover {
    background: var(--bg-surface-elevated);
}

.reference-row.highlight {
    background: rgba(0, 212, 255, 0.08);
    border-left: 3px solid var(--primary);
}

.reference-row.highlight .cidr-badge {
    background: var(--primary);
    color: #0a0e1a;
}

.ref-col {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.ref-col:first-child {
    justify-content: center;
}

.cidr-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--glass-border);
    font-weight: 600;
    font-size: 11px;
    color: var(--primary);
    transition: all 0.2s ease;
}

.cidr-badge.active {
    background: var(--primary);
    color: #0a0e1a;
    border-color: var(--primary);
}

.reference-row:hover .cidr-badge {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.1);
}
