/* =========================
       Apple-ish Light UI (MVP)
       ========================= */
:root {
  /* core */
  --bg: #f5f5f7;
  --bg2: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, .12);

  /* surfaces */
  --card: rgba(255, 255, 255, .82);
  --cardSolid: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --shadow2: 0 4px 14px rgba(0, 0, 0, .06);
  --radius: 18px;

  /* brand */
  --accent: #007aff;
  /* Apple blue */
  --accent2: #0a84ff;
  --ok: #34c759;
  /* Apple green */
  --warn: #ff9f0a;
  /* Apple orange */
  --bad: #ff3b30;
  /* Apple red */

  /* controls */
  --btn: #ffffff;
  --btnHover: #f2f3f5;
  --btnText: #111827;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0, 122, 255, .10), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(52, 199, 89, .08), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #eef0f3 100%);
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 245, 247, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 35% 30%, #7cc4ff, #2f86ff 45%, #0d4aa3 100%);
  box-shadow: var(--shadow2);
  flex: 0 0 auto;
}

.title {
  font-weight: 750;
  letter-spacing: .2px
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap
}

.pill {
  display: flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .65);
  padding: 7px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

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

select,
input,
textarea {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .85);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

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

input::placeholder,
textarea::placeholder {
  color: #9aa3af
}

button {
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--btnText);
  border-radius: 14px;
  padding: 8px 11px;
  cursor: pointer;
  transition: .15s transform, .15s background, .15s box-shadow;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

button:hover {
  transform: translateY(-1px);
  background: var(--btnHover);
  box-shadow: var(--shadow2)
}

button:active {
  transform: translateY(0px)
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none
}

.btn-accent {
  border-color: rgba(0, 122, 255, .22);
  background: rgba(0, 122, 255, .10);
}

.btn-ok {
  border-color: rgba(52, 199, 89, .25);
  background: rgba(52, 199, 89, .12)
}

.btn-warn {
  border-color: rgba(255, 159, 10, .28);
  background: rgba(255, 159, 10, .14)
}

.btn-bad {
  border-color: rgba(255, 59, 48, .28);
  background: rgba(255, 59, 48, .12)
}

.btn-ghost {
  background: transparent
}

main {
  padding: 18px 0 46px
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  grid-column: span 4;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 270px;
}

@media (max-width: 980px) {
  .card {
    grid-column: span 6
  }
}

@media (max-width: 640px) {
  .card {
    grid-column: span 12
  }
}

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

.card-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.jobname {
  display: flex;
  gap: 8px;
  align-items: center
}

.jobname strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px
}

.status {
  font-size: 12px;
  color: var(--muted)
}

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

/* Status badges */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.status-running {
  background: rgba(52, 199, 89, .14);
  color: #1a8a3e;
  animation: pulse-running 1.8s ease-in-out infinite;
}

@keyframes pulse-running {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .55
  }
}

.status-paused {
  background: rgba(255, 159, 10, .14);
  color: #b06e00;
}

.status-idle {
  background: rgba(107, 114, 128, .12);
  color: #6b7280;
}

/* Live timer info row */
.timer-info {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.timer-label {
  font-weight: 500;
}

.timer-value {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
}

.timer-work {
  color: #1a8a3e;
}

.timer-break {
  color: #b06e00;
}

.timer-sep {
  color: var(--line);
  font-size: 14px;
}

.clock-area {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, .10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .55));
  padding: 14px;
  min-height: 130px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.digital {
  font-family: var(--mono);
  font-size: 34px;
  letter-spacing: 1px;
  color: #0f172a;
}

canvas {
  max-width: 150px;
  max-height: 150px
}

.btnrow {
  display: flex;
  gap: 10px;
  margin-top: 12px
}

.btnrow button {
  flex: 1
}

/* BIG GAP between clocks and dashboard */
.dashboard-gap {
  height: 26px
}

.bottom {
  grid-column: span 12;
  background: var(--cardSolid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

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

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.tablewrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .70);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: transparent;
}

th,
td {
  border-bottom: 1px solid rgba(17, 24, 39, .10);
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: rgba(245, 245, 247, .95);
  font-size: 12px;
  color: var(--muted);
  z-index: 1;
  backdrop-filter: blur(10px);
}

td {
  font-size: 13px
}

td input,
td textarea {
  width: 100%;
  min-width: 120px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(17, 24, 39, .12);
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}

td textarea {
  min-height: 34px;
  resize: vertical
}

.row-actions {
  display: flex;
  gap: 8px
}

.kpi {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 12px
}

.kpi strong {
  color: var(--text)
}

.divider {
  height: 1px;
  background: rgba(17, 24, 39, .10);
  margin: 12px 0
}

.note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5
}

/* ---------- Big dual-timer display on clock card ---------- */
.clock-timer-area {
  flex-direction: row;
  gap: 0;
  padding: 16px 8px;
  min-height: 110px;
  align-items: stretch;
}

.big-timer-block {
  flex: 0 0 50%;
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 4px;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.big-timer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
}

.big-timer-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0px;
  line-height: 1;
  color: #0f172a;
  white-space: nowrap;
}

.big-timer-value.timer-work {
  color: #1a8a3e;
}

.big-timer-value.timer-break {
  color: #b06e00;
}

.big-timer-divider {
  flex: 0 0 1px;
  width: 1px;
  background: var(--line);
  align-self: stretch;
  margin: 8px 0;
}

/* ---------- Live session rows in dashboard table ---------- */
.live-row {
  background: rgba(52, 199, 89, .05);
  border-left: 3px solid rgba(52, 199, 89, .45);
}

.live-row-paused {
  background: rgba(255, 159, 10, .06);
  border-left: 3px solid rgba(255, 159, 10, .45);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.live-dot-running {
  background: #34c759;
  box-shadow: 0 0 0 2px rgba(52, 199, 89, .25);
  animation: pulse-running 1.4s ease-in-out infinite;
}

.live-dot-paused {
  background: #ff9f0a;
  box-shadow: 0 0 0 2px rgba(255, 159, 10, .25);
}

.live-session-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #1a8a3e;
  white-space: nowrap;
}

.live-row-paused .live-session-label {
  color: #b06e00;
}