/* MimWebCRM — RTL Persian layout */
@font-face { font-family: "Vazirmatn"; src: url("../lib/vazirmatn/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../lib/vazirmatn/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../lib/vazirmatn/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
    --mim-primary: #1f4e79;
    --mim-primary-dark: #163a5a;
    --mim-surface: #f4f6f9;
    --mim-border: #d9dee5;
    --bs-body-font-family: "Vazirmatn", Tahoma, sans-serif;
}

html, body { height: 100%; }
body {
    font-family: var(--bs-body-font-family);
    background: var(--mim-surface);
    display: flex;
    flex-direction: column;
    font-size: .92rem;
}
.mim-main { flex: 1 0 auto; }

.mim-navbar { background: var(--mim-primary); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.mim-navbar .dropdown-item i, .mim-navbar .nav-link i { margin-left: .35rem; }

.mim-status {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    padding: .4rem 1rem;
    background: #fff;
    border-top: 1px solid var(--mim-border);
    font-size: .8rem;
    color: #555;
}
.mim-status i { margin-left: .25rem; color: var(--mim-primary); }

.mim-card { background: #fff; border: 1px solid var(--mim-border); border-radius: .5rem; padding: 1rem; margin-bottom: 1rem; }
.mim-card > h2, .mim-card > h3 { font-size: 1.05rem; font-weight: 700; color: var(--mim-primary-dark); margin-bottom: .75rem; }
.page-title { font-size: 1.2rem; font-weight: 700; color: var(--mim-primary-dark); margin-bottom: 1rem; }

/* Customer header: label/value grid */
.mim-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem 1.5rem; }
.mim-field { display: flex; gap: .5rem; border-bottom: 1px dashed #e5e8ec; padding: .25rem 0; }
.mim-field .label { color: #6b7280; white-space: nowrap; min-width: 9rem; }
.mim-field .value { font-weight: 500; word-break: break-word; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.mim-license { font-family: Consolas, "Courier New", monospace; letter-spacing: .05em; cursor: pointer; }

.table-mim { background: #fff; font-size: .88rem; }
.table-mim thead th { background: #e9eef5; color: var(--mim-primary-dark); white-space: nowrap; }
.table-mim td.actions { white-space: nowrap; width: 1%; }
.toolbar { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }

.nav-tabs .nav-link { color: var(--mim-primary-dark); }
.nav-tabs .nav-link.active { font-weight: 700; }
.tab-pane { background: #fff; border: 1px solid var(--mim-border); border-top: 0; padding: 1rem; border-radius: 0 0 .5rem .5rem; }

.badge-gift { background: #c2185b; }

/* Access tree */
.access-tree, .access-tree ul { list-style: none; padding-right: 1.4rem; margin: 0; }
.access-tree > li { padding-right: 0; }
.access-tree li { margin: .15rem 0; }
.access-tree .sep { color: #9aa1aa; font-size: .8rem; }

.login-wrap { max-width: 420px; margin: 8vh auto; }
.login-wrap .card { border-radius: .75rem; box-shadow: 0 6px 24px rgba(0,0,0,.08); }

.calendar td, .calendar th { text-align: center; width: 14.28%; }
.calendar td.today { background: #fff3cd; font-weight: 700; }
.calendar td.friday, .calendar th.friday { color: #c62828; }

@media print {
    .mim-navbar, .mim-status, .toolbar, .no-print, .nav-tabs, .btn { display: none !important; }
    .tab-pane { border: 0; }
}

/* Dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.stat-tile { display: flex; gap: .75rem; align-items: center; background: #fff; border: 1px solid var(--mim-border); border-radius: .5rem;
             padding: .8rem 1rem; color: inherit; text-decoration: none; }
a.stat-tile:hover { border-color: var(--mim-primary); box-shadow: 0 2px 8px rgba(31,78,121,.12); }
.stat-tile > i { font-size: 1.6rem; color: var(--mim-primary); }
.stat-title { color: #6b7280; font-size: .82rem; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: #1f2937; }
.stat-note { color: #6b7280; font-size: .75rem; }
.chart-box { position: relative; }
.badge-black { background: #212529; }

/* Customer timeline */
.mim-timeline { list-style: none; margin: 0; padding: 0 1.2rem 0 0; border-right: 2px solid var(--mim-border); }
.mim-timeline li { position: relative; display: flex; gap: .6rem; padding: .35rem 0 .6rem; }
.mim-timeline li > i { position: absolute; right: -1.95rem; top: .35rem; background: #fff; color: var(--mim-primary);
                       border: 1px solid var(--mim-border); border-radius: 50%; width: 1.5rem; height: 1.5rem;
                       display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.mim-timeline .tl-head { font-size: .82rem; }
.mim-timeline .tl-text { white-space: pre-wrap; }
