/* Tooltip Styles */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 0.5rem 0.75rem;
    background-color: #1F2937;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: #1F2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-8px);
}

[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(0);
}

[data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(4px);
}

[data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(-4px);
    border-top-color: transparent;
    border-bottom-color: #1F2937;
}

[data-tooltip-pos="bottom"]:hover::before {
    transform: translateX(-50%) translateY(8px);
}

[data-tooltip-pos="bottom"]:hover::after {
    transform: translateX(-50%) translateY(0);
}

.dark [data-tooltip]::before {
    background-color: #374151;
}

.dark [data-tooltip]::after {
    border-top-color: #374151;
}

.dark [data-tooltip-pos="bottom"]::after {
    border-top-color: transparent;
    border-bottom-color: #374151;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: #6B7280;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-item i {
    width: 1.25rem;
    text-align: center;
    font-size: 1.25rem;
}

.nav-item:hover {
    color: #1F2937;
    background-color: #F3F4F6;
}

.dark .nav-item {
    color: #9CA3AF;
}

.dark .nav-item:hover {
    color: #F3F4F6;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #1B84FF;
    background-color: #EBF5FF;
    font-weight: 600;
}

.dark .nav-item.active {
    color: #1B84FF;
    background-color: rgba(27, 132, 255, 0.1);
}

.nav-item.active i {
    color: #1B84FF;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4B5563;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.card {
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.dark .card {
    background-color: #1E1E2D;
    color: #E5E7EB;
    border-color: #2B2B40;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.dark .card-header {
    border-color: #3F4254;
}

.card-body {
    padding: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #1B84FF;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #1A56DB;
    box-shadow: 0 4px 12px rgba(27, 132, 255, 0.35);
}

.btn-secondary {
    background-color: transparent;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.btn-secondary:hover {
    background-color: #F3F4F6;
    border-color: #D1D5DB;
}

.dark .btn-secondary {
    color: #E5E7EB;
    border-color: #4B5563;
}

.dark .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #6B7280;
}

.btn-success {
    background-color: #17C653;
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #F8285A;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #ECFDF5;
    color: #047857;
}

.dark .badge-success {
    background-color: rgba(23, 198, 83, 0.15);
    color: #34D399;
}

.badge-warning {
    background-color: #FFFBEB;
    color: #B45309;
}

.dark .badge-warning {
    background-color: rgba(246, 177, 0, 0.15);
    color: #FBBF24;
}

.badge-danger {
    background-color: #FEF2F2;
    color: #B91C1C;
}

.dark .badge-danger {
    background-color: rgba(248, 40, 90, 0.15);
    color: #F87171;
}

.badge-info {
    background-color: #EBF5FF;
    color: #1A56DB;
}

.dark .badge-info {
    background-color: rgba(27, 132, 255, 0.15);
    color: #76A9FA;
}

.badge-gray {
    background-color: #F3F4F6;
    color: #4B5563;
}

.dark .badge-gray {
    background-color: rgba(107, 114, 128, 0.2);
    color: #9CA3AF;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1F2937;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .form-input {
    background-color: #151521;
    border-color: #2B2B40;
    color: #E5E7EB;
}

.form-input::placeholder {
    color: #9CA3AF;
}

.form-input:focus {
    outline: none;
    border-color: #1B84FF;
    box-shadow: 0 0 0 3px rgba(27, 132, 255, 0.15);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.dark .form-label {
    color: #E5E7EB;
}

.form-select {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1F2937;
    appearance: none;
}

.dark .form-select {
    background-color: #151521;
    border-color: #2B2B40;
    color: #E5E7EB;
}

.form-select:focus {
    outline: none;
    border-color: #1B84FF;
    box-shadow: 0 0 0 3px rgba(27, 132, 255, 0.15);
}

.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
}

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

table th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    background-color: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.dark table th {
    background-color: #151521;
    color: #9CA3AF;
    border-color: #2B2B40;
}

table td {
    padding: 1rem 1.25rem;
    color: #374151;
    border-bottom: 1px solid #E5E7EB;
}

.dark table td {
    color: #E5E7EB;
    border-color: #2B2B40;
}

table tbody tr:hover {
    background-color: #F9FAFB;
}

.dark table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

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

.stat-card {
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.dark .stat-card {
    background-color: #1E1E2D;
    border-color: #3F4254;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1F2937;
    line-height: 1.2;
}

.dark .stat-value {
    color: #FFFFFF;
}

.stat-label {
    font-size: 0.8125rem;
    color: #6B7280;
    font-weight: 500;
    margin-top: 0.25rem;
}

.dark .stat-label {
    color: #9CA3AF;
}

.stat-trend {
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.up {
    color: #17C653;
}

.stat-trend.down {
    color: #F8285A;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: #17C653;
    box-shadow: 0 0 0 3px rgba(23, 198, 83, 0.2);
}

.status-dot.offline {
    background-color: #9CA3AF;
}

.status-dot.error {
    background-color: #F8285A;
    box-shadow: 0 0 0 3px rgba(248, 40, 90, 0.2);
}

.status-dot.warning {
    background-color: #F6B100;
    box-shadow: 0 0 0 3px rgba(246, 177, 0, 0.2);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 32rem;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.dark .modal-content {
    background-color: #1E1E2D;
    border: 1px solid #3F4254;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.dark .modal-header {
    border-color: #3F4254;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    border-radius: 0 0 0.75rem 0.75rem;
}

.dark .modal-footer {
    border-color: #3F4254;
    background-color: #27293D;
}

.terminal {
    background-color: #1F2937;
    color: #10B981;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.terminal .error {
    color: #F87171;
}

.terminal .warning {
    color: #FBBF24;
}

.terminal .info {
    color: #60A5FA;
}

.terminal .timestamp {
    color: #6B7280;
}

.ip-address {
    font-family: 'Roboto Mono', monospace;
    color: #1B84FF;
    font-size: 0.875rem;
}

.dark .ip-address {
    color: #76A9FA;
}

.device-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.device-icon.router {
    background-color: #EBF5FF;
    color: #1B84FF;
}

.dark .device-icon.router {
    background-color: rgba(27, 132, 255, 0.15);
}

.device-icon.switch {
    background-color: #ECFDF5;
    color: #17C653;
}

.dark .device-icon.switch {
    background-color: rgba(23, 198, 83, 0.15);
}

.device-icon.firewall {
    background-color: #FEF2F2;
    color: #F8285A;
}

.dark .device-icon.firewall {
    background-color: rgba(248, 40, 90, 0.15);
}

.device-icon.default {
    background-color: #F3F4F6;
    color: #6B7280;
}

.dark .device-icon.default {
    background-color: rgba(107, 114, 128, 0.2);
}

.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #E5E7EB;
    border-top-color: #1B84FF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #D1D5DB;
}

.dark .empty-state-icon {
    color: #4B5563;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.5rem;
}

.dark .empty-state-title {
    color: #F3F4F6;
}

.empty-state-text {
    font-size: 0.875rem;
    color: #6B7280;
}

.dark .empty-state-text {
    color: #9CA3AF;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 12rem;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.15s ease;
}

.dark .dropdown-menu {
    background-color: #1E1E2D;
    border-color: #2B2B40;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    transition: background-color 0.15s ease;
}

.dark .dropdown-item {
    color: #E5E7EB;
}

.dropdown-item:hover {
    background-color: #F3F4F6;
}

.dark .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    background-color: #E5E7EB;
}

.dark .dropdown-divider {
    background-color: #3F4254;
}

.toast {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}