/* ========================
   Yekan Bakh Font
   ======================== */

@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 01 Hairline.woff') format('woff');
    font-weight: 100;
    font-style: normal;
}
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 02 Thin.woff') format('woff');
    font-weight: 200;
    font-style: normal;
}
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 03 Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 04 Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 05 Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 06 Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 07 Heavy.woff') format('woff');
    font-weight: 800;
    font-style: normal;
}
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan Bakh Fa-En 08 Fat.woff') format('woff');
    font-weight: 900;
    font-style: normal;
}

/* ========================
   گروه صنعتی رضوی — Brand CSS
   ========================

   Colors:
   --razavi-red:    #D42027   (primary brand red)
   --razavi-red-dk: #A8181E   (darker red for hover)
   --razavi-grey:   #8C8C8C   (logo grey)
   --razavi-dark:   #1E1E2D   (navbar dark)
   --razavi-light:  #F5F5F7   (page background)
*/

:root {
    --razavi-red:    #D42027;
    --razavi-red-dk: #A8181E;
    --razavi-grey:   #8C8C8C;
    --razavi-dark:   #1E1E2D;
    --razavi-light:  #F5F5F7;
}

/* ---- Base ---- */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'YekanBakh', Tahoma, sans-serif;
    direction: rtl;
    background-color: var(--razavi-light);
    color: #1A1A1A;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'YekanBakh', Tahoma, sans-serif;
    font-weight: 700;
}

.fw-light    { font-weight: 300 !important; }
.fw-normal   { font-weight: 400 !important; }
.fw-medium   { font-weight: 500 !important; }
.fw-semibold { font-weight: 500 !important; }
.fw-bold     { font-weight: 700 !important; }
.fw-heavy    { font-weight: 800 !important; }

.btn, .nav-link, label, .form-label, .badge, .alert {
    font-family: 'YekanBakh', Tahoma, sans-serif;
}

input, textarea, select {
    font-family: 'YekanBakh', Tahoma, sans-serif !important;
}

/* ===== NAVBAR ===== */
.navbar-razavi {
    background-color: var(--razavi-dark);
    border-bottom: 3px solid var(--razavi-red);
    padding: 0 1rem;
    height: 54px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-razavi .navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-razavi .navbar-brand img.brand-logo {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s;
}
.nav-icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.notif-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--razavi-red);
    color: #fff;
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    font-family: 'YekanBakh', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}
.user-btn:hover { background: rgba(255,255,255,0.18); }

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    height: calc(100vh - 54px);
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
    width: 220px;
    min-width: 220px;
    background: #fff;
    border-left: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.25s;
    z-index: 100;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--razavi-grey);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.5rem 0.25rem;
    margin-top: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: #444;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    color: var(--razavi-grey);
    font-size: 0.9rem;
    transition: color 0.15s;
}

.sidebar-link:hover {
    background: #f5f5f7;
    color: var(--razavi-red);
}
.sidebar-link:hover i { color: var(--razavi-red); }

.sidebar-link.active {
    background: rgba(212,32,39,0.08);
    color: var(--razavi-red);
    font-weight: 700;
}
.sidebar-link.active i { color: var(--razavi-red); }

/* ── گروه‌های بازشو سایدبار ── */
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #444;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: right;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}
.sidebar-group-toggle i:first-child {
    width: 18px;
    text-align: center;
    color: var(--razavi-grey);
    font-size: 0.9rem;
}
.sidebar-group-toggle:hover { background: #f5f5f7; color: var(--razavi-red); }
.sidebar-group-toggle:hover i { color: var(--razavi-red); }
.sidebar-chevron {
    margin-right: auto;
    font-size: 0.6rem !important;
    transition: transform 0.2s;
}
.sidebar-group-toggle:not(.collapsed) .sidebar-chevron { transform: rotate(180deg); }
.sidebar-group-toggle:not(.collapsed) { color: var(--razavi-red); }
.sidebar-group-toggle:not(.collapsed) i { color: var(--razavi-red); }
.sidebar-sub { padding-right: 0.9rem; }
.sidebar-sub .sidebar-link { font-size: 0.83rem; padding: 0.45rem 0.7rem; }
.sidebar-sub .sidebar-link i { font-size: 0.8rem; }

.sidebar-companies {
    padding: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.company-chip {
    display: inline-block;
    background: #f0f0f2;
    color: #555;
    border-radius: 20px;
    padding: 0.15rem 0.65rem;
    font-size: 0.75rem;
    margin: 2px;
    font-weight: 500;
}

/* ===== MAIN CONTENT ===== */
.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--razavi-light);
}

/* Mobile sidebar */
@media (max-width: 991px) {
    .app-sidebar {
        position: fixed;
        top: 54px;
        right: 0;
        height: calc(100vh - 54px);
        transform: translateX(100%);
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { padding: 1rem; }
}

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.card-header-razavi {
    background: linear-gradient(135deg, var(--razavi-red) 0%, var(--razavi-red-dk) 100%);
    color: #fff;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
}

/* ---- Buttons ---- */
.btn-razavi {
    background-color: var(--razavi-red);
    border-color: var(--razavi-red);
    color: #fff;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-razavi:hover,
.btn-razavi:focus {
    background-color: var(--razavi-red-dk);
    border-color: var(--razavi-red-dk);
    color: #fff;
}

/* Override Bootstrap primary where used with brand */
.btn-primary {
    background-color: var(--razavi-red);
    border-color: var(--razavi-red);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--razavi-red-dk);
    border-color: var(--razavi-red-dk);
}
.btn-outline-primary {
    color: var(--razavi-red);
    border-color: var(--razavi-red);
}
.btn-outline-primary:hover {
    background-color: var(--razavi-red);
    border-color: var(--razavi-red);
}
.text-primary { color: var(--razavi-red) !important; }
.bg-primary   { background-color: var(--razavi-red) !important; }
.border-primary { border-color: var(--razavi-red) !important; }

/* ---- Login page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--razavi-dark) 0%, #2c2c3e 60%, #3a1a1c 100%);
}

.login-card {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    min-width: 360px;
    max-width: 420px;
    width: 100%;
}

.login-card .login-header {
    background: linear-gradient(135deg, var(--razavi-red) 0%, var(--razavi-red-dk) 100%);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.login-card .login-header img {
    height: 72px;
    width: auto;
    filter: brightness(0) invert(1); /* white logo on red */
}

.login-card .login-header h5 {
    color: #fff;
    font-weight: 700;
    margin-top: 0.75rem;
    margin-bottom: 0.1rem;
}

.login-card .login-header p {
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    margin: 0;
}

.login-card .login-body {
    padding: 2rem 1.75rem;
    background: #fff;
}

.login-card .form-control {
    border-radius: 7px;
    border: 1.5px solid #ddd;
    padding: 0.6rem 0.9rem;
}

.login-card .form-control:focus {
    border-color: var(--razavi-red);
    box-shadow: 0 0 0 0.2rem rgba(212,32,39,0.15);
}

/* ---- OTP page ---- */
.otp-input {
    letter-spacing: 0.5em;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.otp-input:focus {
    border-color: var(--razavi-red);
    box-shadow: 0 0 0 0.2rem rgba(212,32,39,0.15);
}

/* ---- Tables ---- */
.table th {
    white-space: nowrap;
    background-color: #f0f0f2;
    font-weight: 600;
    font-size: 0.88rem;
}

/* ---- Badges ---- */
.company-badge {
    font-size: 0.75rem;
    padding: 0.3em 0.6em;
}

/* ---- RTL fixes ---- */
.dropdown-menu {
    text-align: right;
}

.alert {
    text-align: right;
}

/* ===== QUICK LINKS (dashboard) ===== */
.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    border-radius: 10px;
    background: #f8f8f9;
    text-decoration: none;
    color: #333;
    font-size: 0.82rem;
    font-weight: 500;
    gap: 0.4rem;
    transition: background 0.15s, transform 0.15s;
    text-align: center;
}
.quick-link i { font-size: 1.3rem; }
.quick-link:hover {
    background: #f0f0f2;
    transform: translateY(-2px);
    color: #111;
}

/* ===== FORM SECTION DIVIDER ===== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
    color: var(--razavi-red);
    font-weight: 700;
    font-size: 0.9rem;
}
.section-divider::before, .section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

/* ===== STAT CARDS ON DASHBOARD ===== */
.stat-card {
    border-right: 4px solid var(--razavi-red);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--razavi-red);
}

.stat-card .stat-label {
    color: var(--razavi-grey);
    font-size: 0.85rem;
}

/* ==================================================
   RIGMS UI refresh — simple, fast and worker-friendly
   ================================================== */
:root {
    --app-surface: #ffffff;
    --app-canvas: #f4f5f7;
    --app-border: #e7e8ec;
    --app-text: #252631;
    --app-muted: #747681;
    --app-radius: 14px;
    --app-shadow: 0 6px 24px rgba(30, 30, 45, 0.065);
    --app-control-height: 44px;
}

html { scroll-behavior: smooth; }
body { background: var(--app-canvas); color: var(--app-text); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(212, 32, 39, .2);
    outline-offset: 2px;
}

/* Top navigation */
.navbar-razavi {
    height: 62px;
    padding-inline: 1.1rem;
    background: linear-gradient(110deg, #252536 0%, var(--razavi-dark) 70%);
    border-bottom-width: 2px;
    box-shadow: 0 5px 18px rgba(18, 18, 27, .16);
}
.navbar-razavi .container-fluid { max-width: 1800px; }
.navbar-razavi .navbar-brand { gap: .75rem; margin: 0; }
.navbar-razavi .navbar-brand img.brand-logo { height: 40px; }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1.2; color: #fff; }
.brand-wordmark strong { font-size: .83rem; font-weight: 700; }
.brand-wordmark small { margin-top: .16rem; color: rgba(255,255,255,.48); font-size: .62rem; font-weight: 400; }
.navbar-toggler { width: 40px; height: 40px; border-radius: 10px !important; background: rgba(255,255,255,.08); }
.nav-icon-btn { width: 40px; height: 40px; border-radius: 11px; }
.user-btn { min-height: 40px; padding: .35rem .8rem; border-radius: 10px; }

/* Application shell */
.app-layout { height: calc(100vh - 62px); }
.app-sidebar {
    width: 246px;
    min-width: 246px;
    border-left-color: var(--app-border);
    box-shadow: -2px 0 14px rgba(30,30,45,.025);
    scrollbar-width: thin;
}
.sidebar-mobile-head { display: none; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--app-border); }
.sidebar-mobile-head strong { font-size: .9rem; }
.sidebar-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: #f2f2f4; color: #555761; }
.sidebar-nav { padding: 1rem .8rem; }
.sidebar-section-title { padding: .65rem .65rem .35rem; color: #9a9ba4; font-size: .65rem; }
.sidebar-link {
    min-height: 43px;
    gap: .72rem;
    margin-bottom: 4px;
    padding: .6rem .75rem;
    border-radius: 10px;
    color: #4d4f59;
    font-size: .84rem;
}
.sidebar-link i { display: grid; place-items: center; width: 25px; height: 25px; font-size: .92rem; }
.sidebar-link:hover { background: #f7f7f9; }
.sidebar-link.active { position: relative; background: #fff0f1; box-shadow: inset -3px 0 0 var(--razavi-red); }
.sidebar-footer { margin-top: auto; padding: .85rem; border-top: 1px solid var(--app-border); background: #fbfbfc; }
.sidebar-user { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.sidebar-user__avatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: #fff0f1; color: var(--razavi-red); }
.sidebar-user__info { min-width: 0; }
.sidebar-user__info strong, .sidebar-user__info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user__info strong { color: #41424c; font-size: .75rem; }
.sidebar-user__info small { margin-top: .15rem; color: #9899a1; font-size: .65rem; }
.sidebar-overlay { display: none; }

.app-main {
    padding: clamp(1rem, 2.4vw, 2rem);
    background:
        radial-gradient(circle at 0 0, rgba(212,32,39,.025), transparent 24rem),
        var(--app-canvas);
    scrollbar-gutter: stable;
}
.app-main > .container-fluid { max-width: 1380px !important; padding: 0 !important; }
.app-main > .container, .app-main > .container-fluid { margin-inline: auto; }
.system-messages { position: relative; z-index: 5; max-width: 1380px; margin: 0 auto; padding: 1rem 1rem 0; }
.system-messages .alert { border: 0; border-right: 4px solid currentColor; border-radius: 12px; box-shadow: var(--app-shadow); }

/* Clear page headings */
.app-main h4, .app-main h5 { color: var(--app-text); }
.app-main > .d-flex:first-child,
.app-main > .container-fluid > .d-flex:first-child,
.app-main > .container > .d-flex:first-child {
    min-height: 48px;
}
.app-main h4 > i:first-child,
.app-main h5 > i:first-child { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: .5rem !important; border-radius: 10px; background: #fff0f1; font-size: .95rem; }

/* Cards and sections */
.card {
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow) !important;
}
.card-header, .card-footer { border-color: var(--app-border); }
.card-header { min-height: 50px; padding: .8rem 1.1rem; background: #fbfbfc; font-weight: 700; }
.card-header-razavi {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: .78rem 1.1rem;
    border-bottom: 1px solid #efc9cb;
    border-radius: var(--app-radius) var(--app-radius) 0 0 !important;
    background: linear-gradient(90deg, #fff5f5, #fff);
    color: #4b3033;
    font-weight: 700;
}
.card-header-razavi i { color: var(--razavi-red); }
.card-body { line-height: 1.75; }
.card-hover, .task-card, .quick-link { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-hover:hover, .task-card:hover, .quick-link:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(30,30,45,.1) !important; }

/* Forms: large, obvious controls for field workers */
.form-label, form label { color: #4a4b54; font-size: .8rem; font-weight: 600; }
.form-control, .form-select {
    min-height: var(--app-control-height);
    border: 1.5px solid #dedfe4;
    border-radius: 10px;
    background-color: #fff;
    color: #30313a;
    font-size: .85rem;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-control::placeholder { color: #aaabb3; }
.form-control:hover, .form-select:hover { border-color: #c9cad1; }
.form-control:focus, .form-select:focus { border-color: var(--razavi-red); box-shadow: 0 0 0 .22rem rgba(212,32,39,.1); }
.form-check-input:checked { background-color: var(--razavi-red); border-color: var(--razavi-red); }
.form-text, .text-muted { color: var(--app-muted) !important; }

/* Buttons and actions */
.btn { min-height: 40px; padding: .45rem .9rem; border-radius: 10px; font-size: .8rem; font-weight: 600; }
.btn-sm { min-height: 34px; padding: .32rem .7rem; border-radius: 8px; }
.btn-razavi, .btn-primary { border-color: var(--razavi-red); background: var(--razavi-red); box-shadow: 0 5px 12px rgba(212,32,39,.14); }
.btn-razavi:hover, .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(212,32,39,.22); }
.btn-outline-secondary { border-color: #d7d8dd; color: #60616a; }
.btn-outline-secondary:hover { border-color: #5e606a; background: #5e606a; }

/* Tables and contained scrolling regions */
.table-responsive.app-scroll-region {
    max-height: min(62vh, 620px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c6c7ce transparent;
}
.app-scroll-region:not(.table-responsive) {
    max-height: min(62vh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c6c7ce transparent;
}
.app-scroll-region::-webkit-scrollbar { width: 7px; height: 7px; }
.app-scroll-region::-webkit-scrollbar-thumb { border-radius: 10px; background: #c6c7ce; }
.app-scroll-region::-webkit-scrollbar-track { background: transparent; }
.table { margin: 0; color: #3e3f48; font-size: .8rem; }
.table > :not(caption) > * > * { padding: .76rem .9rem; border-bottom-color: #edeef1; vertical-align: middle; }
.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid #dedfe4;
    background: #f5f5f7;
    color: #575862;
    font-size: .73rem;
    font-weight: 700;
    box-shadow: 0 1px 0 #dedfe4;
}
.table tbody tr { transition: background .12s; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #fff8f8; }
.table td .btn { white-space: nowrap; }
.scroll-region-hint { display: flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-top: 1px solid var(--app-border); background: #fbfbfc; color: #8a8b94; font-size: .66rem; }

/* Long card/list collections stay inside their own section */
.list-group-item { border-color: #edeef1; padding: .9rem 1rem; color: #41424b; }
.list-group-item-action:hover { background: #fff8f8; color: #262730; }
.staff-row { min-height: 72px; transition: background .12s; }
.staff-row:hover { background: #fff8f8 !important; }

/* Status, pagination and empty states */
.badge { padding: .38em .65em; font-weight: 600; }
.pagination { margin-bottom: 0; }
.page-link { min-width: 36px; border-color: var(--app-border); color: #555761; text-align: center; }
.page-link:hover { border-color: #efc9cb; background: #fff4f4; color: var(--razavi-red); }
.page-item.active .page-link { border-color: var(--razavi-red); background: var(--razavi-red); }
.opacity-25 { opacity: .22 !important; }

/* Dashboard */
.stat-card { position: relative; overflow: hidden; min-height: 112px; border: 1px solid var(--app-border); border-right: 4px solid var(--razavi-red); border-radius: var(--app-radius); box-shadow: var(--app-shadow); }
.stat-card::after { content: ""; position: absolute; left: -24px; bottom: -34px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .035; }
.stat-card .stat-number { font-size: 1.75rem; font-weight: 800; }
.quick-link { min-height: 92px; border: 1px solid #ececf0; border-radius: 12px; background: #fafafd; }
.quick-link:hover { border-color: #f0c2c4; background: #fff7f7; color: var(--razavi-red); }

/* Warehouse dashboard: explicit high-contrast cards */
.warehouse-dashboard .card-hover {
    position: relative;
    overflow: hidden;
    min-height: 154px;
    border: 1px solid #e8e8ed !important;
    border-right: 4px solid var(--razavi-red) !important;
    background: #fff !important;
}
.warehouse-dashboard .card-hover::after {
    content: "";
    position: absolute;
    left: -28px;
    bottom: -38px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--razavi-red);
    opacity: .035;
    pointer-events: none;
}
.warehouse-dashboard .card-hover h6 { color: #292a31 !important; }
.warehouse-dashboard .card-hover .text-danger { color: #b71920 !important; }
.warehouse-dashboard .card-hover:hover {
    border-color: #e9b8bb !important;
    border-right-color: var(--razavi-red) !important;
    background: #fffafa !important;
}
.warehouse-stat-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 96px;
    padding: 1rem 1.15rem;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--app-shadow);
}
.warehouse-stat-icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: #fff0f1;
    color: #a8181e;
    font-size: 1.3rem;
}
.warehouse-stat-card strong, .warehouse-stat-card small { display: block; }
.warehouse-stat-card strong { color: #26272e; font-size: 1.45rem; line-height: 1.2; }
.warehouse-stat-card small { margin-top: .25rem; color: #777983; }
.warehouse-stat-card.is-alert { border-color: #e9b8bb; background: #fffafa; }
.warehouse-stat-card.is-alert .warehouse-stat-icon { background: #f8dadd; color: #9b151b; }

/* Mobile bottom shortcuts */
.mobile-bottom-nav { display: none; }

@media (max-width: 991px) {
    .navbar-razavi { height: 58px; padding-inline: .75rem; }
    .navbar-razavi .navbar-brand img.brand-logo { height: 36px; }
    .brand-wordmark small { display: none; }
    .app-layout { height: calc(100vh - 58px); }
    .app-sidebar { top: 58px; right: 0; height: calc(100vh - 58px); z-index: 1045; }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-mobile-head { display: flex; }
    .sidebar-overlay { position: fixed; inset: 58px 0 0; z-index: 1040; border: 0; background: rgba(24,24,34,.42); backdrop-filter: blur(2px); }
    .sidebar-overlay.show { display: block; }
    .app-main { padding: 1rem 1rem 5.4rem; }
    .mobile-bottom-nav {
        position: fixed;
        right: .75rem;
        left: .75rem;
        bottom: .65rem;
        z-index: 1035;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        min-height: 62px;
        padding: .4rem;
        border: 1px solid rgba(231,232,236,.9);
        border-radius: 18px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 12px 34px rgba(30,30,45,.18);
        backdrop-filter: blur(12px);
    }
    .mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .22rem; border-radius: 12px; color: #777983; text-decoration: none; font-size: .62rem; }
    .mobile-bottom-nav a i { font-size: 1rem; }
    .mobile-bottom-nav a.active { background: #fff0f1; color: var(--razavi-red); font-weight: 700; }
    .table-responsive.app-scroll-region, .app-scroll-region:not(.table-responsive) { max-height: 58vh; }
}

@media (max-width: 576px) {
    :root { --app-control-height: 46px; }
    .brand-wordmark strong { font-size: .72rem; }
    .app-main { padding-inline: .75rem; }
    .app-main > .container-fluid { padding-inline: 0 !important; }
    .app-main h4 { font-size: 1.08rem; }
    .app-main h5 { font-size: .98rem; }
    .card { border-radius: 12px; }
    .card-body { padding: 1rem; }
    .btn:not(.btn-sm) { min-height: 44px; }
    .table { font-size: .75rem; }
    .table > :not(caption) > * > * { padding: .7rem .75rem; }
    .stat-card { min-height: 100px; padding: 1rem; }
    .stat-card .stat-number { font-size: 1.5rem; }
    .user-btn { width: 40px; padding: 0; }
    .warehouse-dashboard .row > .col-md-3 { width: 50%; }
    .warehouse-dashboard .card-hover { min-height: 142px; padding: .9rem !important; }
    .warehouse-dashboard .card-hover i { font-size: 1.65rem !important; }
    .warehouse-dashboard .card-hover h6 { margin-bottom: .35rem; font-size: .78rem; }
    .warehouse-dashboard .card-hover small { font-size: .65rem; line-height: 1.55; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ==================================================
   Worker-first journeys: one clear next action at a time
   ================================================== */
.worker-home { max-width: 1100px !important; }
.worker-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: .3rem 0 1.5rem;
}
.worker-welcome__eyebrow, .section-heading__eyebrow {
    margin: 0 0 .25rem;
    color: var(--razavi-red);
    font-size: .73rem;
    font-weight: 800;
}
.worker-welcome h1, .quick-report h1, .daily-report-flow h1 {
    margin: 0;
    color: #252631;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    font-weight: 800;
}
.worker-welcome__date, .quick-report__header p, .daily-report-flow__header p {
    margin: .35rem 0 0;
    color: var(--app-muted);
    font-size: .86rem;
}
.worker-welcome__date i { margin-left: .4rem; color: var(--razavi-red); }
.worker-welcome__guide {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 42px;
    padding: .55rem .8rem;
    border: 1px solid var(--app-border);
    border-radius: 11px;
    color: #555762;
    background: #fff;
    font-size: .8rem;
    text-decoration: none;
}
.worker-welcome__guide:hover { border-color: #eab6b9; color: var(--razavi-red); }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: .75rem; }
.section-heading h2 { margin: 0; font-size: 1.06rem; font-weight: 800; }

.today-action {
    display: flex;
    gap: 1rem;
    padding: clamp(1.15rem, 2vw, 1.5rem);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--app-shadow);
}
.today-action--report { border-right: 5px solid var(--razavi-red); }
.today-action--tasks { border-right: 5px solid #4f5967; }
.today-action__icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff0f1;
    color: var(--razavi-red);
    font-size: 1.25rem;
}
.today-action--tasks .today-action__icon { background: #eef0f3; color: #4f5967; }
.today-action__content { min-width: 0; flex: 1; }
.today-action__label { margin: 0 0 .3rem; color: var(--app-muted); font-size: .75rem; font-weight: 700; }
.today-action h3 { margin: 0; color: #292a32; font-size: 1rem; font-weight: 800; }
.today-action__content > p:not(.today-action__label) { margin: .45rem 0 1rem; color: #71737c; font-size: .85rem; }
.action-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; padding-inline: .95rem; font-size: .84rem; }
.company-action-list { display: grid; gap: .5rem; margin-top: .85rem; }
.company-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: .55rem .75rem;
    border: 1px solid #f2d2d4;
    border-radius: 10px;
    color: #852229;
    background: #fff8f8;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
}
.company-action span { display: inline-flex; gap: .45rem; align-items: center; }
.company-action small { font-size: .72rem; font-weight: 500; }
.company-action--done { border-color: #cbe6d6; color: #187744; background: #f4fbf7; }
.company-action:hover { color: inherit; filter: brightness(.985); }

.simple-action {
    display: flex;
    align-items: center;
    min-height: 86px;
    gap: .85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--app-shadow);
    color: #363840;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease;
}
.simple-action:hover { transform: translateY(-2px); border-color: #d8d9df; color: #22232a; }
.simple-action--safety { border-right: 4px solid #d77a00; background: linear-gradient(90deg, #fffaf1, #fff 42%); }
.simple-action__icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px; background: #f2f3f5; color: #555761; }
.simple-action--safety .simple-action__icon { background: #fff0d5; color: #a95900; }
.simple-action__body { min-width: 0; flex: 1; }
.simple-action__body strong, .simple-action__body small { display: block; }
.simple-action__body strong { font-size: .88rem; font-weight: 800; }
.simple-action__body small { margin-top: .25rem; color: #777983; font-size: .76rem; line-height: 1.5; }
.simple-action__arrow { color: #a5a6ad; }

.action-queue { padding: .9rem 1rem; border: 1px solid #eee0c9; border-radius: 14px; background: #fffdf9; }
.action-queue__title { margin-bottom: .65rem; color: #715724; font-size: .8rem; font-weight: 800; }
.action-queue__title i { margin-left: .4rem; }
.action-queue__items { display: flex; flex-wrap: wrap; gap: .5rem; }
.queue-item { display: inline-flex; align-items: center; gap: .55rem; min-height: 38px; padding: .35rem .5rem .35rem .35rem; border-radius: 9px; font-size: .78rem; text-decoration: none; }
.queue-item b { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.9); }
.queue-item--info { background: #e9f5fb; color: #176681; }.queue-item--warning { background: #fff4d9; color: #8e6400; }.queue-item--success { background: #e9f7ee; color: #16733d; }.queue-item--danger { background: #fff0f0; color: #a62a2a; }

.more-tools { border: 1px solid var(--app-border); border-radius: 14px; background: #fff; box-shadow: var(--app-shadow); }
.more-tools__toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .9rem 1rem; border: 0; border-radius: inherit; background: transparent; color: #34363e; text-align: right; }
.more-tools__toggle > span { display: grid; grid-template-columns: 24px auto; align-items: center; column-gap: .45rem; }
.more-tools__toggle > span > i { grid-row: span 2; display: grid; place-items: center; color: var(--razavi-red); }
.more-tools__toggle strong { font-size: .83rem; }.more-tools__toggle small { color: #85868e; font-size: .69rem; }
.more-tools__toggle > i { font-size: .7rem; transition: transform .2s; }.more-tools__toggle:not(.collapsed) > i { transform: rotate(180deg); }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: .55rem; padding: 0 1rem 1rem; }
.shortcut-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; min-height: 76px; padding: .5rem; border: 1px solid #ededf0; border-radius: 10px; background: #fafafd; color: #52545e; font-size: .75rem; text-decoration: none; }.shortcut-tile i { color: var(--razavi-red); font-size: 1.05rem; }.shortcut-tile:hover { color: var(--razavi-red); background: #fff7f7; border-color: #f0cacc; }

/* Focused form flows */
.back-button { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid var(--app-border); border-radius: 11px; background: #fff; color: #545660; text-decoration: none; }.back-button:hover { border-color: #d7d8de; color: var(--razavi-red); }
.daily-report-flow__header, .quick-report__header { display: flex; align-items: center; gap: .8rem; margin: .25rem 0 1rem; }.daily-report-flow__header > div:not(.form-progress), .quick-report__header > div { min-width: 0; flex: 1; }.daily-report-flow__header p span { margin: 0 .25rem; }
.form-progress { display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto; padding: .45rem .6rem; border: 1px solid #eee0c9; border-radius: 10px; background: #fffaf1; color: #705217; font-size: .72rem; font-weight: 700; }.form-progress i { color: #bb6d00; }
.form-guidance { display: flex; align-items: flex-start; gap: .45rem; margin: 0 0 1rem; padding: .7rem .8rem; border-radius: 10px; background: #f4f5f7; color: #696b74; font-size: .78rem; }.form-guidance i { margin-top: .18rem; color: var(--razavi-red); }
.report-field-card { border-right: 3px solid #e5e6e9 !important; box-shadow: 0 3px 14px rgba(30,30,45,.045) !important; }.report-field-card:focus-within { border-right-color: var(--razavi-red) !important; box-shadow: 0 5px 18px rgba(212,32,39,.09) !important; }.report-field-card--optional { border-right-color: #d3d5da !important; background: #fcfcfd; }
.form-submit-bar { position: sticky; bottom: .75rem; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .75rem .7rem 1rem; border: 1px solid rgba(225,226,231,.95); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 8px 24px rgba(30,30,45,.12); backdrop-filter: blur(10px); }.form-submit-bar p { margin: 0; color: #747680; font-size: .72rem; }.form-submit-bar p i { color: var(--razavi-red); font-size: .55rem; }.form-submit-bar > div { display: flex; gap: .5rem; }.form-submit-bar .btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; }

/* Short, plain-language HSE report */
.quick-report { max-width: 860px !important; }.quick-report__header { margin-bottom: 1.1rem; }.quick-report__header p { max-width: 580px; line-height: 1.65; }.safety-notice { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1rem; padding: .8rem .9rem; border: 1px solid #f1d6a3; border-radius: 12px; background: #fff9ec; color: #72510a; font-size: .8rem; line-height: 1.7; }.safety-notice i { margin-top: .25rem; color: #bd6b00; }
.quick-report__form { display: grid; gap: .85rem; }.report-step-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: .75rem; padding: 1rem; border: 1px solid var(--app-border); border-radius: 15px; background: #fff; box-shadow: var(--app-shadow); }.report-step-card__number { display: grid; place-items: center; align-self: start; width: 34px; height: 34px; border-radius: 11px; background: #fff0f1; color: var(--razavi-red); font-size: .86rem; font-weight: 800; }.report-step-card__content h2 { margin: .18rem 0 0; color: #34353d; font-size: .96rem; font-weight: 800; }.report-step-card__content h2 small { color: #9798a0; font-size: .7rem; font-weight: 500; }.report-step-card__content > p { margin: .3rem 0 .85rem; color: #777982; font-size: .76rem; }.report-step-card--optional { background: #fcfcfd; }.report-step-card--optional .report-step-card__number { background: #f0f1f3; color: #777983; }.quick-report .form-label { margin-bottom: .35rem; color: #4b4d55; font-size: .78rem; font-weight: 700; }.quick-report .form-label span { color: var(--razavi-red); }.field-error { margin-top: .3rem; color: #b4232a; font-size: .72rem; }

@media (max-width: 576px) {
    .worker-welcome { align-items: flex-start; margin-bottom: 1.1rem; }.worker-welcome__guide { display: none; }.today-action { padding: 1rem; }.today-action__icon { flex-basis: 42px; width: 42px; height: 42px; border-radius: 12px; font-size: 1.1rem; }.today-action h3 { font-size: .93rem; }.simple-action { min-height: 78px; padding: .85rem .9rem; }.simple-action__body small { font-size: .71rem; }.action-queue { padding: .75rem; }.queue-item { width: 100%; justify-content: space-between; }.shortcut-grid { grid-template-columns: repeat(3, 1fr); padding: 0 .75rem .75rem; }.daily-report-flow__header, .quick-report__header { align-items: flex-start; }.form-progress { margin-top: .15rem; max-width: 126px; line-height: 1.4; }.daily-report-flow .card-body { padding: .9rem !important; }.form-submit-bar { bottom: 4.85rem; align-items: stretch; flex-direction: column; padding: .65rem; }.form-submit-bar p { display: none; }.form-submit-bar > div { width: 100%; }.form-submit-bar .btn { flex: 1; justify-content: center; }.report-step-card { grid-template-columns: 30px minmax(0, 1fr); gap: .6rem; padding: .85rem; }.report-step-card__number { width: 30px; height: 30px; border-radius: 9px; }.quick-report .form-submit-bar { bottom: 4.85rem; }
}

/* =====================================================================
   Dashboard redesign — هدر، تایل آمار، پنل با اسکرول داخلی
   ===================================================================== */
.dash-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.dash-header__title { display: flex; align-items: center; gap: .7rem; }
.dash-header__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--razavi-red) 0%, var(--razavi-red-dk) 100%); color: #fff; font-size: 1.15rem; box-shadow: 0 6px 16px rgba(212,32,39,.28); }
.dash-header__title h1 { margin: 0; font-size: 1.12rem; font-weight: 800; color: #26272e; }
.dash-header__title p { margin: .1rem 0 0; font-size: .74rem; color: #8b8d96; }
.dash-header__actions { display: flex; flex-wrap: wrap; gap: .45rem; }

.stat-tile { position: relative; display: flex; align-items: center; gap: .8rem; height: 100%; padding: .9rem 1rem; border: 1px solid #ececf0; border-radius: 16px; background: #fff; box-shadow: 0 3px 14px rgba(30,30,45,.05); overflow: hidden; transition: box-shadow .2s; }
a.stat-tile { text-decoration: none; cursor: pointer; }
a.stat-tile:hover { box-shadow: 0 8px 22px rgba(30,30,45,.11); }
.stat-tile::before { content: ''; position: absolute; inset-inline-start: 0; top: 14%; bottom: 14%; width: 4px; border-radius: 4px; background: var(--tile-accent, #c9cbd3); }
.stat-tile__icon { flex: 0 0 44px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--tile-bg, #f2f3f6); color: var(--tile-accent, #6c6e78); font-size: 1.05rem; }
.stat-tile__body { min-width: 0; }
.stat-tile__value { font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: #26272e; }
.stat-tile__value small { font-size: .72rem; font-weight: 600; color: #9b9da6; }
.stat-tile__label { margin-top: .1rem; font-size: .72rem; font-weight: 600; color: #8b8d96; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile--red    { --tile-accent: #D42027; --tile-bg: #fdeeee; }
.stat-tile--green  { --tile-accent: #1d9d6c; --tile-bg: #e9f7f1; }
.stat-tile--amber  { --tile-accent: #d9930d; --tile-bg: #fdf5e4; }
.stat-tile--blue   { --tile-accent: #2563eb; --tile-bg: #ebf1fe; }
.stat-tile--purple { --tile-accent: #7c3aed; --tile-bg: #f3edfd; }
.stat-tile--grey   { --tile-accent: #6c6e78; --tile-bg: #f2f3f6; }

.panel-card { display: flex; flex-direction: column; height: 100%; border: 1px solid #ececf0; border-radius: 16px; background: #fff; box-shadow: 0 3px 14px rgba(30,30,45,.05); overflow: hidden; }
.panel-card__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid #f1f1f4; }
.panel-card__head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .85rem; font-weight: 800; color: #34353d; }
.panel-card__head h2 i { color: var(--razavi-red); font-size: .8rem; }
.panel-card__head a { font-size: .72rem; font-weight: 700; text-decoration: none; }
.panel-card__body { padding: 1rem; }
/* اسکرول داخلی: محتوای زیاد، صفحه را طولانی نمی‌کند */
.panel-scroll { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c6c7ce transparent; }
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-thumb { border-radius: 10px; background: #c6c7ce; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll--tall { max-height: 420px; }
.panel-card .table thead th { position: sticky; top: 0; z-index: 2; background: #fafafc; font-size: .72rem; font-weight: 700; color: #8b8d96; border-bottom: 1px solid #ececf0; white-space: nowrap; }
.panel-card .table td { font-size: .8rem; }
.panel-card .list-group-item { border-color: #f3f3f6; }
.panel-empty { display: grid; place-items: center; gap: .4rem; padding: 2.2rem 1rem; color: #a2a4ad; font-size: .78rem; text-align: center; }
.panel-empty i { font-size: 1.6rem; opacity: .35; }
.min-w-0 { min-width: 0; }

.filter-bar { border: 1px solid #ececf0; border-radius: 16px; background: #fff; box-shadow: 0 3px 14px rgba(30,30,45,.05); padding: .8rem 1rem; margin-bottom: 1rem; }
.filter-bar .form-label { margin-bottom: .25rem; font-size: .7rem; font-weight: 700; color: #8b8d96; }

/* برچسب QR تجهیز (نمایش + چاپ) */
.qr-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.qr-card img { width: 132px; height: 132px; border: 1px solid #ececf0; border-radius: 12px; padding: 6px; background: #fff; }
.equipment-label-sheet { max-width: 340px; margin: 2rem auto; padding: 1.2rem; border: 2px dashed #c9cbd3; border-radius: 16px; text-align: center; background: #fff; }
.equipment-label-sheet img { width: 190px; height: 190px; }
.equipment-label-sheet h1 { font-size: 1rem; font-weight: 800; margin: .6rem 0 .2rem; }
.equipment-label-sheet .code { font-size: .85rem; font-weight: 700; color: var(--razavi-red); letter-spacing: 1px; }
.equipment-label-sheet p { margin: .3rem 0 0; font-size: .72rem; color: #8b8d96; }
@media print {
    .navbar-razavi, .app-sidebar, .mobile-bottom-nav, .sidebar-overlay, .no-print, .system-messages { display: none !important; }
    .app-main { padding: 0 !important; }
    .app-layout { display: block !important; }
    .equipment-label-sheet { border-style: solid; margin: 0 auto; }
}

@media (max-width: 576px) {
    .stat-tile { padding: .7rem .75rem; gap: .55rem; }
    .stat-tile__icon { flex-basis: 36px; width: 36px; height: 36px; border-radius: 10px; font-size: .9rem; }
    .stat-tile__value { font-size: 1.1rem; }
    .panel-scroll { max-height: 300px; }
}
