﻿@font-face{
    font-family: 'mont';
    src: url('/font/Montserrat-Regular.ttf');
    font-size: 12px;
}
body {
    font-family: 'mont', sans-serif;
}
/*--btn Styles--*/
.btn {
    border-radius: 0px !important;
}
/*--btn Styles--*/

/*--Header--*/
.header {
    background-color: #333;
    padding: 10px 0px 10px 0px;
    color: white;
    display: flex;
    width: 100%;
}

    .header a, .header a:hover, .header a:visited, .header a:active {
        color: inherit;
        text-decoration: none;
    }

    .header span {
        padding-left: 12px;
    }

.heading {
    width: 100%;
}
/*--Header--*/

/*--Footer--*/
.footer {
    position: fixed;
    bottom: 0;
    width: 90%;
    background: #fff;   /* it sits over the page, so it must not be see-through */
}

/* A fixed footer floats above the page, so the last rows of a long screen end up
   underneath it. Reserve the height it takes rather than relying on stray <br>s. */
.content {
    padding-bottom: 90px;
}
/*--Footer--*/

/*--Fixed Table--*/
.tableFixed{
    width: 100% auto;
    overflow-y: auto;
    height: 260px !important;
}
/*--Fixed Table--*/

/*--Loader-- a frosted overlay with a green ring; the markup (.loader > .lds-facebook > 3 divs) is the same on every page --*/
.loader {
    display: none;
    position: fixed;
    inset: 0;
    width: 100% !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: rgba(243, 245, 247, .72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.lds-facebook {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    background: transparent;
    animation: none;
}
.lds-facebook div { display: none; }
.lds-facebook::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(18, 163, 90, .18);
}
.lds-facebook::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #12a35a;
    border-right-color: #12a35a;
    animation: sb-spin .8s linear infinite;
}
.lds-facebook div:first-child {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border-radius: 8px;
    background: linear-gradient(145deg, #2fce7f, #0e8a4b);
    color: #fff;
    font: 800 11px/28px "Nunito", "Segoe UI", Arial, sans-serif;
    text-align: center;
    letter-spacing: .04em;
    animation: sb-pulse 1.2s ease-in-out infinite;
}
.lds-facebook div:first-child::before { content: 'SB'; }
@keyframes sb-spin { to { transform: rotate(360deg); } }
@keyframes sb-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.88); opacity: .75; } }
body.sb2-dark .loader { background: rgba(15, 23, 42, .7); }
/*--Loader--*/

/*--Mobile--*/
/* The footer is position:fixed, so on a phone it parks itself over the bottom of
   the page and the last rows cannot be reached — scrolling looks stuck. The name
   and the copyright line are of no use on a phone anyway, so the whole strip is
   dropped there and the spacer it needed goes with it. */
@media (max-width: 768px) {
    .footer {
        display: none !important;
    }
    /* the four <br> before the footer only existed to clear it */
    .content + br,
    .content ~ br {
        display: none;
    }
    /* room to scroll past the last row on a phone */
    .content {
        padding-bottom: 24px;
    }
}
/*--Mobile--*/

/* Tight column gutters used by the Tailor measurement sheet (Views/Customer/AddTailor, EditTailor) */
@media only screen and (min-width: 786px) {
    .col-md-pl-5 { padding-left: 5px; }
    .col-md-pr-5 { padding-right: 5px; }
    .col-md-p-5 { padding-left: 5px; padding-right: 5px; }
}

/* ====================================================================== */
/*  PHONE                                                                 */
/*  Sidebar to shell2.css pehle se sambhal leta hai (992px par slide hota  */
/*  hai). Yahan wo cheezen hain jo har screen par aati hain: lists,        */
/*  filter bars, forms aur dialogs.                                       */
/* ====================================================================== */
@media (max-width: 768px) {

    /* --- Lists ---------------------------------------------------------
       Har list ki table ke 8-10 khane hote hain. Phone par wo nichudh kar
       ek ek harf ki line ban jate the. Ab table khud daayein-baayein
       scroll hoti hai aur page ka baqi hissa apni jagah par rehta hai. */
    #myTable, table.co, table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        table-layout: auto !important;
    }
    #myTable th, #myTable td,
    table.table th, table.table td { white-space: nowrap; }
    /* Naam wale khane ko phir bhi tootne dein, warna scroll bohat lamba ho jata hai */
    #myTable td:nth-child(3), #myTable td.nm { white-space: normal; min-width: 150px; }

    /* Action ke buttons ek doosre par charh jate the */
    #myTable td:last-child { white-space: normal; }
    #myTable td .btn { margin: 1px; }

    /* DataTables ka upar wala hissa: "Show 10 entries" aur Search alag alag line par */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter { float: none !important; text-align: left !important; width: 100%; }
    .dataTables_wrapper .dataTables_filter { margin-top: 6px; }
    .dataTables_wrapper .dataTables_filter input { width: 100%; margin-left: 0; }
    .dataTables_wrapper .dataTables_paginate { float: none !important; text-align: center; margin-top: 8px; }
    .dataTables_wrapper .dataTables_info { text-align: center; }

    /* --- Filter bars (From Date / To Date / Branch / View) ------------- */
    .list-filter { padding: 10px; gap: 8px; }
    .list-filter .fld { flex: 1 1 140px; }
    .list-filter .fld input, .list-filter .fld select { width: 100% !important; min-width: 0; }
    .list-filter .acts { flex: 1 1 100%; }
    .list-filter .acts .btn { flex: 1; }

    /* --- Forms --------------------------------------------------------- */
    /* 16px se chhota font ho to iPhone khana chunte hi poore page ko zoom
       kar deta hai, aur user ko haath se wapas chhota karna parta hai. */
    input, select, textarea, .form-control { font-size: 16px !important; }
    .form-control-sm { padding: 6px 10px; height: auto; }
    /* Bootstrap ke do-teen khane wale row phone par upar neeche */
    .row > [class*="col-md-"], .row > [class*="col-lg-"] { flex: 0 0 100%; max-width: 100%; }

    /* --- Dialogs ------------------------------------------------------- */
    .jconfirm-box { width: 94vw !important; max-width: 94vw !important; }
    .modal-dialog { margin: 8px; }

    /* --- Upar ke stat cards ek qatar mein na samayein to lipat jayen --- */
    .cards, .stat-row, .kpi-row { flex-wrap: wrap; }
}

/* Chhote phone (iPhone SE waghera) */
@media (max-width: 420px) {
    .list-filter .fld { flex: 1 1 100%; }
    #myTable td .btn { padding: 4px 8px; }
}

/* Running project's name in the top bar (see _Layout) */
.header .proj-name { font-size: 13px; font-weight: 600; letter-spacing: .4px; color: #9fe0b8; text-transform: uppercase; margin-bottom: 2px; }
.header .proj-name i { margin-right: 4px; }


/* ---- Role tiers (Tools > User Roles) ----------------------------------------
   Salesman: no edit, delete or toggle. The server blocks the actions too
   (BaseController.TierBlocks); this only keeps the buttons away. */
body.tier-salesman .btnRemove, body.tier-salesman .btnDelete, body.tier-salesman .btnDeleteGrp,
body.tier-salesman .btnRemoveItem, body.tier-salesman .btnImgRemove,
body.tier-salesman .btnRevert, body.tier-salesman .btnToggle, body.tier-salesman .btnStatus,
body.tier-salesman a[href*="/Edit?"], body.tier-salesman a[href*="/Edit/"], body.tier-salesman a[href$="/Edit"],
body.tier-salesman a[href*="/EditUser"], body.tier-salesman a[href*="/EditInfo"],
body.tier-salesman .btnUpdateStatus, body.tier-salesman .btnEdit { display: none !important; }
/* Custom roles (Tools > User Roles > Roles): the same buttons, per screen */
body.perm-noedit .btnRevert, body.perm-noedit .btnToggle, body.perm-noedit .btnStatus, body.perm-noedit .btnUpdateStatus, body.perm-noedit .btnEdit,
body.perm-noedit a[href*="/Edit?"], body.perm-noedit a[href*="/Edit/"], body.perm-noedit a[href$="/Edit"], body.perm-noedit a[href*="/EditInfo"],
body.perm-noedit .act-edit, body.perm-noedit .act-toggle,
body.perm-nodelete .btnRemove, body.perm-nodelete .btnDelete, body.perm-nodelete .btnDeleteGrp, body.perm-nodelete .btnRemoveItem, body.perm-nodelete .btnImgRemove, body.perm-nodelete .act-remove,
body.perm-noadd .btnAdd, body.perm-noadd .btnAddNew, body.perm-noadd a[href$="/Add"], body.perm-noadd a[href*="/Add?"], body.perm-noadd .btnSave, body.perm-noadd #btnAdd, body.perm-noadd #btnSave { display: none !important; }

/* Demo server (appsettings.json ka "DemoLogins"): jise demo dikhaya gaya wo apna password na
   badal sake, warna agla demo hi na ho paye. Screen khud bhi band hai (UsersController) - ye
   sirf link nazar se hata deta hai. Superadmin par ye class lagti hi nahi. */
body.demo-lock a[href*="/Users/ChangePassword"] { display: none !important; }

/* ---- FBR ka HS (PCT) code dhoondne wala khana (Product aur Category) ----------
   Khana text ka hi rehta hai; neeche FBR ki apni list se chunne ki sahulat. */
.hs-pick { position: relative; display: flex; gap: 6px; align-items: stretch; }
.hs-pick > input { flex: 1; min-width: 0; }
.hs-pick .hs-find { flex: none; border: 1px solid #ced4da; }
.hs-pick .hs-list {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 1060;
    max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #ced4da;
    border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.14); margin-top: 3px;
}
.hs-pick .hs-row { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #f1f3f5; font-size: 12.5px; }
.hs-pick .hs-row:last-child { border-bottom: 0; }
.hs-pick .hs-row:hover { background: #eef7f1; }
.hs-pick .hs-row b { display: inline-block; min-width: 86px; font-variant-numeric: tabular-nums; }
.hs-pick .hs-row span { color: #555; }
.hs-pick .hs-none { padding: 10px; color: #777; font-size: 12.5px; }
body.sb2-dark .hs-pick .hs-list { background: #16213a; border-color: #2a3340; }
body.sb2-dark .hs-pick .hs-row { border-bottom-color: #243048; }
body.sb2-dark .hs-pick .hs-row:hover { background: #1c273d; }
body.sb2-dark .hs-pick .hs-row span { color: #9ca3af; }

/* ---- Head office se branch ko data bhejne wali patti ---------------------------- */
.bs-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.bs-bar .bs-n { font-size: 12px; color: #6b7280; min-width: 70px; }
.bs-bar select { width: auto; min-width: 180px; }
th.bscol, td.bscol { width: 36px; text-align: center; }
body.sb2-dark .bs-bar .bs-n { color: #9ca3af; }
.bs-bar .bs-why { font-size: 12px; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 5px 10px; }
body.sb2-dark .bs-bar .bs-why { color: #fcd34d; background: #3a2e12; border-color: #5a4718; }

/* ---- Khane ke sath chhota "+" ------------------------------------------------
   Pehle har jagah "+ New customer" ka poora pill button hota tha, aur uski saari
   sajawat seedha markup mein likhi hoti thi - teen screens par teen naqlein. Ab ek
   hi gol nishan hai aur sajawat yahan ek jagah. Naam tooltip mein aa jata hai. */
.qa-plus { display: inline-flex; align-items: center; justify-content: center;
           width: 20px; height: 20px; margin-left: 8px; border-radius: 50%;
           background: var(--brand, #16794a); color: #fff; font-size: 15px; line-height: 1;
           font-weight: 700; text-decoration: none; vertical-align: middle;
           text-transform: none; letter-spacing: 0; transition: .15s; flex: none; }
.qa-plus:hover, .qa-plus:focus { background: #0f5c37; color: #fff; text-decoration: none; transform: scale(1.1); }
.qa-plus:focus-visible { outline: 2px solid #0f5c37; outline-offset: 2px; }

/* Allowances: jis khane ki ijazat nahi (rate / discount) wo bhara to nazar aata hai
   magar badla nahi ja sakta. Dikhne mein saaf pata chale ke ye band hai. */
.allow-locked, input.allow-locked {
    background: #eef1f0 !important;
    color: #6b7a74 !important;
    cursor: not-allowed;
}

/* Bhejne ki ijazat na ho to Send ka button wahi se ghayab - bilkul Edit / Delete ki tarah.
   CSS is liye ke list ki qataarein baad mein banti hain; JS un tak pohnch hi nahi pata tha. */
body.allow-nosend .btnSendDoc,
body.allow-nosend #btnVoucherSend,
body.allow-nosend #rptSend { display: none !important; }
body.allow-nowa   .allow-wa   { display: none !important; }
body.allow-nomail .allow-mail { display: none !important; }

/* Lists ki "Actions" wali qataar. Waqt ke saath yahan button barhte gaye (Print, Thermal PDF,
   A4, A4 PDF, Send, Invoice PDF, Edit, Delete) aur mez apni jagah se bahar nikal kar neeche
   horizontal patti le aati thi.
   Do cheezein ki hain: button ke andar ki fazool jagah kam, aur un ke darmiyan ki khali jagah
   (jo HTML ke space se banti thi) khatam - ab ek barabar ka faasla CSS se aata hai.
   font-size: 0 sirf is khane par hai, is liye kisi aur qataar ka likha hua nahi badalta;
   button ke andar ka naap neeche wapas de diya gaya hai. */
#myTable td.acts { font-size: 0; white-space: normal; }
#myTable td.acts > .btn,
#myTable td.acts > a.btn { font-size: .72rem; padding: .18rem .3rem; margin: 1px 0 1px 2px; line-height: 1.35; }
#myTable td.acts > .btn:first-child,
#myTable td.acts > a.btn:first-child { margin-left: 0; }
#myTable td.acts .btn sup { font-size: .6em; }

/* Neeche ki horizontal patti. Lagta tha buttons ki wajah se hai, magar naapne par pata chala
   ke mez poori andar hi thi - bahar nikalne wali cheez DataTables ki apni qataarein thin
   ("Show 10 entries", Search, "Showing 1 to 10", paging). Wo Bootstrap ke .row mein hoti hain
   aur .row par -15px ka margin lagta hai, to har list 15px bahar nikal jati thi aur patti
   aa jati thi - chahe mez mein kuch bhi na ho.
   Margin ko sifar karte hain aur us ke saath khanon ki 15px padding bhi, taake dikhne mein
   kuch na hile - sirf patti chali jaye. */
.tbl-wrap .dataTables_wrapper > .row { margin-left: 0; margin-right: 0; }
.tbl-wrap .dataTables_wrapper > .row > [class*="col-"] { padding-left: 0; padding-right: 0; }
