:root{
  --navy:#102640;
  --blue:#2f6fed;
  --bg:#f4f7fb;
  --text:#172033;
  --muted:#6b778b;
  --line:#dfe6ef;
  --green:#20885a;
  --red:#c83f3f;
  --orange:#c77618;
  --card:#fff;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;
  background:var(--bg);
  color:var(--text);
}

button,
input,
select,
textarea{
  font:inherit;
}

.hidden{
  display:none!important;
}

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

.center-screen{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:22px;
  background:linear-gradient(135deg,#102640,#1f4f82);
}

.auth-card{
  width:min(450px,100%);
  background:white;
  border-radius:20px;
  padding:30px;
  box-shadow:0 24px 70px #0003;
}

.auth-logo{
  display:block;
  width:280px;
  max-width:88%;
  height:auto;
  margin:0 auto 24px;
  object-fit:contain;
}

.logo{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:var(--blue);
  color:#fff;
  font-weight:850;
}

.auth-card h1{
  margin:18px 0 4px;
}

.muted{
  color:var(--muted);
}

.small{
  font-size:12px;
}

.tabs{
  display:flex;
  gap:8px;
  margin:22px 0;
}

.tab{
  flex:1;
  border:1px solid var(--line);
  background:#fff;
  padding:10px;
  border-radius:9px;
  font-weight:700;
}

.tab.active{
  background:#edf4ff;
  color:var(--blue);
  border-color:#bed1ff;
}

label{
  display:block;
  font-weight:700;
  font-size:13px;
  margin:13px 0 6px;
}

input,
select,
textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:10px;
  padding:11px 12px;
  background:#fff;
}

.primary,
.secondary,
.danger{
  border:0;
  border-radius:10px;
  padding:11px 14px;
  font-weight:750;
  cursor:pointer;
}

.primary{
  background:var(--blue);
  color:white;
}

.secondary{
  background:white;
  border:1px solid var(--line);
}

.danger{
  background:#ffeaea;
  color:var(--red);
}

.wide{
  width:100%;
  margin-top:18px;
}

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

.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:245px 1fr;
}

.sidebar{
  height:100vh;
  position:sticky;
  top:0;
  background:var(--navy);
  color:white;
  padding:20px 15px;
  display:flex;
  flex-direction:column;
}

.brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:8px;
  padding:4px 7px 18px;
  border-bottom:1px solid #ffffff1c;
}

.sidebar-logo{
  display:block;
  width:135px;
  max-width:90%;
  height:auto;
  max-height:85px;
  object-fit:contain;
  margin:0 auto 4px;
}

.brand > div{
  width:100%;
}

.brand strong{
  display:block;
  font-size:14px;
}

.brand span{
  display:block;
  font-size:12px;
  color:#b8c7da;
  margin-top:3px;
}

.small-logo{
  width:42px;
  height:42px;
  border-radius:11px;
}

nav{
  display:grid;
  gap:5px;
  margin-top:18px;
}

.nav{
  border:0;
  background:transparent;
  color:#dbe6f3;
  text-align:left;
  padding:12px 14px;
  border-radius:9px;
  font-weight:650;
  cursor:pointer;
}

.nav.active,
.nav:hover{
  background:#ffffff18;
  color:white;
}

.user-box{
  margin-top:auto;
  border-top:1px solid #ffffff1c;
  padding:15px 8px 0;
}

.user-box span,
.user-box small{
  display:block;
}

.user-box small{
  color:#afbed2;
  margin:3px 0 8px;
}

.link-btn{
  border:0;
  background:transparent;
  color:#9fc1ff;
  padding:0;
  cursor:pointer;
}

/* =========================================================
   TOPBAR / CONTENT
========================================================= */

.topbar{
  background:white;
  border-bottom:1px solid var(--line);
  padding:22px 28px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

.topbar h2{
  margin:0;
}

.topbar p{
  margin:5px 0 0;
  color:var(--muted);
}

.top-actions{
  display:flex;
  gap:9px;
}

.content{
  padding:26px 28px;
}

.grid{
  display:grid;
  gap:16px;
}

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

.two{
  grid-template-columns:1.25fr .75fr;
  margin-top:16px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:15px;
  padding:18px;
  box-shadow:0 8px 24px #142b500d;
}

.stat-label{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

.stat-value{
  font-size:31px;
  font-weight:850;
  margin:7px 0;
}

.stat-meta{
  font-size:13px;
  color:var(--muted);
}

.good{
  color:var(--green);
}

.warn{
  color:var(--orange);
}

.bad{
  color:var(--red);
}

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.section-head h3{
  margin:0;
}

.section-head span{
  color:var(--muted);
  font-size:13px;
}

.table-wrap{
  overflow:auto;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,
td{
  text-align:left;
  padding:11px 9px;
  border-bottom:1px solid var(--line);
  font-size:14px;
}

th{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
}

.badge{
  display:inline-flex;
  border-radius:999px;
  padding:5px 8px;
  font-size:11px;
  font-weight:800;
  background:#edf4ff;
  color:var(--blue);
}

.badge.green{
  background:#e7f7ef;
  color:var(--green);
}

.badge.red{
  background:#ffeded;
  color:var(--red);
}

.badge.orange{
  background:#fff1df;
  color:var(--orange);
}

.toolbar{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.toolbar input,
.toolbar select{
  width:auto;
  min-width:180px;
}

.empty{
  padding:30px;
  text-align:center;
  color:var(--muted);
}

.feed{
  display:grid;
  gap:11px;
}

.feed-item{
  border-left:4px solid var(--blue);
  padding:9px 11px;
  background:#fafcff;
  border-radius:7px;
}

.feed-item p{
  margin:0;
}

.feed-item small{
  color:var(--muted);
}

/* =========================================================
   TIME CLOCK
========================================================= */

.clock-card{
  text-align:center;
  padding:30px;
}

.clock-time{
  font-size:42px;
  font-weight:850;
}

.clock-location{
  color:var(--muted);
  margin:7px 0 20px;
}

.clock-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

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

.modal{
  position:fixed;
  inset:0;
  background:#08152580;
  display:grid;
  place-items:center;
  padding:18px;
  z-index:20;
}

.modal-card{
  width:min(620px,100%);
  max-height:92vh;
  overflow:auto;
  background:white;
  border-radius:17px;
  padding:20px;
}

.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.modal-head h3{
  margin:0;
}

.icon{
  border:0;
  background:#edf1f6;
  width:34px;
  height:34px;
  border-radius:9px;
  font-size:20px;
  cursor:pointer;
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.form-actions{
  display:flex;
  justify-content:flex-end;
  gap:9px;
  margin-top:18px;
}

.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  background:#102640;
  color:white;
  padding:12px 15px;
  border-radius:10px;
  z-index:50;
  box-shadow:0 8px 30px #0003;
}

.message-list{
  display:grid;
  gap:10px;
}

.message{
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
}

.message strong{
  display:block;
}

.message small{
  color:var(--muted);
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width:1000px){
  .stats{
    grid-template-columns:repeat(2,1fr);
  }

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

@media(max-width:760px){

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

  .sidebar{
    position:static;
    height:auto;
  }

  .sidebar-logo{
    width:120px;
    max-height:72px;
  }

  .sidebar nav{
    grid-template-columns:repeat(2,1fr);
  }

  .user-box{
    display:none;
  }

  .topbar{
    padding:17px;
    align-items:flex-start;
  }

  .content{
    padding:17px;
  }

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

  .top-actions{
    flex-direction:column;
  }

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

  .auth-logo{
    width:185px;
    max-width:75%;
  }
}

/* =========================================================
   APP BACKGROUND WATERMARK
========================================================= */

main{
  position:relative;
  overflow:hidden;
}

main::before{
  content:"";
  position:fixed;

  left:245px;
  right:0;
  top:70px;
  bottom:0;

  background-image:url("timeallyear-logo.png");
  background-repeat:no-repeat;
  background-position:center center;
  background-size:min(700px,55vw);

  opacity:0.035;

  pointer-events:none;
  z-index:0;
}

.topbar,
.content{
  position:relative;
  z-index:1;
}

/* =========================================================
   DARK MODE
========================================================= */

html[data-theme="dark"]{

  --bg:#0b1220;

  --text:#e8eef7;

  --muted:#94a3b8;

  --line:#263449;

  --card:#131e2f;

  --navy:#0a1d33;

  --blue:#4f86f7;

  --green:#42b883;

  --red:#f87171;

  --orange:#f0a64b;

  color-scheme:dark;
}


/* =========================================================
   GENERAL
========================================================= */

html[data-theme="dark"] body{
  background:var(--bg);
  color:var(--text);
}


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

html[data-theme="dark"] .center-screen{
  background:
    linear-gradient(
      135deg,
      #07111f,
      #102640
    );
}


html[data-theme="dark"] .auth-card{
  background:var(--card);
  color:var(--text);
}


html[data-theme="dark"] .tab{
  background:#111c2c;
  color:var(--text);
  border-color:var(--line);
}


html[data-theme="dark"] .tab.active{
  background:#172d4d;
  color:#7da7ff;
  border-color:#355d96;
}


/* =========================================================
   INPUTS
========================================================= */

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#0f1928;
  color:var(--text);
  border-color:var(--line);
}


html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{
  color:#718096;
}


html[data-theme="dark"] option{
  background:#0f1928;
  color:var(--text);
}


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

html[data-theme="dark"] .secondary{
  background:#172235;
  color:var(--text);
  border-color:var(--line);
}


html[data-theme="dark"] .secondary:hover{
  background:#1d2b41;
}


html[data-theme="dark"] .danger{
  background:#3b1d23;
  color:#ff9b9b;
}


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

html[data-theme="dark"] .sidebar{
  background:var(--navy);
}


html[data-theme="dark"] .topbar{
  background:#101a2a;
  border-color:var(--line);
}


html[data-theme="dark"] .card{
  background:var(--card);
  border-color:var(--line);

  box-shadow:
    0 8px 24px
    rgba(
      0,
      0,
      0,
      .18
    );
}


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

html[data-theme="dark"] table{
  color:var(--text);
}


html[data-theme="dark"] th,
html[data-theme="dark"] td{
  border-color:var(--line);
}


html[data-theme="dark"] tbody tr:hover{
  background:#182438;
}


/* =========================================================
   FEED
========================================================= */

html[data-theme="dark"] .feed-item{
  background:#101b2c;
}


/* =========================================================
   MODALS
========================================================= */

html[data-theme="dark"] .modal{
  background:
    rgba(
      2,
      8,
      18,
      .82
    );
}


html[data-theme="dark"] .modal-card{
  background:var(--card);
  color:var(--text);
}


html[data-theme="dark"] .icon{
  background:#1e2b3f;
  color:var(--text);
}


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

html[data-theme="dark"] .message{
  background:#101b2c;
  border-color:var(--line);
}


/* =========================================================
   BADGES
========================================================= */

html[data-theme="dark"] .badge{
  background:#172d4d;
  color:#8db2ff;
}


html[data-theme="dark"] .badge.green{
  background:#153a2d;
  color:#6ee7b7;
}


html[data-theme="dark"] .badge.red{
  background:#3d2024;
  color:#fca5a5;
}


html[data-theme="dark"] .badge.orange{
  background:#412d18;
  color:#f7bd72;
}


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

html[data-theme="dark"] .empty{
  color:var(--muted);
}


/* =========================================================
   WATERMARK
========================================================= */

html[data-theme="dark"] main::before{
  opacity:.025;
}


/* =========================================================
   SCROLLBARS
========================================================= */

html[data-theme="dark"] ::-webkit-scrollbar{
  width:10px;
  height:10px;
}


html[data-theme="dark"] ::-webkit-scrollbar-track{
  background:#0b1220;
}


html[data-theme="dark"] ::-webkit-scrollbar-thumb{
  background:#30415a;
  border-radius:999px;
}


html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{
  background:#405574;
}