/* ===== أيقونات SVG (كل الشاشات) ===== */
.ico{width:1.25em;height:1.25em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;vertical-align:-.22em}
button .ico{margin-inline-end:6px}
button .ico:only-child,.nav-icon .ico,.symbol .ico,.quick button .ico,.operation-options button .ico{margin:0}
.nav-icon{display:inline-grid;place-items:center}
.nav-icon .ico{width:20px;height:20px}
.quick button,.operation-options button{display:flex;align-items:center;gap:9px}
.stat .symbol{display:grid!important;place-items:center;position:absolute!important;left:14px!important;top:14px!important;width:36px;height:36px;padding:0!important;border-radius:10px;background:var(--line)!important;background:color-mix(in srgb,var(--gold) 14%,transparent)!important;color:var(--gold)!important}
.stat .symbol .ico{width:20px;height:20px}
.stat>p{padding-left:46px}
.topbar [data-action=alerts],.topbar [data-action=logout]{display:inline-flex;align-items:center}

/* ===== الجوال ===== */
@media(max-width:720px){
html{-webkit-text-size-adjust:100%}
body{overflow-x:hidden}

/* الشريط العلوي */
.topbar{position:relative;display:grid!important;grid-template-columns:auto minmax(0,1fr);gap:8px 10px;align-items:center;min-height:0!important;padding:calc(8px + env(safe-area-inset-top)) 12px 8px!important;background:var(--panel)}
.topbar .mobile-menu{display:inline-grid!important;place-items:center;width:44px;height:44px;padding:0}
.topbar .mobile-menu .ico{width:24px;height:24px}
.topbar .search{width:100%;min-width:0;min-height:44px}
.topbar .profile{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%}
.topbar .profile [data-action=alerts]{display:none}
.topbar .profile>.theme-control{display:flex!important;align-items:center;gap:6px}
.topbar .profile>.theme-control button{min-height:38px;padding:6px 14px;font-size:13px}
.topbar .profile [data-action=logout]{min-height:38px;padding:6px 12px;font-size:13px}

/* القائمة الجانبية كدرج */
.sidebar{top:0;bottom:0;height:100vh;height:100dvh;width:min(300px,86vw);z-index:40;padding-top:calc(14px + env(safe-area-inset-top))!important;padding-bottom:calc(14px + env(safe-area-inset-bottom))!important}
.sidebar.open{display:flex!important;flex-direction:column;overflow:hidden;box-shadow:0 0 0 100vmax rgba(0,0,0,.55)!important}
.sidebar .nav-item{min-height:46px}

/* الشريط السفلي */
.bottom-nav{position:fixed;left:0;right:0;bottom:0;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));align-items:end;gap:0;min-height:64px;padding:6px 6px calc(6px + env(safe-area-inset-bottom));background:var(--panel);border-top:1px solid var(--line);box-shadow:0 -6px 20px rgba(0,0,0,.08);z-index:30}
nav.bottom-nav button.bn-item{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:52px!important;padding:6px 2px!important;border:0!important;border-radius:12px!important;background:transparent!important;color:var(--muted)!important;box-shadow:none!important;font-size:11px;font-weight:700;line-height:1.2}
nav.bottom-nav .bn-item .ico{width:24px;height:24px;margin:0}
nav.bottom-nav .bn-item span{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:11px}
nav.bottom-nav button.bn-item.active{color:var(--gold)!important;background:var(--line)!important;background:color-mix(in srgb,var(--gold) 12%,transparent)!important}
nav.bottom-nav button.bn-main{background:transparent!important;color:var(--gold)!important}
nav.bottom-nav .bn-main .ico{box-sizing:content-box;width:24px;height:24px;padding:12px;margin-top:-30px;border:4px solid var(--panel);border-radius:50%;background:var(--gold);color:var(--panel);box-shadow:0 6px 16px rgba(0,0,0,.25)}

/* زر المساعد: أصغر وفوق الشريط */
button.assistant-launch,[data-theme=military] button.assistant-launch{width:58px!important;height:58px!important;gap:0!important;padding:4px!important;border-radius:16px!important;bottom:calc(78px + env(safe-area-inset-bottom))!important;left:12px!important}
.assistant-launch .tank-ai-image{width:40px!important;height:26px!important}
.assistant-launch .tank-ai-label{font-size:11px!important;padding:1px 6px!important}

/* المحتوى */
.workspace{padding:16px 12px calc(112px + env(safe-area-inset-bottom))!important;overflow-x:hidden}
.page-head{gap:12px}
.page-head .actions{display:flex;flex-wrap:wrap;gap:8px;width:100%}
.page-head .actions button{flex:1 1 calc(50% - 8px);justify-content:center;min-height:44px}
.panel-head{flex-wrap:wrap;gap:8px}
.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.stat{padding:12px!important}
.stat strong{font-size:26px}
.stat>p{min-height:44px!important;font-size:13px;padding-left:44px}
.quick{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.quick button{min-height:50px;padding:10px!important;font-size:14px;text-align:right}
#toast{left:12px!important;right:12px;bottom:calc(86px + env(safe-area-inset-bottom))!important;text-align:center}

/* الجداول تتحول لبطاقات */
.table-wrap{overflow:visible!important;border:0!important}
.table-wrap table,.table-wrap tbody{display:block;width:100%}
.table-wrap thead{display:none}
.table-wrap tr{display:block;margin:0 0 10px;padding:4px 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.table-wrap td{position:relative;display:block;width:100%!important;padding:7px 0!important;padding-inline-start:38%!important;border:0!important;border-bottom:1px dashed var(--line)!important;text-align:start;overflow-wrap:anywhere}
.table-wrap td:last-child{border-bottom:0!important}
.table-wrap td[data-label]::before{content:attr(data-label);position:absolute;inset-inline-start:0;top:9px;width:34%;color:var(--muted);font-size:12px;font-weight:700}
.table-wrap td[data-label*="جراء"]{padding-inline-start:0!important}
.table-wrap td[data-label*="جراء"]::before{position:static;display:block;width:auto;margin-bottom:6px}
.table-wrap td button,.table-wrap td .file-download{min-height:40px;margin:2px 0}
.table-wrap td.empty{padding-inline-start:0!important;text-align:center}

/* النوافذ كلوحة سفلية */
dialog{width:100vw!important;max-width:100vw!important;max-height:92vh;max-height:92dvh;margin:auto 0 0!important;padding:18px 16px calc(18px + env(safe-area-inset-bottom))!important;border-radius:20px 20px 0 0!important;overflow:auto}
dialog[open]{animation:sheetUp .22s ease-out}
@keyframes sheetUp{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
input,select,textarea{font-size:16px!important}
.form-grid input,.form-grid select{min-height:46px}
.operation-options button{min-height:52px}

/* صفحة الدخول */
.login{min-height:100vh;min-height:100dvh;grid-template-columns:minmax(0,1fr)}
.login-form form{width:100%;max-width:370px}
.login-visual,.login-visual:has(.login-logo){padding:20px 20px 14px!important;text-align:center}
.login-logo img{width:84px!important;height:84px!important}
.login-visual h1,.login-visual:has(.login-logo) h1{font-size:22px!important;margin:10px 0 0!important}
.login-visual p{display:none}
.login-form{padding:20px 18px calc(24px + env(safe-area-inset-bottom))}
}

@media(prefers-reduced-motion:reduce){dialog[open]{animation:none}}
@media print{.bottom-nav,.assistant-launch{display:none!important}}
