:root{
  --ink:#16233D;
  --ink-2:#223350;
  --paper:#F6F4EE;
  --card:#FFFFFF;

  --steel:#3B6E8F;
  --steel-d:#2A5270;
  --copper:#A6620C;

  --ok:#3F7D58;
  --bad:#B23B3B;

  --text:#1D2430;
  --muted:#6B7280;
  --line:#E4E1D8;

  --mono:'SF Mono','JetBrains Mono',ui-monospace,Consolas,monospace;
  --sans:-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
}


/* =====================================================
   BASE
===================================================== */

*{
  box-sizing:border-box;
}

html{
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  min-height:100vh;

  font-family:var(--sans);

  color:var(--text);
  background:var(--paper);
}

a,
button,
input,
select,
textarea{
  font-family:inherit;
}

button,
input,
select,
textarea{
  max-width:100%;
}

a{
  -webkit-tap-highlight-color:transparent;
}

.app{
  display:flex;
  min-height:100vh;
}


/* =====================================================
   SIDEBAR
===================================================== */

.side{
  width:220px;
  min-height:100vh;

  flex-shrink:0;

  display:flex;
  flex-direction:column;

  padding:22px 0;

  background:var(--ink);
  color:#EDEFF4;
}


/* =====================================================
   BRAND
===================================================== */

.brand{
  padding:0 20px 20px;

  margin-bottom:16px;

  border-bottom:1px solid rgba(255,255,255,.12);
}

.brand-top{
  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:12px;
}

.brand-title{
  min-width:0;
}

.brand .mark{
  font-size:11px;
  line-height:1.3;

  letter-spacing:.14em;

  color:#9FB0C8;

  text-transform:uppercase;
}

.brand h1{
  margin:4px 0 2px;

  font-size:20px;
  line-height:1.2;

  font-weight:600;

  color:#fff;
}

.brand .sub{
  font-size:12px;

  color:#7C8CA6;
}


/* =====================================================
   MOBILE MENU BUTTON
===================================================== */

.mobile-menu-btn{
  display:none;

  width:42px;
  height:42px;

  flex-shrink:0;

  padding:9px;

  border:1px solid rgba(255,255,255,.16);
  border-radius:8px;

  background:rgba(255,255,255,.07);

  cursor:pointer;

  -webkit-tap-highlight-color:transparent;
}

.mobile-menu-btn span{
  display:block;

  width:100%;
  height:2px;

  margin:4px 0;

  border-radius:2px;

  background:#fff;

  transform-origin:center;

  transition:
    transform .2s ease,
    opacity .2s ease;
}


/* HAMBURGER -> X */

.side.menu-open .mobile-menu-btn span:nth-child(1){
  transform:translateY(6px) rotate(45deg);
}

.side.menu-open .mobile-menu-btn span:nth-child(2){
  opacity:0;
}

.side.menu-open .mobile-menu-btn span:nth-child(3){
  transform:translateY(-6px) rotate(-45deg);
}


/* =====================================================
   NAVIGATION
===================================================== */

.nav{
  display:flex;
  flex-direction:column;

  gap:2px;

  padding:0 10px;
}

.nav a{
  display:block;

  padding:10px 12px;

  border-radius:6px;

  color:#C6CEDC;

  font-size:14px;
  line-height:1.3;

  text-decoration:none;

  cursor:pointer;

  transition:
    background .15s ease,
    color .15s ease;
}

.nav a:hover{
  background:rgba(255,255,255,.06);
}

.nav a.active{
  background:var(--steel);

  color:#fff;
}


/* =====================================================
   USER BOX
===================================================== */

.user-box{
  margin-top:auto;

  padding:16px 20px 0;

  border-top:1px solid rgba(255,255,255,.12);
}

.user-info{
  display:flex;
  align-items:center;

  gap:10px;

  margin-bottom:10px;
}

.user-avatar{
  display:flex;
  align-items:center;
  justify-content:center;

  width:36px;
  height:36px;

  flex:0 0 36px;

  border-radius:50%;

  background:var(--steel);

  color:#fff;

  font-size:15px;
  font-weight:700;
}

.user-text{
  min-width:0;
}

.user-box .uname{
  overflow:hidden;

  color:#fff;

  font-size:13.5px;
  font-weight:600;

  white-space:nowrap;
  text-overflow:ellipsis;
}

.user-box .urole{
  margin-top:2px;

  color:#9FB0C8;

  font-size:12px;
}

.logout-btn{
  display:inline-block;

  padding:7px 0;

  color:#C6CEDC;

  font-size:12.5px;

  text-decoration:none;
}

.logout-btn:hover{
  color:#fff;
}


/* =====================================================
   MAIN
===================================================== */

.main{
  flex:1;

  min-width:0;

  padding:26px 30px;
}


/* =====================================================
   PAGE HEADER
===================================================== */

.pagehead{
  display:flex;
  align-items:baseline;
  justify-content:space-between;

  flex-wrap:wrap;

  gap:6px;

  margin-bottom:18px;
}

.pagehead h2{
  margin:0;

  font-size:20px;
  font-weight:600;
}

.pagehead .note{
  color:var(--muted);

  font-size:13px;
}


/* =====================================================
   CARDS
===================================================== */

.cards{
  display:grid;

  grid-template-columns:
    repeat(auto-fill,minmax(220px,1fr));

  gap:12px;

  margin-bottom:20px;
}

.card{
  position:relative;

  overflow:hidden;

  padding:14px 16px;

  border:1px solid var(--line);
  border-radius:10px;

  background:var(--card);
}

.card .barcol{
  position:absolute;

  top:0;
  bottom:0;
  left:0;

  width:4px;
}

.card .cname{
  margin-bottom:6px;

  color:var(--muted);

  font-size:12.5px;
}

.card .ctotal{
  font-family:var(--mono);

  font-size:19px;
  font-weight:600;
}

.card .crow{
  display:flex;
  justify-content:space-between;

  gap:10px;

  margin-top:8px;

  color:var(--muted);

  font-family:var(--mono);

  font-size:12px;
}

.card .bar{
  overflow:hidden;

  height:5px;

  margin-top:8px;

  border-radius:3px;

  background:var(--line);
}

.card .bar > i{
  display:block;

  height:100%;
}


/* =====================================================
   GRAND SUMMARY
===================================================== */

.grand{
  display:flex;
  flex-wrap:wrap;

  gap:34px;

  margin-bottom:20px;

  padding:18px 20px;

  border-radius:10px;

  background:var(--ink);

  color:#fff;
}

.grand .k{
  color:#9FB0C8;

  font-size:11px;

  letter-spacing:.08em;

  text-transform:uppercase;
}

.grand .v{
  margin-top:4px;

  font-family:var(--mono);

  font-size:22px;
  font-weight:600;
}


/* =====================================================
   PANEL
===================================================== */

.panel{
  margin-bottom:18px;

  padding:18px 20px;

  border:1px solid var(--line);
  border-radius:10px;

  background:var(--card);
}

.panel h3{
  margin:0 0 14px;

  font-size:15px;
}


/* =====================================================
   FORMS
===================================================== */

.grid2{
  display:grid;

  grid-template-columns:1fr 1fr;

  gap:12px;
}

.field{
  display:flex;
  flex-direction:column;

  gap:5px;

  margin-bottom:12px;
}

.field label{
  color:var(--muted);

  font-size:12.5px;
}

.field input,
.field select,
.field textarea{
  width:100%;

  padding:9px 10px;

  border:1px solid var(--line);
  border-radius:6px;

  outline:none;

  background:#FBFAF7;

  color:var(--text);

  font-size:14px;
}

.field textarea{
  min-height:90px;

  resize:vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color:var(--steel);

  box-shadow:
    0 0 0 3px rgba(59,110,143,.10);
}


/* =====================================================
   BUTTONS
===================================================== */

.btn{
  min-height:38px;

  padding:9px 16px;

  border:0;
  border-radius:6px;

  background:var(--steel);

  color:#fff;

  font-size:13.5px;
  font-weight:600;

  cursor:pointer;

  transition:background .15s ease;
}

.btn:hover{
  background:var(--steel-d);
}

.btn.ghost{
  border:1px solid var(--line);

  background:transparent;

  color:var(--text);
}


/* =====================================================
   TABLE
===================================================== */

table{
  width:100%;

  border-collapse:collapse;

  font-size:13px;
}

th{
  padding:8px 10px;

  border-bottom:1px solid var(--line);

  color:var(--muted);

  font-size:11.5px;

  text-align:left;
  text-transform:uppercase;
}

td{
  padding:9px 10px;

  border-bottom:1px solid var(--line);

  font-family:var(--mono);
}

td.name{
  font-family:var(--sans);
}


/* =====================================================
   TAG
===================================================== */

.tag{
  display:inline-block;

  padding:2px 8px;

  border-radius:20px;

  font-size:11px;
  font-weight:600;
}


/* =====================================================
   EMPTY
===================================================== */

.empty{
  padding:20px 0;

  color:var(--muted);

  font-size:13px;

  text-align:center;
}


/* =====================================================
   FILTERS
===================================================== */

.filters{
  display:flex;
  flex-wrap:wrap;

  gap:8px;

  margin-bottom:14px;
}

.filters a{
  padding:6px 12px;

  border:1px solid var(--line);
  border-radius:20px;

  color:var(--muted);

  font-size:12.5px;

  text-decoration:none;
}

.filters a.on{
  border-color:var(--ink);

  background:var(--ink);

  color:#fff;
}


/* =====================================================
   STATUS COLORS
===================================================== */

.rem-neg{
  color:var(--bad);
}

.rem-pos{
  color:var(--ok);
}


/* =====================================================
   MESSAGES
===================================================== */

.msg-err{
  margin-bottom:14px;

  padding:10px 14px;

  border-radius:6px;

  background:#FBEAEA;

  color:var(--bad);

  font-size:13px;
}

.msg-ok{
  margin-bottom:14px;

  padding:10px 14px;

  border-radius:6px;

  background:#E7F1EA;

  color:var(--ok);

  font-size:13px;
}


/* =====================================================
   LOGIN
===================================================== */

.login-wrap{
  display:flex;
  align-items:center;
  justify-content:center;

  min-height:100vh;

  padding:20px;

  background:var(--ink);
}

.login-box{
  width:320px;
  max-width:100%;

  padding:34px;

  border-radius:12px;

  background:var(--card);
}

.login-box h1{
  margin:0 0 4px;

  font-size:22px;
}

.login-box .sub{
  margin-bottom:20px;

  color:var(--muted);

  font-size:13px;
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width:900px){

  .main{
    padding:22px 18px;
  }

  .cards{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }

  .grid2{
    grid-template-columns:1fr;
  }

  .grand{
    gap:22px;
  }

}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width:760px){

  .app{
    display:block;

    width:100%;

    min-height:100vh;
  }


  /* =========================
     MOBILE HEADER
  ========================= */

  .side{
    display:block;

    width:100% !important;

    min-height:auto !important;

    margin:0;

    padding:0 !important;

    position:relative;

    background:var(--ink);
  }


  /* BRAND */

  .brand{
    width:100%;

    margin:0 !important;

    padding:14px 16px !important;

    border-bottom:1px solid rgba(255,255,255,.12);
  }

  .brand-top{
    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:14px;
  }

  .brand-title{
    flex:1;

    min-width:0;
  }

  .brand .mark{
    margin:0;

    color:#9FB0C8;

    font-size:10px;
    line-height:1.3;

    letter-spacing:.12em;
  }

  .brand h1{
    margin:4px 0 0;

    color:#fff;

    font-size:20px;
    line-height:1.2;

    font-weight:600;
  }


  /* =========================
     HAMBURGER
  ========================= */

  .mobile-menu-btn{
    display:flex !important;

    flex-direction:column;
    align-items:center;
    justify-content:center;

    width:42px;
    height:42px;

    flex:0 0 42px;

    margin:0;

    padding:9px;

    border:1px solid rgba(255,255,255,.18);
    border-radius:8px;

    background:rgba(255,255,255,.07);

    cursor:pointer;

    -webkit-tap-highlight-color:transparent;
  }

  .mobile-menu-btn:hover{
    background:rgba(255,255,255,.12);
  }

  .mobile-menu-btn span{
    display:block;

    width:21px;
    height:2px;

    margin:2.5px 0;

    border-radius:2px;

    background:#fff;

    transition:
      transform .2s ease,
      opacity .2s ease;
  }


  /* HAMBURGER -> X */

  .side.menu-open
  .mobile-menu-btn span:nth-child(1){
    transform:translateY(7px) rotate(45deg);
  }

  .side.menu-open
  .mobile-menu-btn span:nth-child(2){
    opacity:0;
  }

  .side.menu-open
  .mobile-menu-btn span:nth-child(3){
    transform:translateY(-7px) rotate(-45deg);
  }


  /* =========================
     MENU CLOSED
  ========================= */

  .side .nav{
    display:none !important;
  }

  .side .user-box{
    display:none !important;
  }


  /* =========================
     MENU OPEN
  ========================= */

  .side.menu-open .nav{
    display:flex !important;
    flex-direction:column !important;

    width:100%;

    gap:4px;

    margin:0;

    padding:12px 14px !important;

    border-bottom:1px solid rgba(255,255,255,.10);
  }

  .side.menu-open .nav a{
    display:block;

    width:100%;

    padding:12px 14px !important;

    border-radius:7px;

    color:#C6CEDC;

    font-size:15px !important;
    line-height:1.3;

    white-space:normal !important;

    text-decoration:none;
  }

  .side.menu-open .nav a:hover{
    background:rgba(255,255,255,.06);
  }

  .side.menu-open .nav a.active{
    background:var(--steel);

    color:#fff;
  }


  /* =========================
     USER BOX
  ========================= */

  .side.menu-open .user-box{
    display:block !important;

    width:100%;

    margin:0 !important;

    padding:14px 18px 16px !important;

    border-top:0;

    background:rgba(0,0,0,.08);
  }

  .user-info{
    display:flex;
    align-items:center;

    gap:10px;

    margin-bottom:8px;
  }

  .user-avatar{
    display:flex;
    align-items:center;
    justify-content:center;

    width:38px;
    height:38px;

    flex:0 0 38px;

    border-radius:50%;

    background:var(--steel);

    color:#fff;

    font-size:15px;
    font-weight:700;
  }

  .user-text{
    flex:1;

    min-width:0;
  }

  .user-box .uname{
    color:#fff;

    font-size:14px;
    font-weight:600;
  }

  .user-box .urole{
    margin-top:2px;

    color:#9FB0C8;

    font-size:12px;
  }

  .logout-btn{
    display:inline-block;

    margin-top:3px;

    padding:7px 0;

    color:#C6CEDC;

    font-size:13px;

    text-decoration:none;
  }


  /* =========================
     MAIN
  ========================= */

  .main{
    display:block;

    width:100% !important;

    min-width:0;

    padding:18px 14px 28px !important;
  }


  /* =========================
     PAGE HEADER
  ========================= */

  .pagehead{
    display:flex;

    flex-direction:column;

    align-items:flex-start;

    gap:5px;

    margin-bottom:14px;
  }

  .pagehead h2{
    margin:0;

    font-size:20px;
    line-height:1.3;
  }

  .pagehead .note{
    font-size:13px;
    line-height:1.4;
  }


  /* =========================
     CARDS
  ========================= */

  .cards{
    display:grid;

    grid-template-columns:1fr;

    gap:10px;

    margin-bottom:16px;
  }

  .card{
    width:100%;
  }

  .card .ctotal{
    font-size:19px;
  }


  /* =========================
     GRAND SUMMARY
  ========================= */

  .grand{
    display:flex;

    flex-direction:column;

    width:100%;

    gap:16px;

    margin-bottom:16px;

    padding:16px;
  }

  .grand > div{
    width:100%;

    min-width:0;
  }

  .grand .v{
    margin-top:4px;

    font-size:20px;

    word-break:break-word;
  }


  /* =========================
     PANELS
  ========================= */

  .panel{
    width:100%;

    margin-bottom:14px;

    padding:15px 14px;

    border-radius:9px;

    overflow-x:auto;

    -webkit-overflow-scrolling:touch;
  }

  .panel h3{
    font-size:15px;
  }


  /* =========================
     FORMS
  ========================= */

  .grid2{
    display:grid;

    grid-template-columns:1fr;

    gap:0;
  }

  .field{
    width:100%;
  }

  .field input,
  .field select,
  .field textarea{
    width:100%;

    min-height:46px;

    padding:10px 12px;

    font-size:16px;
  }


  /* =========================
     BUTTONS
  ========================= */

  .btn{
    min-height:44px;

    padding:10px 16px;

    font-size:14px;
  }


  /* =========================
     FILTERS
  ========================= */

  .filters{
    display:flex;

    flex-wrap:nowrap;

    gap:7px;

    width:100%;

    overflow-x:auto;

    padding-bottom:5px;

    -webkit-overflow-scrolling:touch;
  }

  .filters::-webkit-scrollbar{
    display:none;
  }

  .filters a{
    flex:0 0 auto;

    white-space:nowrap;
  }


  /* =========================
     TABLES
  ========================= */

  .panel table{
    min-width:680px;
  }


  /* =========================
     LOGIN
  ========================= */

  .login-wrap{
    width:100%;

    min-height:100vh;

    padding:16px;
  }

  .login-box{
    width:100%;

    max-width:380px;

    padding:26px 20px;
  }

}


/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width:420px){

  .brand{
    padding:12px 14px !important;
  }

  .brand .mark{
    font-size:9px;
  }

  .brand h1{
    font-size:19px;
  }

  .mobile-menu-btn{
    width:40px;
    height:40px;

    flex-basis:40px;
  }

  .main{
    padding:16px 10px 24px !important;
  }

  .pagehead h2{
    font-size:19px;
  }

  .panel{
    padding:13px 12px;
  }

  .card{
    padding:14px;
  }

  .card .ctotal{
    font-size:18px;
  }

  .grand{
    padding:15px 14px;
  }

  .grand .v{
    font-size:19px;
  }

  .btn{
    width:100%;
  }

}