:root {
    --bg-dark: #070b19;
    --bg-card: rgba(22, 30, 49, 0.7);
    --bg-card-hover: rgba(30, 41, 67, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 242, 254, 0.3);
    
    --primary-grad: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --secondary-grad: linear-gradient(135deg, #b621fe 0%, #1fd1f9 100%);
    --danger-grad: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    --success-grad: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    --warning-grad: linear-gradient(135deg, #f9d423 0%, #ff4e50 100%);
    
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --glow-primary: 0 0 20px rgba(0, 242, 254, 0.25);
    --glow-secondary: 0 0 20px rgba(182, 33, 254, 0.25);
    
    --font-ar: 'Segoe UI', Tahoma, Arial, system-ui, -apple-system, sans-serif;
    --font-en: 'Segoe UI', Arial, system-ui, -apple-system, sans-serif;
    --sidebar-width: 300px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ar);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(182, 33, 254, 0.06) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.4);
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(11, 16, 31, 0.85);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    padding: 1.75rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    box-sizing: border-box;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.2);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.4);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.25rem;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 2.2rem;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(0, 242, 254, 0.3));
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: #fff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

.nav-item i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-item span {
    display: inline-block;
    white-space: nowrap;
    line-height: 1.3;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--border-hover);
    box-shadow: var(--glow-primary);
}

.nav-item.active i {
    color: #00f2fe;
    filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.5));
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    padding: 2.5rem;
    min-height: 100vh;
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
}

/* Page Section Styling */
.page-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.page-section.active {
    display: block;
}

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

/* Section Header */
.section-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-grad);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 400;
}

/* Dashboard Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-grad);
    opacity: 0;
    transition: var(--transition);
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--glow-primary);
}

.card-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.icon-blue { background: var(--primary-grad); }
.icon-purple { background: var(--secondary-grad); }
.icon-green { background: var(--success-grad); }
.icon-orange { background: var(--warning-grad); }
.icon-red { background: var(--danger-grad); }
.icon-teal { background: linear-gradient(135deg, #028090 0%, #00f2fe 100%); }

.card-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-stat {
    margin-top: auto;
    font-size: 1.8rem;
    font-weight: 800;
    background: #fff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-en);
}

/* Info Dashboard Panel */
.dashboard-panel {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title i {
    color: #00f2fe;
}

/* Video Sub-Tabs Navigation */
.subtabs-container {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 8px;
}

.subtab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.subtab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.subtab-btn.active {
    background: var(--primary-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--glow-primary);
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
}

.video-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--glow-primary);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(7, 11, 25, 0.8) 0%, transparent 60%);
}

.thumbnail-icon {
    font-size: 3.5rem;
    background: var(--secondary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.4;
    transition: var(--transition);
}

.video-card:hover .thumbnail-icon {
    opacity: 1;
    transform: scale(1.15);
    filter: drop-shadow(0 0 10px rgba(31, 209, 249, 0.5));
}

.play-badge {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    z-index: 2;
}

.video-card:hover .play-badge {
    background: var(--primary-grad);
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: var(--glow-primary);
}

.video-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.video-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    font-family: var(--font-en);
}

/* Modal Overlay & Custom Video Player */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 5, 12, 0.9);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #0f1626;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--danger-grad);
    border-color: transparent;
    transform: rotate(90deg);
}

.modal-video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.modal-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    border-top: 1px solid var(--border-color);
    background: #0f1626;
    flex-wrap: wrap;
    gap: 1rem;
}

.modal-video-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    font-family: var(--font-ar);
}

.modal-download-btn {
    background: var(--primary-grad);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font-ar);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.modal-download-btn:hover {
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
    color: #fff;
}

/* Video Card Download Button */
.video-card-download-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    text-decoration: none;
}

.video-card-download-btn:hover {
    background: var(--primary-grad);
    color: #fff;
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: var(--glow-primary);
}

/* Search and Filters Bar */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 45px 14px 20px;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-ar);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: #00f2fe;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
    background: var(--bg-card-hover);
}

.filter-select-wrapper {
    position: relative;
    min-width: 200px;
}

.filter-select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-ar);
    font-size: 0.95rem;
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: #00f2fe;
}

/* Laboratory Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.item-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
    position: relative;
}

.item-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--glow-primary);
}

.item-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.item-image-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: var(--transition);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.item-card:hover .item-image-wrapper img {
    transform: scale(1.08);
}

.item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid #00f2fe;
    color: #00f2fe;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.item-names {
    margin-top: 4px;
}

.item-ar-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.item-en-name {
    font-size: 0.85rem;
    font-family: var(--font-en);
    color: var(--text-secondary);
    font-weight: 600;
}

.item-usage {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
}

/* Preparation Gateway Grid Layout */
.prep-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .prep-layout {
        grid-template-columns: 1fr;
    }
}

.prep-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Table Style */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-card);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.custom-table th, .custom-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 700;
}

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

.custom-table tbody tr {
    cursor: pointer;
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.formula-tag {
    font-family: var(--font-en);
    background: rgba(182, 33, 254, 0.15);
    border: 1px solid #b621fe;
    color: #b621fe;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

/* Form Styles */
.calculator-panel {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.calculator-panel.active-glow {
    border-color: #00f2fe !important;
    box-shadow: var(--glow-primary) !important;
    transform: scale(1.02);
    opacity: 1 !important;
    pointer-events: auto !important;
}

.calculator-panel.inactive-dim {
    opacity: 0.35 !important;
    pointer-events: none !important;
    transform: scale(0.98);
    filter: grayscale(0.5);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: rgba(7, 11, 25, 0.6);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-ar);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: #00f2fe;
    background: rgba(7, 11, 25, 0.8);
}

.form-control-en {
    font-family: var(--font-en);
    direction: ltr;
}

/* Premium Date Picker Enhancements */
input[type="date"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(175deg); /* Neon cyan glow icon */
    cursor: pointer;
    border-radius: 6px;
    padding: 4px;
    transition: var(--transition);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: rgba(0, 242, 254, 0.15);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.calc-btn {
    width: 100%;
    background: var(--primary-grad);
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.calc-btn:hover {
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
}

.result-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(11, 163, 96, 0.1);
    border: 1px solid #0ba360;
    border-radius: 12px;
    display: none;
}

.result-box.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.result-title {
    font-size: 0.9rem;
    color: #3cba92;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

/* Timeline Steps */
.timeline-container {
    position: relative;
    padding-right: 30px;
    margin-top: 1rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 5px;
    right: 9px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
}

.timeline-step {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.step-marker {
    position: absolute;
    right: -30px;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--text-muted);
    transition: var(--transition);
}

.timeline-step.active .step-marker {
    border-color: #00f2fe;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

.step-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.timeline-step.active .step-content {
    border-color: var(--border-hover);
    background: rgba(0, 242, 254, 0.02);
}

.step-num {
    font-size: 0.8rem;
    color: #00f2fe;
    font-weight: 700;
    margin-bottom: 4px;
}

.step-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.step-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* GHS Label Layout */
.ghs-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .ghs-layout {
        grid-template-columns: 1fr;
    }
}

.ghs-form-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pictograms-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.picto-checkbox {
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    padding: 8px 4px;
    gap: 6px;
}

.picto-checkbox img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.picto-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
}

.picto-checkbox input {
    display: none;
}

.picto-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.picto-checkbox.active {
    border-color: #ff0844;
    background: rgba(255, 8, 68, 0.15);
    box-shadow: 0 0 12px rgba(255, 8, 68, 0.3);
}

.picto-checkbox.active .picto-label {
    color: #fff;
}

/* Live Label Preview Canvas Style */
.ghs-preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.live-label-container {
    background: #ffffff;
    color: #000000;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/3;
    border: 6px solid #000000;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.label-header {
    border-bottom: 3px solid #000;
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.label-header .chem-title {
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
}

.label-header .chem-formula {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 4px;
}

.label-header .chem-conc {
    font-size: 1.3rem;
    font-weight: 900;
    color: #d32f2f;
}

.label-body {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 12px;
    margin-top: 12px;
    direction: ltr; /* Standards look best in standard formats */
}

.label-body.rtl {
    direction: rtl;
}

.label-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.detail-row {
    display: flex;
    gap: 6px;
}

.detail-label {
    font-weight: 700;
}

.label-warning-word {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ff0000;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.label-precautions {
    font-size: 0.75rem;
    line-height: 1.4;
    border-top: 1px solid #ccc;
    padding-top: 6px;
    margin-top: auto;
}

.label-pictograms {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.label-picto-diamond {
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    transform: none;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-picto-diamond img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none;
}

.label-footer {
    border-top: 2px solid #000;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Printing styles for GHS Chemical Labels */
@media print {
    body.printing-ghs-generator * {
        visibility: hidden;
    }
    body.printing-ghs-generator .live-label-container, 
    body.printing-ghs-generator .live-label-container * {
        visibility: visible;
    }
    body.printing-ghs-generator .live-label-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border: 4px solid #000;
    }
}

/* User Role Panel styling */
.user-role-panel {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-panel-title i {
    color: #00f2fe;
}

.role-select {
    width: 100%;
    background: rgba(7, 11, 25, 0.6);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-ar);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.role-select:focus {
    outline: none;
    border-color: #00f2fe;
}

.admin-password-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.current-role-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    display: inline-block;
}

.badge-visitor { background: rgba(160, 174, 192, 0.15); border: 1px solid #a0aec0; color: #a0aec0; }
.badge-member { background: rgba(79, 172, 254, 0.15); border: 1px solid #4facfe; color: #4facfe; }
.badge-admin { background: rgba(249, 212, 35, 0.15); border: 1px solid #f9d423; color: #f9d423; }

/* Admin and Editor Actions */
.admin-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.admin-btn {
    flex: 1;
    border: none;
    color: #fff;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.admin-btn-edit {
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid #00f2fe;
    color: #00f2fe;
}

.admin-btn-edit:hover {
    background: #00f2fe;
    color: #000;
}

.admin-btn-delete {
    background: rgba(255, 8, 68, 0.15);
    border: 1px solid #ff0844;
    color: #ff0844;
}

.admin-btn-delete:hover {
    background: #ff0844;
    color: #fff;
}

/* Chemical Cards Selector Grid */
.chemical-cards-grid {
    scrollbar-width: thin;
}

.chem-select-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.chem-select-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 242, 254, 0.2);
    transform: translateY(-3px);
}

.chem-select-card.active {
    background: rgba(0, 242, 254, 0.08);
    border-color: #00f2fe;
    box-shadow: var(--glow-primary);
}

.chem-card-icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
    transition: var(--transition);
}

.chem-select-card.active .chem-card-icon {
    color: #00f2fe;
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.5));
}

.chem-card-formula {
    font-family: var(--font-en);
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.chem-card-name-ar {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.chem-card-name-en {
    font-size: 0.75rem;
    font-family: var(--font-en);
    color: var(--text-muted);
    font-weight: 500;
}

.chem-card-type-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.badge-solid-chem {
    background: rgba(182, 33, 254, 0.15);
    border: 1px solid #b621fe;
    color: #b621fe;
}

.badge-liquid-chem {
    background: rgba(31, 209, 249, 0.15);
    border: 1px solid #1fd1f9;
    color: #1fd1f9;
}

.chem-card-check {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.75rem;
    color: #00f2fe;
    display: none;
}

.chem-select-card.active .chem-card-check {
    display: block;
}

/* High-Fidelity Custom Tables and Interactive Selection */
.table-container {
    background: rgba(11, 16, 31, 0.6) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.custom-table {
    border-collapse: separate;
    border-spacing: 0;
}

.custom-table th {
    background: rgba(19, 26, 45, 0.8) !important;
    color: #00f2fe !important;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0, 242, 254, 0.15) !important;
    padding: 14px 18px !important;
}

.custom-table tbody tr {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-table tbody tr td {
    padding: 12px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    transition: all 0.25s ease;
}

/* Hover and Click Selection Row highlight */
.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    transform: translateX(-4px); /* RTL push effect */
}

.custom-table tbody tr.active {
    background: linear-gradient(270deg, rgba(0, 242, 254, 0.12) 0%, rgba(0, 242, 254, 0.02) 100%) !important;
    border-right: 5px solid #00f2fe !important;
    box-shadow: inset 5px 0 15px rgba(0, 242, 254, 0.08) !important;
}

.custom-table tbody tr.active td {
    color: #ffffff !important;
    font-weight: 600;
}

.custom-table tbody tr.active .formula-tag {
    background: #b621fe !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(182, 33, 254, 0.5);
    border-color: transparent !important;
}

/* Custom interactive select checkbox/radio column */
.select-indicator-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
}

.custom-table tbody tr:hover .select-indicator-wrapper {
    border-color: rgba(0, 242, 254, 0.5);
    background: rgba(0, 242, 254, 0.05);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

.custom-table tbody tr.active .select-indicator-wrapper {
    background: var(--primary-grad);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    transform: scale(1.1);
}

/* ========================================== */
/* SAFETY & SECURITY INTERACTIVE SECTION     */
/* ========================================== */
.safety-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.safety-tabs-nav {
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.4);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: thin;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}

.safety-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.safety-tab-btn i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.safety-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.safety-tab-btn.active {
    color: #fff;
    background: var(--primary-grad);
    box-shadow: var(--glow-primary);
}

.safety-pane {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.safety-pane.active {
    display: block;
}

/* Hazard Flip Cards */
.hazard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.hazard-card {
    background: rgba(19, 26, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hazard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--secondary-grad);
    opacity: 0.8;
}

.hazard-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 8, 68, 0.3);
    box-shadow: 0 15px 35px rgba(255, 8, 68, 0.15);
}

.hazard-icon-wrapper {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(255, 8, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #ff0844;
    border: 1px solid rgba(255, 8, 68, 0.2);
    box-shadow: 0 0 15px rgba(255, 8, 68, 0.1);
    transition: var(--transition);
}

.hazard-card:hover .hazard-icon-wrapper {
    transform: scale(1.1);
    background: rgba(255, 8, 68, 0.2);
    box-shadow: 0 0 25px rgba(255, 8, 68, 0.3);
}

.hazard-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.hazard-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Spill Handling Layout */
.spill-workflow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.spill-box {
    background: rgba(19, 26, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.spill-box-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spill-box-acid .spill-box-title {
    color: #ff5e62;
}

.spill-box-alkali .spill-box-title {
    color: #00f2fe;
}

.spill-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.spill-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    right: 20px;
    width: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.spill-step-item {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.spill-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: var(--transition);
}

.spill-step-item:hover .spill-step-num {
    border-color: #00f2fe;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.spill-step-text {
    flex-grow: 1;
    padding-top: 8px;
}

.spill-step-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.spill-step-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Heating & Bunsen Simulator */
.bunsen-simulator {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    background: rgba(19, 26, 45, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .bunsen-simulator {
        grid-template-columns: 1fr;
    }
}

.burner-graphic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 320px;
    position: relative;
    background: rgba(10, 15, 30, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.flame-wrapper {
    position: relative;
    width: 60px;
    height: 120px;
    bottom: -15px;
    z-index: 10;
}

/* CSS Animated Flame */
.css-flame {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100px;
    background: linear-gradient(to top, rgba(255,100,0,0.8), rgba(255,200,0,0.2));
    border-radius: 50% 50% 20% 20%;
    filter: blur(4px);
    animation: flameWobble 0.8s ease-in-out infinite alternate;
    opacity: 0;
    transition: all 0.5s ease;
}

.css-flame-inner {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 60px;
    background: linear-gradient(to top, rgba(255,255,0,0.9), transparent);
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.9;
}

/* Flame Yellow safety state */
.css-flame.safety {
    opacity: 1;
    width: 45px;
    height: 110px;
    background: radial-gradient(circle at bottom, #ff5e62 10%, #ff9966 40%, #ffde17 80%, transparent 100%);
    filter: drop-shadow(0 0 15px rgba(255, 150, 0, 0.6));
    animation: flameWobble 0.6s ease-in-out infinite alternate;
}

/* Flame Blue heating state */
.css-flame.heating {
    opacity: 1;
    width: 32px;
    height: 85px;
    background: radial-gradient(circle at bottom, rgba(0, 50, 255, 0.9) 10%, rgba(0, 150, 255, 0.7) 40%, rgba(0, 242, 254, 0.4) 80%, transparent 100%);
    filter: drop-shadow(0 0 20px rgba(0, 242, 254, 0.7));
    animation: flameWobble 0.4s ease-in-out infinite alternate;
}

@keyframes flameWobble {
    0% {
        transform: translateX(-50%) scaleX(0.95) skewX(-1deg);
        border-radius: 50% 50% 30% 30%;
    }
    100% {
        transform: translateX(-50%) scaleX(1.05) skewX(1deg);
        border-radius: 51% 49% 29% 31%;
    }
}

.burner-base {
    width: 44px;
    height: 100px;
    background: linear-gradient(90deg, #475569, #1e293b, #475569);
    border-radius: 4px;
    position: relative;
    border-top: 4px solid #94a3b8;
    z-index: 5;
}

.burner-stand {
    width: 90px;
    height: 10px;
    background: linear-gradient(90deg, #334155, #0f172a, #334155);
    border-radius: 4px;
    position: relative;
    z-index: 4;
}

.burner-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.burner-status-badge.off {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.1);
}

.burner-status-badge.safety {
    background: rgba(255, 153, 102, 0.15);
    color: #ff9966;
    border: 1px solid rgba(255, 153, 102, 0.3);
    box-shadow: 0 0 10px rgba(255, 153, 102, 0.2);
}

.burner-status-badge.heating {
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.burner-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.burner-gas-knob {
    display: flex;
    align-items: center;
    gap: 12px;
}

.burner-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.burner-btn-match {
    background: rgba(255, 94, 98, 0.1);
    border: 1px solid rgba(255, 94, 98, 0.3);
    color: #ff5e62;
}

.burner-btn-match:hover {
    background: rgba(255, 94, 98, 0.2);
}

.burner-btn-match.active {
    background: #ff5e62;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 94, 98, 0.4);
}

.burner-btn-gas {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: #00f2fe;
}

.burner-btn-gas:hover {
    background: rgba(0, 242, 254, 0.2);
}

.burner-btn-gas.active {
    background: #00f2fe;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.burner-btn-gas:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.burner-vent-control {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
}

/* Safety Pledge Checklist */
.pledge-card {
    background: rgba(19, 26, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.pledge-progress-wrapper {
    margin-bottom: 24px;
}

.pledge-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.03);
}

.pledge-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-grad);
    box-shadow: var(--glow-primary);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.pledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.pledge-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255,255,255,0.03);
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.pledge-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(0, 242, 254, 0.2);
}

.pledge-item.checked {
    background: rgba(0, 242, 254, 0.05);
    border-color: rgba(0, 242, 254, 0.3);
}

.pledge-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.15);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    color: transparent;
    font-size: 0.75rem;
}

.pledge-item:hover .pledge-checkbox {
    border-color: rgba(0, 242, 254, 0.5);
}

.pledge-item.checked .pledge-checkbox {
    background: var(--primary-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.pledge-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: var(--transition);
}

.pledge-item.checked .pledge-text {
    color: #fff;
}

.pledge-certificate-wrapper {
    display: none;
    text-align: center;
    padding: 30px;
    background: radial-gradient(circle at center, rgba(0, 242, 254, 0.1) 0%, transparent 70%);
    border-radius: 12px;
    border: 2px dashed rgba(0, 242, 254, 0.3);
    margin-top: 20px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.pledge-certificate-wrapper.active {
    display: block;
}

.certificate-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    background: var(--secondary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.certificate-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 20px;
}

.certificate-input-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

@keyframes scaleIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

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

/* Premium PDF Interface Styling */
.pdf-interface-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin-top: 20px;
    align-items: stretch;
}

@media (max-width: 992px) {
    .pdf-interface-grid {
        grid-template-columns: 1fr;
    }
}

.pdf-info-card {
    background: rgba(19, 26, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.pdf-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 18px;
}

.pdf-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: rgba(255, 78, 80, 0.1);
    border: 1px solid rgba(255, 78, 80, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #ff4e50;
    box-shadow: 0 0 15px rgba(255, 78, 80, 0.1);
    flex-shrink: 0;
}

.pdf-doc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

.pdf-doc-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pdf-metadata-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.pdf-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
    padding-bottom: 8px;
}

.pdf-meta-item:last-child {
    border-bottom: none;
}

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

.meta-value {
    color: #fff;
    font-weight: 600;
}

.badge-status-active {
    background: rgba(11, 163, 96, 0.15);
    color: #3cba92;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid rgba(11, 163, 96, 0.3);
}

.pdf-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pdf-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--danger-grad);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.2);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.pdf-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 8, 68, 0.4);
    filter: brightness(1.1);
}

.pdf-open-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
}

.pdf-open-new-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.pdf-embed-card {
    background: rgba(19, 26, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.pdf-embed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.pdf-badge-interactive {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
    box-shadow: var(--glow-primary);
}

.pdf-iframe-wrapper {
    width: 100%;
    height: 520px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 15, 30, 0.6);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.pdf-iframe-element {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================== */
/* TECHNICIAN GUIDE INTERACTIVE SECTION       */
/* ========================================== */
.tech-tabs-nav {
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.4);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: thin;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    margin-bottom: 24px;
}

.tech-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.tech-tab-btn i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.tech-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.tech-tab-btn.active {
    color: #fff;
    background: var(--primary-grad);
    box-shadow: var(--glow-primary);
}

.tech-tab-btn.active i {
    color: #00f2fe;
    filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.5));
}

.tech-tab-btn.tech-pdf-btn.active {
    background: linear-gradient(135deg, #b621fe 0%, #1fd1f9 100%);
    box-shadow: 0 0 15px rgba(182, 33, 254, 0.4);
}

.tech-tab-btn.tech-pdf-btn.active i {
    color: #b621fe;
    filter: drop-shadow(0 0 5px rgba(182, 33, 254, 0.5));
}

.tech-pane {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tech-pane.active {
    display: block;
}

/* Beautiful details for lists and tables in guide content */
.tech-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.tech-guide-card {
    background: rgba(19, 26, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tech-guide-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-grad);
    opacity: 0.8;
}

.tech-guide-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.tech-guide-card.card-safety::before {
    background: linear-gradient(to bottom, #ff0844 0%, #ffb199 100%);
}
.tech-guide-card.card-safety:hover {
    border-color: rgba(255, 8, 68, 0.2);
}

.tech-guide-card.card-files::before {
    background: linear-gradient(to bottom, #b621fe 0%, #1fd1f9 100%);
}
.tech-guide-card.card-files:hover {
    border-color: rgba(182, 33, 254, 0.2);
}

.tech-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.tech-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: #00f2fe;
    font-size: 1.25rem;
}

.tech-guide-card.card-safety .tech-card-icon {
    background: rgba(255, 8, 68, 0.1);
    border-color: rgba(255, 8, 68, 0.2);
    color: #ff0844;
}

.tech-guide-card.card-files .tech-card-icon {
    background: rgba(182, 33, 254, 0.1);
    border-color: rgba(182, 33, 254, 0.2);
    color: #b621fe;
}

.tech-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.tech-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tech-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tech-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.tech-checklist-item i {
    color: #00f2fe;
    margin-top: 4px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tech-guide-card.card-safety .tech-checklist-item i {
    color: #ff0844;
}

.tech-guide-card.card-files .tech-checklist-item i {
    color: #b621fe;
}

/* Chemical hazard table inside guide */
.tech-hazard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.tech-hazard-table th {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-weight: 600;
    padding: 10px 14px;
    text-align: right;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-hazard-table td {
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.tech-hazard-table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* magenta icon styling for files */
.icon-magenta {
    background: linear-gradient(135deg, #ec008c 0%, #fc6767 100%);
}

/* Form pane styles */
.form-pane {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}
.form-pane.active {
    display: block;
}

/* Form dynamic table styles */
.custom-table td input[type="text"],
.custom-table td input[type="number"],
.custom-table td select,
.custom-table td input[type="date"] {
    width: 100%;
    background: rgba(7, 11, 25, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 0.85rem;
    transition: var(--transition);
}
.custom-table td input[type="text"]:focus,
.custom-table td input[type="number"]:focus,
.custom-table td select:focus,
.custom-table td input[type="date"]:focus {
    border-color: #00f2fe;
    outline: none;
    background: rgba(7, 11, 25, 0.7);
}

.table-action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.table-action-btn:hover {
    color: #fff;
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}
.btn-add-row {
    color: #0ba360;
    border-color: rgba(11, 163, 96, 0.3);
}
.btn-add-row:hover {
    background: rgba(11, 163, 96, 0.1);
    border-color: #0ba360;
}
.btn-remove-row {
    color: #ff0844;
    border-color: rgba(255, 8, 68, 0.3);
}
.btn-remove-row:hover {
    background: rgba(255, 8, 68, 0.1);
    border-color: #ff0844;
}

/* Styling Section 7 Forms on Screen as White Paper Sheets */
.form-pane .dashboard-panel {
    background: #ffffff !important;
    color: #0f172a !important; /* Dark slate text for form content */
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    border-radius: 12px !important;
    padding: 3rem !important;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: none !important;
}

/* Ensure headings and titles are dark on screen */
.form-pane .dashboard-panel .panel-title {
    color: #0f172a !important;
}
.form-pane .dashboard-panel .panel-title i {
    color: #0284c7 !important; /* Premium blue icon */
}

/* Ensure all sub-headings (h5) are dark slate on screen */
.form-pane .dashboard-panel h5 {
    color: #0f172a !important;
}

.form-pane .dashboard-panel .form-label {
    color: #334155 !important;
    font-weight: 600;
}

/* Paragraphs and descriptions inside the form */
.form-pane .dashboard-panel p {
    color: #475569 !important;
    border-right-color: #0284c7 !important;
}

/* Form controls (inputs, selects, etc.) inside the white paper form */
.form-pane .dashboard-panel .form-control {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
}
.form-pane .dashboard-panel .form-control:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Readonly fields like grand total */
.form-pane .dashboard-panel .form-control[readonly] {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* Table styling inside the white paper form */
.form-pane .dashboard-panel .table-container {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
}

.form-pane .dashboard-panel .custom-table {
    width: 100%;
    border-collapse: collapse;
}

.form-pane .dashboard-panel .custom-table th,
.form-pane .dashboard-panel .custom-table td {
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.form-pane .dashboard-panel .custom-table th {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
}

.form-pane .dashboard-panel .custom-table td {
    background: #ffffff !important;
}

/* Editable month and week inputs in stats table header */
.form-pane .dashboard-panel th input.header-month-input {
    width: 100%;
    border: none !important;
    background: transparent !important;
    color: #1e293b !important;
    text-align: center !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    font-family: inherit !important;
    padding: 2px !important;
    outline: none !important;
    cursor: text;
}

.form-pane .dashboard-panel th input.header-week-input {
    width: 100%;
    border: none !important;
    background: transparent !important;
    color: #0f172a !important;
    text-align: center !important;
    font-size: 0.8rem !important;
    font-family: inherit !important;
    padding: 2px !important;
    outline: none !important;
    cursor: text;
}

/* Input fields inside the table */
.form-pane .dashboard-panel .custom-table td input[type="text"],
.form-pane .dashboard-panel .custom-table td input[type="number"],
.form-pane .dashboard-panel .custom-table td select,
.form-pane .dashboard-panel .custom-table td input[type="date"] {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
}

.form-pane .dashboard-panel .custom-table td input[type="text"]:focus,
.form-pane .dashboard-panel .custom-table td input[type="number"]:focus,
.form-pane .dashboard-panel .custom-table td select:focus,
.form-pane .dashboard-panel .custom-table td input[type="date"]:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Checkboxes or select styling */
.form-pane .dashboard-panel select {
    appearance: auto !important;
}

/* Ensure calendar indicator is visible and colored dark on the white page */
.form-pane .dashboard-panel input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none !important;
    cursor: pointer;
    opacity: 0.7;
}
.form-pane .dashboard-panel input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: transparent;
    box-shadow: none;
    transform: none;
}

/* Action buttons inside the panel (add/delete row, print) */
.form-pane .dashboard-panel .table-action-btn {
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    background: #f8fafc !important;
}

.form-pane .dashboard-panel .table-action-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.form-pane .dashboard-panel .btn-add-row {
    color: #166534 !important;
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
}
.form-pane .dashboard-panel .btn-add-row:hover {
    background: #dcfce7 !important;
    color: #15803d !important;
}

.form-pane .dashboard-panel .btn-remove-row {
    color: #991b1b !important;
    border-color: #fecaca !important;
    background: #fef2f2 !important;
}
.form-pane .dashboard-panel .btn-remove-row:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

/* Footers and bottom text signatures */
.form-pane .dashboard-panel div[style*="border-top: 1px dashed"] {
    border-top: 1px dashed #cbd5e1 !important;
    color: #475569 !important;
}

/* Print header (Ministry details) styled for screen visibility */
.printable-form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 1.8rem;
    padding: 14px 20px 12px 20px;
    background: #ffffff;
    border-radius: 12px;
    border-bottom: 3px solid #0284c7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.printable-form-header .form-header-logo {
    max-width: 100%;
    width: auto;
    max-height: 90px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px auto;
}

.printable-form-header .print-form-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
    font-family: var(--font-ar);
}

.printable-form-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.92rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: var(--font-ar);
}

/* Printing Media Rules for Electronic Files */
@media print {
    body.printing-electronic-files {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        line-height: 1.5 !important;
    }
    body.printing-electronic-files .printable-form-header {
        display: block !important;
        text-align: center !important;
        margin-bottom: 1.2rem !important;
        padding: 0 0 8px 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 2px solid #000000 !important;
        box-shadow: none !important;
    }

    body.printing-electronic-files .printable-form-header .form-header-logo {
        max-width: 100% !important;
        width: auto !important;
        max-height: 85px !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto 6px auto !important;
        filter: none !important;
    }

    body.printing-electronic-files .printable-form-header .print-form-title {
        font-size: 13pt !important;
        font-weight: bold !important;
        color: #000000 !important;
        text-align: center !important;
        margin-top: 4px !important;
    }

    body.printing-electronic-files .printable-form-footer {
        display: block !important;
        text-align: center !important;
        margin-top: 2rem !important;
        padding-top: 0.8rem !important;
        border-top: 1.5px solid #000000 !important;
        font-size: 10pt !important;
        font-weight: bold !important;
        color: #000000 !important;
        width: 100% !important;
    }
    body.printing-electronic-files .app-container {
        display: block !important;
    }
    body.printing-electronic-files .sidebar, 
    body.printing-electronic-files .no-print, 
    body.printing-electronic-files .subtabs-container, 
    body.printing-electronic-files .section-header, 
    body.printing-electronic-files .calc-btn, 
    body.printing-electronic-files .table-action-btn, 
    body.printing-electronic-files .sidebar-footer {
        display: none !important;
    }
    body.printing-electronic-files .main-content {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    body.printing-electronic-files .form-pane.active .dashboard-panel {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        max-width: 100% !important;
    }
    body.printing-electronic-files .print-header {
        display: block !important;
    }
    
    /* Force all child elements inside the active printed form to black color and transparent background */
    body.printing-electronic-files .form-pane.active .dashboard-panel,
    body.printing-electronic-files .form-pane.active .dashboard-panel * {
        color: #000000 !important;
        background: transparent !important;
        border-color: #000000 !important;
    }

    /* Input Styling for Print */
    body.printing-electronic-files .form-control, 
    body.printing-electronic-files .custom-table td input[type="text"],
    body.printing-electronic-files .custom-table td input[type="number"],
    body.printing-electronic-files .custom-table td select,
    body.printing-electronic-files .custom-table td input[type="date"] {
        border: none !important;
        border-bottom: 1px solid #000000 !important;
        background: transparent !important;
        color: #000000 !important;
        padding: 2px !important;
        border-radius: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
        font-size: inherit !important;
        font-family: inherit !important;
    }
    
    /* Tables for Print */
    body.printing-electronic-files .table-container {
        border: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: visible !important;
        width: 100% !important;
    }
    body.printing-electronic-files .custom-table {
        width: 100% !important;
        border-top: 2px solid #000000 !important;
        border-bottom: 2px solid #000000 !important;
    }
    body.printing-electronic-files .custom-table th, 
    body.printing-electronic-files .custom-table td {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        padding: 5px 3px !important;
        font-size: 8.5pt !important;
    }
    body.printing-electronic-files .custom-table th {
        background: #f2f2f2 !important;
        font-weight: bold !important;
    }
    
    /* Print overrides for editable headers */
    body.printing-electronic-files th input.header-month-input,
    body.printing-electronic-files th input.header-week-input {
        border: none !important;
        background: transparent !important;
        color: #000000 !important;
        text-align: center !important;
        font-weight: bold !important;
        font-family: inherit !important;
        padding: 0 !important;
        width: 100% !important;
    }
    body.printing-electronic-files .custom-table tbody tr:hover {
        background: transparent !important;
    }
    .page-break {
        page-break-before: always;
    }

    /* Print-only value spans for inputs */
    body.printing-electronic-files .print-only-value {
        display: inline-block !important;
        width: 100% !important;
        min-height: 1.2em;
        line-height: 1.2;
        word-break: break-word !important;
        white-space: normal !important;
        color: #000000 !important;
        font-size: inherit !important;
        font-family: inherit !important;
        box-sizing: border-box !important;
        text-align: inherit !important;
    }
    body.printing-electronic-files .form-group .print-only-value {
        border-bottom: 1px solid #000000 !important;
        padding-bottom: 2px !important;
    }
    body.printing-electronic-files .custom-table td .print-only-value {
        border-bottom: none !important;
        text-align: center !important;
    }
    body.printing-electronic-files .custom-table td input[type="text"] + .print-only-value {
        text-align: right !important; /* Align teacher name to right in RTL */
    }
    body.printing-electronic-files .print-only-value.is-placeholder {
        color: #777777 !important;
        font-style: italic !important;
        font-size: 0.9em !important;
    }
    /* Hide input elements during print when replaced by spans */
    body.printing-electronic-files .form-pane.active input:not([type="button"]):not([type="submit"]):not([type="hidden"]):not([type="image"]),
    body.printing-electronic-files .form-pane.active select,
    body.printing-electronic-files .form-pane.active textarea,
    body.printing-electronic-files .custom-table td input,
    body.printing-electronic-files .custom-table td select {
        display: none !important;
    }
}

/* Optimize month-input styling in stats table to prevent clipping */
.month-input {
    text-align: center !important;
    padding: 6px 2px !important;
}
.month-input::-webkit-outer-spin-button,
.month-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
.month-input[type="number"] {
    -moz-appearance: textfield !important;
}

.print-only-value {
    display: none;
}

/* ==========================================================================
   THEME TOGGLE BUTTON & LIGHT MODE SYSTEM
   ========================================================================== */

/* Logo Container Flex for Theme Toggle */
.logo-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
}

.nav-item i,
.dashboard-card i,
.subtab-btn i,
.calc-btn i,
.btn i,
button i,
.nav-item span,
.subtab-btn span {
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   DAYLIGHT MODE BUTTON & WHITE BACKGROUND THEME (الرؤية النهارية / الخلفية البيضاء)
   -------------------------------------------------------------------------- */
.daylight-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #f59e0b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.daylight-toggle-btn:hover {
    transform: scale(1.08) rotate(15deg);
    background: rgba(255, 255, 255, 0.15);
    border-color: #0284c7;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.3);
}

.daylight-toggle-btn i {
    pointer-events: none;
}

body.daylight-theme {
    --bg-dark: #ffffff;
    --bg-card: #f8fafc;
    --bg-card-hover: #f1f5f9;
    --border-color: #cbd5e1;
    --border-hover: #0284c7;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    background-color: #ffffff !important;
    color: #0f172a !important;
    background-image: none !important;
}

body.daylight-theme .sidebar {
    background: #f8fafc !important;
    border-left-color: #cbd5e1 !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05) !important;
}

body.daylight-theme .logo-text {
    color: #0f172a !important;
}

body.daylight-theme .logo-text span {
    color: #0284c7 !important;
}

body.daylight-theme .nav-item {
    color: #475569 !important;
}

body.daylight-theme .nav-item:hover {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #0284c7 !important;
}

body.daylight-theme .nav-item.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%) !important;
    color: #0284c7 !important;
    border-right-color: #0284c7 !important;
}

body.daylight-theme .user-role-panel {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

body.daylight-theme .role-panel-title {
    color: #0f172a !important;
}

body.daylight-theme .role-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

body.daylight-theme .sidebar-footer {
    color: #64748b !important;
    border-top-color: #cbd5e1 !important;
}

body.daylight-theme .section-title {
    color: #0f172a !important;
}

body.daylight-theme .section-subtitle {
    color: #334155 !important;
}

body.daylight-theme .dashboard-card,
body.daylight-theme .dashboard-panel,
body.daylight-theme .exp-card,
body.daylight-theme .chem-card,
body.daylight-theme .tech-card,
body.daylight-theme .calc-panel,
body.daylight-theme .modal-content,
body.daylight-theme .subtabs-container {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
    color: #0f172a !important;
}

body.daylight-theme .dashboard-card h3,
body.daylight-theme .panel-title,
body.daylight-theme .exp-title,
body.daylight-theme .chem-name,
body.daylight-theme .tech-card-title,
body.daylight-theme .modal-header h3 {
    color: #0f172a !important;
}

body.daylight-theme .dashboard-card p,
body.daylight-theme .panel-desc,
body.daylight-theme .exp-desc,
body.daylight-theme .chem-desc,
body.daylight-theme .tech-card-desc {
    color: #475569 !important;
}

body.daylight-theme .form-control,
body.daylight-theme select,
body.daylight-theme textarea,
body.daylight-theme input[type="text"],
body.daylight-theme input[type="number"],
body.daylight-theme input[type="date"],
body.daylight-theme input[type="search"] {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

body.daylight-theme .custom-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

body.daylight-theme .custom-table td {
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

body.daylight-theme .subtab-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

body.daylight-theme .subtab-btn:hover,
body.daylight-theme .subtab-btn.active {
    background: #0284c7 !important;
    color: #ffffff !important;
}

.daylight-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    outline: none;
}

.daylight-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

body.daylight-theme .daylight-toggle-btn {
    background: rgba(15, 23, 42, 0.06) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #4f46e5 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

body.daylight-theme .daylight-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}




.tech-tab-btn * { pointer-events: none; }
