@font-face {
    font-family: 'Yekan';
    src: url('/fonts/Yekan.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
.nav-bar-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 20px;
    font-family: 'Yekan', 'Poppins', sans-serif;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logotext {
    font-weight: 600;
    font-size: 15px;
    color: white;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.menu-toggle, .print-sheet-manager-btn {
    font-size: 20px;
    cursor: pointer;
    color: white;
    z-index: 1001;
}
.menu-toggle {
    margin-left: auto;
}
.print-sheet-manager-btn {
    position: relative;
    margin-left: 20px;
}
.print-queue-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #2c3e50;
}
.navbar-app-icon {
    margin-left: 15px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.navbar-app-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-out;
}
.navbar-app-icon:hover img {
    transform: scale(1.1) rotate(10deg);
}
.menuwrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(44, 62, 80, 0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 2000; opacity: 0; visibility: hidden; transform: scale(1.05); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.menuwrapper.open { opacity: 1; visibility: visible; transform: scale(1); }
.menucontent { display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 60px 20px 20px 20px; width: 90%; max-width: 450px; max-height: 90vh; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.menucontent::-webkit-scrollbar { width: 0; height: 0; }
.close-menu-btn { position: fixed; top: 20px; right: 20px; background: transparent; color: white; border: 2px solid white; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 2001; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; box-shadow: none; }
.close-menu-btn:hover { background: white; color: #2c3e50; transform: rotate(90deg) scale(1.1); }
.menu-section { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; border-bottom: 1px solid rgba(255, 255, 255, 0.2); padding-bottom: 15px; }
.menu-section:last-child { border-bottom: none; padding-bottom: 0; }
.menu-section h3, .menu-section h4 { color: white; font-size: 16px; margin-bottom: 0; text-align: center; font-family: 'Yekan', 'Poppins', sans-serif; }
.menu-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 280px; padding: 10px 15px; border-radius: 8px; color: #ecf0f1; font-size: 14px; text-decoration: none; transition: all 0.2s ease; }
.persian-text { font-family: 'Yekan', sans-serif; }
.menu-link:hover { background: rgba(255, 255, 255, 0.1); transform: scale(1.03); }
.menu-link i { width: 18px; text-align: center; font-size: 14px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); gap: 15px; width: 100%; }
.tool-item { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; padding: 10px 5px; border-radius: 12px; transition: all 0.2s ease; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.1); }
.tool-item:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-3px); }
.tool-icon { width: 40px; height: 40px; object-fit: contain; margin-bottom: 8px; transition: all 0.2s ease; }
.tool-name { font-size: 11px; text-align: center; font-family: 'Yekan', sans-serif; font-weight: 600; color: #ecf0f1; }
.contact-section { align-items: stretch; gap: 15px; }
.contact-section h3 { text-align: center; margin-bottom: 5px; }
.contact-person { background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 15px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.contact-person h4 { margin: 0; color: #fff; font-size: 14px; font-weight: 500; }
.contact-links { display: flex; justify-content: center; gap: 15px; }
.contact-links .menu-link { width: auto; max-width: none; flex-grow: 1; background: rgba(255, 255, 255, 0.1); padding: 8px 15px; }
body { font-family: 'Yekan', 'Poppins', Tahoma, Geneva, Verdana, sans-serif;
; direction: rtl; text-align: right; background-color: #f4f7f9; margin: 0; padding: 0; color: #333; user-select: none; -webkit-user-select: none; -moz-user-select: none; transition: background-color 0.3s, color 0.3s;}
input, textarea, select, button { user-select: text; -webkit-user-select: text; -moz-user-select: text; }
.container { max-width: 500px; margin: 15px auto; padding: 20px; min-height: 100vh; display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-radius: 20px; box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); border: 1px solid rgba(255, 255, 255, 0.18); transition: background-color 0.3s, border-color 0.3s; }
.boxes-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; position: relative; }
.box { background-color: #fff; border-radius: 12px; text-align: center; transition: all 0.3s ease; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); border: 2px solid transparent; position: relative; overflow: hidden; padding-bottom: 15px; min-height: 180px; display: flex; flex-direction: column; transform-origin: center; }
@keyframes fadeInScale { from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes fadeOutScale { from { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, -50%) scale(0.95); } }
.box.active { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1); z-index: 1000; width: 90%; max-width: 400px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); min-height: auto; max-height: 80vh; overflow-y: auto; animation: fadeInScale 0.2s ease-out; }
.box.closing { animation: fadeOutScale 0.2s ease-out forwards !important; }
.boxes-container.active .box:not(.active) { display: none; }
.boxes-container.active ~ .ad-container,
.boxes-container.active ~ footer {
    display: none;
}
.box:nth-child(1) { background-color: rgba(187, 222, 251, 0.9); border-color: #90caf9; }
.box:nth-child(2) { background-color: rgba(200, 230, 201, 0.9); border-color: #a5d6a7; }
.box:nth-child(3) { background-color: rgba(178, 235, 242, 0.9); border-color: #80deea; }
.box:nth-child(4) { background-color: rgba(225, 190, 231, 0.9); border-color: #ce93d8; }
.box:nth-child(5) { background-color: rgba(255, 249, 196, 0.9); border-color: #fff59d; }
.box:nth-child(6) { background-color: rgba(255, 224, 178, 0.9); border-color: #ffcc80; }
.box[data-link] { cursor: pointer; }
.box:nth-child(7) { background-color: rgba(185, 246, 202, 0.9); border-color: #69f0ae; }
.box:nth-child(8) { background-color: rgba(248, 187, 208, 0.9); border-color: #f48fb1; }
.box:nth-child(9) { background-color: rgba(220, 237, 200, 0.9); border-color: #a5d6a7; }
.box-header { padding: 12px 10px; cursor: pointer; position: relative; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.custom-icon { width: 50px; height: 50px; margin-bottom: 8px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)); border-radius: 12px; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; background-color: rgba(255, 255, 255, 0.8); padding: 8px; }
.box-title { font-size: 13px; font-weight: 600; color: #2c3e50; margin-top: 8px; line-height: 1.3; text-align: center; padding: 0 5px; }
.box-content { display: none; padding: 10px 12px; border-top: 1px dashed #ccc; animation: fadeIn 0.3s ease; font-size: 12px; }
.box.active .box-content { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
label { display: block; margin-bottom: 6px; font-weight: bold; color: #333; font-size: 12px; }
input, select { width: 100%; padding: 6px 8px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; box-sizing: border-box; background-color: #fff; }
button, .close-btn { width: 100%; padding: 8px; background-color: #4CAF50; color: white; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; transition: background-color 0.3s; margin-top: 5px; font-family: 'Yekan', sans-serif !important; font-weight: bold !important; }
button:hover { background-color: #388E3C; }
.result { margin-top: 15px; padding: 12px; background-color: #f8f9fa; border-radius: 8px; font-size: 16px; color: #2c3e50; text-align: center; border: 1px solid #eee; font-weight: bold; min-height: 60px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); position: relative; }
.result .error { color: #d32f2f; font-weight: bold; background-color: #ffebee; border-radius: 4px; border: 1px solid #ef9a9a; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.close-btn { background-color: #f44336 !important; margin-top: 8px; }
.close-btn:hover { background-color: #d32f2f !important; }
.ad-container { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.ad-box { background-color: #fff; border-radius: 12px; padding: 15px; text-align: center; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); border: 1px solid #eee; }
.ad-box p { font-size: 14px; margin-bottom: 15px; font-weight: bold; color: #333; min-height: 40px; display: flex; align-items: center; justify-content: center; line-height: 1.5; }
.ad-btn { background-color: #2196F3; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; border-radius: 25px; color: white; font-size: 13px; font-weight: bold; border: none; cursor: pointer; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); width: 100%; }
.ad-btn:hover { background-color: #0d8aee; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); }
@media (max-width: 480px) { .ad-container { grid-template-columns: 1fr; } .ad-box p { font-size: 13px; } }
footer { text-align: center; padding: 15px 0; background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%); margin-top: 15px; color: white; width: 100%; border-radius: 12px; transition: background 0.3s; }
.footer-content { max-width: 500px; margin: 0 auto; padding: 0 15px; display: flex; flex-direction: column; align-items: center;}
.footer-supervisor, .footer-designer { margin: 8px 0; font-size: 13px; color: #e0e0e0; line-height: 1.6; }
.footer-supervisor { font-weight: bold; color: #ffffff; font-size: 14px; }
.footer-designer { font-style: italic; }
.copyright { font-size: 11px; color: #bbbbbb; margin-top: 12px; transition: color 0.3s;}
.radio-group { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 12px; padding: 10px; border-radius: 8px; background-color: #f0f4f8; font-size: 12px; }
.radio-group div { font-weight: bold; flex-shrink: 0; }
.radio-group label { margin-bottom: 0; }
.quick-links { display: flex; gap: 5px; margin-top: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.quick-link { background: #2b7a78; color: white; padding: 3px 7px; border-radius: 10px; font-size: 11px; cursor: pointer; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.quick-link:hover { background: #3aafa9; }
.quick-link.active { background: #17252a; transform: scale(1.05); }
.quick-link.high-risk { background: #d32f2f; }
.quick-link.moderate-risk { background: #ff9800; }
#gir-warning { font-size: 13px; color: #d32f2f; text-align: center; margin-top: 10px; padding: 8px; background-color: #ffebee; border-radius: 5px; display: none; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 3000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal-content { position: relative; background: #fff; padding: 25px 30px; border-radius: 15px; width: 90%; max-width: 550px; max-height: 90vh; overflow-y: auto; box-shadow: 0 5px 25px rgba(0,0,0,0.2); transform: scale(0.95); transition: transform 0.3s ease; text-align: right; direction: rtl; }
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-close-btn { position: absolute; top: 10px; left: 10px; background: #eee; border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 20px; color: #888; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.modal-close-btn:hover { background: #ddd; color: #333; }
.modal-content h2, .sidebar-title { text-align: center; color: #2c3e50; margin-top: 0; }
.modal-content p { text-align: center; margin-bottom: 20px; color: #7f8c8d; }
.modal-tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 20px; }
.modal-tab-btn { flex: 1; padding: 10px 15px; border: none; background: none; cursor: pointer; font-size: 14px; font-family: 'Yekan', sans-serif; color: #7f8c8d; position: relative; transition: color 0.3s ease; }
.modal-tab-btn:hover { color: #34495e; }
.modal-tab-btn.active { color: #3498db; font-weight: bold; }
.modal-tab-btn.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: #3498db; }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; animation: fadeIn 0.5s; }
.modal-tab-content h4 { color: #34495e; margin-bottom: 15px; }
.modal-tab-content ol { padding-right: 20px; line-height: 1.8; color: #333; }
.modal-tab-content ol li::marker { font-weight: bold; }
.guide-image { width: 100%; max-width: 350px; display: block; margin: 20px auto 0 auto; border-radius: 8px; border: 1px solid #eee; }
.android-install-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}
.qr-code-container {
    padding: 10px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
}
.qr-code-container img {
    display: block;
    width: 160px;
    height: 160px;
    border-radius: 6px;
}
.bazaar-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 25px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Yekan', sans-serif;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
}
.bazaar-download-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}
.bazaar-download-btn i {
    font-size: 16px;
}
#conversionResult {
    display: block;
    text-align: right;
    padding: 15px;
    align-items: initial;
    justify-content: initial;
}
#conversionResult p {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 500;
    color: #34495e;
}
#conversionResult p:first-child {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}
#conversionResult p strong {
    font-weight: bold;
    color: #2980b9;
    font-size: 1.1em;
}
.save-btn {
    background-color: #3498db !important;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.save-btn:hover { background-color: #2980b9 !important; }
.save-btn.disabled { background-color: #27ae60 !important; cursor: not-allowed; opacity: 0.7; }
.modal-content.large { max-width: 90vw; width: 1200px; }
.print-sheet-layout { display: flex; gap: 20px; }
.a4-sheet-preview { flex-grow: 1; display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(6, 1fr); gap: 10px; padding: 10px; background-color: #f0f4f8; border: 1px solid #dde4e9; border-radius: 8px; aspect-ratio: 210 / 297; height: 60vh; max-height: 700px; }
.label-slot { border: 2px dashed #bdc3c7; border-radius: 4px; transition: all 0.2s ease; position: relative; display: flex; align-items: center; justify-content: center; }
.label-slot.empty { cursor: pointer; }
.label-slot.empty:hover { background-color: #e8f4fd; border-color: #3498db; }
.label-slot .slot-number { font-size: 24px; color: #bdc3c7; }
.label-slot.filled { border-style: solid; border-color: #27ae60; background-color: #f0fff4; }
.mini-label-preview { padding: 5px; font-size: 11px; text-align: center; }
.mini-label-preview strong { display: block; font-size: 12px; margin-bottom: 4px; color: #333; }
.remove-label-btn { position: absolute; top: -10px; left: -10px; width: 24px !important; height: 24px; padding: 0; border-radius: 50%; background-color: #e74c3c !important; font-size: 14px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.print-sheet-sidebar { width: 300px; display: flex; flex-direction: column; }
.waiting-labels-list { flex-grow: 1; border: 1px solid #dde4e9; border-radius: 6px; padding: 10px; background: #fff; overflow-y: auto; max-height: 400px; }
.no-waiting-labels { color: #7f8c8d; text-align: center; font-style: italic; padding-top: 20px; }
.waiting-label-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-radius: 4px; margin-bottom: 5px; background-color: #ecf0f1; font-size: 13px; cursor: grab; }
.waiting-label-item.active { background-color: #e8f4fd; border: 2px solid #3498db; font-weight: bold; }
.remove-waiting-label-btn { background: none !important; border: none !important; color: #e74c3c; width: auto !important; margin: 0; padding: 0 5px; }
.print-sheet-actions { margin-top: 15px; display: flex; flex-direction: column; gap: 10px; }
.action-btn { font-size: 14px !important; padding: 12px !important; }
.action-btn.danger { background-color: #c0392b !important; }
@media print {
    body.printing-a4-layout > :not(.a4-sheet-print-render) {
        display: none !important;
    }
    .a4-sheet-print-render, .a4-sheet-print-render * {
        display: block !important;
        visibility: visible !important;
    }
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
    .a4-sheet-print-render {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 41mm); 
        gap: 5mm;
        box-sizing: border-box;
        height: auto; 
    }
    .a4-sheet-print-render .print-label-container {
        border: 1px dashed #999;
        box-sizing: border-box;
        padding: 2mm;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        overflow: hidden;
        font-family: 'Yekan', sans-serif;
        direction: rtl;
        background: white !important;
        color: black !important;
        font-size: 8pt;
    }
    .print-label-container .label-header { text-align: center; border-bottom: 0.5pt solid black; padding-bottom: 1mm; margin-bottom: 1.5mm; display: flex !important; align-items: center; justify-content: center; gap: 4px; }
    .print-label-container .label-header img { width: 14px; height: 14px; }
    .print-label-container .label-header strong { font-size: 8pt; font-weight: bold; }
    .print-label-container .label-body { flex-grow: 1; display: flex !important; flex-direction: column !important; justify-content: center; gap: 1mm; }
    .print-label-container .label-item { display: flex !important; justify-content: space-between !important; line-height: 1.4; }
    .print-label-container .label-item strong { font-weight: bold; text-align: left; }
    .print-label-container .label-footer { font-size: 7pt; text-align: center; border-top: 0.5pt solid black; padding-top: 1mm; margin-top: 1.5mm; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}
.box.active::-webkit-scrollbar {
  width: 8px;
}
.box.active::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}
.box.active::-webkit-scrollbar-thumb {
  background-color: #c5c5c5;
  border-radius: 10px;
}
.box.active::-webkit-scrollbar-thumb:hover {
  background-color: #a8a8a8;
}
.box.active {
  scrollbar-width: thin;
  scrollbar-color: #c5c5c5 rgba(0, 0, 0, 0.05);
}
body.dark-mode {
    --bg-primary: #18222d;
    --bg-secondary: #212d3b;
    --bg-tertiary: #2a3a4b;
    --border-color: #0f1923;
    --text-primary: #ffffff;
    --text-secondary: #a9b2bb;
    --accent-primary: #5288c1;
    --accent-hover: #6499c4;
    --danger-color: #d9534f;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
}
body.dark-mode .container,
body.dark-mode .menucontent,
body.dark-mode .modal-overlay,
body.dark-mode .print-sheet-layout,
body.dark-mode footer,
body.dark-mode .nav-bar-container,
body.dark-mode .menuwrapper {
    background: var(--bg-secondary);
    background-image: none;
    color: var(--text-primary);
}
body.dark-mode .box,
body.dark-mode .ad-box,
body.dark-mode .modal-content,
body.dark-mode .tool-item,
body.dark-mode .contact-person {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode .radio-group {
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--bg-secondary) !important;
}
body.dark-mode .box-title,
body.dark-mode .box-content,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode p,
body.dark-mode label,
body.dark-mode .logotext,
body.dark-mode .ad-box p,
body.dark-mode .footer-supervisor,
body.dark-mode .footer-designer,
body.dark-mode .copyright,
body.dark-mode #conversionResult p,
body.dark-mode .tool-name {
    color: var(--text-primary);
}
body.dark-mode .custom-icon {
    background-color: var(--bg-tertiary);
}
body.dark-mode label {
    color: var(--text-secondary);
}
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--bg-secondary);
}
body.dark-mode input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
body.dark-mode input:focus,
body.dark-mode select:focus {
    border-color: var(--accent-primary);
}
body.dark-mode button,
body.dark-mode .ad-btn,
body.dark-mode .save-btn {
    background-color: var(--accent-primary) !important;
    color: var(--text-primary) !important;
    border: none;
}
body.dark-mode button:hover,
body.dark-mode .ad-btn:hover,
body.dark-mode .save-btn:hover {
    background-color: var(--accent-hover) !important;
}
body.dark-mode .close-btn {
    background-color: var(--danger-color) !important;
}
body.dark-mode .action-btn.danger {
    background-color: var(--danger-color) !important;
}
body.dark-mode .quick-link {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}
body.dark-mode .quick-link:hover {
    background-color: var(--accent-hover);
    color: var(--text-primary);
}
body.dark-mode .quick-link.active {
    background-color: var(--accent-primary);
    color: var(--text-primary);
}
body.dark-mode .print-sheet-sidebar {
    background-color: var(--bg-primary);
}
body.dark-mode .waiting-labels-list {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}
body.dark-mode .waiting-labels-list .no-waiting-labels {
    color: var(--text-secondary);
}
body.dark-mode .waiting-label-item {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}
body.dark-mode .a4-sheet-preview {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}
body.dark-mode .label-slot {
    border-color: var(--text-secondary);
}
body.dark-mode .label-slot .slot-number {
    color: var(--text-secondary);
}
body.dark-mode .box.active::-webkit-scrollbar-thumb {
    background-color: #4b5563;
}
body.dark-mode .box.active::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}
body.dark-mode .box.active {
    scrollbar-color: #4b5563 var(--bg-secondary);
}
body.dark-mode .result,
body.dark-mode #drugResult,
body.dark-mode #percentageDrugResult,
body.dark-mode #fluidResult,
body.dark-mode #microsetResult,
body.dark-mode #conversionResult,
body.dark-mode #mEqToMgResult,
body.dark-mode #gir-result {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--bg-secondary) !important;
    background-image: none !important;
}
body.dark-mode .result > * {
    background-color: transparent !important;
    color: inherit !important;
}
body.dark-mode .result .error {
    background-color: #382424 !important;
    color: #f5c1c0 !important;
    border-color: #723e3d !important;
}
body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:focus,
body.dark-mode input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary) !important;
    box-shadow: 0 0 0 30px var(--bg-tertiary) inset !important;
    caret-color: var(--text-primary) !important;
}
.theme-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 22px;
    cursor: pointer;
    margin-top: 20px;
    margin-bottom: 15px;
}
.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.theme-toggle .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #73C0FC;
    border-radius: 22px;
    transition: background-color 0.4s ease;
}
.theme-toggle .slider .icons {
    position: absolute;
    top: 2px;
    left: 2px;
    height: 18px;
    width: 18px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle input:checked + .slider {
    background-color: var(--accent-primary);
}
.theme-toggle input:checked + .slider .icons {
    transform: translateX(26px);
}
.theme-toggle .icons svg {
    position: absolute;
    width: 12px;
    height: 12px;
    transition: opacity 0.2s ease, transform 0.4s ease;
}
.theme-toggle .icons .sun {
    color: #FDB813;
    opacity: 1;
    transform: rotate(0deg);
}
.theme-toggle .icons .moon {
    color: #f4f3ef;
    opacity: 0;
    transform: rotate(-90deg);
}
.theme-toggle input:checked + .slider .icons .sun {
    opacity: 0;
    transform: rotate(90deg);
}
.theme-toggle input:checked + .slider .icons .moon {
    opacity: 1;
    transform: rotate(0deg);
}
#promo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#promo-overlay.visible {
    display: flex;
    opacity: 1;
}
#promo-modal {
    position: relative;
    padding: 0;
    background: transparent;
    max-width: 400px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
#promo-overlay.visible #promo-modal {
    transform: scale(1);
}
#promo-modal a {
    display: block;
    line-height: 0;
}
#promo-modal img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
#close-promo {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
#close-promo .fas {
    font-size: 16px;
}
#close-promo:hover {
    transform: scale(1.1) rotate(90deg);
    background-color: rgba(0, 0, 0, 0.8);
}

/* ==================== GIR ADVANCED STYLES ==================== */

.gir-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-right: 4px solid #3498db;
}

.section-title {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    font-family: 'Yekan', sans-serif;
    font-weight: bold;
}

.quick-gir-links {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-gir {
    padding: 6px 12px;
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    font-family: 'Yekan', sans-serif;
    font-weight: 500;
}

.quick-gir:hover,
.quick-gir.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    transform: scale(1.05);
}

.gir-results-container {
    margin-top: 20px;
}

.result-section {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
    font-family: 'Yekan', sans-serif;
}

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

.result-label {
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.result-value {
    font-weight: bold;
    font-size: 13px;
}

.result-value.highlight {
    color: #e74c3c;
    font-size: 1.2em;
}

.result-value.critical-low { color: #c0392b; }
.result-value.low { color: #e67e22; }
.result-value.normal { color: #27ae60; }
.result-value.high { color: #f39c12; }
.result-value.critical-high { color: #c0392b; }

.alerts-container {
    margin: 15px 0;
}

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-right: 4px solid;
    font-family: 'Yekan', sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-success {
    background: #d1edff;
    border-color: #007bff;
    color: #004085;
}

.suggestions-container {
    margin-top: 15px;
}

.suggestions-container h5 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-family: 'Yekan', sans-serif;
    font-size: 14px;
}

.suggestion {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-right: 4px solid;
    font-family: 'Yekan', sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.suggestion.critical {
    background: #f8d7da;
    border-color: #dc3545;
}

.suggestion.warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.suggestion.success {
    background: #d4edda;
    border-color: #28a745;
}

.suggestion.info {
    background: #d1ecf1;
    border-color: #17a2b8;
}

.suggestion ul {
    margin: 8px 0;
    padding-right: 20px;
}

.suggestion li {
    margin-bottom: 5px;
}

.quick-calculations {
    background: #e8f4fd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid #b8daff;
}

.quick-calculations h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-family: 'Yekan', sans-serif;
    font-size: 14px;
    text-align: center;
}

.quick-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    margin-bottom: 6px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    font-family: 'Yekan', sans-serif;
    font-size: 12px;
}

.gir-value {
    font-weight: bold;
    color: #2c3e50;
}

.rate-value {
    color: #e74c3c;
    font-weight: bold;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin: 15px 0;
    font-family: 'Yekan', sans-serif;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Dark Mode Styles for GIR */
body.dark-mode .gir-section {
    background: var(--bg-primary);
    border-right-color: var(--accent-primary);
}

body.dark-mode .section-title {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

body.dark-mode .quick-gir {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .quick-gir:hover,
body.dark-mode .quick-gir.active {
    background: var(--accent-primary);
    color: var(--text-primary);
    border-color: var(--accent-hover);
}

body.dark-mode .result-section {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .result-label {
    color: var(--text-secondary);
}

body.dark-mode .result-value {
    color: var(--text-primary);
}

body.dark-mode .alert-warning {
    background: #382c05;
    border-color: #856404;
    color: #ffd351;
}

body.dark-mode .alert-danger {
    background: #3c1c1c;
    border-color: #842029;
    color: #ea868f;
}

body.dark-mode .alert-success {
    background: #0c2b3d;
    border-color: #084298;
    color: #6ea8fe;
}

body.dark-mode .suggestion.critical {
    background: #3c1c1c;
    border-color: #842029;
    color: #ea868f;
}

body.dark-mode .suggestion.warning {
    background: #382c05;
    border-color: #856404;
    color: #ffd351;
}

body.dark-mode .suggestion.success {
    background: #0f2a1c;
    border-color: #0f5132;
    color: #75b798;
}

body.dark-mode .suggestion.info {
    background: #072528;
    border-color: #055160;
    color: #6edff6;
}

body.dark-mode .quick-calculations {
    background: #1a2a3a;
    border-color: #2a3a4a;
}

body.dark-mode .quick-result-item {
    background: var(--bg-tertiary);
    border-left-color: var(--accent-primary);
    color: var(--text-primary);
}

body.dark-mode .gir-value {
    color: var(--text-primary);
}

body.dark-mode .rate-value {
    color: #ff6b6b;
}

/* Responsive Design */
@media (max-width: 480px) {
    .gir-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .section-title {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .quick-gir-links {
        gap: 5px;
    }
    
    .quick-gir {
        padding: 4px 8px;
        font-size: 0.8em;
    }
    
    .result-section {
        padding: 10px;
    }
    
    .result-item {
        padding: 6px 0;
        font-size: 12px;
    }
    
    .calculate-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Animation for GIR results */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gir-results-container > * {
    animation: slideInUp 0.3s ease-out;
}

/* Print styles for GIR */
@media print {
    .gir-section,
    .result-section,
    .quick-calculations {
        break-inside: avoid;
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
    
    .calculate-btn {
        display: none !important;
    }
}
/* ==================== MODERN PEDIATRIC CALCULATOR - FIXED VERSION ==================== */

.pediatric-box {
    background-color: rgba(185, 246, 202, 0.95) !important;
    border-color: #27ae60 !important;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.1) !important;
}

.pediatric-box .box-content {
    padding: 0;
    background: rgba(185, 246, 202, 0.98) !important;
    border-radius: 0 0 12px 12px;
}

.patient-info-section {
    background: rgba(185, 246, 202, 0.95) !important;
    padding: 20px 15px;
    border-bottom: 1px solid rgba(39, 174, 96, 0.3);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border-left: 3px solid #27ae60;
}

.section-header i {
    color: #27ae60;
    font-size: 18px;
    background: white;
    padding: 8px;
    border-radius: 50%;
    border: 1px solid #e8f5e9;
}

.section-header h3 {
    color: #2c3e50;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.input-field {
    display: flex;
    flex-direction: column;
}

.input-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.input-field label i {
    color: #27ae60;
    font-size: 12px;
}

.input-field input {
    padding: 10px 12px;
    border: 1px solid #d5dbdb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.input-field input:focus {
    border-color: #27ae60;
    outline: none;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}

/* Prediction Banner */
.prediction-banner {
    background: #f8fff9;
    border: 1px solid #d4efdf;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 0;
    display: none;
}

.prediction-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.prediction-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prediction-label {
    color: #2c3e50;
    font-size: 12px;
    font-weight: 500;
}

.prediction-value {
    color: #27ae60;
    font-size: 14px;
    font-weight: 600;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #d4efdf;
}

.btn-primary {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #219653;
    transform: translateY(-1px);
}

/* Calculator Tabs */
.calculator-tabs {
    background: rgba(185, 246, 202, 0.95) !important;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.tab-nav {
    background: rgba(185, 246, 202, 0.9) !important;
    padding: 0;
    position: relative;
    border-bottom: 1px solid rgba(39, 174, 96, 0.3);
}

.tab-scroll {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    padding: 0;
}

.tab-group {
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(39, 174, 96, 0.3);
    background: rgba(185, 246, 202, 0.8);
}

.tab-group:last-child {
    border-right: none;
}

.group-label {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid rgba(39, 174, 96, 0.3);
    font-family: 'Yekan', sans-serif;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border: none;
    background: rgba(185, 246, 202, 0.7);
    color: #2c3e50;
    font-size: 9px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
    justify-content: center;
    border-bottom: 1px solid rgba(39, 174, 96, 0.2);
    flex: 1;
}

.tab-btn:last-child {
    border-bottom: none;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #2196F3;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: #2196F3;
    background: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.tab-btn.active::before {
    transform: scaleX(1);
}

.tab-btn:hover:not(.active) {
    color: #495057;
    background: rgba(255, 255, 255, 0.8);
}

.tab-btn i {
    font-size: 14px;
    margin-bottom: 2px;
    transition: all 0.3s ease;
    color: inherit;
}

.tab-btn.active i {
    transform: scale(1.1);
    color: #2196F3;
}

.tab-btn span {
    line-height: 1.2;
    text-align: center;
    font-size: 8px;
}

/* Tab Contents */
.tab-contents {
    padding: 20px;
    background: rgba(185, 246, 202, 0.92) !important;
    min-height: 350px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* Calculation Cards */
.calc-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(5px);
}

.calc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #27ae60;
    opacity: 1;
    transition: all 0.3s ease;
}

.calc-card:hover {
    border-color: rgba(39, 174, 96, 0.6);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.98) !important;
}

.calc-card.critical {
    border-left: 3px solid #e74c3c;
}

.calc-card.critical::before {
    background: #e74c3c;
}

.calc-card.critical .card-header {
    background: rgba(253, 237, 236, 0.9);
}

.card-header {
    background: rgba(248, 255, 249, 0.9);
    padding: 16px;
    border-bottom: 1px solid rgba(39, 174, 96, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header i {
    color: #27ae60;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.calc-card.critical .card-header i {
    color: #e74c3c;
}

.card-header h4 {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.card-body {
    padding: 16px;
    background: transparent;
}

.calc-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(248, 249, 250, 0.5);
    transition: all 0.2s ease;
}

.calc-result:last-child {
    border-bottom: none;
}

.calc-result:hover {
    background: rgba(248, 255, 249, 0.5);
    border-radius: 4px;
    padding: 10px 8px;
}

.result-label {
    color: #2c3e50;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
}

.result-value {
    color: #27ae60;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    flex: 1;
    min-width: 110px;
    direction: ltr;
    text-align: right;
    font-family: 'Courier New', monospace;
    background: rgba(248, 255, 249, 0.7);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(212, 239, 223, 0.5);
}

.calc-card.critical .result-value {
    color: #c0392b;
    background: rgba(253, 237, 236, 0.7);
    border-color: rgba(245, 183, 177, 0.5);
}

.calc-formula {
    color: #7f8c8d;
    font-size: 10px;
    font-style: italic;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(213, 245, 227, 0.5);
    text-align: center;
}

/* Drug Fields */
.drug-field {
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.drug-field:hover {
    border-color: rgba(39, 174, 96, 0.4);
    background: rgba(255, 255, 255, 0.9);
}

.drug-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(39, 174, 96, 0.3);
}

.drug-info {
    color: #7f8c8d;
    font-size: 11px;
    font-style: italic;
    margin-bottom: 8px;
}

.drug-values {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.value-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.value-label {
    color: #5d6d7e;
    font-size: 12px;
    font-weight: 500;
    flex: 1;
}

.value-dose {
    color: #2196F3;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    direction: ltr;
    font-family: 'Courier New', monospace;
    background: rgba(227, 242, 253, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(187, 222, 251, 0.5);
    min-width: 100px;
    text-align: center;
}

.value-prep {
    color: #4CAF50;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    direction: ltr;
    font-family: 'Courier New', monospace;
    background: rgba(232, 245, 232, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(200, 230, 201, 0.5);
}

.value-max {
    color: #FF9800;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    direction: ltr;
    font-family: 'Courier New', monospace;
    background: rgba(255, 243, 224, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 204, 128, 0.5);
}

/* دکمه بستن مرتب‌تر */
.pediatric-box .close-btn {
    margin: 20px 15px 15px 15px !important;
    padding: 12px !important;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease !important;
    width: calc(100% - 30px) !important;
    cursor: pointer;
}

.pediatric-box .close-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4) !important;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%) !important;
}

.pediatric-box .close-btn:active {
    transform: translateY(0) !important;
}

/* ==================== FIX FOR DARK MODE ==================== */

body.dark-mode .pediatric-box {
    background-color: var(--bg-secondary) !important;
    border-color: var(--accent-primary) !important;
}

body.dark-mode .pediatric-box .box-content {
    background: var(--bg-secondary) !important;
}

body.dark-mode .patient-info-section {
    background: var(--bg-tertiary) !important;
    border-bottom-color: var(--border-color);
}

body.dark-mode .section-header {
    background: var(--bg-primary) !important;
    border-left-color: var(--accent-primary);
}

body.dark-mode .section-header i {
    color: var(--accent-primary);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .section-header h3 {
    color: var(--text-primary);
}

body.dark-mode .input-field label {
    color: var(--text-secondary);
}

body.dark-mode .input-field label i {
    color: var(--accent-primary);
}

body.dark-mode .input-field input {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .prediction-banner {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.dark-mode .prediction-value {
    color: var(--accent-primary);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .calculator-tabs {
    background: var(--bg-primary) !important;
}

body.dark-mode .tab-nav {
    background: var(--bg-primary) !important;
    border-bottom-color: var(--border-color);
}

body.dark-mode .tab-scroll {
    background: var(--bg-primary) !important;
}

body.dark-mode .tab-group {
    background: var(--bg-primary) !important;
    border-right-color: var(--border-color) !important;
}

body.dark-mode .group-label {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

body.dark-mode .tab-btn {
    background: var(--bg-primary) !important;
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-color) !important;
}

body.dark-mode .tab-btn.active {
    background: var(--bg-secondary) !important;
    color: var(--accent-primary) !important;
}

body.dark-mode .tab-btn:hover:not(.active) {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .tab-contents {
    background: var(--bg-secondary) !important;
}

body.dark-mode .calc-card {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color);
}

body.dark-mode .calc-card:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--accent-primary);
}

body.dark-mode .calc-card::before {
    background: var(--accent-primary);
}

body.dark-mode .card-header {
    background: var(--bg-primary);
    border-bottom-color: var(--border-color);
}

body.dark-mode .result-label {
    color: var(--text-primary);
}

body.dark-mode .result-value {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .drug-field {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color);
}

body.dark-mode .drug-field:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--accent-primary);
}

body.dark-mode .drug-name {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color);
}

body.dark-mode .value-label {
    color: var(--text-secondary) !important;
}

body.dark-mode .value-dose {
    color: #64B5F6;
    background: #1a237e;
    border-color: #283593;
}

body.dark-mode .value-prep {
    color: #81C784;
    background: #1b5e20;
    border-color: #2e7d32;
}

body.dark-mode .value-max {
    color: #FFB74D;
    background: #382c05;
    border-color: #FF9800;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .tab-scroll {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-group {
        border-right: 1px solid rgba(39, 174, 96, 0.3);
        border-bottom: 1px solid rgba(39, 174, 96, 0.3);
    }
    
    .tab-group:nth-child(even) {
        border-right: none;
    }
    
    body.dark-mode .tab-group:nth-child(even) {
        border-right: none !important;
    }
}

@media (max-width: 480px) {
    .tab-scroll {
        grid-template-columns: 1fr;
    }
    
    .tab-group {
        border-right: none;
        border-bottom: 1px solid rgba(39, 174, 96, 0.3);
    }
    
    .tab-group:last-child {
        border-bottom: none;
    }
    
    body.dark-mode .tab-group {
        border-right: none !important;
        border-bottom-color: var(--border-color) !important;
    }
    
    .tab-btn {
        min-height: 50px;
        padding: 8px 4px;
    }
    
    .tab-btn i {
        font-size: 12px;
    }
    
    .tab-btn span {
        font-size: 7px;
    }
    
    .group-label {
        font-size: 9px;
        padding: 5px 3px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
}

/* استایل برای زیرنویس‌های دفیبریلاسیون و کاردیوورژن */
.calc-result .dose-description {
    font-size: 9px;
    color: #666;
    margin-top: 1px;
    text-align: center;
    font-style: italic;
    line-height: 1.2;
    padding: 0 2px;
}

body.dark-mode .calc-result .dose-description {
    color: var(--text-secondary);
}
/* ==================== ULTIMATE FIX FOR PEDIATRIC BOX ==================== */

/* بازنویسی کامل استایل باکس اطفال */
.pediatric-box {
    background: linear-gradient(135deg, rgba(185, 246, 202, 0.9) 0%, rgba(169, 232, 188, 0.9) 100%) !important;
    border: 2px solid #27ae60 !important;
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.15) !important;
}

.pediatric-box .box-content {
    padding: 0;
    background: linear-gradient(135deg, rgba(185, 246, 202, 0.85) 0%, rgba(169, 232, 188, 0.85) 100%) !important;
    border-radius: 0 0 10px 10px;
}

/* حل قطعی مشکل فوترهای قرمز */
.calc-card .card-header,
.calc-card.critical .card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.calc-card .card-body {
    background: transparent !important;
}

.calc-card.critical .card-header {
    border-bottom: 1px solid rgba(231, 76, 60, 0.2) !important;
}

/* مطابقت کامل با حالت شب */
body.dark-mode .pediatric-box {
    background: var(--bg-secondary) !important;
    border: 2px solid var(--border-color) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .pediatric-box .box-content {
    background: var(--bg-secondary) !important;
}

body.dark-mode .calc-card .card-header,
body.dark-mode .calc-card.critical .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* مطابقت تب‌ها با حالت شب */
body.dark-mode .tab-nav {
    background: var(--bg-primary) !important;
}

body.dark-mode .tab-scroll {
    background: var(--bg-primary) !important;
}

body.dark-mode .tab-group {
    background: var(--bg-primary) !important;
    border-right-color: var(--border-color) !important;
}

body.dark-mode .tab-btn {
    background: var(--bg-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

body.dark-mode .tab-btn.active {
    background: var(--bg-secondary) !important;
}
/* ==================== COMPLETE FIX FOR ALL ISSUES ==================== */

/* 1. حل مشکل باکس اطفال */
.pediatric-box {
    background: linear-gradient(135deg, rgba(185, 246, 202, 0.9) 0%, rgba(169, 232, 188, 0.9) 100%) !important;
    border: 2px solid #27ae60 !important;
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.15) !important;
}

.pediatric-box .box-content {
    padding: 0;
    background: linear-gradient(135deg, rgba(185, 246, 202, 0.85) 0%, rgba(169, 232, 188, 0.85) 100%) !important;
    border-radius: 0 0 10px 10px;
}

.calc-card .card-header,
.calc-card.critical .card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.calc-card .card-body {
    background: transparent !important;
}

/* 2. حل مشکل هاله سفید دور فیلدها در حالت شب */
body.dark-mode .input-field input {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

body.dark-mode .input-field input:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2) !important;
    background: var(--bg-secondary) !important;
}

/* 3. حل مشکل متن راهنمای نصب در حالت شب */
body.dark-mode .modal-content {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .modal-content h2,
body.dark-mode .modal-content h4 {
    color: var(--text-primary) !important;
}

body.dark-mode .modal-content p {
    color: var(--text-secondary) !important;
}

body.dark-mode .modal-content ol {
    color: var(--text-primary) !important;
}

body.dark-mode .modal-content li {
    color: var(--text-primary) !important;
}

body.dark-mode .modal-tab-content {
    color: var(--text-primary) !important;
}

/* 4. مطابقت کامل با حالت شب */
body.dark-mode .pediatric-box {
    background: var(--bg-secondary) !important;
    border: 2px solid var(--border-color) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .pediatric-box .box-content {
    background: var(--bg-secondary) !important;
}

body.dark-mode .calc-card .card-header,
body.dark-mode .calc-card.critical .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* 5. مطابقت تب‌ها با حالت شب */
body.dark-mode .tab-nav {
    background: var(--bg-primary) !important;
}

body.dark-mode .tab-scroll {
    background: var(--bg-primary) !important;
}

body.dark-mode .tab-group {
    background: var(--bg-primary) !important;
    border-right-color: var(--border-color) !important;
}

body.dark-mode .tab-btn {
    background: var(--bg-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

body.dark-mode .tab-btn.active {
    background: var(--bg-secondary) !important;
}

/* 6. حل مشکل متن‌های راهنمای ناپ در مودال */
body.dark-mode .modal-tab-btn {
    color: var(--text-secondary) !important;
}

body.dark-mode .modal-tab-btn.active {
    color: var(--accent-primary) !important;
}

body.dark-mode .modal-tab-btn:hover {
    color: var(--text-primary) !important;
}

body.dark-mode .guide-image {
    border-color: var(--border-color) !important;
}
