/* ===============================
   MODERN PROFESSIONAL CONTENT THEME
   OMG Design Suite + Content Naming
   =============================== */

/* Root Variables for consistent theming */
:root {
  --primary-color: #667eea;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-dark: #5a67d8;
  --primary-light: #e6f3ff;
  --secondary-color: #f093fb;
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-color: #48bb78;
  --success-gradient: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  --warning-color: #ed8936;
  --warning-gradient: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
  --danger-color: #f56565;
  --danger-gradient: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
  --info-color: #4299e1;
  --info-gradient: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  --dark-color: #2d3748;
  --light-color: #f7fafc;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --border-radius-sm: 0.25rem;
  --border-radius: 0.5rem;
  --border-radius-md: 0.75rem;
  --border-radius-lg: 1rem;
  --border-radius-xl: 1.5rem;
  --border-radius-2xl: 2rem;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --font-family-primary: 'Inter', 'Segoe UI', 'Roboto', system-ui, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
  --transition-fast: all 0.15s ease;
  --transition-smooth: all 0.3s ease;
  --transition-slow: all 0.5s ease;
}

/* ======= GENERAL BASE ======= */
body {
  font-family: var(--font-family-primary) !important;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
  color: var(--gray-800) !important;
  line-height: 1.6 !important;
}

/* ======= MAIN CONTENT THEME CLASSES ======= */
.content-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 2rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}
.content-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.content-header.bg-blue { background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);}
.content-header.bg-indigo { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);}
.content-header.bg-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%);}
.content-header.bg-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);}
.content-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 50%);
    animation: shimmer 8s infinite;
    z-index: 0;
}
@keyframes shimmer {0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}
.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.header-info { display: flex; flex-direction: column; }
.header-info h1, .header-info h2, .header-info h4 {
    font-size: 1.7rem; font-weight: 700; margin: 0;
    text-shadow: 0 2px 7px rgba(0,0,0,0.13);
    display: flex; align-items: center; gap: 0.6rem;
}
.header-info p { margin-top: 0.33em; color: rgba(255,255,255,0.96); font-size: 1.04rem; }
.header-actions { display: flex; gap: 0.6em; }

/* ======= BUTTONS ======= */
.modern-btn,
.modern-action-btn,
.action-btn {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: 0.7rem;
    padding: 0.47rem 1.19rem;
    font-weight: 600;
    font-size: 1.02rem;
    display: inline-flex;
    align-items: center;
    gap: 0.44rem;
    box-shadow: 0 3px 8px rgba(16,185,129,0.09);
    transition: var(--transition-smooth);
    cursor: pointer;
    margin-right: 0.22em;
}
.modern-btn.primary   { background: var(--primary-gradient);}
.modern-btn.success   { background: var(--success-gradient);}
.modern-btn.danger    { background: var(--danger-gradient);}
.modern-btn.info      { background: var(--info-gradient);}
.modern-btn.warning   { background: var(--warning-gradient);}
.modern-btn.secondary { background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); color: #374151;}
.modern-btn.neutral   { background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); color: #6b7280;}
.modern-btn:hover, .modern-action-btn:hover, .action-btn:hover {
    filter: brightness(1.03); color: #fff;
    transform: translateY(-1.5px) scale(1.025);
    box-shadow: 0 6px 16px #818cf812;
}
.modern-btn.danger:hover    { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);}
.modern-btn.success:hover   { background: linear-gradient(135deg, #059669 0%, #10b981 100%);}
.modern-btn.secondary:hover { color: #1e293b; background: linear-gradient(135deg, #f8fafc 0%, #d1d5db 100%);}
.modern-btn.info:hover      { background: linear-gradient(135deg, #818cf8 0%, #67e8f9 100%);}
.modern-btn.sm, .modern-action-btn.sm, .action-btn.sm { padding: 0.36rem 0.85rem; font-size: 0.95rem; }

/* ======= TABLES ======= */
.modern-table-container {
    background: #fff;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.modern-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
.modern-table th {
    padding: 1.12rem 1rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.99rem;
    text-transform: uppercase;
    letter-spacing: 0.36px;
    border: none;
    text-align: center;
}
.modern-table td {
    padding: 1rem 0.7rem;
    font-size: 1rem;
    vertical-align: middle;
    color: #374151;
    border: none;
    text-align: center;
}
.modern-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: var(--transition-fast);
}
.modern-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: scale(1.011);
    box-shadow: 0 8px 20px rgba(34,197,246,0.07);
}

/* ======= BADGES & ALERTS ======= */
.badge-index { font-size:.81rem; border-radius:.7rem; letter-spacing:.13px; vertical-align: 0.5px; padding: 0.32em 0.9em;}
.badge-splice  {background:#06b6d4; color:#fff;}
.badge-twist   {background:#a21caf; color:#fff;}
.badge-info    {background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%); color: #fff; font-weight: 500;}
.warn-badge {
    background: linear-gradient(135deg,#fde68a 0%,#facc15 100%);
    color: #a16207;
    display: inline-block;
    border-radius: 0.7rem;
    font-weight: 650; font-size: 0.99rem;
    padding: 0.35em 1em;
    box-shadow: 0 2px 6px rgba(250,204,21,.13);
    margin: 0.11em 0;
}

/* ======= MODALS ======= */
.modal-content {
    border-radius: 1.5rem;
    border: none;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    overflow: hidden;
}
.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-bottom: none;
    padding: 1.5rem 2rem;
    position: relative;
}
.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    position: relative;
    z-index: 2;
}
.modal-header .close {
    color: white;
    opacity: 0.8;
    font-size: 1.5rem;
    text-shadow: none;
    position: relative;
    z-index: 2;
}
.modal-header .close:hover {
    opacity: 1;
    color: white;
}
.modal-body {
    padding: 2rem;
    background: #ffffff;
}
.modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    gap: 1rem;
}

/* ====== GRAPH, DIAGRAM, AND OPTIONS SUPPORT ====== */

/* Graph Container */
.graph-container, #graph {
    background: #f3f6fb;
    border-radius: 1.2rem;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
    border: 1.5px solid #cbd5e1;
    min-height: 70vh;
    max-height: 95vh;
    width: 100%;
    margin: 2rem 0 0 0;
    padding: 1.5rem;
    position: relative;
    overflow: auto;
    display: block;
    box-sizing: border-box;
}
.graph-container svg, #graph svg {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    min-height: 46vh;
    max-height: 85vh;
    overflow: visible !important;
}
#svg-pan-zoom-controls {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 11;
    pointer-events: auto;
}
#svg-pan-zoom-controls .svg-pan-zoom-control,
#svg-pan-zoom-controls .modern-btn,
#svg-pan-zoom-controls button {
    box-shadow: 0 6px 20px rgba(0,0,0,0.11);
    border-radius: .5rem;
    background: #fff;
    opacity: 0.98;
    padding: 0.25em 0.3em;
}

/* Options Cards/Dashboard Section */
.options-section {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.action-card, .option-card {
    flex: 1 1 330px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem;
    min-width: 260px;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.action-card .card-title, .option-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.action-card .card-actions, .option-card .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}
.options-table th, .options-table td {
    padding: 0.32rem 0.5rem;
    font-size: 0.99rem;
    vertical-align: middle;
    border: none;
}
.options-table {
    width: 100%;
    margin-bottom: 0;
    background: none;
}
/* Responsive: Stack option cards on small screens */
@media (max-width:900px) {
    .options-section { flex-direction: column; gap: 1rem; }
}
@media (max-width: 600px) {
    .graph-container, #graph { padding: 0.7rem !important; }
    .action-card, .option-card { padding: 1.1rem 0.5rem; }
}

/* ======= FILE UPLOAD ======= */
.file-upload-wrapper {
    position: relative;
    margin-top: 0.25rem;
}
.file-upload-display {
    background: #fff;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #667eea;
    cursor: pointer;
}

.file-upload-wrapper.has-file .file-upload-display { border-color: #10b981; background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); color: #059669;}
.file-upload-display i { font-size: 2rem; margin-bottom: 0.5rem;}
.file-upload-text      { font-weight: 600; color: #374151; font-size: 0.89rem;}
.file-upload-formats   { font-size: 0.77rem; color: #6b7280; font-style: italic;}

/* ======= Select slider ======= */
.switch {
  display:inline-flex;
  align-items:center;
  cursor:pointer;
  user-select:none;
  margin-bottom:0;
}
.switch input{
  display:none;
}
.slider {
  position:relative;
  width:44px;
  height:24px;
  background:#ccc;
  border-radius:24px;
  margin-right:10px;
  transition:background 0.2s;
}
.slider:before {
  content:"";position:absolute;
  left:4px;top:4px;
  width:16px;height:16px;
  background:#fff;border-radius:50%;
  transition:transform 0.2s;
  box-shadow:0 1px 3px rgba(0,0,0,0.15);
}
input:checked + .slider {
  background:#4f8cff;
}
input:checked + .slider:before {
  transform:translateX(20px);
}
.switch-label {
  font-size:0.97rem;
  color:#333;
  margin-bottom:0;
}

/* Utility */
.color-box {display:inline-block;width:18px;height:18px;border-radius:3px;border:1px solid #ccc; margin-right: 4px;}
.no-results, td.text-muted {color: #6b7280; font-size: 1.08em;}
.hidden {display:none;}

/* ======= EFFECTS ======= */
.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.44,0.2,0.6,1.0) forwards;
    opacity: 0;
}
@keyframes fadeInUp { from {opacity:0;transform:translateY(30px);} to {opacity:1;transform:translateY(0);} }

/* ======= RESPONSIVE ======= */
@media (max-width:768px) {
    .content-container { padding: 1em !important;}
    .content-header { padding: 1.05em !important;}
    .header-content { flex-direction: column; text-align: center;}
    .header-info h1, .header-info h2 { font-size:1.13rem;}
    .modern-table th, .modern-table td { padding: 0.36rem 0.20rem; font-size: 0.90rem;}
    .options-section { gap: 1em;}
}
.content-toolbar {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  margin-bottom: 1.7rem;
  flex-wrap: wrap;
}
/* Modern Dashboard Layout */
.dashboard-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.dashboard-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2rem;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    color: white;
    text-align: center;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: heroShimmer 8s infinite;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    color: #f8fafc;
}

/* Modern Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.stat-card.primary::before { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.success::before { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-card.warning::before { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card.info::before { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.stat-icon.primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-icon.success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-icon.warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-icon.info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: #4b5563;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.875rem;
    color: #059669;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Management Sections */
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.management-card {
    background: #ffffff;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.management-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.management-header {
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.management-header.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}
.management-header.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}
.management-header.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}
.management-header.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.management-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.15) 0%, transparent 50%);
}

.management-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.management-subtitle {
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 2;
    color: #f8fafc;
}

.management-body {
    padding: 2rem;
    background: #ffffff;
}

.management-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.action-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.action-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* Projects Table */
.projects-section {
    background: #ffffff;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.projects-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.projects-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.15) 0%, transparent 50%);
}

.projects-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.projects-subtitle {
    opacity: 0.95;
    position: relative;
    z-index: 2;
    color: #f8fafc;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-badge.primary {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.status-badge.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #86efac;
}
.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.status-badge.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.project-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
}

.project-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Admin Dashboard Enhancements */
.admin-dashboard .management-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.admin-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
}

.admin-card .management-header.primary {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
}

.admin-card .management-header.success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.admin-card .management-header.warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* Enhanced Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stats .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.admin-stats .stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Subscription Badge Styling */
.subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.subscription-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.subscription-badge.free-tier {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.subscription-badge.free-tier:hover {
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.subscription-badge i {
    font-size: 1rem;
}

.upgrade-link {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.upgrade-link:hover {
    color: #f59e0b;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-hero {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .management-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .management-actions {
        grid-template-columns: 1fr;
    }

    .modern-table {
        font-size: 0.875rem;
    }

    .modern-table thead th {
        padding: 1rem;
    }

    .modern-table tbody td {
        padding: 1rem;
    }
}

/* Animations */
@keyframes heroShimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Text Contrast Improvements */
.text-dark { color: #1f2937 !important; }
.text-medium { color: #374151 !important; }
.text-light-dark { color: #4b5563 !important; }
.bg-white-safe { background-color: #ffffff !important; }

/* Enhanced Focus States for Accessibility */
.action-btn:focus,
.project-btn:focus {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

/* Modern Subscription Card Styles */
.subscription-status-section {
    margin-bottom: 2rem;
}

.subscription-card {
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    transition: all 0.3s ease;
}

.subscription-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.subscription-card.premium {
    border: 2px solid #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
}

.subscription-card.free {
    border: 2px solid #6b7280;
    box-shadow: 0 10px 30px rgba(107, 114, 128, 0.15);
}

.subscription-header {
    display: flex;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
}

.subscription-card.premium .subscription-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.subscription-card.free .subscription-header {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.subscription-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.subscription-icon.free {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.3);
}

.subscription-info {
    flex: 1;
}

.subscription-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: inherit;
}

.subscription-price {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

.shared-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

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

.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator.active {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #86efac;
}

.status-indicator.trialing {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.status-indicator.free {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.subscription-body {
    padding: 2rem;
}

.usage-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.usage-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    font-weight: 600;
    color: #374151;
}

.usage-label i {
    color: #667eea;
    width: 16px;
}

.usage-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.usage-progress {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-fill.team {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.usage-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    min-width: 60px;
    text-align: right;
}

.subscription-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.subscription-actions .action-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subscription-actions .action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.subscription-actions .action-btn.secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: #6b7280;
}

.subscription-actions .action-btn.upgrade {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: transparent;
}

.subscription-actions .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.limit-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #92400e;
    font-weight: 600;
}

.limit-warning i {
    color: #f59e0b;
    font-size: 1.25rem;
}

.limit-warning a {
    color: #92400e;
    text-decoration: underline;
    font-weight: 700;
}

.limit-warning a:hover {
    color: #78350f;
}

/* Owner info styling */
.owner-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.owner-name {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
}

.owner-role {
    display: flex;
    align-items: center;
}

.role-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.role-badge.role-admin {
    background: linear-gradient(135deg, #fef3c7 0%, #fde047 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.role-badge.role-staff {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    color: #5b21b6;
    border: 1px solid #8b5cf6;
}

.role-badge.role-system {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
    border: 1px solid #9ca3af;
}

/* Staff Members Section */
.staff-members-section {
    margin-top: 1.5rem;
}

.staff-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.staff-item {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #cbd5e1;
    transition: all 0.3s ease;
}

.staff-item:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateX(5px);
}

.staff-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.staff-name {
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.staff-email {
    color: #6b7280;
    font-size: 0.9rem;
}

.staff-status {
    display: flex;
    align-items: center;
}

.action-btn.disabled {
    background: #9ca3af;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.6;
}

.action-btn.disabled:hover {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
}
/* loader styling */
.loader {
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000; /* Ensure it appears above other content */
    display: none; /* Initially hidden */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern Part Numbers Page Styling */
.part-numbers-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 2rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.part-numbers-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    position: relative;
    overflow: visible !important;
}

.part-numbers-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: shimmer 8s infinite;
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    overflow: visible !important;
}

.header-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-info p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1050 !important;
    overflow: visible !important;
}

/* Dropdown styling with high z-index */
.dropdown {
    position: relative;
    z-index: 1050;
}

.dropdown-toggle {
    z-index: 1051;
}

.dropdown-menu {
    z-index: 1052 !important;
    position: absolute !important;
}

.dropdown-menu-modern {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 0.5rem;
    z-index: 1052 !important;
    position: absolute !important;
    min-width: 200px;
    margin-top: 0.5rem;
}

.dropdown-item-modern {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.dropdown-item-modern:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #1f2937;
    text-decoration: none;
}

/* Additional Bootstrap dropdown overrides */
.dropdown-menu.show {
    z-index: 1052 !important;
    position: absolute !important;
    display: block !important;
    transform: translate3d(0px, 38px, 0px) !important;
}

.dropdown-menu-right {
    right: 0 !important;
    left: auto !important;
}

/* Force dropdown visibility and positioning */
.header-actions .dropdown {
    position: relative !important;
    z-index: 1050 !important;
}

.header-actions .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 1052 !important;
    float: none !important;
    min-width: 200px !important;
    margin: 0.125rem 0 0 !important;
    font-size: 0.875rem !important;
    color: #212529 !important;
    text-align: left !important;
    list-style: none !important;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    border: 1px solid rgba(0,0,0,.15) !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.search-section {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 2rem;
}

.filters-section {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .part-numbers-container {
        padding: 1rem;
    }

    .part-numbers-header {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-info h1 {
        font-size: 1.5rem;
    }
}

/* Modal Styling */
.modal-content {
    border-radius: 1.5rem;
    border: none;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem 2rem;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: shimmer 3s infinite;
}

.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    position: relative;
    z-index: 2;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
    font-size: 1.5rem;
    text-shadow: none;
    position: relative;
    z-index: 2;
}

.modal-header .close:hover {
    opacity: 1;
    color: white;
}

.modal-body {
    padding: 2rem;
    background: #ffffff;
}

.modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    gap: 1rem;
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.form-control {
    border: 2px solid #e5e7eb !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #374151 !important;
}

.form-control:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #374151 !important;
}

/* Additional overrides for modal form controls */
.modal .form-control {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #374151 !important;
}

.modal select.form-control {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #374151 !important;
}

.modal input[type="text"].form-control {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #374151 !important;
}

/* Dropdown/Select specific overrides */
select.form-control {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #374151 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

select.form-control:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #374151 !important;
}

select.form-control option {
    background: #ffffff !important;
    color: #374151 !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #6b7280;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #374151;
}
/* Toggle Switch Styles */
.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.switch input {
  display: none;
}

.slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 24px;
  margin-right: 10px;
  transition: background 0.2s;
  box-sizing: border-box;
}

.slider:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background: #4f8cff;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 1rem;
  color: #333;
}