/* ThreatXpress - Modern Light Theme */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;

    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    /* STRIDE Colors */
    --spoofing: #dc2626;
    --tampering: #d97706;
    --repudiation: #7c3aed;
    --informationdisclosure: #2563eb;
    --denialofservice: #db2777;
    --elevationofprivilege: #059669;

    /* Risk Levels */
    --risk-critical: #dc2626;
    --risk-high: #ea580c;
    --risk-medium: #d97706;
    --risk-low: #16a34a;
    --risk-verylow: #64748b;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    transition: width 0.2s ease;
}

.app-layout.sidebar-collapsed .sidebar {
    width: 72px;
}

.app-layout.sidebar-collapsed .logo-text,
.app-layout.sidebar-collapsed .nav-text,
.app-layout.sidebar-collapsed .nav-section-title {
    display: none;
}

.app-layout.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.875rem;
}

.app-layout.sidebar-collapsed .sidebar-header {
    padding: 1rem;
}

.app-layout.sidebar-collapsed .logo {
    justify-content: center;
}

.app-layout.sidebar-collapsed .main-content {
    margin-left: 72px;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.125rem;
    font-weight: 700;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-toggle {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.sidebar-toggle:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: var(--text-primary);
    width: 280px;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Navigation */
.nav-menu {
    padding: 0.75rem 0;
    flex: 1;
}

.nav-section {
    margin-bottom: 1rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    margin: 0 0.75rem;
    border-radius: 6px;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon-only {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon-only:hover {
    opacity: 1;
}

.btn-icon-only.danger:hover {
    color: var(--danger);
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group.half {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    margin: 0;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h2, .card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 700px;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.page-header .subtitle {
    color: var(--text-secondary);
    margin: 0;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.back-link:hover {
    color: var(--primary);
}

/* Auth Layout */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    margin: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.warning-text {
    color: var(--warning);
    font-size: 0.875rem;
}

/* Loading & Empty States */
.loading-state, .empty-state, .error-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters .form-control {
    width: auto;
    min-width: 180px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-content p {
    color: var(--text-secondary);
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.dashboard-grid .stride-overview {
    grid-column: span 2;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.project-card:hover {
    border-color: var(--primary);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.project-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.project-card-footer {
    display: flex;
    gap: 0.75rem;
}

/* Exercise Cards */
.exercises-grid, .exercises-list {
    display: grid;
    gap: 1rem;
}

.exercise-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.exercise-header h3 {
    margin: 0;
    font-size: 1rem;
}

.project-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.exercise-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.exercise-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.exercise-actions {
    display: flex;
    gap: 0.5rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.draft { background: var(--secondary); color: white; }
.status-badge.in-progress { background: var(--info); color: white; }
.status-badge.review { background: var(--warning); color: black; }
.status-badge.completed { background: var(--success); color: white; }
.status-badge.archived { background: var(--text-muted); color: white; }
.status-badge.identified { background: var(--info); color: white; }
.status-badge.inanalysis { background: var(--warning); color: black; }
.status-badge.mitigated { background: var(--success); color: white; }
.status-badge.accepted { background: var(--secondary); color: white; }
.status-badge.transferred { background: #8b5cf6; color: white; }
.status-badge.closed { background: var(--text-muted); color: white; }

/* Category Badges (STRIDE) */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-badge.spoofing { background: var(--spoofing); color: white; }
.category-badge.tampering { background: var(--tampering); color: black; }
.category-badge.repudiation { background: var(--repudiation); color: white; }
.category-badge.informationdisclosure { background: var(--informationdisclosure); color: white; }
.category-badge.denialofservice { background: var(--denialofservice); color: white; }
.category-badge.elevationofprivilege { background: var(--elevationofprivilege); color: white; }

/* Priority Badge */
.priority-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-badge.p1 { background: var(--danger); color: white; }
.priority-badge.p2 { background: var(--warning); color: black; }
.priority-badge.p3 { background: var(--info); color: white; }
.priority-badge.p4 { background: var(--success); color: white; }
.priority-badge.p5 { background: var(--secondary); color: white; }

/* Risk Level Badge */
.risk-level-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* STRIDE Chart */
.stride-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stride-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stride-label {
    width: 120px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stride-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.bar-fill.spoofing { background: var(--spoofing); }
.bar-fill.tampering { background: var(--tampering); }
.bar-fill.repudiation { background: var(--repudiation); }
.bar-fill.informationdisclosure { background: var(--informationdisclosure); }
.bar-fill.denialofservice { background: var(--denialofservice); }
.bar-fill.elevationofprivilege { background: var(--elevationofprivilege); }

.stride-count {
    width: 30px;
    text-align: right;
    font-weight: 600;
}

/* STRIDE Summary Bar */
.stride-summary-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stride-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 60px;
}

.stride-count.spoofing { border-color: var(--spoofing); }
.stride-count.tampering { border-color: var(--tampering); }
.stride-count.repudiation { border-color: var(--repudiation); }
.stride-count.informationdisclosure { border-color: var(--informationdisclosure); }
.stride-count.denialofservice { border-color: var(--denialofservice); }
.stride-count.elevationofprivilege { border-color: var(--elevationofprivilege); }

.stride-count .count {
    font-size: 1.5rem;
    font-weight: 700;
}

.stride-count .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tables */
.threats-table {
    overflow-x: auto;
}

.threats-table table {
    width: 100%;
    border-collapse: collapse;
}

.threats-table th, .threats-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.threats-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.threats-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.threat-cell strong {
    display: block;
}

.threat-cell .description {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 0.25rem 0 0 0;
}

/* Tabs */
.project-tabs, .exercise-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Members */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.member-info {
    flex: 1;
}

.member-name {
    display: block;
    font-weight: 500;
}

.member-email {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.role-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-secondary);
}

.role-badge.owner { background: var(--primary); color: white; }
.role-badge.admin { background: var(--warning); color: black; }
.role-badge.contributor { background: var(--info); color: white; }
.role-badge.viewer { background: var(--secondary); color: white; }

/* Modal */
.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 100000 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Risk Cards */
.risk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.risk-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border-left: 4px solid var(--border-color);
}

.risk-card.critical { border-left-color: var(--risk-critical); }
.risk-card.high { border-left-color: var(--risk-high); }
.risk-card.medium { border-left-color: var(--risk-medium); }
.risk-card.low { border-left-color: var(--risk-low); }
.risk-card.verylow { border-left-color: var(--risk-verylow); }

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.risk-header h3, .risk-header h4 {
    margin: 0;
    font-size: 1rem;
}

.risk-level-badge, .risk-level {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.risk-level.critical, .risk-level-badge.critical { background: var(--risk-critical); color: white; }
.risk-level.high, .risk-level-badge.high { background: var(--risk-high); color: white; }
.risk-level.medium, .risk-level-badge.medium { background: var(--risk-medium); color: black; }
.risk-level.low, .risk-level-badge.low { background: var(--risk-low); color: white; }
.risk-level.verylow, .risk-level-badge.verylow { background: var(--risk-verylow); color: white; }

.risk-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.risk-metrics {
    margin-bottom: 1rem;
}

.risk-metrics .metric {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.metric-label {
    width: 80px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.metric-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.metric-bar .bar-fill {
    background: var(--primary);
}

.metric-value {
    width: 70px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.risk-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.score-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.score-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Risk Summary Bar */
.risk-summary-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.risk-level-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 80px;
}

.risk-level-count.critical { border-color: var(--risk-critical); background: rgba(220, 38, 38, 0.1); }
.risk-level-count.high { border-color: var(--risk-high); background: rgba(234, 88, 12, 0.1); }
.risk-level-count.medium { border-color: var(--risk-medium); background: rgba(245, 158, 11, 0.1); }
.risk-level-count.low { border-color: var(--risk-low); background: rgba(34, 197, 94, 0.1); }
.risk-level-count.verylow { border-color: var(--risk-verylow); background: rgba(100, 116, 139, 0.1); }

.risk-level-count .count {
    font-size: 1.5rem;
    font-weight: 700;
}

.risk-level-count .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Risk Matrix */
.matrix-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.matrix-stats {
    display: flex;
    gap: 2rem;
}

.matrix-stats .stat {
    text-align: center;
}

.matrix-stats .stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.matrix-stats .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.risk-matrix {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.matrix-y-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 1rem;
}

.matrix-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.matrix-row {
    display: flex;
    gap: 2px;
}

.matrix-y-axis, .matrix-x-axis {
    width: 80px;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.matrix-cell {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.matrix-cell:hover {
    transform: scale(1.05);
}

.matrix-cell.verylow { background: var(--risk-verylow); }
.matrix-cell.low { background: var(--risk-low); }
.matrix-cell.medium { background: var(--risk-medium); }
.matrix-cell.high { background: var(--risk-high); }
.matrix-cell.critical { background: var(--risk-critical); }

.cell-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.matrix-x-label {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 1rem;
    text-align: center;
}

.matrix-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-item.critical .legend-color { background: var(--risk-critical); }
.legend-item.high .legend-color { background: var(--risk-high); }
.legend-item.medium .legend-color { background: var(--risk-medium); }
.legend-item.low .legend-color { background: var(--risk-low); }
.legend-item.verylow .legend-color { background: var(--risk-verylow); }

.selected-risks {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.selected-risks h3 {
    margin-bottom: 1rem;
}

.risk-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Risk Form */
.risk-form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.form-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-section h3 {
    margin: 0 0 0.5rem 0;
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.factor-group {
    margin-bottom: 1.25rem;
}

.factor-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    min-width: 80px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.slider-value.very-low { background: var(--risk-verylow); color: white; }
.slider-value.low { background: var(--risk-low); color: white; }
.slider-value.medium { background: var(--risk-medium); color: black; }
.slider-value.high { background: var(--risk-high); color: white; }
.slider-value.critical { background: var(--risk-critical); color: white; }

.factor-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.risk-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.risk-preview-card h3 {
    margin: 0 0 1rem 0;
}

.preview-score {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.preview-score .score-value {
    font-size: 3rem;
    font-weight: 700;
    display: block;
}

.preview-score .score-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.preview-score.critical { background: var(--risk-critical); color: white; }
.preview-score.high { background: var(--risk-high); color: white; }
.preview-score.medium { background: var(--risk-medium); color: black; }
.preview-score.low { background: var(--risk-low); color: white; }
.preview-score.verylow { background: var(--risk-verylow); color: white; }

.preview-level {
    text-align: center;
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.preview-factors {
    display: flex;
    justify-content: space-around;
}

.preview-factors .factor {
    text-align: center;
}

.preview-factors .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-factors .value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Diagram Editor */
.diagram-editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    margin: -2rem;
}

.diagram-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.diagram-title h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.diagram-name-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.element-palette {
    display: flex;
    gap: 0.25rem;
}

.palette-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
}

.palette-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.palette-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.element-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.element-icon.process {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.element-icon.datastore {
    width: 22px;
    height: 14px;
    border: 2px solid currentColor;
    border-top: none;
    border-bottom: none;
}

.element-icon.external {
    width: 20px;
    height: 16px;
    border: 2px solid currentColor;
}

.element-icon.dataflow {
    position: relative;
}

.element-icon.dataflow::before {
    content: '→';
    font-size: 1.25rem;
}

.element-icon.boundary {
    width: 20px;
    height: 16px;
    border: 2px dashed currentColor;
    border-radius: 4px;
}

.diagram-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.diagram-canvas-container {
    flex: 1;
    overflow: auto;
    background: var(--bg-primary);
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

.diagram-canvas {
    width: 100%;
    height: 100%;
    min-width: 2000px;
    min-height: 1500px;
}

.diagram-properties {
    width: 320px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
}

.properties-panel {
    padding: 1.25rem;
}

.properties-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.properties-panel.empty {
    text-align: center;
    padding: 2rem 1.25rem;
    color: var(--text-secondary);
}

.property-group {
    margin-bottom: 1rem;
}

.property-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.property-value {
    color: var(--text-secondary);
}

.property-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.element-threats {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.element-threats h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
}

.threat-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.threat-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
}

.no-threats {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.help-text {
    text-align: left;
    margin-top: 2rem;
}

.help-text h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
}

.help-text ul {
    margin: 0;
    padding-left: 1.25rem;
}

.help-text li {
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

/* SVG Diagram Elements */
.process-shape {
    fill: var(--bg-tertiary);
    stroke: var(--primary);
    stroke-width: 2;
}

.datastore-shape {
    fill: var(--bg-tertiary);
    stroke: var(--info);
    stroke-width: 2;
}

.datastore-line {
    stroke: var(--info);
    stroke-width: 2;
}

.external-shape {
    fill: var(--bg-tertiary);
    stroke: var(--warning);
    stroke-width: 2;
}

.trust-boundary {
    fill: none;
    stroke: var(--danger);
    stroke-width: 2;
    stroke-dasharray: 10 5;
}

.data-flow-line {
    stroke: #666;
    stroke-width: 2;
    fill: none;
}

.drawing-flow {
    stroke: var(--primary);
    stroke-width: 2;
}

.element-label {
    fill: var(--text-primary);
    font-size: 12px;
}

.boundary-label {
    fill: var(--danger);
    font-weight: 600;
}

.flow-label {
    fill: var(--text-secondary);
    font-size: 11px;
}

.diagram-element {
    cursor: pointer;
}

.diagram-element.selected .process-shape,
.diagram-element.selected .datastore-shape,
.diagram-element.selected .external-shape,
.diagram-element.selected .trust-boundary {
    stroke-width: 3;
}

/* Threat Suggestions Modal */
.threat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.suggestion-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.suggestion-header h4 {
    margin: 0;
    font-size: 0.9375rem;
}

.suggestion-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

/* STRIDE Reference */
.stride-reference {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.stride-reference h3 {
    margin: 0 0 1rem 0;
}

.stride-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stride-ref-card {
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid;
}

.stride-ref-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
}

.stride-ref-card p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stride-ref-card.spoofing { border-color: var(--spoofing); background: rgba(239, 68, 68, 0.1); }
.stride-ref-card.tampering { border-color: var(--tampering); background: rgba(245, 158, 11, 0.1); }
.stride-ref-card.repudiation { border-color: var(--repudiation); background: rgba(139, 92, 246, 0.1); }
.stride-ref-card.informationdisclosure { border-color: var(--informationdisclosure); background: rgba(59, 130, 246, 0.1); }
.stride-ref-card.denialofservice { border-color: var(--denialofservice); background: rgba(236, 72, 153, 0.1); }
.stride-ref-card.elevationofprivilege { border-color: var(--elevationofprivilege); background: rgba(16, 185, 129, 0.1); }

/* Threat Details */
.threat-details-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.threat-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.threat-details-grid .main-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.threat-details-grid .sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: static;
    width: auto;
    height: auto;
    border: none;
    background: transparent;
}

.status-card, .risk-card, .metadata-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.status-card h3, .metadata-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
}

.risk-summary {
    text-align: center;
}

.risk-level-display {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.risk-level-display.critical { background: var(--risk-critical); color: white; }
.risk-level-display.high { background: var(--risk-high); color: white; }
.risk-level-display.medium { background: var(--risk-medium); color: black; }
.risk-level-display.low { background: var(--risk-low); color: white; }
.risk-level-display.verylow { background: var(--risk-verylow); color: white; }

.risk-scores {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.metadata-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.metadata-item .label {
    color: var(--text-muted);
}

/* Danger Zone */
.danger-zone {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.danger-zone h3 {
    color: var(--danger);
    margin: 0 0 0.5rem 0;
}

.danger-zone p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Quick Actions */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--primary);
    background: var(--bg-primary);
}

.action-icon {
    font-size: 1.5rem;
}

/* Project List */
.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-list li {
    border-bottom: 1px solid var(--border-color);
}

.project-list li:last-child {
    border-bottom: none;
}

.project-list a {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    text-decoration: none;
    color: var(--text-primary);
}

.project-list a:hover {
    color: var(--primary);
}

.project-date {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.overview-grid .card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.overview-grid .card p {
    margin: 0;
    color: var(--text-secondary);
}

.overview-grid .stride-summary,
.overview-grid .risk-summary {
    grid-column: span 1;
}

/* Diagrams Grid */
.diagrams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.diagram-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.diagram-preview {
    height: 120px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.diagram-info {
    padding: 1rem;
}

.diagram-info h4 {
    margin: 0 0 0.25rem 0;
}

.diagram-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.diagram-actions {
    padding: 0 1rem 1rem;
}

/* Status Select */
.status-select {
    width: auto;
    min-width: 140px;
}

/* Not Found */
.not-found {
    text-align: center;
    padding: 4rem;
}

.not-found h1 {
    font-size: 6rem;
    margin: 0;
    color: var(--primary);
}

.not-found p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Validation */
.validation-message {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.invalid {
    border-color: var(--danger) !important;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--danger);
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
}

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem;
    color: white;
    border-radius: var(--border-radius);
}

/* ============================================
   Enhanced Diagram Editor Styles
   ============================================ */

.diagram-editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    background: var(--bg-secondary);
}

.diagram-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.diagram-title h2 {
    margin: 0;
    font-size: 1.125rem;
    cursor: pointer;
}

.diagram-title h2:hover {
    color: var(--primary);
}

.diagram-name-input {
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.toolbar-center {
    display: flex;
    align-items: center;
}

.tool-buttons {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 6px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.tool-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tool-btn.active {
    background: var(--primary);
    color: white;
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-icon {
    font-size: 1.125rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.save-status {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Main Diagram Layout */
.diagram-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Asset Library Panel */
.asset-library {
    width: 200px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1rem 0;
}

.asset-library h3 {
    margin: 0 1rem 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.asset-category {
    margin-bottom: 1.5rem;
}

.asset-category h4 {
    margin: 0 1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.asset-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.asset-item:hover {
    border-color: var(--primary);
    background: var(--bg-primary);
}

.asset-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border-radius: 50%;
}

.asset-icon.process {
    background: rgba(59, 130, 246, 0.2);
}

.asset-icon.datastore {
    background: rgba(139, 92, 246, 0.2);
}

.asset-icon.externalentity {
    background: rgba(245, 158, 11, 0.2);
}

.asset-name {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}

/* Canvas Wrapper */
.diagram-canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.diagram-canvas-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    background:
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px),
        linear-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: var(--bg-secondary);
}

.diagram-canvas {
    width: 2000px;
    height: 1500px;
    display: block;
}

/* Canvas Controls */
.canvas-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem;
}

.control-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
}

.control-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.zoom-level {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

/* Properties Panel */
.properties-panel {
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.panel-section {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-section h3 {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.property-group {
    margin-bottom: 0.75rem;
}

.property-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.property-value {
    font-size: 0.875rem;
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.type-badge.process { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.type-badge.datastore { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.type-badge.externalentity { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.type-badge.dataflow { background: rgba(100, 116, 139, 0.2); color: #64748b; }
.type-badge.trustboundary { background: rgba(236, 72, 153, 0.2); color: #ec4899; }

/* Threats Section in Properties */
.threats-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.threats-section .section-header h3 {
    margin: 0;
}

.threat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.threat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8125rem;
}

.threat-info {
    flex: 1;
    min-width: 0;
}

.threat-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.threat-status {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.threat-link {
    color: var(--text-muted);
    text-decoration: none;
}

.threat-link:hover {
    color: var(--primary);
}

.no-threats {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
    padding: 1rem;
}

.stride-badge {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.stride-badge.spoofing { background: var(--spoofing); }
.stride-badge.tampering { background: var(--tampering); }
.stride-badge.repudiation { background: var(--repudiation); }
.stride-badge.informationdisclosure { background: var(--informationdisclosure); }
.stride-badge.denialofservice { background: var(--denialofservice); }
.stride-badge.elevationofprivilege { background: var(--elevationofprivilege); }

/* Info Stats */
.info-stats {
    display: flex;
    gap: 1rem;
}

.info-stats .stat {
    text-align: center;
}

.info-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.info-stats .stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Help List */
.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
}

.help-list li {
    padding: 0.375rem 0;
    color: var(--text-secondary);
}

.help-list strong {
    color: var(--text-primary);
}

/* STRIDE Summary in Properties */
.stride-summary {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.stride-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.stride-name {
    flex: 1;
    color: var(--text-secondary);
}

.stride-count {
    font-weight: 600;
    color: var(--text-primary);
}

/* Panel Actions */
.panel-actions {
    padding: 1rem;
    margin-top: auto;
}

/* SVG Element Styles */
.diagram-element {
    cursor: pointer;
}

.diagram-element.selected .process-shape,
.diagram-element.selected .datastore-shape,
.diagram-element.selected .external-shape {
    stroke: var(--primary) !important;
    stroke-width: 3px !important;
}

.diagram-element.selected .trust-boundary {
    stroke: var(--primary) !important;
}

.diagram-element.selected .data-flow-line {
    stroke: var(--primary) !important;
}

.process-shape {
    fill: var(--bg-card);
    stroke: #3b82f6;
    stroke-width: 2px;
}

.datastore-shape {
    fill: var(--bg-card);
    stroke: #8b5cf6;
    stroke-width: 2px;
}

.datastore-line {
    stroke: #8b5cf6;
    stroke-width: 2px;
}

.external-shape {
    fill: var(--bg-card);
    stroke: #f59e0b;
    stroke-width: 2px;
}

.trust-boundary {
    fill: none;
    stroke: #ec4899;
    stroke-width: 2px;
    stroke-dasharray: 8 4;
}

.data-flow-line {
    stroke: #64748b;
    stroke-width: 2px;
    fill: none;
}

.element-label {
    fill: var(--text-primary);
    font-size: 11px;
    font-family: inherit;
}

.element-icon {
    fill: var(--text-secondary);
    font-size: 16px;
}

.boundary-label {
    fill: #ec4899;
    font-size: 12px;
    font-weight: 500;
}

.flow-label {
    fill: var(--text-secondary);
    font-size: 10px;
    text-anchor: middle;
}

.drawing-flow {
    stroke: var(--primary);
    stroke-width: 2px;
}

/* Button Block */
.btn-block {
    width: 100%;
}

/* Form Hint */
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   Context Menu Styles
   ============================================ */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 1000;
    padding: 0.375rem 0;
    animation: contextMenuFadeIn 0.1s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background 0.1s;
}

.context-menu-item:hover {
    background: var(--bg-tertiary);
}

.context-menu-item.danger {
    color: var(--danger);
}

.context-menu-item.danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

.context-menu-item[disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.context-menu-item .menu-icon {
    width: 18px;
    text-align: center;
}

.context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 0.375rem 0;
}

/* ============================================
   Selection Box Styles
   ============================================ */
.selection-box {
    fill: rgba(79, 70, 229, 0.1);
    stroke: var(--primary);
    stroke-width: 1;
    stroke-dasharray: 4 2;
}

/* ============================================
   Tool Separator Styles
   ============================================ */
.tool-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

/* ============================================
   Enhanced Light Theme Adjustments
   ============================================ */

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.05);
}

/* Cards with subtle shadows */
.card, .project-card, .exercise-card, .diagram-card, .stat-card {
    box-shadow: var(--shadow);
}

/* Inputs with better contrast */
.form-control {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Auth card */
.auth-card {
    box-shadow: var(--shadow-md);
}

/* Asset library */
.asset-library {
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.05);
}

.asset-item:hover {
    box-shadow: var(--shadow);
}

/* Properties panel */
.properties-panel {
    box-shadow: -1px 0 3px rgba(0, 0, 0, 0.05);
}

/* Toolbar */
.diagram-toolbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Tool buttons */
.tool-btn {
    background: var(--bg-secondary);
}

.tool-btn:hover {
    background: var(--bg-tertiary);
}

.tool-btn.active {
    background: var(--primary);
    color: white;
}

/* Canvas controls */
.canvas-controls {
    box-shadow: var(--shadow-md);
}

/* Modal overlay lighter - but keep high z-index */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999 !important;
}

/* SVG elements for light theme */
.process-shape {
    fill: var(--bg-secondary);
    stroke: #4f46e5;
}

.datastore-shape {
    fill: var(--bg-secondary);
    stroke: #7c3aed;
}

.datastore-line {
    stroke: #7c3aed;
}

.external-shape {
    fill: var(--bg-secondary);
    stroke: #d97706;
}

.trust-boundary {
    stroke: #db2777;
}

.data-flow-line {
    stroke: #64748b;
}

.element-label {
    fill: var(--text-primary);
}

.boundary-label {
    fill: #db2777;
}

.flow-label {
    fill: var(--text-secondary);
}

/* Diagram canvas grid */
.diagram-canvas-container {
    background:
        linear-gradient(90deg, #e2e8f0 1px, transparent 1px),
        linear-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #f8fafc;
}

/* Arrowhead for light theme */
.diagram-canvas marker polygon {
    fill: #64748b;
}

/* Risk cards with colored left border */
.risk-card.critical { border-left-color: var(--risk-critical); }
.risk-card.high { border-left-color: var(--risk-high); }
.risk-card.medium { border-left-color: var(--risk-medium); }
.risk-card.low { border-left-color: var(--risk-low); }
.risk-card.verylow { border-left-color: var(--risk-verylow); }

/* Better contrast for badges */
.status-badge.review { background: var(--warning); color: white; }
.category-badge.tampering { background: var(--tampering); color: white; }
.priority-badge.p2 { background: var(--warning); color: white; }
.slider-value.medium { background: var(--risk-medium); color: white; }
.risk-level.medium, .risk-level-badge.medium { background: var(--risk-medium); color: white; }

/* Matrix cell for light theme */
.matrix-cell.medium { background: var(--risk-medium); }

/* Preview score adjustments */
.preview-score.medium { background: var(--risk-medium); color: white; }

/* Diagram Element Icons */
.element-icon-path {
    stroke: var(--text-muted);
}

.diagram-element.selected .element-icon-path {
    stroke: var(--primary);
}

/* Resize Handles */
.resize-handle {
    fill: var(--primary);
    stroke: white;
    stroke-width: 1;
    cursor: nwse-resize;
}

/* Dragging cursor */
.diagram-element {
    cursor: move;
}

.diagram-element:active {
    cursor: grabbing;
}

/* ============================================
   Professional Diagram Editor Styles
   ============================================ */

.diagram-editor {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Header */
.diagram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.back-btn:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.diagram-title-input {
    font-size: 1.125rem;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    min-width: 200px;
}

.diagram-title-input:focus {
    outline: none;
    background: var(--bg-tertiary);
}

.header-center {
    display: flex;
    align-items: center;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.tool-btn:hover {
    background: #ffffff;
    color: var(--text-primary);
}

.tool-btn.active {
    background: var(--primary);
    color: #ffffff;
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tool-btn svg {
    width: 20px;
    height: 20px;
}

.tool-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.save-indicator.saved {
    color: var(--success);
}

.save-indicator svg {
    width: 16px;
    height: 16px;
}

/* Workspace */
.diagram-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Components Panel */
.components-panel {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s, margin 0.2s;
}

.components-panel.collapsed {
    width: 32px;
    min-width: 32px;
    overflow: visible;
}

.components-panel.collapsed .panel-content,
.components-panel.collapsed .panel-header {
    display: none;
}

.properties-panel.collapsed {
    width: 32px;
    min-width: 32px;
    overflow: visible;
}

.properties-panel.collapsed .panel-content,
.properties-panel.collapsed .panel-header {
    display: none;
}

.panel-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 48px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.panel-expand-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.panel-expand-btn.left {
    border-right: 1px solid var(--border-color);
}

.panel-expand-btn.right {
    border-left: 1px solid var(--border-color);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.panel-toggle:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.panel-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.component-category {
    margin-bottom: 8px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    cursor: pointer;
    user-select: none;
}

.category-header:hover {
    background: var(--bg-tertiary);
}

.category-header h4 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.category-header svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.component-category.collapsed .category-header svg {
    transform: rotate(-90deg);
}

.category-items {
    padding: 4px 8px;
}

.component-category.collapsed .category-items {
    display: none;
}

.component-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.component-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
}

.component-item:active {
    transform: scale(0.98);
}

.component-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}

.component-icon.process {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
}

.component-icon.datastore {
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
}

.component-icon.external {
    background: rgba(217, 119, 6, 0.15);
    color: #d97706;
}

.component-icon.boundary {
    background: rgba(219, 39, 119, 0.15);
    color: #db2777;
}

.component-icon svg {
    width: 20px;
    height: 20px;
}

.component-info {
    flex: 1;
    min-width: 0;
}

.component-info strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.component-info span {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    overflow: auto;
    background: #f8fafc;
}

.diagram-canvas {
    display: block;
}

.canvas-grid {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 1;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.zoom-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.zoom-btn svg {
    width: 18px;
    height: 18px;
}

.zoom-level {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.zoom-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

/* Minimap Placeholder */
.minimap {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 160px;
    height: 100px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Properties Panel */
.properties-panel {
    width: 280px;
    background: #ffffff;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s, margin 0.2s;
}

.property-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.property-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.property-row {
    margin-bottom: 12px;
}

.property-row label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.property-row input,
.property-row textarea,
.property-row select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.property-row input:focus,
.property-row textarea:focus,
.property-row select:focus {
    outline: none;
    border-color: var(--primary);
}

.property-row textarea {
    resize: vertical;
    min-height: 60px;
}

.empty-state {
    padding: 40px 24px;
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h4 {
    margin: 0 0 8px 0;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Context Menu - Standard OS-like appearance */
.context-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 4px 0;
    z-index: 1001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 400;
    color: #1a1a1a;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.1s ease;
    text-align: left;
}

.context-item:hover {
    background: #4f46e5;
    color: #ffffff;
}

.context-item:hover svg {
    color: #ffffff;
}

.context-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.context-item:disabled:hover {
    background: none;
    color: #1a1a1a;
}

.context-item.danger {
    color: #dc2626;
}

.context-item.danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.context-item svg {
    width: 15px;
    height: 15px;
    color: #666666;
    flex-shrink: 0;
}

.context-item.danger svg {
    color: #dc2626;
}

.context-item.danger:hover svg {
    color: #ffffff;
}

.context-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

.context-item .menu-shortcut {
    margin-left: auto;
    font-size: 11px;
    color: #999999;
    font-weight: 400;
}

.context-item:hover .menu-shortcut {
    color: rgba(255, 255, 255, 0.7);
}

/* Diagram Elements */
.element-shape {
    transition: stroke-width 0.15s;
}

.element-shape.process {
    fill: #ffffff;
    stroke: var(--primary);
    stroke-width: 2;
}

.element-shape.datastore {
    fill: #ffffff;
    stroke: #7c3aed;
    stroke-width: 2;
}

.element-shape.external {
    fill: #ffffff;
    stroke: #d97706;
    stroke-width: 2;
}

.element-shape.boundary {
    fill: none;
    stroke: #db2777;
    stroke-width: 2;
    stroke-dasharray: 8 4;
}

.element-icon {
    fill: var(--text-muted);
}

.element-label {
    fill: var(--text-primary);
    font-size: 11px;
    font-family: inherit;
}

.diagram-element.selected .element-shape {
    stroke-width: 3;
}

.diagram-element.selected .element-shape.process {
    stroke: var(--primary);
}

.diagram-element.selected .element-shape.datastore {
    stroke: #7c3aed;
}

.diagram-element.selected .element-shape.external {
    stroke: #d97706;
}

.diagram-element.selected .element-shape.boundary {
    stroke: #db2777;
}

/* Data Flows */
.flow-line {
    stroke: #64748b;
    stroke-width: 2;
    fill: none;
}

.flow-line.selected {
    stroke: var(--primary);
    stroke-width: 3;
}

.flow-arrow {
    fill: #64748b;
}

.flow-arrow.selected {
    fill: var(--primary);
}

.flow-label {
    fill: var(--text-secondary);
    font-size: 10px;
}

/* Selection Handles */
.selection-handle {
    fill: #ffffff;
    stroke: var(--primary);
    stroke-width: 2;
    cursor: nwse-resize;
}

/* Connection Mode Indicator */
.connection-indicator {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 100;
}

/* Toast adjustments for diagram editor */
.diagram-fullscreen-layout .success-toast {
    background: var(--success);
}

.diagram-fullscreen-layout .error-toast {
    background: var(--danger);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .components-panel {
        width: 200px;
    }

    .properties-panel {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .components-panel,
    .properties-panel {
        position: absolute;
        top: 56px;
        bottom: 0;
        z-index: 100;
        box-shadow: var(--shadow-md);
    }

    .components-panel {
        left: 0;
    }

    .properties-panel {
        right: 0;
    }

    .components-panel.collapsed,
    .properties-panel.collapsed {
        display: none;
    }
}

/* ============================================
   Diagram Editor Additional Styles
   ============================================ */

/* Diagram Title in Header */
.diagram-editor .diagram-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diagram-editor .diagram-title h1 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.diagram-editor .diagram-title h1:hover {
    color: var(--primary);
}

.diagram-editor .title-input {
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    min-width: 200px;
}

.diagram-editor .edit-title-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}

.diagram-editor .edit-title-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* Save Indicator */
.save-indicator.unsaved {
    color: var(--warning);
}

/* Primary and Secondary Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
}

/* Collapse Button */
.collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.collapse-btn:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

/* Search Box in Panel */
.diagram-editor .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 16px;
}

.diagram-editor .search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.diagram-editor .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

.diagram-editor .search-box input:focus {
    outline: none;
}

/* Category Header */
.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.category-header:hover {
    background: var(--bg-tertiary);
}

.category-header span:first-of-type {
    flex: 1;
    text-align: left;
}

.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Component List */
.component-list {
    padding: 4px 0;
}

.component-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.component-item:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.component-item .component-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

.component-item.process .component-icon {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
}

.component-item.datastore .component-icon {
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
}

.component-item.externalentity .component-icon {
    background: rgba(217, 119, 6, 0.15);
    color: #d97706;
}

.component-name {
    font-size: 0.8125rem;
    color: var(--text-primary);
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    position: relative;
}

.diagram-canvas {
    width: 2000px;
    height: 1500px;
    display: block;
}

.diagram-canvas.show-grid {
    background: #f8fafc;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 50;
}

.zoom-controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.zoom-controls button:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.zoom-level {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

/* Minimap */
.minimap {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 160px;
    height: 100px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 50;
}

.minimap-content {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
}

/* Property Section */
.property-section {
    margin-bottom: 16px;
}

.property-section > label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.property-section input,
.property-section textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.property-section input:focus,
.property-section textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.property-section textarea {
    resize: vertical;
    min-height: 60px;
}

.property-value {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 8px 0;
}

/* Position Inputs */
.position-inputs {
    display: flex;
    gap: 12px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input {
    width: 80px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Threats Section */
.threats-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.threats-section .section-header label {
    margin: 0;
}

.add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
}

.add-btn:hover {
    background: var(--primary-hover);
}

.threats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.threat-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.threat-item:hover {
    background: var(--border-color);
}

.threat-item.expanded {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.threat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.threat-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.threat-badge.spoofing { background: var(--spoofing); }
.threat-badge.tampering { background: var(--tampering); }
.threat-badge.repudiation { background: var(--repudiation); }
.threat-badge.informationdisclosure { background: var(--informationdisclosure); }
.threat-badge.denialofservice { background: var(--denialofservice); }
.threat-badge.elevationofprivilege { background: var(--elevationofprivilege); }

.threat-name {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.threat-status-badge {
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.threat-status-badge.status-identified {
    background: #fef3c7;
    color: #92400e;
}

.threat-status-badge.status-inanalysis {
    background: #dbeafe;
    color: #1e40af;
}

.threat-status-badge.status-mitigated {
    background: #dcfce7;
    color: #166534;
}

.threat-status-badge.status-accepted {
    background: #f3e8ff;
    color: #6b21a8;
}

.threat-status-badge.status-transferred {
    background: #e0f2fe;
    color: #0369a1;
}

.threat-status-badge.status-closed {
    background: #f1f5f9;
    color: #475569;
}

.threat-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.threat-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.threat-status-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.threat-status-control label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.threat-status-control select {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

.threat-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.6875rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-sm.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-sm.btn-danger:hover {
    background: #fecaca;
}

/* Threat Creation Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.threat-dialog {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.dialog-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dialog-header .close-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-header .close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dialog-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.dialog-body .form-group {
    margin-bottom: 16px;
}

.dialog-body .form-group:last-child {
    margin-bottom: 0;
}

.dialog-body label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.dialog-body .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.dialog-body .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dialog-body textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.dialog-body .form-row {
    display: flex;
    gap: 12px;
}

.dialog-body .form-group.half {
    flex: 1;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.dialog-footer .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dialog-footer .btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.dialog-footer .btn-outline:hover {
    background: var(--bg-tertiary);
}

.dialog-footer .btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: white;
}

.dialog-footer .btn-primary:hover {
    background: #1d4ed8;
}

/* Threat List Dialog */
.threat-list-dialog {
    max-width: 650px;
}

.threat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.threat-list-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.threat-list-item:hover {
    box-shadow: var(--shadow-md);
}

.threat-list-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.threat-list-item .threat-title {
    margin: 0 0 8px 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.threat-list-item .threat-description {
    margin: 0 0 12px 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.threat-list-actions {
    display: flex;
    gap: 8px;
}

.threat-list-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.empty-threats {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-threats p {
    margin: 0;
}

/* View Threat Dialog */
.view-threat-dialog {
    max-width: 600px;
}

.threat-view-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.threat-view-title {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.threat-view-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.threat-view-section:last-of-type {
    border-bottom: none;
}

.threat-view-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.threat-view-section p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.threat-view-meta {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Edit Threat Dialog */
.edit-threat-dialog {
    max-width: 650px;
}

.edit-threat-dialog .dialog-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Delete Threat Dialog */
.delete-threat-dialog {
    max-width: 450px;
}

.delete-warning {
    text-align: center;
    padding: 20px 0;
}

.delete-warning .warning-icon {
    color: #ef4444;
    margin-bottom: 16px;
}

.delete-warning p {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.delete-warning .warning-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.threat-to-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 16px;
}

.threat-to-delete strong {
    color: var(--text-primary);
}

/* Button styles */
.btn-danger-text {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

.btn-danger-text:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.dialog-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty Properties */
.empty-properties {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-properties svg {
    margin-bottom: 16px;
}

.empty-properties p {
    margin: 0;
    font-size: 0.875rem;
}

/* Button Link */
.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* SVG Element Classes */
.boundary-shape {
    fill: none;
    stroke: #db2777;
    stroke-width: 2;
    stroke-dasharray: 8 4;
}

.boundary-label {
    fill: #db2777;
    font-size: 12px;
    font-weight: 500;
}

.process-shape {
    fill: #ffffff;
    stroke: var(--primary);
    stroke-width: 2;
}

.datastore-shape {
    fill: #ffffff;
    stroke: #7c3aed;
    stroke-width: 2;
}

.datastore-body {
    fill: #ffffff;
    stroke: #7c3aed;
    stroke-width: 2;
    stroke-left: none;
    stroke-right: none;
}

.datastore-line {
    stroke: #7c3aed;
    stroke-width: 2;
}

.external-shape {
    fill: #ffffff;
    stroke: #d97706;
    stroke-width: 2;
}

.diagram-element.selected .process-shape,
.diagram-element.selected .datastore-shape,
.diagram-element.selected .external-shape {
    stroke-width: 3;
}

.diagram-element.selected .boundary-shape {
    stroke-width: 3;
    stroke: #db2777;
}

.diagram-element.connectable .process-shape,
.diagram-element.connectable .datastore-shape,
.diagram-element.connectable .external-shape {
    stroke-dasharray: 4 2;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.connecting-line {
    stroke: var(--primary);
    stroke-width: 2;
}

.selection-rect {
    fill: rgba(79, 70, 229, 0.1);
    stroke: var(--primary);
    stroke-width: 1;
    stroke-dasharray: 4 2;
}

/* Danger Button */
.tool-btn.danger:hover {
    color: var(--danger);
}

/* Spinner in button */
.btn-primary .spinner,
.btn-secondary .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Confirm Dialog - Global Modal */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: dialogFadeIn 0.2s ease-out;
}

@keyframes dialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.confirm-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.confirm-dialog-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.confirm-dialog-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.confirm-dialog-close:hover {
    color: var(--text-primary);
}

.confirm-dialog-body {
    padding: 1.5rem;
}

.confirm-dialog-body p {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
}

.confirm-dialog-body .warning-text {
    color: var(--danger);
    font-size: 0.875rem;
}

.confirm-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
}
