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

:root {
    /* Color Palette */
    --primary-navy: #1C2B47;
    --primary-bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --accent-blue: #2563EB;
    --success-green: #10B981;
    --warning-orange: #F59E0B;
    --danger-red: #EF4444;

    /* Charts Colors */
    --chart-navy: #1C2B47;
    --chart-grey: #9CA3AF;
    --chart-blue-light: #E0E7FF;

    /* Spacing & Layout */
    --header-height: 70px;
    --sidebar-width: 250px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --spacing-xs: 0.5rem;
    /* 8px */
    --spacing-sm: 1rem;
    /* 16px */
    --spacing-md: 1.5rem;
    /* 24px */
    --spacing-lg: 2rem;
    /* 32px */

    /* Shadows (Premium Feel) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: --primary-bg;
    background: #F5F7FA;
    /* Fallback */
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.grid {
    display: grid;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.p-6 {
    padding: 1.5rem;
}

.rounded-lg {
    border-radius: var(--border-radius-lg);
}

/* Header */
.app-header {
    background-color: var(--primary-navy);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-lg);
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-right: var(--spacing-lg);
}

.nav-menu {
    display: flex;
    gap: var(--spacing-md);
    margin-left: auto;
    margin-right: 75px;
    /* approx 20mm */
    /* Push to right or center based on design */
}

.nav-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: white;
}

.nav-item i {
    font-size: 1.1rem;
}

/* Dashboard Grid */
.dashboard-container {
    max-width: 1400px;
    /* Constrain width for large screens */
    margin: 0 auto;
    padding: var(--spacing-lg);
    width: 100%;
}

/* Ensure nested Bootstrap containers behave within our layout */
.dashboard-container .container-fluid {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.dashboard-container .container-fluid>.row {
    margin-left: 0;
    margin-right: 0;
}



.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    /* Two main rows inferred */
    gap: var(--spacing-md);
}

/* Widgets / Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

/* Specific Widget Layouts based on Image */
.widget-threat {
    grid-column: span 3;
    /* Approx */
}

.widget-vulnerability {
    grid-column: span 4;
    /* Approx */
}

.widget-col-right {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Chart Canvas Placeholders */
.chart-container {
    flex-grow: 1;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typography Helpers */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

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

.font-bold {
    font-weight: 700;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
}

/* Dropdown Menu */
.dropdown-trigger {
    position: relative;
    cursor: pointer;
}

.nav-dropdown-menu {
    display: block;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    /* Align to right since it's on the right side */
    left: auto;
    width: 220px;
    background-color: #ffffff !important;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    z-index: 1000;
    border: 1px solid #e5e7eb;
    margin-top: 10px;
    /* Delay closing by 1 second */
    transition: visibility 0s linear 1s, opacity 0.2s linear 1s;
}

/* Show dropdown on hover instantly */
.dropdown-trigger:hover .nav-dropdown-menu {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

/* Dropdown Arrow/Triangle */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #1F2937 !important;
    /* Force dark gray */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.15s;
}

.nav-dropdown-menu a:hover {
    background-color: #F3F4F6 !important;
    color: #111827 !important;
}

.nav-dropdown-menu a.text-danger {
    color: #DC2626 !important;
}

.nav-dropdown-menu a.text-danger:hover {
    background-color: #FEF2F2 !important;
    color: #B91C1C !important;
}

/* --- Missing Utility Classes for User Manager --- */

/* Text Colors */
.text-navy {
    color: var(--primary-navy);
}

.text-gray-400 {
    color: #9CA3AF;
}

.text-gray-500 {
    color: #6B7280;
}

.text-gray-600 {
    color: #4B5563;
}

.text-gray-700 {
    color: #374151;
}

.text-red-500 {
    color: #EF4444;
}

.text-white {
    color: white;
}

/* Text Alignment & Weight */
.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xl {
    font-size: 1.25rem;
}

/* Backgrounds */
.bg-white {
    background-color: white;
}

.bg-navy {
    background-color: var(--primary-navy);
}

.bg-black\/50 {
    background-color: rgba(0, 0, 0, 0.5);
}

.hover\:bg-gray-50:hover {
    background-color: #F9FAFB;
}

.hover\:bg-gray-100:hover {
    background-color: #F3F4F6;
}

.hover\:text-red-700:hover {
    color: #B91C1C;
}

.hover\:bg-opacity-90:hover {
    opacity: 0.9;
}

/* Spacing (Margins & Padding) */
.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-8 {
    padding: 2rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Borders */
.border {
    border: 1px solid;
}

.border-gray-100 {
    border-color: #F3F4F6;
}

.border-gray-200 {
    border-color: #E5E7EB;
}

.border-gray-300 {
    border-color: #D1D5DB;
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.border-collapse {
    border-collapse: collapse;
}

.rounded {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

/* Sizing */
.w-full {
    width: 100%;
}

.w-96 {
    width: 24rem;
}

/* Flex & Layout */
.block {
    display: block;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.z-50 {
    z-index: 50;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-3 {
    gap: 0.75rem;
}

/* Components */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: var(--primary-navy);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #2c3e5d;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Form Inputs */
.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus\:border-navy:focus {
    border-color: var(--primary-navy);
}


/* Role Badge Colors */
.bg-blue-100 {
    background-color: #DBEAFE;
}

.bg-green-100 {
    background-color: #D1FAE5;
}

.bg-gray-100 {
    background-color: #F3F4F6;
}

.text-green-700 {
    color: #047857;
}

.text-blue-700 {
    color: #1D4ED8;
}

.text-navy {
    color: var(--primary-navy);
}

/* Disabled Badges */
.bg-red-100 {
    background-color: #FEE2E2;
}

.text-red-700 {
    color: #B91C1C;
}

/* Custom Action Button */
.btn-sm {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.btn-action {
    background-color: #3B82F6;
    color: white;
}

.btn-action:hover {
    background-color: #2563EB;
    color: white;
}

.text-right {
    text-align: right;
}

/* Fix spacing for action buttons in Bootstrap tables (Radius Manager) */
.table .btn+.btn,
.table .btn+form,
.table form+.btn,
.table form+form {
    margin-left: 0.5rem;
}

/* === Missing Utility Classes for Action Buttons === */

/* Background Colors */
.bg-blue-500 {
    background-color: #3B82F6;
}

.bg-blue-600 {
    background-color: #2563EB;
}

.bg-red-500 {
    background-color: #EF4444;
}

.bg-red-600 {
    background-color: #DC2626;
}

/* Hover Background Colors */
.hover\:bg-blue-600:hover {
    background-color: #2563EB;
}

.hover\:bg-red-600:hover {
    background-color: #DC2626;
}

/* Padding Utilities */
.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-1\.5 {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

/* Text Size */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

/* Margin Utilities */
.mr-2 {
    margin-right: 0.5rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

/* Transition */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Inline Display */
.inline-block {
    display: inline-block;
}

.inline {
    display: inline;
}

/* Cursor */
.cursor-not-allowed {
    cursor: not-allowed;
}

/* Additional Gap Utilities */
.gap-2 {
    gap: 0.5rem;
}

/* === Icon-Only Action Buttons === */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    margin-right: 6px;
    text-decoration: none;
}

.btn-icon:last-child {
    margin-right: 0;
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Icon Button Colors */
.btn-icon-blue {
    background-color: #3B82F6;
}

.btn-icon-blue:hover {
    background-color: #2563EB;
}

.btn-icon-orange {
    background-color: #F59E0B;
}

.btn-icon-orange:hover {
    background-color: #D97706;
}

.btn-icon-green {
    background-color: #10B981;
}

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

.btn-icon-cyan {
    background-color: #06B6D4;
}

.btn-icon-cyan:hover {
    background-color: #0891B2;
}

.btn-icon-red {
    background-color: #EF4444;
}

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

/* Grid utilities */
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Additional color utilities */
.text-orange-600 {
    color: #EA580C;
}

.text-green-600 {
    color: #16A34A;
}

.text-red-600 {
    color: #DC2626;
}

.bg-orange-500 {
    background-color: #F97316;
}

.bg-green-500 {
    background-color: #22C55E;
}

.bg-red-500 {
    background-color: #EF4444;
}

.bg-gray-700 {
    background-color: #374151;
}

.bg-gray-900 {
    background-color: #111827;
}

/* --- Device Manager UI Overhaul --- */

/* Device Type Selector Tiles */
.device-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.type-tile {
    position: relative;
    cursor: pointer;
}

.type-tile input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-align: center;
    height: 100%;
}

.type-content i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.type-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.type-tile input:checked + .type-content {
    border-color: var(--accent-blue);
    background-color: #eff6ff;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.type-tile input:checked + .type-content i {
    color: var(--accent-blue);
}

.type-tile input:checked + .type-content .type-label {
    color: var(--accent-blue);
}

.type-tile:hover .type-content {
    border-color: #d1d5db;
    transform: translateY(-2px);
}

/* Form Sectioning */
.form-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #f3f4f6;
}

.form-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title i {
    font-size: 1rem;
    color: var(--primary-navy);
}

/* Modern Input Polish */
.form-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control-custom {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Enhanced Table & Badges */
.device-table th {
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 12px 16px;
}

.device-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

.badge-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* Transitions */
.field-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

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