/* BND global presentation layer
   Light enterprise / administrative workspace.
   Presentation only: no business, authorization or persistence behavior. */

:root{
    --bnd-bg:#f4f6f8;
    --bnd-surface:#ffffff;
    --bnd-surface-soft:#f8fafc;
    --bnd-surface-muted:#eef3f7;
    --bnd-border:#d9e1e8;
    --bnd-border-strong:#c5d0da;
    --bnd-text:#223548;
    --bnd-text-soft:#5f7182;
    --bnd-text-muted:#7b8b99;
    --bnd-heading:#173a59;
    --bnd-primary:#165b8f;
    --bnd-primary-hover:#104a75;
    --bnd-primary-soft:#eaf3f9;
    --bnd-success:#27734f;
    --bnd-warning:#936214;
    --bnd-danger:#a63e33;
    --bnd-danger-soft:#fff1ef;
    --bnd-focus:#6ea6d2;
    --bnd-radius:5px;
    --bnd-shadow:0 1px 2px rgba(26,46,66,.05);
    --bnd-header-height:64px;
    --bnd-nav-height:44px;
}

*{box-sizing:border-box}

html,body{
    margin:0;
    min-height:100%;
    background:var(--bnd-bg);
    color:var(--bnd-text);
    font-family:Tahoma,"Segoe UI",Arial,sans-serif;
    font-size:14px;
    line-height:1.65;
    direction:rtl;
    text-rendering:optimizeLegibility;
}

body{min-height:100vh}

a{
    color:var(--bnd-primary);
    text-decoration:none;
}

a:hover{color:var(--bnd-primary-hover)}

button,input,select,textarea{font:inherit}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
    outline:3px solid color-mix(in srgb,var(--bnd-focus) 55%,transparent);
    outline-offset:2px;
}

.shell{
    min-height:100vh;
    background:var(--bnd-bg);
}

.app-header{
    position:sticky;
    top:0;
    z-index:50;
    background:var(--bnd-surface);
    border-bottom:1px solid var(--bnd-border);
    box-shadow:0 1px 4px rgba(28,47,66,.045);
}

.app-header__inner{
    min-height:var(--bnd-header-height);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    padding:8px 24px;
    max-width:1760px;
    margin:0 auto;
}

.brand{
    min-width:0;
    display:flex;
    align-items:center;
    gap:11px;
    color:var(--bnd-heading);
}

.brand:hover{color:var(--bnd-heading)}

.brand img{
    width:42px;
    height:42px;
    object-fit:contain;
    background:#fff;
    border:1px solid var(--bnd-border);
    border-radius:6px;
    padding:3px;
}

.brand__text{
    display:grid;
    gap:1px;
    line-height:1.25;
}

.brand__text strong{
    font-size:14.5px;
    font-weight:700;
    white-space:nowrap;
}

.brand__text small{
    color:var(--bnd-text-soft);
    font-size:11.5px;
    font-weight:400;
    white-space:nowrap;
}

.app-header__actions{
    display:flex;
    align-items:center;
    gap:12px;
}

.app-header__status{
    color:var(--bnd-text-muted);
    font-size:12px;
    padding-inline-end:12px;
    border-inline-end:1px solid var(--bnd-border);
}

.logout-form{margin:0}

.header-action{
    border:1px solid var(--bnd-border-strong);
    background:var(--bnd-surface);
    color:var(--bnd-text);
    border-radius:4px;
    padding:6px 12px;
    min-height:32px;
    cursor:pointer;
}

.header-action:hover{
    background:var(--bnd-surface-soft);
    border-color:#aebcc8;
}

.main-nav{
    min-height:var(--bnd-nav-height);
    border-top:1px solid #edf1f4;
    background:#fbfcfd;
}

.main-nav__inner{
    min-height:var(--bnd-nav-height);
    max-width:1760px;
    margin:0 auto;
    padding:0 24px;
    display:flex;
    align-items:stretch;
    gap:2px;
}

.main-nav__direct,
.nav-group__toggle{
    min-height:43px;
    display:flex;
    align-items:center;
    gap:6px;
    padding:0 13px;
    color:#334b61;
    font-size:13px;
    font-weight:600;
    white-space:nowrap;
    border-bottom:2px solid transparent;
}

.main-nav__direct:hover,
.nav-group__toggle:hover{
    color:var(--bnd-primary);
    background:#f2f6f9;
}

.main-nav__direct.active{
    color:var(--bnd-primary);
    background:var(--bnd-primary-soft);
    border-bottom-color:var(--bnd-primary);
}

.nav-group{
    position:relative;
    margin:0;
}

.nav-group__toggle{
    cursor:pointer;
    appearance:none;
    background:transparent;
    border:0;
    border-bottom:2px solid transparent;
    border-radius:0;
    font-family:inherit;
    width:100%;
    user-select:none;
}



.nav-group__toggle::after{
    content:"⌄";
    color:#7d8c99;
    font-size:11px;
    margin-inline-start:2px;
    transform:translateY(-1px);
}

.nav-group__toggle[aria-expanded="true"]{
    color:var(--bnd-primary);
    background:#f2f6f9;
}

.nav-dropdown{
    position:absolute;
    top:calc(100% - 1px);
    right:0;
    z-index:80;
    min-width:210px;
    padding:6px;
    background:#fff;
    border:1px solid var(--bnd-border);
    border-radius:0 0 6px 6px;
    box-shadow:0 10px 24px rgba(36,55,73,.13);
}

.nav-dropdown--wide{min-width:235px}

.nav-dropdown a{
    display:flex;
    align-items:center;
    min-height:34px;
    padding:6px 10px;
    border-radius:4px;
    color:#344c61;
    font-size:12.75px;
    white-space:nowrap;
}

.nav-dropdown a:hover{
    background:#f2f6f9;
    color:var(--bnd-primary);
}

.nav-dropdown a.active{
    color:var(--bnd-primary);
    background:var(--bnd-primary-soft);
    font-weight:700;
}

.app-main{
    width:100%;
    min-width:0;
}

.content{
    width:100%;
    max-width:1760px;
    margin:0 auto;
    padding:20px 24px 34px;
}

h1,h2,h3{
    color:var(--bnd-heading);
    font-weight:700;
    line-height:1.35;
}

h1{
    font-size:22px;
    margin:0 0 16px;
}

h2{
    font-size:16px;
    margin:0 0 12px;
}

h3{
    font-size:14px;
    margin:0 0 10px;
}

p{margin-top:0}

.cards{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin:14px 0;
}

.metric{
    background:var(--bnd-surface);
    border:1px solid var(--bnd-border);
    border-radius:var(--bnd-radius);
    padding:14px 16px;
    color:var(--bnd-text);
    box-shadow:var(--bnd-shadow);
}

.metric span{
    display:block;
    color:var(--bnd-text-soft);
    font-size:12px;
}

.metric strong{
    display:block;
    margin-top:4px;
    color:var(--bnd-heading);
    font-size:22px;
    line-height:1.25;
}

.panel{
    background:var(--bnd-surface);
    border:1px solid var(--bnd-border);
    border-radius:var(--bnd-radius);
    padding:16px;
    margin:12px 0;
    overflow:auto;
    box-shadow:var(--bnd-shadow);
}

.grid2{
    display:grid;
    grid-template-columns:minmax(300px,400px) minmax(0,1fr);
    gap:14px;
}

.formgrid,.detailgrid{
    display:grid;
    grid-template-columns:repeat(2,minmax(180px,1fr));
    gap:10px 14px;
}

label{
    display:grid;
    gap:5px;
    margin-bottom:10px;
    color:#425a70;
    font-size:12.5px;
    font-weight:500;
}

input,select,textarea{
    width:100%;
    min-height:36px;
    padding:7px 10px;
    background:#fff;
    color:var(--bnd-text);
    border:1px solid var(--bnd-border-strong);
    border-radius:4px;
    transition:border-color .14s ease,box-shadow .14s ease;
}

textarea{min-height:90px;resize:vertical}

input:hover,select:hover,textarea:hover{border-color:#aebcc8}

input:focus,select:focus,textarea:focus{
    border-color:#7ca9ca;
    box-shadow:0 0 0 2px rgba(56,126,176,.09);
}

button,.buttonlike{
    border:1px solid var(--bnd-border-strong);
    background:#f7f9fb;
    color:#29475f;
    border-radius:4px;
    padding:7px 12px;
    min-height:34px;
    cursor:pointer;
    transition:background .14s ease,border-color .14s ease,color .14s ease;
}

button:hover,.buttonlike:hover{
    background:#eef3f7;
    border-color:#aebcc8;
}

button.primary,.primary{
    background:var(--bnd-primary);
    border-color:var(--bnd-primary);
    color:#fff;
}

button.primary:hover,.primary:hover{
    background:var(--bnd-primary-hover);
    border-color:var(--bnd-primary-hover);
}

button:disabled{
    opacity:.5;
    cursor:not-allowed;
}

.actions,.toolbar,.searchbar{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}

table{
    width:100%;
    border-collapse:collapse;
    min-width:650px;
    background:#fff;
}

th,td{
    text-align:right;
    padding:8px 10px;
    border-bottom:1px solid #e3e9ee;
    vertical-align:middle;
}

th{
    color:#4b6276;
    background:#f3f6f8;
    font-size:12.5px;
    font-weight:700;
    white-space:nowrap;
}

tbody tr:hover td{background:#f8fafc}

.badge{
    display:inline-block;
    background:#edf2f6;
    color:#3d566d;
    border:1px solid #d7e0e7;
    padding:2px 7px;
    border-radius:4px;
    font-size:11.5px;
    line-height:1.5;
}

.notice{
    background:#f1f7fb;
    color:#34546d;
    border:1px solid #d5e3ed;
    border-right:3px solid #4e8db9;
    padding:10px 13px;
    border-radius:4px;
}

.alert.error{
    background:var(--bnd-danger-soft);
    color:#8d372f;
    border:1px solid #edc9c4;
    padding:10px 12px;
    border-radius:4px;
}

.search-hit{
    display:flex;
    justify-content:space-between;
    gap:16px;
    background:#fff;
    border:1px solid var(--bnd-border);
    padding:11px 13px;
    border-radius:4px;
    margin:7px 0;
}

.search-hit span{color:var(--bnd-text-soft)}

.ai textarea{min-height:150px}

.answer{
    white-space:pre-wrap;
    margin-top:14px;
    padding:14px;
    background:#f7f9fb;
    border:1px solid var(--bnd-border);
    border-radius:4px;
    line-height:1.85;
}

.detailgrid small{
    display:block;
    color:var(--bnd-text-muted);
    font-size:11.5px;
}

.detailgrid b{
    display:block;
    margin-top:4px;
    color:var(--bnd-text);
}

code,[dir=ltr],bdi{unicode-bidi:isolate}

/* Login follows the same light enterprise language. */
.login-wrap{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:20px;
    background:linear-gradient(180deg,#eef3f7 0%,#f7f9fb 100%);
}

.login-card{
    width:min(410px,100%);
    background:#fff;
    border:1px solid var(--bnd-border);
    border-radius:7px;
    padding:26px;
    box-shadow:0 12px 34px rgba(31,54,75,.10);
}

.login-card img{
    display:block;
    width:108px;
    margin:0 auto 18px;
    background:white;
    border:1px solid var(--bnd-border);
    border-radius:6px;
    padding:6px;
}

.login-card button{width:100%}

.linkbtn{
    background:transparent;
    border:0;
    color:var(--bnd-primary);
    padding:4px 6px;
}

@media(max-width:1050px){
    .main-nav__inner{
        overflow-x:auto;
        scrollbar-width:thin;
    }

    .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
    .grid2{grid-template-columns:1fr}
}

@media(max-width:760px){
    :root{
        --bnd-header-height:58px;
        --bnd-nav-height:auto;
    }

    .app-header{
        position:relative;
    }

    .app-header__inner{
        padding:7px 14px;
    }

    .brand img{
        width:38px;
        height:38px;
    }

    .brand__text small{display:none}
    .app-header__status{display:none}

    .main-nav{
        border-top:1px solid var(--bnd-border);
        padding:6px 10px 8px;
    }

    .main-nav__inner{
        display:grid;
        grid-template-columns:1fr;
        gap:3px;
        padding:0;
        overflow:visible;
    }

    .main-nav__direct,
    .nav-group__toggle{
        min-height:38px;
        padding:0 10px;
        border:1px solid transparent;
        border-radius:4px;
    }

    .main-nav__direct.active{
        border-color:#d3e1eb;
    }

    .nav-group{
        width:100%;
    }

    .nav-dropdown{
        position:static;
        min-width:0;
        width:100%;
        box-shadow:none;
        border:0;
        border-right:2px solid #d8e4ec;
        border-radius:0;
        margin:0 10px 4px 0;
        padding:3px 8px 3px 0;
        background:transparent;
    }

    .nav-dropdown a{
        min-height:34px;
        background:transparent;
    }

    .content{
        padding:14px 12px 24px;
    }

    .formgrid,.detailgrid{grid-template-columns:1fr}
}

@media(max-width:520px){
    html,body{font-size:13.5px}
    .cards{grid-template-columns:1fr}
    .app-header__actions{gap:6px}
    .header-action{padding:5px 9px}
    h1{font-size:20px}
}
