.profile-image { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.avatar,.header-avatar,.cell-avatar { overflow:hidden; flex-shrink:0; }
.photo-picker { display:flex; align-items:center; gap:18px; padding:16px; border:1px solid var(--line); border-radius:9px; margin-bottom:23px; }
.photo-preview { display:grid; place-items:center; width:76px; height:76px; flex-shrink:0; border-radius:50%; background:#fff0e3; color:#9c4700; overflow:hidden; font-size:24px; }
.photo-fields { flex:1; min-width:0; }
.photo-fields>label { margin-bottom:7px; }
.photo-fields input[type="file"] { padding:8px; font-size:11px; max-width:100%; }
.photo-fields input::file-selector-button { border:0; border-radius:4px; padding:7px 10px; margin-inline-end:9px; background:#ff7900; color:#24170b; font:inherit; cursor:pointer; }
[data-theme="dark"] .photo-preview { background:#3b291c; color:#ffb673; }
.nav-scrim { position:fixed; inset:0; border:0; border-radius:0; padding:0; background:#0008; backdrop-filter:blur(2px); z-index:25; }
.navigation-open { overflow:hidden; }
.main-shell,main,.card,.card-body,.modal-body { min-width:0; }
.page-header h1,.offer-card h2,.summary-box,.details-grid strong,.log-detail { overflow-wrap:anywhere; }
.sidebar { overflow-y:auto; overscroll-behavior:contain; }
.quick-foot:has(:only-child:empty) { display:none; }

@media(max-width:850px) {
  .sidebar { width:min(280px,85vw); height:100dvh; padding-top:max(24px,env(safe-area-inset-top)); padding-bottom:env(safe-area-inset-bottom); transform:translateX(-100%); transition:transform .2s; }
  .sidebar.open { transform:translateX(0); }
  .main-shell,[dir="rtl"] .main-shell { margin-left:0; margin-right:0; width:100%; }
  [dir="rtl"] .sidebar { transform:translateX(100%); }
  [dir="rtl"] .sidebar.open { transform:translateX(0); }
  .mobile-menu { display:grid; place-items:center; min-width:44px; min-height:44px; padding:8px; margin:0 8px 0 0; border:0; background:none; font-size:20px; }
  .topbar { padding:0 20px; height:68px; position:sticky; top:0; z-index:20; }
  .breadcrumb { margin-inline-end:auto; gap:9px; min-width:0; }
  .breadcrumb strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .topbar-right { gap:10px; flex-shrink:0; }
  .topbar .language-switch>span { display:none; }
  .topbar .language-switch select { min-height:40px; }
  .nav-item { min-height:44px; font-size:13px; }
  .sidebar-bottom { padding-top:24px; }
  .profile strong { font-size:12px; }
  [dir="rtl"] .mobile-menu { margin-right:0; margin-left:8px; }
  .modal { max-height:calc(100dvh - 24px); }
}

@media(max-width:620px) {
  body { font-size:14px; }
  .topbar { height:64px; padding:0 12px; gap:0; }
  .breadcrumb { font-size:11px; }
  .breadcrumb>span,.breadcrumb:not(:has(strong)) { display:none; }
  .topbar .mode-pill { display:none; }
  .topbar .header-avatar { width:32px; height:32px; }
  .topbar .language-switch select { font-size:12px; max-width:90px; }
  main { padding:23px 16px 16px; min-height:calc(100dvh - 125px); }
  .page-header { flex-direction:column; gap:15px; align-items:stretch; }
  .page-header h1 { font-size:26px; }
  .page-header p { font-size:12px; }
  .page-header .buttons { justify-content:flex-start; }
  .button,.page-header .button { min-height:44px; padding:11px 15px; font-size:12px; }
  .cell-action { min-height:44px; padding:10px 12px; font-size:12px; }
  input,select,textarea,.login-form input { min-height:46px; font-size:16px; }
  .search input { min-height:24px; font-size:16px; }
  .search { max-width:none; width:100%; padding:10px 12px; margin:0; }
  .table-toolbar { flex-direction:column; align-items:stretch; gap:12px; padding:17px; }
  .table-toolbar h2 { font-size:15px; }
  .table-toolbar .ghost { align-self:flex-start; }
  .table-wrap { overflow:visible; padding:0 12px 12px; }
  .table-wrap table,.table-wrap tbody { display:block; width:100%; white-space:normal; }
  .table-wrap thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .table-wrap tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 14px; padding:14px; margin-top:12px; border:1px solid var(--line); border-radius:9px; }
  .table-wrap tbody tr[hidden] { display:none!important; }
  .table-wrap td { display:block; min-width:0; padding:10px 0; border:0; font-size:13px; overflow-wrap:anywhere; white-space:normal; }
  .table-wrap td::before { content:attr(data-label); display:block; font-size:10px; color:var(--muted); margin-bottom:6px; }
  .table-wrap td:first-child { grid-column:1/-1; padding-top:0; padding-bottom:14px; border-bottom:1px solid var(--line); margin-bottom:4px; }
  .table-wrap td:first-child::before { display:none; }
  .table-wrap .cell-user strong { font-size:14px; }
  .table-wrap .cell-user small { font-size:11px; margin-top:5px; }
  .cell-avatar { width:42px; height:42px; border-radius:50%; }
  .table-wrap td.table-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; grid-column:1/-1; border-top:1px solid var(--line); margin-top:5px; padding:8px 0 0; }
  .table-wrap td.table-actions::before { display:none; }
  .table-wrap .log-detail { grid-column:1/-1; max-width:none; min-width:0; }
  .table-wrap .small-note { font-size:11px; }
  .table-footer { gap:10px; flex-wrap:wrap; font-size:10px; }
  .badge { font-size:11px; padding:5px 8px; }
  .stat-card { padding:15px; }
  .stat-top { font-size:11px; gap:6px; }
  .stat-value { font-size:clamp(20px,6vw,27px); overflow-wrap:anywhere; }
  .stat-bottom { font-size:10px; line-height:1.6; flex-wrap:wrap; }
  .card-header p,.small-note,.field-hint,.offer-note { font-size:12px; line-height:1.75; }
  .offer-duration,.offer-tag { font-size:11px; }
  .allocation-row { font-size:13px; gap:12px; }
  .form-row { grid-template-columns:1fr; gap:0; }
  .modal-backdrop { padding:10px; padding-bottom:max(10px,env(safe-area-inset-bottom)); }
  .modal { max-height:calc(100dvh - 20px); width:100%; border-radius:12px; }
  .modal-header { padding:19px; position:sticky; top:0; background:var(--white); z-index:1; }
  .modal-header h2 { font-size:20px; }
  .close { min-width:40px; min-height:40px; }
  .modal-body { padding:19px; }
  .modal-actions { flex-wrap:wrap; gap:10px; }
  .modal-actions>.button { flex:1; white-space:normal; }
  .photo-picker { align-items:flex-start; gap:12px; padding:12px; }
  .photo-preview { width:60px; height:60px; }
  .photo-fields input[type="file"] { font-size:12px; min-height:44px; padding:5px; }
  .filter-buttons { gap:7px; }
  .filter-buttons button { min-height:40px; font-size:11px; }
  .appearance-options { gap:10px; }
  .appearance-option { padding:11px; }
  .summary-line { gap:12px; flex-wrap:wrap; }
  .cih-amount strong { font-size:27px; }
  .cih-copy .cih-note { font-size:12px; }
  .cih-amount small { font-size:11px; line-height:1.6; }
  .app-footer { padding:18px 16px calc(18px + env(safe-area-inset-bottom)); gap:12px; }
}
@media(max-width:360px) {
  .breadcrumb { max-width:100px; }
  .breadcrumb { font-size:10px; }
  .topbar .language-switch select { max-width:78px; }
  .stat-icon { display:none; }
  .photo-picker { flex-direction:column; }
}
