*{box-sizing:border-box}
html,body{min-height:100%}
body.master-shell{margin:0!important;padding:0!important;background:var(--brand-background)!important;color:#263b31;font-family:Yekan,Tahoma,sans-serif;direction:rtl}
body.public-shell{margin:0;padding:0;min-height:100vh}.public-main{width:100%;min-height:100vh;margin:0;padding:0}
.shell-header{position:sticky;top:0;z-index:1050;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;min-height:72px;padding:10px 22px;background:linear-gradient(135deg,var(--brand-primary),var(--brand-secondary));color:#fff;border-bottom:3px solid var(--brand-accent);box-shadow:0 5px 20px rgba(0,0,0,.16)}
.shell-brand{display:flex;align-items:center;gap:10px;color:#fff!important;text-decoration:none;font-size:1.15rem;font-weight:800;white-space:nowrap}.shell-logo{width:44px;height:44px;object-fit:contain;border-radius:10px;background:#ffffff18;padding:3px}.shell-nav{display:flex;justify-content:center;align-items:center;gap:5px;flex-wrap:wrap}.shell-nav a,.shell-logout{display:inline-flex;align-items:center;min-height:40px;padding:8px 12px;border:1px solid transparent;border-radius:9px;color:#fff!important;text-decoration:none!important;background:transparent;font:inherit;cursor:pointer}.shell-nav a:hover,.shell-nav a:focus,.shell-logout:hover{background:#ffffff18;border-color:#ffffff35}.shell-user{display:flex;align-items:center;justify-content:flex-end;gap:9px;white-space:nowrap}.shell-logout{border-color:#ffffff38}.shell-menu-toggle{display:none;border:1px solid #ffffff55;border-radius:9px;background:#ffffff14;color:#fff;min-height:42px;padding:8px 13px;font:inherit}.shell-main{width:100%;max-width:none;margin:0;padding:22px}.shell-footer{padding:18px;text-align:center;color:#6e766f;font-size:.8rem}
body.master-shell .dashboard-container,body.master-shell .container,body.master-shell .page,body.master-shell .wrap,body.master-shell .main-container,body.master-shell .content-container{width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
body.master-shell .admin-header,body.master-shell .header,body.master-shell .navbar{background:linear-gradient(135deg,var(--brand-primary),var(--brand-secondary))!important;border-color:var(--brand-accent)!important;border-radius:14px!important;margin-bottom:20px!important;color:#fff!important}
body.master-shell .card,body.master-shell .stat-card,body.master-shell .menu-card,body.master-shell .system-section,body.master-shell .users-table-container{background:var(--brand-surface)!important;border-color:var(--brand-accent)!important;border-radius:14px!important;box-shadow:0 7px 24px rgba(28,48,38,.09)!important}
body.master-shell .btn-primary,body.master-shell .btn-main,body.master-shell .search-btn,body.master-shell .btn-confirm{background:var(--brand-primary)!important;border-color:var(--brand-primary)!important;color:#fff!important}body.master-shell input:focus,body.master-shell select:focus,body.master-shell textarea:focus{border-color:var(--brand-primary)!important;box-shadow:0 0 0 3px rgba(26,71,42,.15)!important}
@media(max-width:1100px){.shell-header{grid-template-columns:1fr auto}.shell-menu-toggle{display:block}.shell-nav{display:none;grid-column:1/-1;justify-content:flex-start;padding-top:8px}.shell-nav.is-open{display:flex}.shell-user{grid-column:1/-1;justify-content:space-between;border-top:1px solid #ffffff25;padding-top:8px}.shell-main{padding:14px}}
@media(max-width:600px){.shell-header{padding:9px 11px}.shell-brand span{max-width:160px;overflow:hidden;text-overflow:ellipsis}.shell-main{padding:9px}.shell-nav a{width:calc(50% - 4px);justify-content:center}.shell-logo{width:38px;height:38px}}

/* Phase 6: shared visual rhythm for every master-based page. */
body.master-shell{--shell-text:#25382e;--shell-muted:#718078;--shell-border:#dbe3dd;--shell-radius:14px;--shell-gap:18px;color:var(--shell-text)}
.shell-main>div,.shell-main>section{width:100%;max-width:none}
body.master-shell .admin-header,body.master-shell .header,body.master-shell .navbar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:16px!important;min-height:82px!important;padding:18px 22px!important;box-shadow:0 8px 24px rgba(20,48,34,.14)!important}
body.master-shell .admin-header h1,body.master-shell .header h1,body.master-shell .navbar h1{margin:0!important;font-size:1.35rem!important;line-height:1.6!important}
body.master-shell .stats-grid,body.master-shell .stats-wrapper,body.master-shell .menu-grid{gap:var(--shell-gap)!important;margin-bottom:var(--shell-gap)!important}
body.master-shell .card,body.master-shell .stat-card,body.master-shell .menu-card,body.master-shell .system-section,body.master-shell .users-table-container{padding:20px!important;border:1px solid var(--shell-border)!important;border-top:3px solid var(--brand-accent)!important;overflow:hidden}
body.master-shell .filter-section,body.master-shell .filter-container,body.master-shell .search-section,body.master-shell .toolbar{display:flex;align-items:end;gap:12px;padding:16px!important;margin-bottom:18px!important;background:var(--brand-surface);border:1px solid var(--shell-border);border-radius:var(--shell-radius);box-shadow:0 5px 18px rgba(28,48,38,.06)}
body.master-shell input[type=text],body.master-shell input[type=password],body.master-shell input[type=number],body.master-shell input[type=date],body.master-shell input[type=email],body.master-shell input[type=search],body.master-shell select,body.master-shell textarea{min-height:44px;padding:9px 12px;border:1px solid #cfd9d2;border-radius:9px;background:#fff;color:var(--shell-text);font-family:inherit}
body.master-shell textarea{min-height:96px;resize:vertical}
body.master-shell button,body.master-shell .btn,body.master-shell input[type=submit],body.master-shell a[class*=btn]{min-height:42px;border-radius:9px;font-family:inherit;transition:transform .15s ease,box-shadow .15s ease,background-color .15s ease}
body.master-shell button:hover,body.master-shell .btn:hover,body.master-shell input[type=submit]:hover,body.master-shell a[class*=btn]:hover{transform:translateY(-1px)}
body.master-shell table{width:100%;border-collapse:separate;border-spacing:0;background:var(--brand-surface)}
body.master-shell th{background:#edf2ee!important;color:#33483c!important;font-weight:800!important;border-bottom:2px solid var(--brand-accent)!important}
body.master-shell td{vertical-align:middle!important;border-bottom:1px solid #e7ece8!important}
body.master-shell tr:last-child td{border-bottom:0!important}
body.master-shell .modal-content{border:1px solid var(--shell-border)!important;border-radius:16px!important;box-shadow:0 24px 70px rgba(14,35,24,.24)!important}
body.master-shell .footer{margin-top:24px!important;padding:18px!important;color:var(--shell-muted)!important;text-align:center!important}
body.master-shell .shell-main [id$="btnLogout"]{display:none!important}
@media(max-width:900px){body.master-shell .admin-header,body.master-shell .header,body.master-shell .navbar{align-items:stretch!important;min-height:0!important;padding:15px!important}body.master-shell .filter-section,body.master-shell .filter-container,body.master-shell .search-section,body.master-shell .toolbar{align-items:stretch!important}.shell-main{padding:12px!important}}
@media(max-width:520px){body.master-shell .card,body.master-shell .stat-card,body.master-shell .menu-card,body.master-shell .system-section,body.master-shell .users-table-container{padding:14px!important;border-radius:11px!important}.shell-main{padding:8px!important}}

/* Compact page identity bar: the master header already owns navigation and user actions. */
body.master-shell .admin-header,
body.master-shell .header,
body.master-shell .navbar{
    min-height:50px!important;
    padding:8px 14px!important;
    margin-bottom:14px!important;
    border:1px solid var(--shell-border)!important;
    border-right:4px solid var(--brand-accent)!important;
    border-radius:10px!important;
    background:var(--brand-surface)!important;
    color:var(--shell-text)!important;
    box-shadow:0 3px 12px rgba(28,48,38,.07)!important;
}
body.master-shell .admin-header h1,
body.master-shell .admin-header h2,
body.master-shell .admin-header h3,
body.master-shell .header h1,
body.master-shell .header h2,
body.master-shell .header h3,
body.master-shell .navbar h1,
body.master-shell .navbar h2,
body.master-shell .navbar h3{font-size:1.05rem!important;line-height:1.5!important;color:var(--shell-text)!important}
body.master-shell .admin-header a,
body.master-shell .header a,
body.master-shell .navbar a{color:var(--brand-primary)!important}
body.master-shell .admin-header .user-info,
body.master-shell .header .user-info,
body.master-shell .navbar .user-info{font-size:.78rem!important;color:var(--shell-muted)!important}
@media(max-width:900px){
    body.master-shell .admin-header,
    body.master-shell .header,
    body.master-shell .navbar{min-height:44px!important;padding:7px 10px!important;gap:8px!important}
}
