/* LEAN V11.19.66 ? Foundation, legacy base and primary layouts. Cascade order: 01/04. */
:root{
      --bg:#080b10;
      --panel:#10151e;
      --panel2:#151c27;
      --line:#263041;
      --text:#eef3fb;
      --muted:#8793a6;
      --gold:#e5b74d;
      --green:#18c784;
      --green-soft:rgba(24,199,132,.16);
      --red:#ff5d67;
      --red-soft:rgba(255,93,103,.15);
      --blue:#5aa8ff;
      --shadow:0 18px 50px rgba(0,0,0,.35);
      --radius:16px;
    }

    *{box-sizing:border-box}
    html,body{height:100%;margin:0}
    body{
      font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;
      background:
        radial-gradient(circle at 20% -10%, rgba(229,183,77,.10), transparent 30%),
        radial-gradient(circle at 100% 0%, rgba(90,168,255,.08), transparent 30%),
        var(--bg);
      color:var(--text);
      overflow:hidden;
    }

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

    .app{
      height:100%;
      display:grid;
      grid-template-rows:auto auto 1fr;
      gap:10px;
      padding:12px;
    }

    .topbar{
      min-height:64px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding:10px 14px;
      background:rgba(16,21,30,.88);
      border:1px solid var(--line);
      border-radius:var(--radius);
      box-shadow:var(--shadow);
      backdrop-filter:blur(14px);
    }

    .brand{display:flex;align-items:center;gap:12px;min-width:0}
    .logo{
      width:42px;height:42px;border-radius:12px;
      display:grid;place-items:center;
      font-weight:900;color:#181105;
      background:linear-gradient(135deg,#ffe196,#b98017);
      box-shadow:0 0 24px rgba(229,183,77,.25);
      flex:0 0 auto;
    }
    .brand h1{font-size:17px;margin:0;letter-spacing:.5px}
    .brand p{font-size:12px;margin:4px 0 0;color:var(--muted)}

    .toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
    .btn{
      border:1px solid var(--line);
      background:var(--panel2);
      color:var(--text);
      min-height:38px;
      padding:8px 12px;
      border-radius:10px;
      font-weight:700;
      transition:.2s ease;
    }
    .btn:hover{transform:translateY(-1px);border-color:#3a4960}
    .btn.gold{background:linear-gradient(135deg,#e9bf5c,#a86f10);color:#160f03;border:none}
    .btn.danger{color:#ffd5d8;border-color:rgba(255,93,103,.35)}
    .btn.icon{width:40px;padding:0;display:grid;place-items:center;font-size:18px}

    .stats{
      display:grid;
      grid-template-columns:repeat(8,minmax(115px,1fr));
      gap:8px;
    }
    .stat{
      background:rgba(16,21,30,.9);
      border:1px solid var(--line);
      border-radius:13px;
      padding:10px 12px;
      min-width:0;
    }
    .stat .label{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.7px}
    .stat .value{font-size:19px;font-weight:900;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .positive{color:var(--green)!important}
    .negative{color:var(--red)!important}
    .neutral{color:var(--text)!important}

    .calendar-shell{
      min-height:0;
      background:rgba(16,21,30,.90);
      border:1px solid var(--line);
      border-radius:var(--radius);
      overflow:hidden;
      display:grid;
      grid-template-rows:auto auto 1fr;
      box-shadow:var(--shadow);
    }

    .calendar-head{
      display:grid;
      grid-template-columns:1fr auto 1fr;
      align-items:center;
      padding:10px 12px;
      border-bottom:1px solid var(--line);
      gap:8px;
    }
    .month-title{text-align:center;font-size:20px;font-weight:900;letter-spacing:.4px}
    .head-left,.head-right{display:flex;gap:8px;align-items:center}
    .head-right{justify-content:flex-end}
    .jump{
      border:1px solid var(--line);
      background:var(--panel2);
      color:var(--text);
      border-radius:10px;
      padding:8px 10px;
      outline:none;
    }

    .weekdays{
      display:grid;
      grid-template-columns:repeat(7,1fr);
      border-bottom:1px solid var(--line);
      background:#0d121a;
    }
    .weekday{
      text-align:center;
      padding:8px 4px;
      font-size:12px;
      font-weight:800;
      color:var(--muted);
      border-right:1px solid rgba(38,48,65,.65);
    }
    .weekday:last-child{border-right:none}
    .weekday.sun{color:#ff9da4}

    .calendar-grid{
      min-height:0;
      display:grid;
      grid-template-columns:repeat(7,1fr);
      grid-template-rows:repeat(6,minmax(75px,1fr));
    }

    .day{
      position:relative;
      border-right:1px solid rgba(38,48,65,.75);
      border-bottom:1px solid rgba(38,48,65,.75);
      padding:7px;
      overflow:hidden;
      background:rgba(15,20,28,.62);
      transition:.15s ease;
      cursor:pointer;
    }
    .day:nth-child(7n){border-right:none}
    .day:nth-last-child(-n+7){border-bottom:none}
    .day:hover{background:#18202c}
    .day.other{opacity:.34}
    .day.today{box-shadow:inset 0 0 0 2px var(--gold)}
    .day.profit{background:linear-gradient(135deg,var(--green-soft),rgba(15,20,28,.72))}
    .day.loss{background:linear-gradient(135deg,var(--red-soft),rgba(15,20,28,.72))}
    .day.flat{background:linear-gradient(135deg,rgba(90,168,255,.10),rgba(15,20,28,.72))}

    .day-top{display:flex;align-items:center;justify-content:space-between;gap:5px}
    .day-number{font-size:13px;font-weight:900}
    .order-count{
      font-size:10px;color:var(--muted);
      background:rgba(255,255,255,.05);
      border:1px solid var(--line);
      border-radius:99px;padding:2px 6px;
    }
    .pnl{
      margin-top:7px;
      font-size:15px;
      font-weight:950;
      letter-spacing:.2px;
    }
    .note-preview{
      margin-top:5px;
      font-size:10px;
      color:#b6c0cf;
      line-height:1.25;
      display:-webkit-box;
      -webkit-line-clamp:2;
      -webkit-box-orient:vertical;
      overflow:hidden;
    }
    .trade-mini{
      margin-top:5px;
      font-size:10px;
      color:var(--muted);
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .modal{
      position:fixed;inset:0;
      background:rgba(0,0,0,.68);
      display:none;
      align-items:center;
      justify-content:center;
      padding:14px;
      z-index:30;
      backdrop-filter:blur(8px);
    }
    .modal.show{display:flex}
    .dialog{
      width:min(760px,100%);
      max-height:94vh;
      overflow:auto;
      background:#101620;
      border:1px solid #334158;
      border-radius:18px;
      box-shadow:0 30px 90px rgba(0,0,0,.65);
    }
    .dialog-head{
      position:sticky;top:0;z-index:2;
      display:flex;align-items:center;justify-content:space-between;gap:10px;
      padding:14px 16px;
      background:rgba(16,22,32,.96);
      border-bottom:1px solid var(--line);
      backdrop-filter:blur(10px);
    }
    .dialog-head h2{margin:0;font-size:18px}
    .dialog-body{padding:15px}
    .form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
    .field{display:flex;flex-direction:column;gap:6px}
    .field.full{grid-column:1/-1}
    label{font-size:12px;font-weight:800;color:#bdc7d5}
    input,select,textarea{
      width:100%;
      color:var(--text);
      background:#0b1017;
      border:1px solid var(--line);
      border-radius:10px;
      padding:10px 11px;
      outline:none;
    }
    input:focus,select:focus,textarea:focus{border-color:var(--gold)}
    textarea{min-height:88px;resize:vertical}
    .hint{font-size:11px;color:var(--muted)}
    .calc-box{
      grid-column:1/-1;
      display:grid;
      grid-template-columns:repeat(4,1fr);
      gap:8px;
      padding:11px;
      background:linear-gradient(135deg,rgba(229,183,77,.09),rgba(90,168,255,.05));
      border:1px solid rgba(229,183,77,.25);
      border-radius:12px;
    }
    .calc-item{min-width:0}
    .calc-item small{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.5px}
    .calc-item strong{display:block;margin-top:5px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .dialog-actions{
      display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;
      margin-top:16px;padding-top:14px;border-top:1px solid var(--line);
    }
    .action-group{display:flex;gap:8px;flex-wrap:wrap}

    .table-wrap{overflow:auto;margin-top:12px;border:1px solid var(--line);border-radius:12px}
    table{width:100%;border-collapse:collapse;min-width:620px}
    th,td{padding:10px;border-bottom:1px solid var(--line);text-align:left;font-size:12px}
    th{background:#0d121a;color:var(--muted);position:sticky;top:0}
    tr:last-child td{border-bottom:none}
    .empty{text-align:center;color:var(--muted);padding:22px}

    .toast{
      position:fixed;right:18px;bottom:18px;z-index:50;
      background:#172130;color:#fff;border:1px solid #3a4a63;
      padding:11px 14px;border-radius:10px;
      opacity:0;transform:translateY(15px);pointer-events:none;
      transition:.25s;
    }
    .toast.show{opacity:1;transform:translateY(0)}

    .cloud-status{
      display:flex;align-items:center;gap:7px;
      min-height:38px;padding:7px 10px;border-radius:10px;
      border:1px solid var(--line);background:var(--panel2);
      font-size:12px;font-weight:800;color:var(--muted)
    }
    .cloud-dot{width:8px;height:8px;border-radius:50%;background:var(--red);box-shadow:0 0 10px currentColor}
    .cloud-status.online{color:var(--green)}
    .cloud-status.online .cloud-dot{background:var(--green)}
    .auth-note{padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#0b1017;color:var(--muted);font-size:12px;line-height:1.5}
    .sync-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}

    /* ===== V3 DASHBOARD APP — module riêng, không sửa logic V2 ===== */
    .app{grid-template-rows:auto 1fr;padding-bottom:78px}
    .stats{display:none}
    .calendar-shell{display:none}
    .topbar{position:sticky;top:8px;z-index:15}
    .v3-main{min-height:0;overflow:auto;padding-bottom:10px}
    .v3-view{display:none;animation:v3fade .18s ease}
    .v3-view.active{display:block}
    @keyframes v3fade{from{opacity:.4;transform:translateY(4px)}to{opacity:1;transform:none}}
    .v3-section-head{
      display:flex;align-items:center;justify-content:space-between;gap:10px;
      margin:2px 2px 10px
    }
    .v3-section-head h2{font-size:18px;margin:0}
    .v3-section-head p{font-size:11px;color:var(--muted);margin:4px 0 0}
    .v3-filter{
      background:var(--panel2);border:1px solid var(--line);color:var(--text);
      border-radius:10px;padding:8px 10px;font-weight:700
    }
    .dashboard-grid{
      display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px
    }
    .metric-card{
      position:relative;min-height:108px;padding:14px;border-radius:15px;
      background:linear-gradient(145deg,rgba(21,28,39,.98),rgba(12,17,25,.98));
      border:1px solid var(--line);overflow:hidden
    }
    .metric-card::after{
      content:"";position:absolute;width:80px;height:80px;border-radius:50%;
      right:-32px;top:-35px;background:rgba(229,183,77,.07)
    }
    .metric-card .m-label{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.6px}
    .metric-card .m-value{font-size:24px;font-weight:950;margin-top:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .metric-card .m-sub{font-size:11px;color:var(--muted);margin-top:7px}
    .dashboard-panels{
      display:grid;grid-template-columns:minmax(0,1.65fr) minmax(280px,.75fr);gap:10px;margin-top:10px
    }
    .panel-card{
      background:rgba(16,21,30,.94);border:1px solid var(--line);border-radius:15px;
      padding:13px;min-width:0
    }
    .panel-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
    .panel-title h3{margin:0;font-size:14px}
    .panel-title span{font-size:10px;color:var(--muted)}
    .chart-wrap{height:245px;position:relative}
    .chart-wrap canvas{width:100%;height:100%}
    .risk-bar{height:10px;background:#090d13;border:1px solid var(--line);border-radius:99px;overflow:hidden;margin-top:8px}
    .risk-fill{height:100%;width:0;background:linear-gradient(90deg,var(--green),var(--gold),var(--red));border-radius:99px;transition:.3s}
    .mini-list{display:flex;flex-direction:column;gap:7px}
    .mini-row{
      display:flex;align-items:center;justify-content:space-between;gap:8px;
      padding:9px 10px;background:#0c1119;border:1px solid var(--line);border-radius:10px;
      font-size:12px
    }
    .mini-row small{color:var(--muted)}
    .v3-calendar-wrap{
      min-height:760px;background:rgba(16,21,30,.94);border:1px solid var(--line);
      border-radius:16px;overflow:hidden
    }
    .v3-calendar-wrap .calendar-shell{display:grid;height:100%;border:0;border-radius:0;box-shadow:none}
    .trade-list-card{
      background:rgba(16,21,30,.94);border:1px solid var(--line);border-radius:16px;overflow:hidden
    }
    .trade-list-toolbar{display:flex;gap:8px;padding:12px;border-bottom:1px solid var(--line);flex-wrap:wrap}
    .trade-list-toolbar input,.trade-list-toolbar select{width:auto;min-width:150px}
    .trade-table-scroll{overflow:auto;max-height:calc(100vh - 250px)}
    .trade-table-scroll table{min-width:780px}
    .badge{
      display:inline-flex;align-items:center;padding:3px 7px;border-radius:99px;
      border:1px solid var(--line);font-size:10px;font-weight:900
    }
    .badge.buy{color:var(--green);background:var(--green-soft)}
    .badge.sell{color:var(--red);background:var(--red-soft)}
    .analytics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    .setup-bars{display:flex;flex-direction:column;gap:9px}
    .setup-line{display:grid;grid-template-columns:90px 1fr 60px;align-items:center;gap:8px;font-size:11px}
    .setup-track{height:8px;background:#090d13;border-radius:99px;overflow:hidden}
    .setup-fill{height:100%;background:linear-gradient(90deg,var(--gold),#fff0b0);border-radius:99px}
    .settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    .setting-card{background:rgba(16,21,30,.94);border:1px solid var(--line);border-radius:15px;padding:14px}
    .setting-card h3{font-size:14px;margin:0 0 12px}
    .bottom-nav{
      position:fixed;left:50%;bottom:10px;transform:translateX(-50%);
      width:min(680px,calc(100% - 16px));height:62px;z-index:25;
      display:grid;grid-template-columns:repeat(5,1fr);
      background:rgba(13,18,26,.95);border:1px solid #303c51;border-radius:18px;
      box-shadow:0 18px 55px rgba(0,0,0,.5);backdrop-filter:blur(18px);padding:5px
    }
    .nav-item{
      border:0;background:transparent;color:var(--muted);border-radius:13px;
      display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
      font-size:10px;font-weight:800
    }
    .nav-item b{font-size:18px;line-height:1}
    .nav-item.active{background:rgba(229,183,77,.13);color:var(--gold)}
    
    .fab{
      position:fixed;right:18px;bottom:86px;z-index:24;width:52px;height:52px;border-radius:50%;
      border:0;background:linear-gradient(135deg,#f4cf70,#a66a0b);color:#160e02;
      font-size:27px;font-weight:900;box-shadow:0 12px 30px rgba(229,183,77,.28)
    }
    @media(max-width:1100px){
      .dashboard-grid{grid-template-columns:repeat(2,1fr)}
      .dashboard-panels{grid-template-columns:1fr}
    }
    @media(max-width:700px){
      .app{padding-bottom:76px}
      .topbar{position:relative;top:0}
      .cloud-status{display:none}
      .dashboard-grid{grid-template-columns:repeat(2,1fr);gap:7px}
      .metric-card{min-height:92px;padding:11px}
      .metric-card .m-value{font-size:19px}
      .dashboard-panels{gap:7px;margin-top:7px}
      .chart-wrap{height:210px}
      .analytics-grid,.settings-grid{grid-template-columns:1fr}
      .v3-calendar-wrap{min-height:760px}
      .bottom-nav{bottom:7px}
      .fab{right:13px;bottom:80px}
      .brand h1{font-size:13px}
      .topbar .toolbar .btn:not(#btnAccount){display:none}
    }

    .hidden{display:none!important}

    @media (max-width:1250px){
      .stats{grid-template-columns:repeat(4,1fr)}
      .brand p{display:none}
    }
    @media (max-width:1000px){
      .stats{grid-template-columns:repeat(3,1fr)}
      .brand p{display:none}
    }

    @media (max-width:700px){
      body{overflow:auto}
      .app{height:auto;min-height:100%;padding:7px;gap:7px}
      .topbar{align-items:flex-start;padding:9px}
      .brand h1{font-size:14px}
      .logo{width:36px;height:36px}
      .toolbar .btn span{display:none}
      .toolbar{gap:5px}
      .btn{min-height:35px;padding:7px 9px}
      .stats{grid-template-columns:repeat(2,1fr);gap:6px}
      .stat{padding:8px}
      .stat .value{font-size:16px}
      .calendar-shell{min-height:720px}
      .calendar-head{grid-template-columns:auto 1fr auto}
      .head-left .btn.gold{display:none}
      .month-title{font-size:16px}
      .jump{display:none}
      .weekdays .weekday{font-size:10px;padding:7px 1px}
      .calendar-grid{grid-template-rows:repeat(6,minmax(105px,1fr))}
      .day{padding:5px}
      .pnl{font-size:12px}
      .note-preview{font-size:9px}
      .form-grid{grid-template-columns:1fr}
      .field.full{grid-column:auto}
      .calc-box{grid-template-columns:repeat(2,1fr)}
      .dialog{max-height:96vh}
    }
  
    


    


    /* ===== V4.5 CLEAN CONSOLIDATED LAYOUT ===== */
    html,body{
      width:100%;
      height:100%;
      margin:0;
      overflow:hidden;
    }
    body{
      min-height:100dvh;
      font-size:14px;
    }

    .app{
      width:100%;
      height:100dvh;
      min-height:0;
      display:grid;
      grid-template-rows:58px minmax(0,1fr);
      gap:8px;
      padding:8px 8px 74px;
      overflow:hidden;
    }

    .topbar{
      position:relative;
      top:auto;
      height:58px;
      min-height:58px;
      padding:7px 11px;
      border-radius:14px;
      overflow:hidden;
    }

    .brand{gap:9px;min-width:0}
    .logo.logo-image{
      width:36px;
      height:36px;
      flex:0 0 36px;
      padding:3px;
      border-radius:10px;
      background:#0c1118;
      border:1px solid rgba(229,183,77,.34);
      overflow:hidden;
    }
    .logo.logo-image img{
      width:100%;
      height:100%;
      object-fit:contain;
      display:block;
    }
    .brand-copy{min-width:0}
    
    .brand-copy h1{
      position:absolute;
      width:1px;height:1px;
      overflow:hidden;
      clip:rect(0,0,0,0);
      white-space:nowrap;
    }
    .brand-copy p{
      margin:1px 0 0 2px;
      font-size:10px;
    }

    .toolbar{flex-wrap:nowrap;gap:6px}
    .cloud-status{
      height:34px;
      min-height:34px;
      padding:6px 9px;
      font-size:11px;
    }
    .topbar .toolbar .btn{
      width:36px;
      height:34px;
      min-height:34px;
      padding:0;
      display:grid;
      place-items:center;
      border-radius:9px;
      font-size:0;
    }
    #btnAccount::before{content:none!important}
    #btnStats::before{content:"▥";font-size:16px}
    #btnExport::before{content:"↓";font-size:18px}
    #btnImport::before{content:"↑";font-size:18px}
    #btnAccount span,#btnStats span,#btnExport span,#btnImport span{display:none!important}

    .stats,.calendar-shell{display:none}
    .v3-main{
      width:100%;
      height:100%;
      min-width:0;
      min-height:0;
      overflow:hidden;
      padding:0;
    }
    .v3-view{
      display:none;
      width:100%;
      height:100%;
      min-width:0;
      min-height:0;
      overflow:hidden;
    }
    .v3-view.active{display:grid}

    .v3-section-head{
      height:42px;
      min-height:42px;
      margin:0;
      padding:0 2px;
    }
    .v3-section-head h2{margin:0;font-size:17px;line-height:1.15}
    .v3-section-head p{margin:3px 0 0;font-size:10px}
    .v3-filter{height:34px;min-height:34px;padding:5px 10px;font-size:12px}

    [data-view="dashboard"].active{
      grid-template-rows:42px auto minmax(0,1fr);
      gap:7px;
    }
    .dashboard-grid{
      display:grid;
      grid-template-columns:repeat(4,minmax(0,1fr));
      gap:7px;
    }
    .metric-card{
      height:78px;
      min-height:78px;
      padding:10px 12px;
      border-radius:13px;
    }
    .metric-card .m-label{font-size:10px}
    .metric-card .m-value{font-size:20px;margin-top:5px}
    .metric-card .m-sub{font-size:10px;margin-top:4px}

    .dashboard-panels{
      display:grid;
      grid-template-columns:minmax(0,1.7fr) minmax(270px,.65fr);
      gap:7px;
      min-width:0;
      min-height:0;
      overflow:hidden;
    }
    .dashboard-panels .panel-card{
      min-width:0;
      min-height:0;
      height:100%;
      padding:10px;
      border-radius:13px;
      overflow:hidden;
    }
    .dashboard-panels .panel-card:first-child{
      display:grid;
      grid-template-rows:24px minmax(0,1fr);
    }
    .panel-title{margin:0;min-height:24px}
    .panel-title h3{font-size:13px}
    .panel-title span{font-size:10px}
    .chart-wrap{
      width:100%;
      height:100%;
      min-width:0;
      min-height:0;
      overflow:hidden;
      position:relative;
    }
    .chart-wrap canvas{
      display:block;
      width:100%!important;
      height:100%!important;
    }
    .mini-list{gap:6px}
    .mini-row{padding:7px 9px;font-size:11px;border-radius:8px}

    [data-view="calendar"].active,
    [data-view="trades"].active,
    [data-view="analytics"].active,
    [data-view="settings"].active{
      grid-template-rows:42px minmax(0,1fr);
      gap:7px;
    }

    .v3-calendar-wrap{
      width:100%;
      height:100%;
      min-width:0;
      min-height:0;
      overflow:hidden;
      border-radius:13px;
    }
    .v3-calendar-wrap .calendar-shell{
      display:grid;
      width:100%;
      height:100%;
      min-width:0;
      min-height:0;
      grid-template-rows:46px 30px minmax(0,1fr);
      border:0;
      border-radius:0;
      overflow:hidden;
    }
    .calendar-head{
      grid-template-columns:minmax(110px,1fr) auto minmax(110px,1fr);
      padding:6px 10px;
      column-gap:8px;
    }
    .weekdays,.calendar-grid{
      width:100%;
      min-width:0;
      grid-template-columns:repeat(7,minmax(0,1fr))!important;
    }
    .calendar-grid{
      min-height:0;
      grid-template-rows:repeat(6,minmax(0,1fr));
      overflow:hidden;
    }
    .day{min-width:0;padding:5px}
    .weekday{font-size:11px}
    .day-number{font-size:12px}
    .pnl{font-size:13px;margin-top:4px}
    .trade-mini,.note-preview{font-size:9px}

    .trade-list-card{
      min-height:0;
      display:grid;
      grid-template-rows:auto minmax(0,1fr);
      overflow:hidden;
    }
    .trade-table-scroll{
      min-height:0;
      max-height:none;
      overflow:auto;
    }
    th,td{font-size:11px;padding:7px 8px}

    .analytics-grid{
      min-height:0;
      overflow:auto;
      gap:7px;
      padding-right:2px;
    }

    [data-view="settings"] .settings-grid{
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      grid-auto-rows:min-content;
      align-content:start;
      gap:8px;
      min-height:0;
      overflow:auto;
    }
    [data-view="settings"] .setting-card{
      min-height:0;
      padding:12px 14px;
      display:grid;
      grid-template-columns:minmax(0,1fr) auto;
      grid-template-areas:"title action" "desc action";
      gap:3px 12px;
      align-items:center;
    }
    [data-view="settings"] .setting-card h3{grid-area:title;margin:0;font-size:14px}
    [data-view="settings"] .setting-card p{grid-area:desc;margin:0;font-size:11px}
    [data-view="settings"] .setting-card .btn{
      grid-area:action;
      min-width:118px;
      height:36px;
    }

    .bottom-nav{
      position:fixed;
      left:50%;
      bottom:7px;
      transform:translateX(-50%);
      width:min(620px,calc(100% - 16px));
      height:56px;
      z-index:50;
      padding:4px;
      border-radius:16px;
    }
    .nav-item{font-size:9px}
    .nav-item b{font-size:16px}

    .fab{
      width:auto;
      min-width:112px;
      height:42px;
      right:14px;
      bottom:71px;
      padding:0 13px 0 9px;
      border-radius:13px;
      display:flex;
      align-items:center;
      justify-content:center;
      gap:7px;
      font-size:0;
      z-index:45;
    }
    .fab-icon{
      width:25px;height:25px;
      display:grid;place-items:center;
      font-size:16px;
      border-radius:8px;
      background:rgba(19,14,6,.12);
    }
    .fab-label{font-size:12px;font-weight:900}
    .fab.hidden-by-view{display:none!important}

    #dayDetailModal,
    #entryModal,
    #authModal,
    #statsModal{z-index:120!important}
    body.modal-open .bottom-nav,
    body.modal-open .fab{
      visibility:hidden!important;
      pointer-events:none!important;
    }

    .day-detail-dialog{
      width:min(720px,100%);
      overflow:hidden;
    }
    .day-detail-summary{
      display:grid;
      grid-template-columns:repeat(4,minmax(0,1fr));
      gap:8px;
    }
    .detail-card{
      min-width:0;
      padding:11px 12px;
      border:1px solid var(--line);
      border-radius:12px;
      background:linear-gradient(145deg,#0c1119,#111823);
    }
    .detail-card span{
      display:block;
      color:var(--muted);
      font-size:10px;
      text-transform:uppercase;
      letter-spacing:.55px;
    }
    .detail-card strong{
      display:block;
      margin-top:6px;
      font-size:16px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    .detail-note-box{
      margin-top:10px;
      padding:12px;
      border:1px solid var(--line);
      border-radius:12px;
      background:#0b1017;
    }

    @media(max-width:900px){
      .dashboard-panels{
        grid-template-columns:minmax(0,1.45fr) minmax(230px,.6fr);
      }
      [data-view="settings"] .settings-grid{grid-template-columns:1fr}
    }

    @media(max-width:760px){
      body{font-size:12px}
      .app{
        grid-template-rows:46px minmax(0,1fr);
        gap:4px;
        padding:4px 4px 62px;
      }
      .topbar{
        height:46px;
        min-height:46px;
        padding:4px 6px;
        border-radius:12px;
      }
      .brand{gap:7px}
      .logo.logo-image{
        width:28px;height:28px;
        flex:0 0 28px;
        border-radius:8px;
        padding:2px;
      }
      
      .brand-copy p{display:none}
      .cloud-status{display:none}
      .topbar .toolbar .btn{
        width:30px;height:30px;min-height:30px;border-radius:8px;
      }

      .v3-main{padding-top:2px}
      .v3-section-head{
        height:38px;
        min-height:38px;
        padding:2px 1px 0;
      }
      .v3-section-head h2{font-size:13px;line-height:1.05}
      .v3-section-head p{font-size:9px;line-height:1.1;margin-top:2px}
      .v3-filter{height:30px;min-height:30px;font-size:11px;padding:4px 8px}

      [data-view="dashboard"].active{
        grid-template-rows:38px auto minmax(0,1fr);
        gap:5px;
      }
      .dashboard-grid{
        grid-template-columns:repeat(2,1fr);
        gap:4px;
      }
      .metric-card{
        height:60px;
        min-height:60px;
        padding:6px 7px;
        border-radius:10px;
      }
      .metric-card .m-label{font-size:8px}
      .metric-card .m-value{font-size:14px;margin-top:3px}
      .metric-card .m-sub{display:none}
      .dashboard-panels{
        grid-template-columns:1fr;
        grid-template-rows:minmax(0,1fr) 96px;
        gap:4px;
      }
      .panel-card{padding:7px;border-radius:10px}
      .panel-title h3{font-size:11px}
      .panel-title span{font-size:8px}
      .mini-row{padding:5px 6px;font-size:9px}

      [data-view="calendar"].active,
      [data-view="trades"].active,
      [data-view="analytics"].active,
      [data-view="settings"].active{
        grid-template-rows:34px minmax(0,1fr);
        gap:4px;
      }
      .v3-calendar-wrap .calendar-shell{
        grid-template-rows:40px 24px minmax(0,1fr);
      }
      .calendar-head{
        grid-template-columns:36px minmax(0,1fr) 36px;
        column-gap:4px;
        padding:4px 5px;
      }
      .head-left,.head-right{width:36px}
      .head-left .btn.gold,.head-right .jump{display:none!important}
      .calendar-head .btn{
        width:36px;height:36px;min-height:36px;padding:0;border-radius:10px;
      }
      .month-title{min-width:0;font-size:12px}
      .weekday{padding:4px 1px;font-size:9px}
      .day{padding:2px}
      .day-number{font-size:9px}
      .order-count{max-width:30px;padding:1px 2px;font-size:6px}
      .pnl{font-size:8px;margin-top:2px;line-height:1.05}
      .trade-mini{font-size:6px;margin-top:2px;line-height:1.05}
      .note-preview{display:none}

      th,td{font-size:9px;padding:6px}
      [data-view="settings"] .setting-card{
        padding:9px 10px;
        gap:2px 8px;
      }
      [data-view="settings"] .setting-card h3{font-size:12px}
      [data-view="settings"] .setting-card p{font-size:9px}
      [data-view="settings"] .setting-card .btn{
        min-width:88px;
        height:32px;
        font-size:10px;
      }

      .bottom-nav{
        width:min(430px,calc(100% - 10px));
        height:50px;
        bottom:4px;
        border-radius:14px;
        padding:3px;
      }
      .nav-item{font-size:8px;gap:1px}
      .nav-item b{font-size:14px}

      .fab{
        width:42px;
        min-width:42px;
        height:42px;
        right:8px;
        bottom:58px;
        padding:0;
        border-radius:12px;
      }
      .fab-icon{
        width:24px;height:24px;
        font-size:15px;
        background:transparent;
      }
      .fab-label{display:none}

      #dayDetailModal{
        align-items:flex-end;
        padding:0;
      }
      .day-detail-dialog{
        width:100%;
        max-width:none;
        max-height:88dvh;
        margin:0;
        border-radius:18px 18px 0 0;
        border-bottom:0;
      }
      .day-detail-dialog .dialog-body{
        overflow:auto;
        padding:10px 14px calc(92px + env(safe-area-inset-bottom));
      }
      .day-detail-summary{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:6px;
      }
      .detail-card{padding:9px 10px}
      .detail-card span{font-size:8px}
      .detail-card strong{font-size:13px}
      .day-detail-dialog .dialog-actions{
        position:sticky;
        bottom:0;
        z-index:2;
        margin:12px -14px -10px;
        padding:10px 14px calc(12px + env(safe-area-inset-bottom));
        background:#101620;
      }
    }

    /* ===== V5.7 CONSOLIDATED UI — SINGLE SOURCE ===== */

    /* Dashboard desktop */
    .v3-main{padding-top:0!important}

    [data-view="dashboard"].active{
      grid-template-rows:48px auto minmax(0,1fr)!important;
      gap:8px!important;
    }

    [data-view="dashboard"] .v3-section-head{
      position:relative!important;
      z-index:2!important;
      display:grid!important;
      grid-template-columns:minmax(0,1fr) minmax(180px,260px)!important;
      align-items:center!important;
      gap:10px!important;
      height:48px!important;
      min-height:48px!important;
      margin:0!important;
      padding:4px 4px 0!important;
      background:transparent!important;
    }

    [data-view="dashboard"] .v3-section-head>div:first-child{
      display:flex;
      flex-direction:column;
      justify-content:center;
      min-width:0!important;
      overflow:visible!important;
    }

    [data-view="dashboard"] .v3-section-head h2{
      margin:0!important;
      padding:0!important;
      font-size:17px!important;
      line-height:1.1!important;
      white-space:nowrap!important;
      overflow:visible!important;
    }

    [data-view="dashboard"] .v3-section-head p{
      margin:3px 0 0!important;
      font-size:10px!important;
      line-height:1.1!important;
    }

    [data-view="dashboard"] .v3-filter{
      width:100%!important;
      height:34px!important;
      min-height:34px!important;
    }

    [data-view="dashboard"] .dashboard-grid{
      grid-template-columns:repeat(4,minmax(0,1fr));
      gap:8px;
    }

    [data-view="dashboard"] .metric-card{
      position:relative;
      height:82px;
      min-height:82px;
      padding:11px 13px;
      border-radius:14px;
      background:linear-gradient(145deg,rgba(18,24,34,.98),rgba(11,16,24,.98));
      border:1px solid rgba(49,63,84,.82);
      box-shadow:inset 0 1px 0 rgba(255,255,255,.025),0 8px 24px rgba(0,0,0,.10);
    }

    [data-view="dashboard"] .metric-card::after{
      width:64px;height:64px;right:-22px;top:-22px;
      background:radial-gradient(circle,rgba(229,183,77,.10),rgba(229,183,77,0) 70%);
    }

    [data-view="dashboard"] .metric-card .m-label{font-size:9px;letter-spacing:.75px;color:#8996aa}
    [data-view="dashboard"] .metric-card .m-value{margin-top:7px;font-size:21px;line-height:1}
    [data-view="dashboard"] .metric-card .m-sub{margin-top:6px;font-size:9px;color:#7f8ba0}

    [data-view="dashboard"] .dashboard-panels{
      grid-template-columns:minmax(0,1.62fr) minmax(280px,.62fr);
      gap:8px;
      overflow:hidden;
    }

    [data-view="dashboard"] .dashboard-panels .panel-card{
      background:linear-gradient(145deg,rgba(17,23,32,.98),rgba(11,16,23,.98));
      border:1px solid rgba(49,63,84,.82);
      border-radius:14px;
      box-shadow:inset 0 1px 0 rgba(255,255,255,.022),0 10px 30px rgba(0,0,0,.10);
    }

    [data-view="dashboard"] .dashboard-panels .panel-card:first-child{
      grid-template-rows:28px minmax(0,1fr);
      padding:11px 12px 10px;
    }

    [data-view="dashboard"] .panel-title{min-height:28px;align-items:center;padding:0 2px}
    [data-view="dashboard"] .panel-title h3{font-size:13px;letter-spacing:.1px}
    [data-view="dashboard"] .panel-title span{font-size:9px;color:#8090a6}
    [data-view="dashboard"] .chart-wrap{border-radius:10px;overflow:hidden}

    [data-view="dashboard"] .dashboard-panels .panel-card:nth-child(2){
      padding:11px;
      display:flex;
      flex-direction:column;
    }

    [data-view="dashboard"] .mini-list{gap:7px}
    [data-view="dashboard"] .mini-row{
      min-height:36px;padding:8px 10px;border-radius:9px;
      background:rgba(8,13,20,.78);border-color:rgba(43,55,74,.9);font-size:10px;
    }
    [data-view="dashboard"] .risk-bar{height:8px;margin-top:7px}
    [data-view="dashboard"] #v3RiskLabel{font-size:10px}

    /* Day detail */
    .day-detail-dialog{width:min(860px,calc(100% - 24px))!important}
    .day-detail-summary{
      display:grid!important;
      grid-template-columns:repeat(4,minmax(0,1fr))!important;
      gap:10px!important;
    }
    .detail-card{
      min-height:88px!important;padding:12px 14px!important;
      display:flex!important;flex-direction:column!important;justify-content:center!important;
      border-radius:13px!important;background:linear-gradient(145deg,#0d131c,#111925)!important;
    }
    .detail-card span{font-size:10px!important;line-height:1.15!important;letter-spacing:.65px!important;margin:0!important}
    .detail-card strong{
      margin-top:8px!important;font-size:17px!important;line-height:1.1!important;
      min-height:20px!important;display:flex!important;align-items:center!important;gap:5px!important;
    }
    #detailDayWinLoss{white-space:nowrap!important;display:flex!important;align-items:center!important;gap:6px!important}
    #detailDayWinLoss .positive,#detailDayWinLoss .negative{display:inline!important;font-size:16px!important;line-height:1!important}
    .detail-note-box{margin-top:10px!important;padding:12px 14px!important;border-radius:13px!important;min-height:74px!important}
    .detail-note-label{margin-bottom:6px!important;font-size:10px!important}
    .detail-note-text{font-size:13px!important;line-height:1.45!important}

    /* Refresh button */
    .refresh-setting-card{
      border-color:rgba(90,168,255,.28)!important;
      background:linear-gradient(145deg,rgba(17,24,34,.98),rgba(10,16,24,.98))!important;
    }
    .refresh-app-btn{
      min-width:112px!important;height:36px!important;
      display:inline-flex!important;align-items:center!important;justify-content:center!important;
      gap:7px!important;padding:0 12px!important;
      border-color:rgba(90,168,255,.38)!important;
      background:rgba(90,168,255,.08)!important;color:#dcecff!important;
    }
    .refresh-app-btn:hover{background:rgba(90,168,255,.14)!important;border-color:rgba(90,168,255,.56)!important}
    .refresh-icon{font-size:17px;line-height:1;font-weight:900}
    .refresh-label{font-size:11px;font-weight:900;white-space:nowrap}
    .refresh-app-btn.loading .refresh-icon{animation:leanRefreshSpin .7s linear infinite}
    @keyframes leanRefreshSpin{to{transform:rotate(360deg)}}

    /* Compact calendar selectors */
    .calendar-toolbar,.calendar-nav,.calendar-controls{justify-content:flex-start!important}
    #monthSelect{flex:0 0 180px!important;width:180px!important;max-width:180px!important}
    #yearSelect{flex:0 0 140px!important;width:140px!important;max-width:140px!important}

    @media(max-width:1100px){
      [data-view="dashboard"] .dashboard-panels{
        grid-template-columns:minmax(0,1.5fr) minmax(250px,.65fr);
      }
    }

    @media(max-width:980px){
      .day-detail-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
      .detail-card{min-height:78px!important}
    }

    /* Mobile — one consolidated block */
    @media(max-width:760px){
      html,body{height:100%!important;overflow:hidden!important}

      .app{
        height:100dvh!important;min-height:0!important;overflow:hidden!important;
        grid-template-rows:46px minmax(0,1fr)!important;
        gap:6px!important;padding:4px 4px 60px!important;
      }

      .topbar{
        height:44px!important;min-height:44px!important;
        padding:4px 6px!important;border-radius:12px!important;
      }
      .brand{gap:6px!important}
      .logo.logo-image{width:26px!important;height:26px!important;flex:0 0 26px!important;border-radius:8px!important;padding:2px!important}
      
      .topbar .toolbar .btn{width:28px!important;height:28px!important;min-height:28px!important}

      .v3-main{min-height:0!important;overflow:hidden!important;padding-top:0!important}

      [data-view="dashboard"].active{
        display:block!important;height:100%!important;min-height:0!important;
        overflow-y:auto!important;overflow-x:hidden!important;
        padding:0 0 118px!important;
        -webkit-overflow-scrolling:touch!important;scrollbar-width:thin;
      }

      [data-view="dashboard"] .v3-section-head{
        position:sticky!important;top:0!important;z-index:5!important;
        display:grid!important;grid-template-columns:minmax(0,1fr) 150px!important;
        align-items:center!important;gap:6px!important;
        height:40px!important;min-height:40px!important;
        margin:0 0 5px!important;padding:3px 2px!important;
        background:rgba(6,10,16,.96)!important;backdrop-filter:blur(8px)!important;
      }

      [data-view="dashboard"] .v3-section-head h2{font-size:13px!important;line-height:1!important}
      [data-view="dashboard"] .v3-section-head p{display:none!important}
      [data-view="dashboard"] .v3-filter{
        width:100%!important;height:30px!important;min-height:30px!important;
        padding:4px 8px!important;font-size:11px!important;border-radius:9px!important;
      }

      [data-view="dashboard"] .dashboard-grid{
        display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:4px!important;margin-bottom:6px!important;
      }

      [data-view="dashboard"] .metric-card{
        height:54px!important;min-height:54px!important;padding:6px 8px!important;border-radius:10px!important;
      }
      [data-view="dashboard"] .metric-card::after{width:40px!important;height:40px!important;right:-14px!important;top:-14px!important}
      [data-view="dashboard"] .metric-card .m-label{font-size:7px!important;letter-spacing:.5px!important}
      [data-view="dashboard"] .metric-card .m-value{font-size:13px!important;margin-top:3px!important}
      [data-view="dashboard"] .metric-card .m-sub{display:none!important}

      [data-view="dashboard"] .dashboard-panels{
        display:flex!important;flex-direction:column!important;
        gap:6px!important;height:auto!important;min-height:0!important;overflow:visible!important;
      }
      [data-view="dashboard"] .dashboard-panels .panel-card{
        width:100%!important;height:auto!important;min-height:0!important;overflow:hidden!important;
      }
      [data-view="dashboard"] .dashboard-panels .panel-card:first-child{
        display:grid!important;grid-template-rows:24px 220px!important;
        min-height:252px!important;padding:8px!important;
      }
      [data-view="dashboard"] .dashboard-panels .panel-card:first-child .chart-wrap{
        height:220px!important;min-height:220px!important;
      }
      [data-view="dashboard"] .panel-title{min-height:24px!important;padding:0 1px!important}
      [data-view="dashboard"] .panel-title h3{font-size:11px!important}
      [data-view="dashboard"] .panel-title span{font-size:8px!important}

      [data-view="dashboard"] .dashboard-panels .panel-card:nth-child(2){
        display:flex!important;flex-direction:column!important;
        min-height:190px!important;padding:8px!important;
        visibility:visible!important;opacity:1!important;
      }
      [data-view="dashboard"] .dashboard-panels .panel-card:nth-child(2) .panel-title{
        display:flex!important;min-height:24px!important;margin-bottom:6px!important;
      }
      [data-view="dashboard"] .mini-list{display:flex!important;flex-direction:column!important;gap:5px!important}
      [data-view="dashboard"] .mini-row{
        display:flex!important;min-height:29px!important;padding:6px 8px!important;
        font-size:9px!important;border-radius:8px!important;
      }
      [data-view="dashboard"] .risk-bar{display:block!important;height:7px!important;margin-top:6px!important}

      .day-detail-dialog{width:100%!important;max-height:90dvh!important}
      .day-detail-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
      .detail-card{min-height:70px!important;padding:9px 10px!important;border-radius:11px!important}
      .detail-card span{font-size:8px!important}
      .detail-card strong{margin-top:6px!important;font-size:14px!important;min-height:17px!important}
      #detailDayWinLoss .positive,#detailDayWinLoss .negative{font-size:13px!important}
      .detail-note-box{min-height:62px!important;padding:10px 11px!important}
      .detail-note-text{font-size:12px!important;line-height:1.4!important}

      .refresh-app-btn{
        min-width:96px!important;width:96px!important;height:32px!important;
        padding:0 9px!important;gap:5px!important;
      }
      .refresh-icon{font-size:15px}
      .refresh-label{font-size:10px}

      #monthSelect{flex:1 1 0!important;width:auto!important;max-width:none!important;min-width:0!important}
      #yearSelect{flex:0 0 108px!important;width:108px!important;max-width:108px!important}

      .bottom-nav{
        height:48px!important;bottom:4px!important;
        width:min(430px,calc(100% - 10px))!important;z-index:60!important;
      }
      .nav-item{font-size:8px!important}
      .nav-item b{font-size:13px!important}
      .fab{
        width:40px!important;min-width:40px!important;height:40px!important;
        right:8px!important;bottom:60px!important;border-radius:12px!important;z-index:59!important;
      }
      .fab-icon{width:22px!important;height:22px!important;font-size:14px!important}
    }

    @media(max-width:380px){
      .day-detail-summary{grid-template-columns:1fr 1fr!important;gap:6px!important}
      .detail-card{min-height:66px!important;padding:8px 9px!important}
      .detail-card strong{font-size:13px!important}
      #yearSelect{flex-basis:92px!important;width:92px!important;max-width:92px!important}
    }

    


    


    


    


    


    /* ===== V6.5 COMPACT JOURNAL FORM ===== */
    #dayDialog .dialog-card,
    #dayModal .dialog-card,
    .journal-dialog,
    .entry-dialog{
      width:min(760px,calc(100% - 20px))!important;
      max-height:94dvh!important;
      overflow:auto!important;
    }

    #dayDialog .dialog-head,
    #dayModal .dialog-head,
    .journal-dialog .dialog-head,
    .entry-dialog .dialog-head{
      min-height:52px!important;
      padding:12px 16px!important;
    }

    #dayDialog .dialog-body,
    #dayModal .dialog-body,
    .journal-dialog .dialog-body,
    .entry-dialog .dialog-body{
      padding:12px 16px 14px!important;
    }

    #dayDialog .form-grid,
    #dayModal .form-grid,
    .journal-dialog .form-grid,
    .entry-dialog .form-grid{
      gap:10px 12px!important;
    }

    #dayDialog .field,
    #dayModal .field,
    .journal-dialog .field,
    .entry-dialog .field{
      gap:5px!important;
    }

    #dayDialog label,
    #dayModal label,
    .journal-dialog label,
    .entry-dialog label{
      font-size:11px!important;
      line-height:1.15!important;
      margin:0!important;
    }

    #dayDialog input,
    #dayDialog select,
    #dayModal input,
    #dayModal select,
    .journal-dialog input,
    .journal-dialog select,
    .entry-dialog input,
    .entry-dialog select{
      min-height:36px!important;
      height:36px!important;
      padding:7px 10px!important;
      font-size:12px!important;
      border-radius:9px!important;
    }

    #dayDialog .hint,
    #dayModal .hint,
    .journal-dialog .hint,
    .entry-dialog .hint{
      margin-top:2px!important;
      font-size:9px!important;
      line-height:1.2!important;
    }

    #dayDialog .calc-panel,
    #dayDialog .summary-panel,
    #dayModal .calc-panel,
    #dayModal .summary-panel,
    .journal-dialog .calc-panel,
    .journal-dialog .summary-panel,
    .entry-dialog .calc-panel,
    .entry-dialog .summary-panel{
      margin-top:10px!important;
      padding:10px 12px!important;
      gap:8px!important;
      border-radius:11px!important;
    }

    #dayDialog .calc-item,
    #dayDialog .summary-item,
    #dayModal .calc-item,
    #dayModal .summary-item,
    .journal-dialog .calc-item,
    .journal-dialog .summary-item,
    .entry-dialog .calc-item,
    .entry-dialog .summary-item{
      min-height:42px!important;
    }

    #dayDialog .calc-item span,
    #dayDialog .summary-item span,
    #dayModal .calc-item span,
    #dayModal .summary-item span,
    .journal-dialog .calc-item span,
    .journal-dialog .summary-item span,
    .entry-dialog .calc-item span,
    .entry-dialog .summary-item span{
      font-size:8px!important;
    }

    #dayDialog .calc-item strong,
    #dayDialog .summary-item strong,
    #dayModal .calc-item strong,
    #dayModal .summary-item strong,
    .journal-dialog .calc-item strong,
    .journal-dialog .summary-item strong,
    .entry-dialog .calc-item strong,
    .entry-dialog .summary-item strong{
      margin-top:4px!important;
      font-size:13px!important;
    }

    #dayDialog textarea,
    #dayModal textarea,
    .journal-dialog textarea,
    .entry-dialog textarea{
      min-height:72px!important;
      height:72px!important;
      padding:9px 10px!important;
      font-size:12px!important;
      line-height:1.4!important;
      border-radius:9px!important;
    }

    #dayDialog .dialog-actions,
    #dayModal .dialog-actions,
    .journal-dialog .dialog-actions,
    .entry-dialog .dialog-actions{
      margin-top:10px!important;
      padding-top:10px!important;
      gap:8px!important;
    }

    #dayDialog .dialog-actions .btn,
    #dayModal .dialog-actions .btn,
    .journal-dialog .dialog-actions .btn,
    .entry-dialog .dialog-actions .btn{
      min-height:36px!important;
      height:36px!important;
      padding:0 13px!important;
      font-size:11px!important;
    }

    @media(max-width:760px){
      #dayDialog .dialog-card,
      #dayModal .dialog-card,
      .journal-dialog,
      .entry-dialog{
        width:calc(100% - 10px)!important;
        max-height:92dvh!important;
      }

      #dayDialog .dialog-head,
      #dayModal .dialog-head,
      .journal-dialog .dialog-head,
      .entry-dialog .dialog-head{
        min-height:46px!important;
        padding:9px 11px!important;
      }

      #dayDialog .dialog-body,
      #dayModal .dialog-body,
      .journal-dialog .dialog-body,
      .entry-dialog .dialog-body{
        padding:9px 10px 12px!important;
      }

      #dayDialog .form-grid,
      #dayModal .form-grid,
      .journal-dialog .form-grid,
      .entry-dialog .form-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
      }

      #dayDialog input,
      #dayDialog select,
      #dayModal input,
      #dayModal select,
      .journal-dialog input,
      .journal-dialog select,
      .entry-dialog input,
      .entry-dialog select{
        min-height:34px!important;
        height:34px!important;
        padding:6px 8px!important;
        font-size:11px!important;
      }

      #dayDialog .calc-panel,
      #dayDialog .summary-panel,
      #dayModal .calc-panel,
      #dayModal .summary-panel,
      .journal-dialog .calc-panel,
      .journal-dialog .summary-panel,
      .entry-dialog .calc-panel,
      .entry-dialog .summary-panel{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        padding:8px 9px!important;
        gap:6px!important;
      }

      #dayDialog textarea,
      #dayModal textarea,
      .journal-dialog textarea,
      .entry-dialog textarea{
        min-height:62px!important;
        height:62px!important;
      }
    }

    @media(max-width:420px){
      #dayDialog .form-grid,
      #dayModal .form-grid,
      .journal-dialog .form-grid,
      .entry-dialog .form-grid{
        gap:7px!important;
      }

      #dayDialog label,
      #dayModal label,
      .journal-dialog label,
      .entry-dialog label{
        font-size:9px!important;
      }
    }


    


    


    /* ===== V6.8 APP LOGIN FIX ===== */
    .auth-message{
      margin-top:10px;
      padding:9px 11px;
      border:1px solid var(--line);
      border-radius:9px;
      font-size:11px;
      line-height:1.35;
      background:#0a1018;
    }

    .auth-message.info{
      color:#b9c9df;
      border-color:rgba(90,168,255,.30);
      background:rgba(90,168,255,.07);
    }

    .auth-message.success{
      color:#48d597;
      border-color:rgba(72,213,151,.30);
      background:rgba(72,213,151,.07);
    }

    .auth-message.error{
      color:#ff7a88;
      border-color:rgba(255,92,109,.35);
      background:rgba(255,92,109,.08);
    }

    #signInBtn:disabled,
    #signUpBtn:disabled{
      opacity:.65;
      cursor:wait;
      pointer-events:none;
    }

    @media(max-width:760px){
      .auth-message{
        margin-top:8px;
        padding:8px 9px;
        font-size:10px;
      }
    }


    /* ===== V6.9 MT5 IMAGE SCANNER ===== */
    .mt5-scan-toolbar{
      display:flex;
      align-items:center;
      gap:10px;
      margin-bottom:10px;
      padding:9px 10px;
      border:1px solid rgba(229,183,77,.24);
      border-radius:10px;
      background:linear-gradient(135deg,rgba(229,183,77,.07),rgba(90,168,255,.04));
    }

    .mt5-scan-toolbar span{
      color:var(--muted);
      font-size:10px;
      line-height:1.3;
    }

    .mt5-scan-btn{
      flex:0 0 auto;
      min-height:34px!important;
      height:34px!important;
      border-color:rgba(229,183,77,.42)!important;
      color:#f0c965!important;
    }

    .mt5-ocr-dialog{
      width:min(980px,calc(100% - 20px))!important;
      max-height:94dvh!important;
    }

    .mt5-ocr-subtitle{
      margin:3px 0 0;
      color:var(--muted);
      font-size:10px;
    }

    .mt5-ocr-progress{
      display:flex;
      flex-direction:column;
      gap:7px;
      margin-bottom:10px;
      padding:10px;
      border:1px solid var(--line);
      border-radius:10px;
      background:#0a1018;
    }

    .mt5-progress-track{
      height:7px;
      overflow:hidden;
      border-radius:999px;
      background:#1a2432;
    }

    .mt5-progress-track span{
      display:block;
      width:0;
      height:100%;
      border-radius:inherit;
      background:linear-gradient(90deg,#c49327,#f0cd68);
      transition:width .18s ease;
    }

    .mt5-ocr-progress strong{
      font-size:10px;
      color:#c7d1df;
    }

    .mt5-ocr-empty{
      display:flex;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      gap:5px;
      min-height:100px;
      margin-bottom:10px;
      padding:18px;
      text-align:center;
      border:1px dashed var(--line);
      border-radius:11px;
      color:var(--muted);
    }

    .mt5-ocr-empty strong{
      color:var(--text);
      font-size:13px;
    }

    .mt5-preview-summary{
      display:flex;
      justify-content:space-between;
      gap:10px;
      margin-bottom:7px;
      font-size:10px;
      color:var(--muted);
    }

    .mt5-preview-summary span:first-child{
      color:#f0c965;
      font-weight:900;
    }

    .mt5-preview-table{
      max-height:300px;
      overflow:auto;
      border:1px solid var(--line);
      border-radius:10px;
    }

    .mt5-preview-table table{
      min-width:680px;
    }

    .mt5-preview-table th,
    .mt5-preview-table td{
      padding:5px;
    }

    .mt5-preview-table input,
    .mt5-preview-table select{
      min-width:84px;
      height:31px!important;
      min-height:31px!important;
      padding:5px 7px!important;
      font-size:10px!important;
      border-radius:7px!important;
    }

    .mt5-preview-table input[type="date"]{min-width:126px}
    .mt5-preview-table [data-field="openPrice"]{min-width:105px}
    .mt5-preview-table [data-field="symbol"]{min-width:86px}
    .mt5-preview-table [data-field="side"]{min-width:70px}
    .ocr-confidence{display:inline-flex;align-items:center;justify-content:center;min-width:58px;padding:5px 7px;border:1px solid #344153;border-radius:999px;background:#101722;color:#aeb9c8;font-size:9px;font-weight:850;white-space:nowrap}
    .ocr-confidence.is-high{border-color:rgba(62,224,170,.4);background:rgba(62,224,170,.09);color:#51e7b6}
    .ocr-confidence.is-medium{border-color:rgba(228,183,68,.45);background:rgba(228,183,68,.09);color:#eac34e}
    .ocr-confidence.is-low{border-color:rgba(255,86,112,.48);background:rgba(255,86,112,.09);color:#ff6b82}

    .mt5-remove-row{
      width:28px!important;
      min-width:28px!important;
      height:28px!important;
      min-height:28px!important;
      color:#ff7a88!important;
    }

    .mt5-raw-details{
      margin-top:10px;
      padding:8px 10px;
      border:1px solid var(--line);
      border-radius:10px;
      background:#0a1018;
    }

    .mt5-raw-details summary{
      cursor:pointer;
      color:#aeb9c9;
      font-size:10px;
      font-weight:800;
    }

    .mt5-raw-details textarea{
      width:100%;
      min-height:110px!important;
      margin:8px 0;
      font-family:monospace;
      font-size:10px!important;
      line-height:1.35;
    }

    @media(max-width:760px){
      .mt5-scan-toolbar{
        gap:7px;
        padding:7px 8px;
      }

      .mt5-scan-toolbar span{
        font-size:8px;
      }

      .mt5-scan-btn{
        min-height:31px!important;
        height:31px!important;
        padding:0 9px!important;
        font-size:9px!important;
      }

      .mt5-ocr-dialog{
        width:calc(100% - 8px)!important;
        max-height:92dvh!important;
      }

      .mt5-preview-table{
        max-height:270px;
      }

      .mt5-preview-summary{
        flex-direction:column;
        gap:2px;
      }

      .mt5-raw-details textarea{
        min-height:90px!important;
      }
    }


    /* ===== V7.7 CLEAN AUTH REBUILD ===== */
    .clean-user-btn{
      display:inline-flex!important;
      align-items:center!important;
      justify-content:center!important;
      gap:7px!important;
      width:auto!important;
      min-width:108px!important;
      max-width:190px!important;
      padding:0 11px!important;
      font-size:11px!important;
    }

    .clean-user-icon{
      width:19px;
      height:19px;
      flex:0 0 19px;
      fill:none;
      stroke:currentColor;
      stroke-width:1.8;
      stroke-linecap:round;
      stroke-linejoin:round;
    }

    .clean-user-btn span{
      display:block!important;
      min-width:0;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
      font-size:11px!important;
      font-weight:900;
    }

    .clean-auth-dialog{
      width:min(520px,calc(100% - 20px))!important;
      max-height:92dvh!important;
    }

    .clean-auth-grid{
      grid-template-columns:1fr!important;
      margin-top:12px;
    }

    .clean-password-wrap{
      position:relative;
      display:flex;
      width:100%;
    }

    .clean-password-wrap input{
      padding-right:42px!important;
    }

    .clean-eye-btn{
      position:absolute;
      right:5px;
      top:50%;
      transform:translateY(-50%);
      width:32px;
      height:30px;
      border:0;
      border-radius:7px;
      background:transparent;
      color:#8490a4;
      cursor:pointer;
    }

    .clean-eye-btn.active{
      color:#e5b74d;
      background:rgba(229,183,77,.08);
    }

    .clean-auth-options{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-top:9px;
    }

    .clean-remember{
      display:inline-flex;
      align-items:center;
      gap:7px;
      color:#aeb9c9;
      font-size:10px;
      font-weight:700;
      cursor:pointer;
    }

    .clean-remember input{
      width:15px;
      height:15px;
      margin:0;
      accent-color:#d9a936;
    }

    .clean-link-btn{
      border:0;
      padding:4px 0;
      background:transparent;
      color:#e0b84e;
      font-size:10px;
      font-weight:800;
      cursor:pointer;
    }

    .clean-reset-field{
      margin-top:11px;
    }

    @media(max-width:700px){
      .clean-user-btn{
        width:34px!important;
        min-width:34px!important;
        max-width:34px!important;
        padding:0!important;
      }

      .clean-user-btn span{
        display:none!important;
      }

      .clean-auth-dialog{
        width:calc(100% - 10px)!important;
      }
    }


    /* ===== V7.8 MT5 IMPORT ===== */
    .mt5-main-btn{
      border-color:rgba(229,183,77,.34)!important;
      color:#efc75e!important;
    }
.mt5-import-dialog{
      width:min(980px,calc(100% - 20px))!important;
      max-height:94dvh!important;
    }

    .mt5-import-subtitle{
      margin:3px 0 0;
      color:var(--muted);
      font-size:10px;
    }

    .mt5-import-choice-grid{
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:10px;
    }

    .mt5-choice-card{
      min-height:96px;
      padding:14px;
      text-align:left;
      border:1px solid var(--line);
      border-radius:12px;
      background:linear-gradient(145deg,#0c121a,#121a25);
      color:var(--text);
      cursor:pointer;
    }

    .mt5-choice-card:hover{
      border-color:rgba(229,183,77,.45);
      background:linear-gradient(145deg,rgba(229,183,77,.08),#121a25);
    }

    .mt5-choice-card strong{
      display:block;
      margin-bottom:6px;
      color:#efc75e;
      font-size:13px;
    }

    .mt5-choice-card span{
      color:var(--muted);
      font-size:10px;
      line-height:1.4;
    }

    .mt5-import-note{
      margin:10px 0;
      padding:9px 10px;
      border:1px solid rgba(90,168,255,.18);
      border-radius:10px;
      background:rgba(90,168,255,.04);
      color:#9eacbe;
      font-size:9px;
      line-height:1.4;
    }

    .mt5-file-summary{
      margin-bottom:7px;
      color:#efc75e;
      font-size:10px;
      font-weight:900;
    }

    .mt5-file-table-wrap{
      max-height:320px;
      overflow:auto;
      border:1px solid var(--line);
      border-radius:10px;
    }

    .mt5-file-table-wrap table{
      min-width:680px;
    }

    .mt5-file-table-wrap th,
    .mt5-file-table-wrap td{
      padding:5px;
    }

    .mt5-file-table-wrap input,
    .mt5-file-table-wrap select{
      min-width:82px;
      height:31px!important;
      min-height:31px!important;
      padding:5px 7px!important;
      font-size:10px!important;
      border-radius:7px!important;
    }

    .mt5-file-table-wrap input[type="date"]{min-width:126px}
    .mt5-file-table-wrap [data-field="openPrice"]{min-width:104px}
    .mt5-file-table-wrap [data-field="symbol"]{min-width:86px}

    @media(max-width:760px){
      .mt5-main-btn{
        min-width:34px!important;
        width:34px!important;
        padding:0!important;
      }
.mt5-import-dialog{
        width:calc(100% - 8px)!important;
      }

      .mt5-import-choice-grid{
        grid-template-columns:1fr;
        gap:7px;
      }

      .mt5-choice-card{
        min-height:78px;
        padding:11px;
      }

      .mt5-file-table-wrap{
        max-height:270px;
      }
    }


    /* ===== V7.9 HEADER REDESIGN ===== */
    header{
      min-height:64px!important;
      padding:8px 14px!important;
      gap:14px!important;
      background:linear-gradient(180deg,#0d131c 0%,#0a0f16 100%)!important;
      border-bottom:1px solid rgba(113,132,158,.28)!important;
    }

    .lean-brand{
      display:flex!important;
      align-items:center!important;
      gap:10px!important;
      min-width:0!important;
      flex:1 1 auto!important;
    }

    .lean-mark{
      width:42px!important;
      height:42px!important;
      flex:0 0 42px!important;
      display:flex!important;
      align-items:center!important;
      justify-content:center!important;
      border-radius:12px!important;
      background:linear-gradient(145deg,rgba(229,183,77,.10),rgba(229,183,77,.02))!important;
      box-shadow:inset 0 0 0 1px rgba(229,183,77,.18)!important;
    }

    .lean-mark svg{
      width:100%!important;
      height:100%!important;
      fill:none!important;
      stroke:#e7b94d!important;
      stroke-width:2.2!important;
      stroke-linecap:round!important;
      stroke-linejoin:round!important;
    }

    .lean-mark svg rect{
      stroke:#3a4b63!important;
      stroke-width:1.4!important;
    }

    .lean-brand-copy{
      min-width:0!important;
      display:flex!important;
      flex-direction:column!important;
      justify-content:center!important;
      gap:3px!important;
    }

    .lean-brand-top{
      display:flex!important;
      align-items:center!important;
      gap:8px!important;
      min-width:0!important;
    }

    .lean-brand-top strong{
      color:#efc45a!important;
      font-size:18px!important;
      line-height:1!important;
      letter-spacing:.7px!important;
      font-weight:900!important;
    }

    .lean-version-badge{
      display:inline-flex!important;
      align-items:center!important;
      justify-content:center!important;
      min-width:40px!important;
      height:18px!important;
      padding:0 7px!important;
      border:1px solid rgba(229,183,77,.40)!important;
      border-radius:999px!important;
      color:#efc45a!important;
      background:rgba(229,183,77,.06)!important;
      font-size:8px!important;
      font-weight:900!important;
      letter-spacing:.45px!important;
    }

    .lean-brand-bottom{
      display:flex!important;
      align-items:center!important;
      gap:10px!important;
      min-width:0!important;
    }

    .lean-brand-bottom span{
      color:#c4cedb!important;
      font-size:9px!important;
      font-weight:900!important;
      letter-spacing:2.1px!important;
      white-space:nowrap!important;
    }

    .lean-brand-bottom small{
      position:relative!important;
      padding-left:10px!important;
      color:#6f7d90!important;
      font-size:9px!important;
      font-weight:600!important;
      white-space:nowrap!important;
      overflow:hidden!important;
      text-overflow:ellipsis!important;
    }

    .lean-brand-bottom small::before{
      content:""!important;
      position:absolute!important;
      left:0!important;
      top:50%!important;
      width:3px!important;
      height:3px!important;
      border-radius:50%!important;
      background:#59677a!important;
      transform:translateY(-50%)!important;
    }

    header .toolbar{
      flex:0 0 auto!important;
      display:flex!important;
      align-items:center!important;
      justify-content:flex-end!important;
      gap:7px!important;
      margin-left:auto!important;
    }

    @media(max-width:900px){
      .lean-brand-bottom small{
        display:none!important;
      }
    }

    @media(max-width:760px){
      header{
        min-height:56px!important;
        padding:7px 8px!important;
        gap:8px!important;
      }

      .lean-brand{
        gap:8px!important;
      }

      .lean-mark{
        width:36px!important;
        height:36px!important;
        flex-basis:36px!important;
        border-radius:10px!important;
      }

      .lean-brand-top{
        gap:6px!important;
      }

      .lean-brand-top strong{
        font-size:15px!important;
      }

      .lean-version-badge{
        min-width:34px!important;
        height:16px!important;
        padding:0 6px!important;
        font-size:7px!important;
      }

      .lean-brand-bottom span{
        font-size:7px!important;
        letter-spacing:1.5px!important;
      }

      header .toolbar{
        gap:5px!important;
      }
    }

    @media(max-width:420px){
      .lean-brand-bottom{
        display:none!important;
      }

      .lean-brand-copy{
        gap:0!important;
      }

      .lean-brand-top strong{
        font-size:14px!important;
      }
    }


    /* ===== V8.3 DAILY FILTER + FULL DELETE ===== */
    .mt5-daily-filter{
      display:flex;
      align-items:flex-end;
      justify-content:space-between;
      gap:12px;
      margin:10px 0;
      padding:10px;
      border:1px solid rgba(229,183,77,.28);
      border-radius:10px;
      background:linear-gradient(135deg,rgba(229,183,77,.07),rgba(90,168,255,.03));
    }
    .mt5-daily-filter .field{min-width:230px}
    .mt5-day-metrics{
      display:flex;
      align-items:center;
      gap:14px;
      color:#aab5c4;
      font-size:10px;
      font-weight:800
    }
    .mt5-day-metrics strong{font-size:12px;white-space:nowrap}
    @media(max-width:760px){
      .mt5-daily-filter{flex-direction:column;align-items:stretch;gap:8px}
      .mt5-daily-filter .field{min-width:0;width:100%}
      .mt5-day-metrics{justify-content:space-between;gap:6px}
    }


    /* ===== V8.5 EXACT IMPORT + PNL HEATMAP ===== */
    .day.heat-profit-1{background:rgba(20,170,112,.07)!important}
    .day.heat-profit-2{background:rgba(20,170,112,.13)!important}
    .day.heat-profit-3{background:rgba(20,170,112,.21)!important}
    .day.heat-profit-4{
      background:linear-gradient(145deg,rgba(20,170,112,.32),rgba(7,43,35,.82))!important;
      box-shadow:inset 0 0 0 1px rgba(76,235,172,.24)!important
    }
    .day.heat-loss-1{background:rgba(205,48,75,.07)!important}
    .day.heat-loss-2{background:rgba(205,48,75,.13)!important}
    .day.heat-loss-3{background:rgba(205,48,75,.21)!important}
    .day.heat-loss-4{
      background:linear-gradient(145deg,rgba(205,48,75,.32),rgba(48,14,25,.84))!important;
      box-shadow:inset 0 0 0 1px rgba(255,111,132,.24)!important
    }
    .day.heat-profit-4 .pnl,
    .day.heat-loss-4 .pnl{
      font-weight:950!important;
      text-shadow:0 0 12px currentColor!important
    }


    /* ===== V8.6 MT5 IMPORT BUTTON ICON ===== */
    .mt5-main-btn{
      display:inline-flex!important;
      align-items:center!important;
      justify-content:center!important;
      gap:7px!important;
    }

    .mt5-import-icon{
      display:inline-flex!important;
      align-items:center!important;
      justify-content:center!important;
      width:20px!important;
      height:20px!important;
      flex:0 0 20px!important;
    }

    .mt5-import-icon svg{
      width:100%!important;
      height:100%!important;
      fill:none!important;
      stroke:currentColor!important;
      stroke-width:1.8!important;
      stroke-linecap:round!important;
      stroke-linejoin:round!important;
    }

    @media(max-width:760px){
      .mt5-main-btn{
        width:34px!important;
        min-width:34px!important;
        max-width:34px!important;
        padding:0!important;
        gap:0!important;
      }

      .mt5-main-btn > span:last-child{
        display:none!important;
      }

      .mt5-import-icon{
        width:19px!important;
        height:19px!important;
        flex-basis:19px!important;
      }
    }


    /* ===== V8.8 WEEK FILTER ===== */
    select option{
      background:#0b1119;
      color:#e7edf6;
    }


    /* ===== V8.9 UNIFIED RANGE LOGIC ===== */
    #dashboardRange{
      min-width:210px;
    }


    


    


    /* ===== V9.2 COMPACT CALENDAR CASHFLOW ===== */
    .calendar-cashflow-summary{
      display:grid;
      grid-template-columns:1.05fr repeat(4,minmax(0,1fr));
      gap:6px;
      margin:0 0 7px;
    }

    .calendar-cashflow-summary article{
      min-height:38px;
      padding:6px 9px;
      border:1px solid var(--line);
      border-radius:9px;
      background:linear-gradient(145deg,#0c121a,#111925);
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:8px;
      overflow:hidden;
    }

    .calendar-cashflow-summary span{
      min-width:0;
      color:var(--muted);
      font-size:7px;
      font-weight:850;
      text-transform:uppercase;
      letter-spacing:.35px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .calendar-cashflow-summary strong{
      flex:0 0 auto;
      font-size:10px;
      white-space:nowrap;
    }

    .day-cashflow-row{
      display:flex;
      align-items:center;
      gap:3px;
      max-width:100%;
      margin-top:3px;
      overflow:hidden;
      white-space:nowrap;
      font-size:6.5px;
      font-weight:900;
      line-height:1;
    }

    .day-cashflow-row span{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-width:0;
      max-width:88px;
      height:14px;
      padding:0 4px;
      border-radius:5px;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
      letter-spacing:-.1px;
    }

    .day-deposit{
      color:#70e8b8;
      background:rgba(36,203,139,.09);
      border:1px solid rgba(36,203,139,.16);
    }

    .day-deposit::before{
      content:"N";
      margin-right:2px;
      font-size:6px;
      opacity:.75;
    }

    .day-withdrawal{
      color:#f1c45e;
      background:rgba(229,183,77,.09);
      border:1px solid rgba(229,183,77,.17);
    }

    .day-withdrawal::before{
      content:"R";
      margin-right:2px;
      font-size:6px;
      opacity:.75;
    }

    .day-credit{
      color:#79b7ff;
      background:rgba(77,157,255,.09);
      border:1px solid rgba(77,157,255,.16);
    }

    .day.has-cashflow .note-preview{
      margin-top:3px;
    }

    .day .note-preview{
      max-height:26px;
      overflow:hidden;
    }

    .day.cashflow-only{
      background:linear-gradient(145deg,rgba(75,133,206,.08),rgba(10,20,32,.95))!important;
      box-shadow:inset 0 0 0 1px rgba(88,155,235,.15)!important;
    }

    @media(max-width:1100px){
      .calendar-cashflow-summary{
        grid-template-columns:repeat(3,minmax(0,1fr));
      }

      .calendar-cashflow-summary article{
        min-height:36px;
      }
    }

    @media(max-width:760px){
      .calendar-cashflow-summary{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:5px;
        margin-bottom:6px;
      }

      .calendar-cashflow-summary article{
        min-height:34px;
        padding:5px 7px;
      }

      .calendar-cashflow-summary span{
        font-size:6.5px;
      }

      .calendar-cashflow-summary strong{
        font-size:9px;
      }

      .day-cashflow-row{
        gap:2px;
        margin-top:2px;
        font-size:6px;
      }

      .day-cashflow-row span{
        max-width:64px;
        height:13px;
        padding:0 3px;
      }

      .day .note-preview{
        display:none;
      }
    }


    /* ===== V9.3 BALANCED OVERVIEW LAYOUT ===== */
    .v3-view[data-view="dashboard"]{
      display:flex;
      flex-direction:column;
      min-height:0;
      overflow:visible;
    }

    .v3-view[data-view="dashboard"].active{
      display:flex!important;
    }

    .dashboard-grid{
      display:grid!important;
      grid-template-columns:repeat(4,minmax(0,1fr))!important;
      gap:8px!important;
      margin-bottom:8px!important;
      flex:0 0 auto!important;
    }

    .dashboard-grid .metric-card{
      min-height:72px!important;
      padding:10px 12px!important;
      overflow:hidden!important;
    }

    .dashboard-grid .m-label{
      font-size:8px!important;
      line-height:1.1!important;
    }

    .dashboard-grid .m-value{
      margin-top:6px!important;
      font-size:19px!important;
      line-height:1!important;
    }

    .dashboard-grid .m-sub{
      margin-top:5px!important;
      font-size:8px!important;
      line-height:1.15!important;
    }

    .overview-cashflow-row{
      display:grid!important;
      grid-template-columns:repeat(4,minmax(0,1fr))!important;
      gap:8px!important;
      margin:0 0 10px!important;
      padding:0!important;
      position:relative!important;
      z-index:1!important;
      flex:0 0 auto!important;
    }

    .overview-cashflow-row article{
      min-width:0!important;
      min-height:38px!important;
      padding:7px 10px!important;
      border:1px solid var(--line)!important;
      border-radius:9px!important;
      background:linear-gradient(145deg,#0c121a,#111925)!important;
      display:flex!important;
      align-items:center!important;
      justify-content:space-between!important;
      gap:8px!important;
      overflow:hidden!important;
    }

    .overview-cashflow-row span{
      min-width:0!important;
      color:var(--muted)!important;
      font-size:7px!important;
      font-weight:850!important;
      text-transform:uppercase!important;
      letter-spacing:.35px!important;
      white-space:nowrap!important;
      overflow:hidden!important;
      text-overflow:ellipsis!important;
    }

    .overview-cashflow-row strong{
      flex:0 0 auto!important;
      font-size:10px!important;
      line-height:1!important;
      white-space:nowrap!important;
    }

    .overview-panels{
      display:grid!important;
      grid-template-columns:minmax(0,2.7fr) minmax(260px,1fr)!important;
      gap:10px!important;
      margin-top:0!important;
      position:relative!important;
      z-index:0!important;
      align-items:stretch!important;
      flex:1 1 auto!important;
      min-height:430px!important;
    }

    .overview-panels > .panel-card{
      min-height:430px!important;
      overflow:hidden!important;
    }

    .overview-panels .panel-title{
      min-height:40px!important;
      padding:10px 12px 4px!important;
    }

    .curve-legend{
      display:flex!important;
      align-items:center!important;
      gap:14px!important;
      min-height:24px!important;
      padding:0 12px 4px!important;
      color:#9ba8b9!important;
      font-size:8px!important;
      font-weight:700!important;
      flex:0 0 auto!important;
    }

    .curve-legend span{
      display:inline-flex!important;
      align-items:center!important;
      gap:5px!important;
    }

    .curve-legend i{
      display:inline-block!important;
      width:16px!important;
      height:3px!important;
      border-radius:999px!important;
    }

    .legend-balance{
      height:9px!important;
      border-radius:2px!important;
      background:#e5b74d!important
    }
    .legend-equity{
      height:9px!important;
      border-radius:2px!important;
      background:linear-gradient(180deg,#45d6a0 0 48%,#e5b74d 48% 100%)!important
    }
    .legend-performance{
      background:repeating-linear-gradient(90deg,#63aaf5 0 5px,transparent 5px 8px)!important;
    }
    .legend-risk{
      background:linear-gradient(90deg,#45d69f 0 34%,#e6b928 34% 64%,#ff536b 64% 100%)!important;
    }

    .equity-chart-wrap{
      position:relative!important;
      width:100%!important;
      height:calc(100% - 72px)!important;
      min-height:340px!important;
      padding:4px 8px 10px!important;
      overflow:hidden!important;
    }

    #equityCanvas{
      display:block!important;
      width:100%!important;
      height:100%!important;
      max-width:100%!important;
    }

    .overview-panels .mini-list{
      padding:0 10px!important;
    }

    .overview-panels .mini-row{
      min-height:38px!important;
      padding:8px 10px!important;
    }

    @media(max-width:1100px){
      .dashboard-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
      }

      .overview-cashflow-row{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
      }

      .overview-panels{
        grid-template-columns:1fr!important;
        min-height:0!important;
      }

      .overview-panels > .panel-card{
        min-height:390px!important;
      }
    }

    @media(max-width:760px){
      .v3-section-head{
        gap:8px!important;
        align-items:flex-start!important;
      }

      #dashboardRange{
        width:150px!important;
        min-width:150px!important;
      }

      .dashboard-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:6px!important;
      }

      .dashboard-grid .metric-card{
        min-height:66px!important;
        padding:8px 9px!important;
      }

      .dashboard-grid .m-value{
        font-size:15px!important;
      }

      .overview-cashflow-row{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:5px!important;
        margin-bottom:7px!important;
      }

      .overview-cashflow-row article{
        min-height:34px!important;
        padding:6px 7px!important;
      }

      .overview-cashflow-row span{
        font-size:6.5px!important;
      }

      .overview-cashflow-row strong{
        font-size:9px!important;
      }

      .overview-panels{
        gap:7px!important;
      }

      .overview-panels > .panel-card{
        min-height:340px!important;
      }

      .equity-chart-wrap{
        min-height:270px!important;
        height:290px!important;
      }

      .curve-legend{
        flex-wrap:wrap!important;
        gap:6px 10px!important;
      }
    }


    /* ===== V9.4 TAB + BALANCE FIX ===== */
    .v3-view{
      display:none!important;
    }

    .v3-view.active{
      display:block!important;
    }

    .v3-view[data-view="dashboard"].active{
      display:flex!important;
    }

    .nav-item[data-target]{
      pointer-events:auto!important;
      cursor:pointer!important;
    }

