/* public/assets/css/custom-doors.css */



/* حذف بولد بودن پیش‌فرض بوت‌استرپ */
.fw-bolder, .fw-bold { font-weight: normal !important; }

/* =========================================
   2. استایل هدر جدید (فلت و یک خطی)
   ========================================= */
.card-header-custom {
    background: #ffffff;
    border-bottom: 1px solid #eff2f5;
    padding: 0 25px; /* پدینگ فقط از چپ و راست */
    display: flex;
    align-items: center; /* تراز عمودی وسط */
    justify-content: space-between; /* فاصله حداکثری بین راست و چپ */
    position: sticky;
    top: 0;
    z-index: 1020;
    height: 65px; /* ارتفاع ثابت و متناسب */
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

/* --- سمت راست (عنوان و آیکون) --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px; /* فاصله آیکون تا متن */
}

.symbol-box {
    width: 38px;
    height: 38px;
    background-color: #f1faff; /* آبی خیلی کمرنگ */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0095e8;
}

.header-text-group {
    display: flex;
    align-items: center;
    font-size: 0.95rem; /* سایز فونت */
    color: #333;
}

.header-title {
    color: #2b2b2b;
    margin: 0;
}

.separator {
    color: #ccc;
    margin: 0 10px;
    font-size: 0.8rem;
}

.header-subtitle {
    color: #666;
}

.block-name {
    color: #0095e8; /* رنگ آبی برای نام بلوک */
    margin-right: 4px;
}

/* --- سمت چپ (دکمه‌ها) --- */
.header-left {
    display: flex;
    align-items: center;
    gap: 8px; /* فاصله بین دکمه‌ها */
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px; /* ارتفاع دکمه */
    padding: 0 15px;
    font-size: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-weight: normal; /* فونت معمولی */
}

/* رنگ دکمه چاپ (آبی ملایم) */
.btn-light-primary {
    background-color: #f1faff;
    color: #0095e8;
}
.btn-light-primary:hover {
    background-color: #0095e8;
    color: #ffffff;
}

/* رنگ دکمه بازگشت (قرمز ملایم) */
.btn-light-danger {
    background-color: #fff5f8;
    color: #f1416c;
}
.btn-light-danger:hover {
    background-color: #f1416c;
    color: #ffffff;
}

/* =========================================
   3. استایل‌های جدول (Table Styles)
   ========================================= */
/* هدر تیره (ردیف اول) */
.bg-dark-header th { 
    background-color: #1e1e2d !important; 
    color: #fff !important; 
    font-weight: normal; 
    vertical-align: middle !important; 
    height: 45px;
    font-size: 0.85rem;
}

/* هدر روشن (ردیف دوم) */
.bg-sub-header th { 
    background-color: #e1f0ff !important; 
    color: #004085 !important; 
    padding: 5px !important; 
    vertical-align: middle !important;
    border-bottom: 2px solid #b8daff !important;
}

/* ستون چسبان سمت راست (طبقات) */
.sticky-col-right { 
    position: sticky; 
    right: 0; 
    z-index: 1005; 
    background-color: #fff !important; 
    border-left: 2px solid #e4e6ef !important; 
    min-width: 90px; 
    vertical-align: middle !important;
}

/* اصلاح رنگ ستون چسبان در هدر */
.bg-dark-header .sticky-col-right { background-color: #1e1e2d !important; color: #fff; }
.bg-sub-header .sticky-col-right { background-color: #e1f0ff !important; color: #004085; }

.border-start-thick { border-left: 2px solid #e4e6ef !important; }

/* محتوای سلول هدر برای تراز عمودی */
.header-cell-content { min-height: 35px; }
.header-label { font-size: 0.8rem; font-weight: bold; }
.small-subtitle { font-size: 0.6rem; color: #5e6278; font-weight: normal; } /* تیپ ساخت */
.adj-badge { font-size: 0.65rem; color: #004085; background: rgba(255,255,255,0.5); padding: 1px 4px; border-radius: 4px; }
.adj-placeholder { height: 16px; width: 1px; }

/* =========================================
   4. استایل‌های سلول‌ها و اینپوت‌ها
   ========================================= */
.cell-container { vertical-align: top !important; position: relative; height: 56px; } 

.floor-text { color: #0095e8; font-weight: 800; font-size: 0.8rem; }
.unit-text { color: #ff5722; font-weight: 800; font-size: 0.8rem; }
.separator-text { color: #e4e6ef; font-size: 0.7rem; margin: 0 4px; }

.input-flush {
    border: none !important; background: transparent; padding: 0 !important; margin: 0 !important;
    text-align: center; width: 100%; font-size: 0.9rem; font-weight: 600; 
    height: 32px; line-height: 32px; box-shadow: none !important; border-radius: 0 !important;
}
.input-flush:focus { background: #fff !important; box-shadow: inset 0 0 0 1px #7239ea !important; outline: none; z-index: 20; }
.bg-filled { background-color: #e8f5e9 !important; color: #1b5e20 !important; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.select-flush {
    -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
    background-image: none !important; background-color: transparent; border: none !important;
    padding: 0 !important; margin: 0 !important; text-align-last: center; text-align: center;
    font-weight: bold; color: #555; height: 32px; width: 100%; cursor: pointer; position: relative; z-index: 5;
}
.select-flush:focus { outline: none; }

/* نوار بنفش (اعداد نهایی) */
.final-bar {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 24px; line-height: 24px;
    background-color: #EEE5FF; color: #7239ea; font-weight: 800; font-size: 0.75rem;
    border-top: 1px solid #dcd5f7; pointer-events: none; z-index: 10;
}

/* نوار زرد (تیپ) */
.type-display {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 24px; line-height: 24px;
    background-color: #fff3cd; color: #856404; font-weight: 900;
    border-top: 1px solid #ffeeba; pointer-events: none; z-index: 10;
    text-align: center; white-space: nowrap; font-size: 0.6rem; 
    letter-spacing: -0.5px; overflow: hidden;
}

/* دکمه ثبت تغییرات پایین */
.btn-purple { background-color: #7239ea; color: #ffffff; border: none; }
.btn-purple:hover { background-color: #5b2da8; color: #ffffff; }



/* --- استایل‌های اختصاصی گزارش (Reports) --- */

/* کارت فیلتر بالا */
.filter-card {
    background-color: #ffffff;
    border: 1px solid #eff2f5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    border-radius: 8px;
}

/* دکمه انتخاب همه */
.select-all-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    font-size: 0.8rem;
    color: #5e6278;
    cursor: pointer;
}
.select-all-container input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #0095e8;
}

/* هدر جدول گزارش */
.report-table-header th {
    background-color: #1e1e2d !important; /* رنگ تیره */
    color: #ffffff !important;
    font-weight: normal;
    font-size: 0.9rem;
    padding: 12px !important;
    vertical-align: middle;
}
.report-table-header th:first-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}
.report-table-header th:last-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

/* استایل ردیف‌های جدول */
.report-table tbody tr {
    border-bottom: 1px solid #eff2f5;
    transition: background 0.2s;
}
.report-table tbody tr:hover {
    background-color: #f9f9f9;
}
.report-table td {
    padding: 12px !important;
    font-size: 0.9rem;
    color: #3f4254;
}

/* استایل کد تیپ (بنفش و شیک) */
.type-code-badge {
    background-color: #f8f5ff; /* بنفش خیلی روشن */
    color: #7239ea; /* بنفش اصلی */
    border: 1px solid #e8fff3; /* بوردر محو */
    padding: 6px 12px;
    border-radius: 6px;
    font-family: monospace; /* فونت مونو برای کدها خواناتر است */
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 100px;
    text-align: center;
}


.direction-L { background-color: #e8fff3; color: #50cd89; } /* سبز برای چپ */
.direction-R { background-color: #fff5f8; color: #f1416c; } /* قرمز برای راست */

/* اعداد */
.num-text {
    font-family: 'Tahoma', sans-serif;
    font-weight: normal;
}

/* --- اصلاح نمایش تعداد در جدول --- */
.count-badge {
    background-color: #f3f6f9; /* رنگ پس زمینه طوسی روشن */
    color: #181c32 !important; /* رنگ متن مشکی برای دیده شدن */
    font-weight: 800;
    font-size: 1rem;
    padding: 5px 15px;
    border-radius: 6px;
    border: 1px solid #ebedf3;
}

/* --- استایل دراپ‌داون سفارشی (شبیه عکس ارسالی) --- */
.custom-multiselect {
    position: relative;
    width: 100%;
    min-width: 250px;
}

.custom-select-trigger {
    background-color: #fff;
    border: 1px solid #eff2f5;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #5e6278;
    min-height: 42px;
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eff2f5;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 100;
    display: none; /* مخفی در حالت عادی */
    padding: 10px;
    margin-top: 5px;
}

.custom-options.open {
    display: block;
}

/* باکس جستجو داخل دراپ‌داون */
.dropdown-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e4e6ef;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}
.dropdown-search:focus {
    outline: none;
    border-color: #0095e8;
}

/* گزینه‌ها */
.option-item {
    display: flex;
    align-items: center;
    padding: 8px 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}
.option-item:hover {
    background-color: #f1faff;
}

/* چک‌باکس‌ها */
.option-checkbox {
    width: 18px;
    height: 18px;
    margin-left: 10px;
    cursor: pointer;
    accent-color: #0095e8;
}

.option-label {
    font-size: 0.9rem;
    color: #3f4254;
    font-weight: 600;
    flex-grow: 1;
}

.divider {
    height: 1px;
    background-color: #eff2f5;
    margin: 5px 0;
}

/* --- استایل‌های اختصاصی گزارش --- */

.filter-card {
    background-color: #ffffff;
    border: 1px solid #eff2f5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    border-radius: 8px;
}

/* استایل دراپ‌داون سفارشی */
.custom-multiselect { position: relative; width: 100%; min-width: 250px; }
.custom-select-trigger {
    background-color: #fff; border: 1px solid #eff2f5; border-radius: 6px; padding: 10px 15px;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    font-size: 0.9rem; color: #5e6278; min-height: 42px;
}
.custom-options {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #eff2f5;
    border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); z-index: 100; display: none; padding: 10px; margin-top: 5px;
}
.custom-options.open { display: block; }
.dropdown-search { width: 100%; padding: 8px 10px; border: 1px solid #e4e6ef; border-radius: 5px; margin-bottom: 10px; font-size: 0.85rem; }
.dropdown-search:focus { outline: none; border-color: #0095e8; }
.option-item { display: flex; align-items: center; padding: 8px 5px; cursor: pointer; border-radius: 4px; transition: background 0.2s; }
.option-item:hover { background-color: #f1faff; }
.option-checkbox { width: 18px; height: 18px; margin-left: 10px; cursor: pointer; accent-color: #0095e8; }
.option-label { font-size: 0.9rem; color: #3f4254; font-weight: 600; flex-grow: 1; }
.divider { height: 1px; background-color: #eff2f5; margin: 5px 0; }

/* استایل جدول گزارش */
.report-table-header th {
    background-color: #1e1e2d !important; color: #ffffff !important;
    font-weight: normal; font-size: 0.9rem; padding: 12px !important; vertical-align: middle;
}
.report-table tbody tr { border-bottom: 1px solid #eff2f5; transition: background 0.2s; }
.report-table tbody tr:hover { background-color: #f9f9f9; }
.report-table td { padding: 12px !important; font-size: 0.9rem; color: #3f4254; }

/* بج تیپ (کد) */
.type-code-badge {
    background-color: #f8f5ff; color: #7239ea; border: 1px solid #e8fff3;
    padding: 6px 12px; border-radius: 6px; font-family: monospace;
    font-size: 0.95rem; font-weight: bold; letter-spacing: 0.5px;
    display: inline-block; min-width: 100px; text-align: center;
}

/* بج ساده طوسی (برای تعداد و جهت) */
.simple-badge {
    background-color: #f3f6f9; /* طوسی روشن */
    color: #181c32 !important; /* مشکی */
    font-weight: 800;
    font-size: 1rem;
    padding: 5px 15px;
    border-radius: 6px;
    border: 1px solid #ebedf3;
    display: inline-block;
    min-width: 40px;
    text-align: center;
}
@media print {
    /* ۱. تغییر جهت کاغذ به افقی */
    @page {
        size: landscape;
        margin: 5mm; /* حاشیه باریک */
    }

    /* ۲. مخفی کردن تمام اجزای اضافی */
    body * {
        visibility: hidden; /* همه چیز مخفی */
    }

    /* ۳. نمایش فقط جدول و فرم */
    #doorsForm, #doorsForm * ,   #printableArea, #printableArea * {
        visibility: visible; /* فرم و محتویاتش دیده شوند */
    }

    /* تنظیم موقعیت فرم برای چاپ */
    #doorsForm {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* ۴. مخفی کردن هدر، دکمه‌ها و فوتر */
    .card-header-custom, 
    .card-footer, 
    .header-left, 
    .header-right, 
    .btn, 
    .no-print {
        display: none !important;
    }

    /* ۵. بهینه‌سازی جدول برای جا شدن در صفحه */
    .table-responsive {
        overflow: visible !important;
        display: block;
        width: 100%;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    /* حذف حالت چسبان (Sticky) چون در پرینت مشکل‌ساز است */
    .sticky-top, 
    .sticky-col-right, 
    thead {
        position: static !important;
    }

    /* ۶. کوچک کردن فونت‌ها و فواصل */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        font-size: 9pt !important; /* فونت ریزتر */
        padding: 2px !important; /* پدینگ کمتر */
        border: 1px solid #000 !important; /* بوردر مشکی برای چاپ بهتر */
    }

    /* کوچک کردن اینپوت‌ها */
    .input-flush, .select-flush, .floor-text, .unit-text {
        font-size: 8pt !important;
        height: auto !important;
    }

    .cell-container {
        height: 35px !important; /* کاهش ارتفاع سلول */
    }

    /* ۷. تنظیم رنگ‌ها برای چاپ */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}