/* Glass UI — design tokens + shared components. Tailwind utilities handle layout. */
:root {
  --bg: #eceffb;
  --ink: #1f1d3d;
  --ink-2: #5b5f7d;
  --ink-3: #9497b3;
  --accent: #5b4cf0;
  --accent-2: #7c3aed;
  --line: rgba(255, 255, 255, .78);
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .86);
  --shadow: 0 24px 48px -28px rgba(67, 56, 202, .38), 0 2px 6px -2px rgba(67, 56, 202, .08);
  --shadow-lg: 0 34px 60px -30px rgba(79, 70, 229, .55);

  --cat-bedding: #5b4cf0;
  --cat-pillowcase: #38bdf8;
  --cat-towel: #10b981;
}

html { -webkit-font-smoothing: antialiased; }
body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 8% -10%, rgba(124, 58, 237, .16), transparent 60%),
    radial-gradient(50rem 36rem at 100% 0%, rgba(56, 189, 248, .14), transparent 60%),
    radial-gradient(60rem 40rem at 60% 110%, rgba(91, 76, 240, .14), transparent 60%);
  background-attachment: fixed;
}

/* --- surfaces ------------------------------------------------------------------------------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--shadow);
}
.card {
  position: relative;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: inset 0 1px 0 #fff, var(--shadow);
}
/* Raised card with a stacked "plate" underneath. */
.card-raised { z-index: 0; }
.card-raised::after {
  content: "";
  position: absolute;
  inset: auto .75rem -.5rem .75rem;
  height: 1.5rem;
  border-radius: 0 0 1.25rem 1.25rem;
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--line);
  box-shadow: 0 18px 30px -20px rgba(67, 56, 202, .45);
  z-index: -1;
}
/* Colored tab on the right edge (identity accent). */
.accent-tab {
  position: absolute;
  right: -1px;
  top: 2.25rem;
  width: .5rem;
  height: 4.5rem;
  border-radius: .75rem 0 0 .75rem;
  background: var(--tab, var(--accent));
  box-shadow: -6px 0 16px -6px var(--tab, var(--accent));
}
.cat-bedding { --tab: var(--cat-bedding); }
.cat-pillowcase { --tab: var(--cat-pillowcase); }
.cat-towel { --tab: var(--cat-towel); }

.hero-gradient {
  background: linear-gradient(160deg, #8b5cf6 0%, #6d28d9 45%, #4f46e5 100%);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .25);
}
.icon-tile {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; border-radius: .9rem;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px -12px rgba(67, 56, 202, .55);
  color: var(--ink);
}

/* --- form controls -------------------------------------------------------------------------- */
.input {
  width: 100%;
  border: 1px solid rgba(203, 207, 236, .9);
  border-radius: .85rem;
  padding: .6rem .85rem;
  font-size: .875rem;
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 1px 2px rgba(31, 29, 61, .04);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 76, 240, .14); }
.input:disabled { background: rgba(241, 243, 252, .7); color: var(--ink-2); }
.label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; letter-spacing: .01em; }
.hint { font-size: .72rem; color: var(--ink-3); margin-top: .3rem; }

.btn { display: inline-flex; align-items: center; gap: .4rem; border-radius: .85rem; padding: .6rem 1.1rem; font-size: .875rem; font-weight: 600; transition: transform .12s, box-shadow .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 12px 24px -12px rgba(91, 76, 240, .8); }
.btn-primary:hover { box-shadow: 0 16px 28px -12px rgba(91, 76, 240, .95); }
.btn-ghost { background: rgba(255, 255, 255, .8); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.btn-ghost:hover { background: #fff; }

.badge { display: inline-block; border-radius: 9999px; padding: .15rem .6rem; font-size: .72rem; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 9999px; padding: .25rem .7rem; font-size: .72rem; font-weight: 600; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); color: var(--ink-2); }

/* --- tables --------------------------------------------------------------------------------- */
table.data { width: 100%; font-size: .875rem; border-collapse: separate; border-spacing: 0; }
table.data th { text-align: left; font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: .9rem 1rem; border-bottom: 1px solid rgba(203, 207, 236, .6); white-space: nowrap; }
table.data td { padding: .85rem 1rem; border-bottom: 1px solid rgba(203, 207, 236, .35); vertical-align: top; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .6); }
table.data tbody tr:last-child td { border-bottom: 0; }

a.link { color: var(--accent); font-weight: 600; }
a.link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* --- rail navigation ------------------------------------------------------------------------ */
.rail-item { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 1rem; color: var(--ink-2); transition: background .15s, color .15s, box-shadow .15s; }
.rail-item:hover { background: rgba(255, 255, 255, .9); color: var(--accent); }
.rail-item.is-active { color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 10px 22px -10px rgba(91, 76, 240, .9); }
.rail-item.is-soon { opacity: .55; }
.rail-tip { position: absolute; left: calc(100% + .75rem); top: 50%; transform: translateY(-50%) translateX(-4px); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 500; padding: .35rem .6rem; border-radius: .5rem; z-index: 50; }
.rail-item:hover .rail-tip, .rail-item:focus-visible .rail-tip { opacity: 1; transform: translateY(-50%); }

/* --- charts --------------------------------------------------------------------------------- */
.bar { position: relative; width: 100%; max-width: 2.75rem; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #8b7cf8, #5b4cf0); transition: filter .15s; }
.bar-slot:hover .bar { filter: brightness(1.08); }
.bar-tip { position: absolute; bottom: calc(100% + .5rem); left: 50%; transform: translateX(-50%); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; background: #fff; color: var(--ink); font-size: .75rem; font-weight: 600; padding: .35rem .6rem; border-radius: .6rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.bar-slot:hover .bar-tip, .bar-slot:focus-within .bar-tip { opacity: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* --- Virtual Office (M5) ---------------------------------------------------------------------- */
.office-room {
  border-radius: 1.75rem;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 #fff, var(--shadow);
  background: #f4efe6;
}
.office-wall {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.25rem;
  background: linear-gradient(#dcd6f7, #cfc8f2);
  border-bottom: 6px solid #b9a98e;
}
.wall-window {
  display: none; gap: 4px; padding: 4px; border-radius: 6px; background: #f8fafc;
  box-shadow: 0 0 0 3px #a8a29e;
}
.wall-window span { width: 54px; height: 34px; border-radius: 2px; background: linear-gradient(#93c5fd, #e0f2fe); }
.wall-poster {
  font-size: .7rem; font-weight: 700; color: #4338ca; background: #fffdf7; padding: .35rem .7rem; border-radius: .5rem;
  box-shadow: 0 2px 0 #a8a29e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.wall-clock {
  display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 999px; background: #fff;
  box-shadow: 0 0 0 4px #4b5563; font-weight: 800; font-size: .8rem; line-height: 1; font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.wall-clock small { font-size: .55rem; color: var(--ink-3); }
.office-floor {
  display: grid; gap: .75rem 1rem; padding: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "manaja manaja" "risa copa" "proma kontena" "somed tray" "anala kometa" "board board";
  background-color: #efe6d6;
  background-image:
    linear-gradient(45deg, rgba(180, 150, 110, .14) 25%, transparent 25%, transparent 75%, rgba(180, 150, 110, .14) 75%),
    linear-gradient(45deg, rgba(180, 150, 110, .14) 25%, transparent 25%, transparent 75%, rgba(180, 150, 110, .14) 75%);
  background-size: 48px 48px; background-position: 0 0, 24px 24px;
}
.pantry { display: none; }
@media (min-width: 768px) {
  .wall-window { display: flex; }
  .office-floor {
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.5rem; padding: 1.5rem 2rem 2rem;
    grid-template-areas: "risa copa proma kontena" "board manaja manaja tray" "anala pantry kometa somed";
  }
  .pantry { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .25rem; }
}

.desk {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: .25rem .25rem .6rem; border-radius: 1.25rem; cursor: pointer; min-width: 0;
  transition: background-color .2s;
}
.desk:hover, .desk:focus-visible { background: rgba(255, 255, 255, .55); outline: none; }
.desk:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.sprite-wrap { position: relative; display: block; width: 100%; max-width: 8.5rem; }
.desk-leader .sprite-wrap { max-width: 10.5rem; }
.desk-sprite { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.nameplate {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .3rem; padding: .2rem .6rem;
  border-radius: 999px; background: #fffdf7; box-shadow: 0 2px 0 rgba(120, 90, 60, .25); font-size: .8rem;
  max-width: 100%; white-space: nowrap;
}
.desk-leader .nameplate { background: #eef2ff; box-shadow: 0 2px 0 #a5b4fc; }
.role { margin-top: .2rem; font-size: .68rem; color: var(--ink-2); line-height: 1.2; }
.queue-chip { font-size: .62rem; font-weight: 700; padding: 0 .35rem; border-radius: 999px; background: #e0e7ff; color: #3730a3; }
.state-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 999px; background: #94a3b8; }
.tone-indigo { background: #6366f1; } .tone-sky { background: #0ea5e9; } .tone-amber { background: #f59e0b; }
.tone-rose { background: #f43f5e; } .tone-slate { background: #94a3b8; }

.bubble-slot { display: flex; align-items: flex-end; justify-content: center; min-height: 2.6rem; width: 100%; }
.bubble {
  position: relative; max-width: 100%; padding: .3rem .55rem; border-radius: .7rem; background: #fff;
  font-size: .68rem; line-height: 1.25; color: var(--ink); box-shadow: 0 2px 0 rgba(120, 90, 60, .2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px;
}
.st-bekerja .bubble { background: #eef2ff; }
.st-error .bubble { background: #fff1f2; color: #9f1239; }
.st-istirahat .bubble, .st-revisi .bubble { background: #fffbeb; }

/* status effects next to the head */
.fx { position: absolute; top: 2%; right: 12%; display: none; font-weight: 800; line-height: 1; }
.st-bekerja .fx-bekerja, .st-menunggu .fx-menunggu, .st-revisi .fx-revisi, .st-error .fx-error,
.st-istirahat .fx-istirahat { display: inline-flex; }
.fx-bekerja { gap: 3px; padding: 4px 6px; border-radius: 999px; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.fx-bekerja i { width: 4px; height: 4px; border-radius: 99px; background: #6366f1; animation: fx-dot 1s infinite; }
.fx-bekerja i:nth-child(2) { animation-delay: .15s; } .fx-bekerja i:nth-child(3) { animation-delay: .3s; }
.fx-menunggu { color: #0284c7; background: #fff; border-radius: 99px; padding: 3px; animation: fx-swing 2s ease-in-out infinite; }
.fx-revisi { color: #b45309; font-size: 1.1rem; animation: fx-wiggle .6s ease-in-out infinite; }
.fx-error { color: #fff; background: #f43f5e; width: 1.3rem; height: 1.3rem; border-radius: 99px; justify-content: center; align-items: center; animation: fx-bounce .8s ease-in-out infinite; }
.fx-istirahat { color: #64748b; font-size: .8rem; gap: 1px; align-items: flex-end; }
.fx-istirahat b, .fx-istirahat i { font-style: normal; animation: fx-float 2.4s ease-in-out infinite; }
.fx-istirahat b { font-size: .95rem; animation-delay: .4s; } .fx-istirahat i { font-size: 1.1rem; animation-delay: .8s; }

/* sprite animations — SVG user units are px here */
.desk-sprite .eyes, .desk-sprite .head, .desk-sprite .hands, .desk-sprite .avatar { transform-box: fill-box; transform-origin: center; }
.desk-sprite .steam { opacity: 0; }
.st-idle .desk-sprite .avatar { animation: px-breathe 3.2s steps(1) infinite; }
.desk-sprite .eyes { animation: px-blink 5s steps(1) infinite; }
.st-bekerja .desk-sprite .hands { animation: px-type .32s steps(1) infinite; }
.st-bekerja .desk-sprite .screen { animation: px-glow 1.1s steps(2) infinite; }
.st-revisi .desk-sprite .hands { animation: px-type .7s steps(1) infinite; }
.st-revisi .desk-sprite .screen { fill: #f59e0b; }
.st-menunggu .desk-sprite .head { animation: px-look 3s steps(1) infinite; }
.st-error .desk-sprite { animation: px-shake .5s ease-in-out 2; }
.st-error .desk-sprite .screen { fill: #f43f5e; }
.st-istirahat .desk-sprite .eyes { transform: scaleY(.25); animation: none; }
.st-istirahat .desk-sprite .head { transform: translateY(1px) rotate(6deg); }
.st-istirahat .desk-sprite .steam { animation: px-steam 2s steps(2) infinite; }
.st-istirahat .desk-sprite { filter: saturate(.7); }
.desk-ping { animation: desk-ping .9s ease-out; }

.tray .sprite-wrap { max-width: 6.5rem; }
.tray:hover { text-decoration: none; }

.whiteboard {
  align-self: center; padding: .8rem 1rem; border-radius: .9rem; background: #fff; border: 4px solid #cbd5e1;
  box-shadow: 0 3px 0 rgba(120, 90, 60, .25);
}

.doc-fly {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  min-width: 2.1rem; height: 2.5rem; padding: .7rem .25rem 0; border-radius: 3px;
  background: linear-gradient(#fff 0 0) padding-box, #fff; border: 2px solid #4f46e5; color: #3730a3;
  font-size: .62rem; font-weight: 800; text-align: center; box-shadow: 0 6px 14px -6px rgba(67, 56, 202, .6);
  background-image: repeating-linear-gradient(#fff 0 5px, #e0e7ff 5px 6px);
}

@keyframes fx-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes fx-swing { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
@keyframes fx-wiggle { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(14deg) translateY(-1px); } }
@keyframes fx-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fx-float { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes px-breathe { 0%, 60% { transform: translateY(0); } 61%, 100% { transform: translateY(.5px); } }
@keyframes px-blink { 0%, 94% { transform: scaleY(1); } 95%, 97% { transform: scaleY(.15); } 98%, 100% { transform: scaleY(1); } }
@keyframes px-type { 0%, 49% { transform: translateY(0); } 50%, 100% { transform: translateY(-1px); } }
@keyframes px-glow { 0% { fill: #a5b4fc; } 100% { fill: #6366f1; } }
@keyframes px-look { 0%, 45% { transform: translateX(0); } 46%, 70% { transform: translateX(-1px); } 71%, 100% { transform: translateX(1px); } }
@keyframes px-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes px-steam { 0% { opacity: .9; } 100% { opacity: .2; } }
@keyframes desk-ping { 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, .55); background: rgba(238, 242, 255, .9); } 100% { box-shadow: 0 0 0 18px rgba(99, 102, 241, 0); } }

@media (prefers-reduced-motion: reduce) {
  .office-room *, .desk { animation: none !important; }
}

/* --- Kanban (M5) ------------------------------------------------------------------------------ */
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15.5rem, 1fr); gap: .9rem;
  overflow-x: auto; padding-bottom: .75rem; scroll-snap-type: x proximity;
}
.kanban-col {
  position: relative; scroll-snap-align: start; border-radius: 1.25rem; background: var(--glass);
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 #fff; min-height: 10rem; align-self: start;
}
.kanban-col::before {
  content: ""; position: absolute; left: 1rem; right: 1rem; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--tab);
}
.kanban-alert { background: rgba(255, 241, 242, .75); }
.kanban-card {
  display: block; padding: .6rem .7rem .55rem .85rem; border-radius: .9rem; background: var(--glass-strong);
  border: 1px solid #fff; box-shadow: 0 6px 14px -12px rgba(67, 56, 202, .5);
  border-left: 4px solid var(--cat, var(--accent)); transition: transform .15s, box-shadow .15s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -12px rgba(67, 56, 202, .6); }
.htmx-swapping .kanban-card { opacity: .6; }
.kanban-col > div { max-height: 34rem; overflow-y: auto; }
.state-dot { flex-shrink: 0; }
