/* DEMD Global — estilos exclusivos para teléfonos. */
.global-mobile-nav{display:none}

@media (max-width:760px){
  :root{--global-mobile-nav:66px;--global-mobile-gap:14px}
  html{scroll-padding-bottom:calc(var(--global-mobile-nav) + 16px)}
  body:not(.login-page):not(.auth-page){padding-bottom:calc(var(--global-mobile-nav) + env(safe-area-inset-bottom))}
  body.global-modal-open{overflow:hidden}

  .main-header{position:sticky;top:0;z-index:700;min-height:58px;padding:9px var(--global-mobile-gap);gap:8px;overflow:visible;background:rgba(255,255,255,.96);backdrop-filter:blur(14px)}
  body.dark .main-header{background:rgba(20,33,55,.96)}
  .main-header .left{display:flex;min-width:0;flex:1}
  .main-header .logo-img{width:36px;height:36px}
  .main-header .brand{display:inline;font-size:14px}
  .main-header .center-nav{display:none}
  .main-header .right{display:flex;min-width:0;gap:5px}
  .main-header .user-name{display:none}
  .main-header .theme-btn,.main-header .config-btn,.main-header .logout-btn{height:36px;min-width:36px;padding:0 9px}
  .main-header .logout-btn{font-size:0}
  .main-header .logout-btn::before{content:"↪";font-size:18px}

  .app{min-height:calc(100dvh - 58px)}
  .container{width:calc(100% - 28px);padding:24px 0 36px}
  .container>h2{font-size:24px}
  .container>h2+p{margin-top:4px}
  .header-row{align-items:flex-start;gap:12px;margin-bottom:18px}
  .header-row h1,.header-row h2{font-size:24px}
  .header-row .btn{flex:0 0 auto;width:auto;min-height:40px;padding-inline:12px;font-size:12px}

  .card,.settings-card{padding:17px!important;border-radius:16px!important}
  .biz-grid,.biz-list{grid-template-columns:1fr!important;gap:12px!important}
  .biz-card,.biz-item{min-height:auto!important}
  .biz-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
  .biz-actions>a:first-child{grid-column:1/-1}
  .biz-actions form,.biz-actions form button{width:100%}
  .settings-actions{display:grid!important;grid-template-columns:1fr!important}
  .settings-actions>*{width:100%;text-align:center}

  main.container>form,.sale-form,#actionFormArea{width:100%;max-width:none;margin:18px 0 24px;padding:17px;border-radius:16px}
  input,select,textarea{min-height:48px;font-size:16px!important}
  textarea{min-height:100px}
  form button[type="submit"]{min-height:46px}
  .action-row{display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important}
  .action-row .btn{width:100%;min-width:0;font-size:12px}
  #actionFormArea{max-width:none!important}
  #actionFormArea input[style]{width:100%!important}

  .report-cards{grid-template-columns:1fr;gap:12px}
  .report-cards .card{min-height:120px}

  .table{display:block;width:100%;margin:18px 0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;white-space:normal}
  .table thead{display:none}
  .table tbody{display:block;width:100%}
  .table tr{display:block;width:100%;margin-bottom:12px;padding:13px 14px;border:1px solid var(--border);border-radius:14px;background:var(--card);box-shadow:var(--shadow-sm)}
  .table td{display:grid;grid-template-columns:minmax(90px,36%) 1fr;gap:10px;width:100%;padding:8px 0;border:0;border-bottom:1px dashed var(--border);text-align:right;overflow-wrap:anywhere}
  .table td:last-child{border-bottom:0}
  .table td::before{content:attr(data-mobile-label);color:var(--muted);font-size:11px;font-weight:800;text-align:left;text-transform:uppercase;letter-spacing:.03em}
  .table td[colspan]{display:block;text-align:center;color:var(--muted)}
  .table td[colspan]::before{display:none}
  .table td .btn{width:100%}

  .calendar{width:100%;max-width:none!important;padding:12px!important;overflow-x:auto}
  .calendar .day{margin:1px!important}

  .modal-content,.modal-backdrop>.modal{
    position:fixed!important;inset:auto 0 0!important;width:100%!important;max-width:none!important;max-height:90dvh;
    margin:0!important;padding:22px 16px calc(20px + env(safe-area-inset-bottom))!important;
    border-radius:22px 22px 0 0!important;overflow-y:auto;animation:global-sheet-in .22s ease-out;
  }
  .modal-backdrop{align-items:flex-end!important;padding:0!important}
  .modal-actions,.modal .actions{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .modal-actions>*,.modal .actions>*{width:100%}
  @keyframes global-sheet-in{from{transform:translateY(35%);opacity:.5}to{transform:translateY(0);opacity:1}}

  .global-mobile-nav{position:fixed;z-index:900;display:grid;grid-template-columns:repeat(3,1fr);left:0;right:0;bottom:0;height:calc(var(--global-mobile-nav) + env(safe-area-inset-bottom));padding:7px 8px env(safe-area-inset-bottom);border-top:1px solid rgba(207,218,232,.9);background:rgba(255,255,255,.97);box-shadow:0 -8px 28px rgba(16,35,63,.11);backdrop-filter:blur(16px)}
  body.dark .global-mobile-nav{background:rgba(20,33,55,.97);border-color:var(--border)}
  .global-mobile-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:11px;color:var(--muted);font-size:10px;font-weight:750;text-decoration:none}
  .global-mobile-nav a span:first-child{font-size:19px;line-height:1}
  .global-mobile-nav a.active{background:var(--accent-soft);color:var(--accent)}
  .global-mobile-nav a:active{transform:scale(.96)}

  .login-page,.auth-page{padding:65px 16px 20px}
  .login-page::before,.auth-page::before{top:20px;left:22px}
  .login-page>main.card,.auth-page>main.card{width:100%;padding:27px 21px!important;border-radius:20px!important}
}

@media (max-width:370px){
  .action-row{grid-template-columns:1fr}
  .header-row{flex-direction:column}
  .header-row .btn{width:100%}
}
