:root{
  --bg0:#0b0f14;
  --bg1:#0e141b;

  --panel:#111a23;
  --panel2:#0f1720;

  --line:rgba(255,255,255,.08);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.62);

  --cyan:#52e0ff;
  --purple:#9b7bff;
  --green:#62f0b5;
  --danger:#ff5c7a;

  --radius:14px;
  --shadow:0 18px 40px rgba(0,0,0,.45);

  --mono:ui-monospace,Menlo,Consolas,monospace;
  --sans:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
}

*{ box-sizing:border-box; }
html,body{
  height:100%;
  width:100%;
  overflow-x:hidden; /* prevents mobile horizontal overflow showing blank area */ /* [web:319] */
}

body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(1100px 600px at 20% -10%, rgba(155,123,255,.22), transparent 60%),
    radial-gradient(900px 500px at 80% 0%, rgba(82,224,255,.18), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-repeat:no-repeat;
  background-attachment:fixed;
  min-height:100vh;
}

@media (max-width: 820px){
  body{ background-attachment:scroll; }
}

a{ color:inherit; text-decoration:none; }
.bg{ min-height:100%; }

.muted{ color:var(--muted); }
.small{ font-size:12px; }
.mono{ font-family:var(--mono); }

:where(a,button,input,select,textarea):focus{ outline:none; }
:where(a,button,input,select,textarea):focus-visible{
  outline:3px solid rgba(82,224,255,.55);
  outline-offset:3px;
}

/* Shell */
.page-shell{
  min-height: 100vh;
  display:flex;
  flex-direction:column;
}

.page-shell > main,
.page-shell > .content{
  flex: 1 1 auto;
}

/* Base surfaces */
.panel,.topbar,.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  background:rgba(0,0,0,.22);
}

.panel{ padding:18px; }

/* Containers */
.app-shell{
  max-width:1240px;
  width: calc(100% - 36px);
  margin: 0 auto;
  padding: 0;
}

.content{
  max-width:1240px;
  width: calc(100% - 36px);
  margin: 0 auto;
  padding: 10px 18px 18px 18px;
  display:grid;
  gap:16px;
}

/* Auth pages */
.auth-shell{
  max-width:980px;
  margin:0 auto;
  padding:36px 18px;
  display:grid;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.brand-mini{ display:flex; align-items:center; gap:10px; }

.brand-name{ font-weight:750; letter-spacing:.2px; }
.brand-sub{ color:var(--muted); font-size:13px; }

/* Legacy dot (keep for any pages still using it) */
.logo-dot{
  width:12px;
  height:12px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--cyan));
  box-shadow: 0 0 18px rgba(82,224,255,.35);
}

/* SVG mark */
.mark{ display:inline-flex; align-items:center; justify-content:center; }
.mark svg{ display:block; }

/* Forms */
.form{ display:grid; gap:10px; margin-top:10px; }
label{ color:var(--muted); font-size:13px; }

input,select,textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
}

input:focus,select:focus,textarea:focus{
  border-color: rgba(82,224,255,.35);
  box-shadow: 0 0 0 3px rgba(82,224,255,.12);
}

.form-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:6px;
  gap:10px;
  flex-wrap:wrap;
}

.link{ color: rgba(82,224,255,.9); }
.msg{ min-height:18px; font-size:13px; color: var(--muted); }

/* Buttons */
.btn{
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

.btn:hover{ background:rgba(255,255,255,.07); }
.btn:active{ transform: translateY(1px); }

.btn.primary{
  border-color:rgba(82,224,255,.35);
  background:linear-gradient(180deg, rgba(82,224,255,.18), rgba(82,224,255,.08));
}

.btn.danger{
  border-color: rgba(255,92,122,.35);
  background: linear-gradient(180deg, rgba(255,92,122,.18), rgba(255,92,122,.08));
}

.btn.donate{
  border-color: rgba(155,123,255,.28);
  background: linear-gradient(180deg, rgba(155,123,255,.18), rgba(155,123,255,.08));
}

.btn.small{ padding:8px 10px; font-size:13px; border-radius:10px; }

/* Topbar */
.topbar{
  max-width:1240px;
  width: calc(100% - 36px);
  margin: 10px auto 0 auto;

  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;

  position:sticky;
  top:10px;
  z-index:10;

  gap:12px;
  flex-wrap:wrap;
  backdrop-filter:blur(8px);
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:16px;
  flex:1 1 auto;
  min-width:320px;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex:0 0 auto;
  margin-left:auto;
}

.global-timer .label{ color:var(--muted); font-size:12px; }
.global-timer .value{ font-size:18px; letter-spacing:.4px; }

/* Tabs */
.tabs{
  display:flex;
  gap:10px;
  padding:6px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  border-radius:999px;

  flex:0 0 auto;
  width:max-content;
}

.tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid transparent;
  color:var(--muted);
  background:transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  line-height:1;
}

.tab:hover{
  color:var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

.tab:active{ transform: translateY(1px); }

.tab.active{
  color:var(--text);
  border-color: rgba(82,224,255,.28);
  background: linear-gradient(180deg, rgba(82,224,255,.16), rgba(82,224,255,.06));
  box-shadow: 0 0 0 3px rgba(82,224,255,.10);
}

/* User chip */
.user-chip{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background: rgba(255,255,255,.04);
}

.user-name{ font-size:13px; color: rgba(255,255,255,.84); }

.icon-btn{
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.9);
  cursor:pointer;
}

.icon-btn:hover{ background: rgba(255,255,255,.08); }

/* Headings / layout bits */
h1{ margin: 0 0 8px 0; font-size: 34px; letter-spacing: .2px; }
h2{ margin: 0; }

.grid-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-top: 2px;
}

/* Card grid: desktop-friendly fixed-feel columns */
.card-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 360px));
  justify-content: center;
  gap: 14px;
}

#cards.card-grid{ width:100%; }

/* Cards */
.card{
  padding:16px;
  display:grid;
  gap:10px;
  min-height:180px;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}

.card-title{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.card-title .names{ display:grid; gap:3px; }
.client{ color:var(--muted); font-size:12px; letter-spacing:.2px; }
.project{ font-size:15px; font-weight:650; }

.timer-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.timer-value{ font-size:18px; font-family:var(--mono); }
.card-actions{ display:flex; gap:8px; flex-wrap:wrap; }

/* Tag cloud */
.tag-cloud{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  border-radius:var(--radius);
  padding:12px;
}

.tag-cloud-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.tag-cloud-body{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding-top:8px;

  max-height:92px;
  overflow:auto;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.86);
  user-select:none;
}

.pill.cyan{ border-color: rgba(82,224,255,.25); background: rgba(82,224,255,.10); }
.pill.purple{ border-color: rgba(155,123,255,.25); background: rgba(155,123,255,.10); }
.pill.green{ border-color: rgba(98,240,181,.25); background: rgba(98,240,181,.10); }

/* Modal */
.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:50;
}

.modal{
  width: min(640px, 100%);
  max-height: min(80vh, 720px);
  overflow:auto;

  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,26,35,.98), rgba(14,20,27,.98));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

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

.hr{
  height:1px;
  background: var(--line);
  margin:12px 0;
}

/* Tables (work log) */
.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

.table th,.table td{
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:10px 8px;
  text-align:left;
  vertical-align:top;
}

.table th{ color:rgba(255,255,255,.75); font-weight:650; }

/* QR */
.qr-wrap{
  display:flex;
  gap:14px;
  align-items:center;
  margin:14px 0;
  flex-wrap:wrap;
}

.qr-box{
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.03);
}

/* Footer */
.app-footer{
  max-width:1240px;
  width: calc(100% - 36px);
  margin: 18px auto 18px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,.18);
  box-shadow: var(--shadow);
}

.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px;
}

.footer-left{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.footer-brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-weight:650;
}

.footer-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--cyan));
  box-shadow: 0 0 14px rgba(82,224,255,.28);
}

.footer-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.footer-link{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid transparent;
  color: var(--muted);
}

.footer-link:hover{
  color: var(--text);
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}

.footer-sep{ opacity:.7; }

.auth-footer{
  max-width:980px;
  width: calc(100% - 36px);
  margin: 10px auto 18px auto;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  opacity:.9;
}

/* Responsive tweaks */
@media (max-width: 640px){
  .topbar,
  .content,
  .app-footer,
  .app-shell,
  .auth-footer{
    width: calc(100% - 24px);
  }

  /* Make the topbar wrap instead of forcing horizontal overflow */
  .topbar-left,
  .topbar-right{
    min-width:0;
    width:100%;
  }

  .topbar-right{
    flex-wrap:wrap;
    justify-content:space-between;
  }

  .tabs{
    width:100%;
    justify-content:flex-start;
  }

  /* Prevent long brand/timer text from pushing layout wider */
  .brand-name{
    max-width:140px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  #globalTotal{
    max-width:120px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  /* Grid head: allow the button to wrap under the title */
  .grid-head{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .grid-head .btn{
    margin-top:6px;
  }

  .card-grid{
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}