:root {
    --red: #d71e2b;
    --red-dark: #a80f1c;
    --ink: #1f1b1a;
    --charcoal: #26201f;
    --muted: #716c67;
    --line: #e7e2db;
    --paper: #fffdfa;
    --canvas: #f4f1ec;
    --cream: #f8f5f0;
    --gold: #e8b849;
    --green: #227a4b;
    --shadow: 0 18px 50px rgba(43, 32, 28, .08);

    /* Animation timing custom properties */
    --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
    --ease-out-back: cubic-bezier(.34, 1.56, .64, 1);
    --ease-spring: cubic-bezier(.2, .85, .32, 1.1);
    --ease-smooth: cubic-bezier(.4, 0, .2, 1);
    --duration-fast: .15s;
    --duration-normal: .25s;
    --duration-slow: .4s;
    --duration-entrance: .6s;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
.muted { color: var(--muted); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-gold { color: #956d13; font-size: 10px; font-weight: 700; }

/* Subtle texture overlay on canvas background */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .018; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-repeat: repeat; background-size: 256px 256px; }

/* Custom focus states */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

.brand { align-items: center; display: inline-flex; gap: 12px; }
.brand-mark { align-items: center; background: var(--red); border-radius: 50%; color: #fff; display: inline-flex; flex: 0 0 auto; font-family: "Noto Serif JP", serif; font-size: 18px; font-weight: 700; height: 48px; justify-content: center; width: 48px; }
.brand-mark--small { border-radius: 12px; height: 38px; width: 38px; }
.brand strong { display: block; font-family: "Syne", sans-serif; font-size: 15px; letter-spacing: -.01em; }
.brand small { color: #8a837d; display: block; font-size: 9px; letter-spacing: .12em; margin-top: 2px; text-transform: uppercase; }
.brand--light strong { color: #fff; }
.brand--light small { color: rgba(255,255,255,.45); }
.eyebrow { color: var(--red); display: block; font-size: 10px; font-weight: 700; letter-spacing: .16em; margin-bottom: 8px; text-transform: uppercase; }
.eyebrow--light { color: #efc7ca; }

.button { align-items: center; background: white; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); display: inline-flex; font-size: 13px; font-weight: 700; gap: 12px; justify-content: center; min-height: 42px; padding: 9px 16px; transition: background var(--duration-fast) var(--ease-smooth), border-color var(--duration-fast) var(--ease-smooth), box-shadow var(--duration-normal) var(--ease-smooth), transform var(--duration-fast) var(--ease-smooth), color var(--duration-fast) var(--ease-smooth); }
.button:hover { border-color: #cfc7bd; transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.98); }
.button--primary { background: var(--red); border-color: var(--red); color: white; box-shadow: 0 8px 22px rgba(215,30,43,.18); }
.button--primary:hover { background: var(--red-dark); border-color: var(--red-dark); box-shadow: 0 12px 28px rgba(215,30,43,.25); }
.button--quiet { background: transparent; }
.button--wide { width: 100%; }
.button--large { min-height: 50px; padding: 12px 20px; }

/* Login */
.login-page { background: #f5f1eb; min-height: 100vh; }
.login-page body::before { display: none; }

/* Animated gradient background for login */
.login-shell { display: grid; grid-template-columns: minmax(460px, .94fr) minmax(500px, 1.06fr); min-height: 100vh; }
.login-story { background: var(--charcoal); color: #fff; display: flex; flex-direction: column; min-height: 100%; overflow: hidden; padding: 48px 56px; position: relative; background: linear-gradient(135deg, #1a1615, #26201f 35%, #2d1f1f 65%, #1a1615); background-size: 300% 300%; animation: loginGradient 12s ease infinite; }
.login-story::before { background: radial-gradient(circle, rgba(255,255,255,.07) 0 1px, transparent 1.5px); background-size: 22px 22px; content: ""; inset: 0; opacity: .45; position: absolute; animation: dotDrift 30s linear infinite; }
.login-story::after { border: 90px solid rgba(215,30,43,.16); border-radius: 50%; content: ""; height: 460px; position: absolute; right: -240px; top: 12%; width: 460px; animation: ringPulse 8s ease-in-out infinite; }
.login-story > * { position: relative; z-index: 1; }
.login-story__content { margin: auto 0; max-width: 570px; padding: 80px 0; }
.login-story__content h1 { font-family: "Syne", sans-serif; font-size: clamp(42px, 4.6vw, 70px); letter-spacing: -.055em; line-height: .98; margin-bottom: 28px; }
.login-story__content p { color: rgba(255,255,255,.6); font-size: 16px; line-height: 1.75; max-width: 500px; }
.login-metrics { border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin-top: 50px; padding-top: 24px; }
.login-metrics div { display: flex; flex-direction: column; }
.login-metrics strong { color: var(--gold); font-family: "Syne", sans-serif; font-size: 20px; font-feature-settings: "tnum" 1; }
.login-metrics span { color: rgba(255,255,255,.55); font-size: 11px; }
.login-story__foot { color: rgba(255,255,255,.34); letter-spacing: .12em; }

/* Login panel with entrance animation */
.login-panel { align-items: center; display: flex; justify-content: center; padding: 60px; animation: loginPanelIn .8s var(--ease-out-expo) both; }
.login-card { max-width: 410px; width: 100%; animation: loginCardIn .7s var(--ease-out-back) .15s both; }
.login-card h2 { font-family: "Syne", sans-serif; font-size: 42px; letter-spacing: -.045em; margin: 0 0 8px; }
.login-card > p { color: var(--muted); margin-bottom: 34px; }
.mobile-brand-mark { display: none; }
.stack-lg { display: grid; gap: 20px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: #514b47; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.field input, .field select, .field textarea { background: #fff; border: 1px solid #dcd5cc; border-radius: 8px; color: var(--ink); min-height: 45px; outline: none; padding: 10px 12px; transition: border-color var(--duration-fast) ease, box-shadow var(--duration-normal) ease, transform var(--duration-fast) ease; width: 100%; }
.field textarea { min-height: auto; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,30,43,.1), 0 2px 8px rgba(215,30,43,.06); transform: translateY(-1px); }
.field input::placeholder, .field textarea::placeholder { color: #aaa29a; }
.password-field { position: relative; }
.password-field input { padding-right: 66px; }
.icon-button { background: transparent; border: 0; color: var(--red); font-size: 11px; font-weight: 700; padding: 7px; position: absolute; right: 7px; top: 7px; transition: color var(--duration-fast) ease; }
.icon-button:hover { color: var(--red-dark); }

/* Login submit button loading state */
.login-card .button--primary { position: relative; overflow: hidden; }
.login-card .button--primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent); transform: translateX(-100%); }
.login-card form:invalid .button--primary::after { display: none; }

.login-help { border-top: 1px solid var(--line); color: var(--muted); display: flex; flex-wrap: wrap; font-size: 11px; gap: 7px 12px; margin-top: 30px; padding-top: 18px; }
.login-help code { color: var(--ink); font-weight: 700; }
.login-help span:last-child { flex-basis: 100%; }
.alert { border-radius: 8px; font-size: 13px; line-height: 1.5; margin-bottom: 20px; padding: 12px 14px; animation: alertSlideIn .4s var(--ease-out-expo) both; }
.alert--error { background: #fff0f1; border: 1px solid #f4c8cb; color: #9f1320; }
.alert--warning { background: #fff8df; border: 1px solid #eddc9e; color: #755b04; }
.alert--success { background: #edf9f1; border: 1px solid #bfe1ca; color: #176239; }

/* Office shell */
.app-shell { min-height: 100vh; }
.sidebar { background: var(--charcoal); color: #fff; display: flex; flex-direction: column; inset: 0 auto 0 0; padding: 0 16px; position: fixed; width: 252px; z-index: 20; background: linear-gradient(180deg, #2a2322 0%, var(--charcoal) 40%, #211c1b 100%); }
.sidebar__header { align-items: center; border-bottom: 1px solid rgba(255,255,255,.09); display: flex; height: 78px; justify-content: space-between; padding: 0 5px; }
.sidebar-close { background: transparent; border: 0; color: #fff; display: none; font-size: 24px; transition: transform var(--duration-fast) ease; }
.sidebar-close:hover { transform: rotate(90deg); }
.main-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 0; scrollbar-color: rgba(255,255,255,.16) transparent; scrollbar-width: thin; }

/* Custom scrollbar for main-nav */
.main-nav::-webkit-scrollbar { width: 4px; }
.main-nav::-webkit-scrollbar-track { background: transparent; }
.main-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 10px; }
.main-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }

.nav-label { color: rgba(255,255,255,.28); font-size: 9px; font-weight: 700; letter-spacing: .16em; margin: 20px 10px 7px; text-transform: uppercase; }
.nav-item { align-items: center; border-radius: 8px; color: rgba(255,255,255,.59); display: flex; font-size: 12px; font-weight: 600; gap: 10px; margin-bottom: 3px; min-height: 42px; padding: 8px 10px; position: relative; transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-normal) ease, transform var(--duration-fast) ease; }
.main-nav button.nav-item { background: transparent; border: 0; text-align: left; width: 100%; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; box-shadow: 0 0 20px rgba(215,30,43,.05); }
.nav-item:active { transform: scale(.98); }
.nav-item.is-active { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.is-active::before { background: var(--red); border-radius: 0 2px 2px 0; content: ""; height: 20px; left: -16px; position: absolute; width: 3px; animation: activeSlideIn .35s var(--ease-out-expo) both; box-shadow: 2px 0 8px rgba(215,30,43,.3); }
.nav-icon { align-items: center; background: rgba(255,255,255,.07); border-radius: 7px; display: inline-flex; font-family: "Noto Serif JP", serif; height: 27px; justify-content: center; width: 27px; transition: background var(--duration-fast) ease, transform var(--duration-fast) ease; }
.nav-item:hover .nav-icon { transform: scale(1.05); }
.nav-item.is-active .nav-icon { background: var(--red); box-shadow: 0 4px 12px rgba(215,30,43,.25); }
.nav-item em { background: rgba(255,255,255,.1); border-radius: 10px; font-size: 9px; font-style: normal; margin-left: auto; padding: 2px 7px; }

/* Improved sidebar-support card */
.sidebar__support { background: linear-gradient(145deg, rgba(215,30,43,.22), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; margin: 14px 0 16px; padding: 16px; position: relative; overflow: hidden; transition: border-color var(--duration-normal) ease, transform var(--duration-fast) ease; }
.sidebar__support::before { content: ""; position: absolute; top: -50%; right: -50%; width: 100%; height: 100%; background: radial-gradient(circle, rgba(215,30,43,.08), transparent 70%); pointer-events: none; }
.sidebar__support:hover { border-color: rgba(255,255,255,.14); transform: translateY(-1px); }
.sidebar__support strong { display: block; font-family: "Syne", sans-serif; font-size: 13px; position: relative; }
.sidebar__support p { color: rgba(255,255,255,.45); font-size: 10px; line-height: 1.55; margin: 7px 0 0; position: relative; }

.sidebar__user { align-items: center; border-top: 1px solid rgba(255,255,255,.09); display: flex; gap: 9px; margin: 0 -16px; min-height: 70px; padding: 12px 18px; }
.sidebar__user > span:nth-child(2) { min-width: 0; }
.sidebar__user strong, .sidebar__user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user strong { font-size: 11px; }
.sidebar__user small { color: rgba(255,255,255,.38); font-size: 9px; margin-top: 2px; }
.sidebar__user a { color: rgba(255,255,255,.4); margin-left: auto; transition: color var(--duration-fast) ease, transform var(--duration-fast) ease; }
.sidebar__user a:hover { color: var(--red); transform: translateX(2px); }

/* Avatar with ring animation for sidebar user */
.avatar { align-items: center; background: var(--red); border-radius: 50%; color: #fff; display: inline-flex; flex: 0 0 auto; font-size: 10px; font-weight: 800; height: 34px; justify-content: center; width: 34px; transition: box-shadow var(--duration-normal) ease, transform var(--duration-fast) ease; }
.sidebar__user .avatar { box-shadow: 0 0 0 2px var(--charcoal), 0 0 0 3px rgba(215,30,43,.4); }
.sidebar__user:hover .avatar { box-shadow: 0 0 0 2px var(--charcoal), 0 0 0 3px var(--red), 0 0 12px rgba(215,30,43,.2); }
.avatar--soft { background: #f5e2e4; color: var(--red); }
.workspace { margin-left: 252px; padding: 28px 34px 50px; position: relative; z-index: 1; }
.topbar { align-items: center; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 26px; }
.topbar h1 { font-family: "Syne", sans-serif; font-size: 29px; letter-spacing: -.035em; margin: 0 0 4px; }
.topbar p { color: var(--muted); font-size: 12px; margin: 0; }
.topbar__actions { display: flex; gap: 9px; }
.menu-button { background: white; border: 1px solid var(--line); border-radius: 8px; display: none; font-size: 18px; height: 42px; width: 42px; transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease; }
.menu-button:active { background: var(--canvas); box-shadow: inset 0 2px 4px rgba(0,0,0,.06); }
.sidebar-scrim { display: none; }

/* Toast notification with slide-in animation */
.toast { align-items: center; border-radius: 10px; display: flex; font-size: 12px; gap: 10px; margin: -8px 0 22px; overflow: hidden; padding: 12px 15px; position: relative; animation: toastSlideIn .5s var(--ease-out-expo) both; }
.toast::after { animation: toastProgress var(--toast-remaining, 6s) linear forwards; background: currentColor; bottom: 0; content: ''; height: 3px; left: 0; opacity: .3; position: absolute; transform-origin: left; width: 100%; }
.toast:hover::after { animation-play-state: paused; }
.toast.is-restarting::after, .toast.is-leaving::after { animation: none; }
.toast > span { align-items: center; border: 1px solid currentColor; border-radius: 50%; display: inline-flex; height: 21px; justify-content: center; width: 21px; }
.toast button { background: transparent; border: 0; color: inherit; font-size: 18px; margin-left: auto; transition: transform var(--duration-fast) ease; }
.toast button:hover { transform: scale(1.15); }
.toast.is-leaving { animation: toastFadeOut .4s ease both; }

.button.is-loading { opacity: .78; pointer-events: none; }
.button.is-loading::before { animation: buttonSpin .6s linear infinite; border: 2px solid currentColor; border-radius: 50%; border-top-color: transparent; content: ''; display: inline-block; flex: none; height: 13px; margin-right: 8px; vertical-align: -2px; width: 13px; }

.table-empty td { color: var(--muted); font-size: 13px; padding: 26px 14px; text-align: center; }

/* Dashboard */
.workday-card { align-items: center; background: var(--charcoal); border-radius: 14px; color: #fff; display: grid; gap: 24px; grid-template-columns: minmax(300px, 1.4fr) auto minmax(285px, .8fr); margin-bottom: 18px; overflow: hidden; padding: 27px 30px; position: relative; box-shadow: 0 20px 50px rgba(38,32,31,.12); }
.workday-card::before { border: 44px solid rgba(215,30,43,.16); border-radius: 50%; content: ""; height: 230px; left: 38%; position: absolute; top: -100px; width: 230px; animation: ringFloat 20s ease-in-out infinite; }
.workday-card > * { position: relative; z-index: 1; }
.workday-card__intro h2 { font-family: "Syne", sans-serif; font-size: 24px; letter-spacing: -.035em; margin: 0 0 7px; }
.workday-card__intro p { color: rgba(255,255,255,.5); font-size: 11px; line-height: 1.55; margin: 0; }

/* Live time with subtle pulse */
.live-time { align-items: flex-end; border-left: 1px solid rgba(255,255,255,.1); border-right: 1px solid rgba(255,255,255,.1); display: grid; grid-template-columns: auto auto; min-width: 190px; padding: 3px 25px; }
.live-time strong { font-family: "Syne", sans-serif; font-size: 27px; letter-spacing: -.04em; font-feature-settings: "tnum" 1; animation: clockPulse 2s ease-in-out infinite; }
.live-time > span { color: var(--gold); font-size: 9px; font-weight: 800; margin: 0 0 4px 6px; }
.live-time small { color: rgba(255,255,255,.35); font-size: 8px; grid-column: 1 / -1; margin-top: 2px; }
.workday-card__status { display: grid; gap: 9px; }

/* Status indicator dots with pulse animation */
.shift-state { align-items: center; color: rgba(255,255,255,.65); display: flex; font-size: 9px; font-weight: 700; gap: 7px; }
.shift-state i, .attendance-state i { background: #8d8580; border-radius: 50%; height: 7px; width: 7px; transition: background var(--duration-normal) ease, box-shadow var(--duration-normal) ease; }
.shift-state--running i, .attendance-state--working i { background: #4bd487; box-shadow: 0 0 0 4px rgba(75,212,135,.12); animation: statusPulse 2s ease-in-out infinite; }
.shift-state--complete i, .attendance-state--complete i { background: var(--gold); }
.clock-form { display: flex; gap: 7px; }
.clock-form > input { background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: #fff; font-size: 9px; min-width: 0; outline: 0; padding: 8px 10px; width: 100%; transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease; }
.clock-form > input::placeholder { color: rgba(255,255,255,.28); }
.clock-form > input:focus { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); }
.button--clock { background: var(--red); border-color: var(--red); color: #fff; flex: 0 0 auto; min-width: 112px; }
.button--clock:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button--clock:disabled { background: rgba(255,255,255,.12); border-color: transparent; box-shadow: none; color: rgba(255,255,255,.45); cursor: default; transform: none; }
.shift-mini { display: flex; gap: 22px; }
.shift-mini span { align-items: center; display: flex; gap: 6px; }
.week-progress { background: rgba(255,255,255,.16); border-radius: 99px; display: inline-block; height: 4px; overflow: hidden; width: 46px; }
.week-progress i { background: var(--gold); border-radius: 99px; display: block; height: 100%; transition: width .6s var(--ease-out-expo); }
.shift-mini small { color: rgba(255,255,255,.35); font-size: 8px; }
.shift-mini strong { color: rgba(255,255,255,.8); font-size: 8px; }

/* Metrics grid with gradient borders on cards */
.metrics-grid { display: grid; gap: 14px; grid-template-columns: 1.2fr repeat(3, 1fr); margin-bottom: 18px; }
.metrics-grid--three { grid-template-columns: repeat(3, 1fr); }
.metric-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-height: 138px; overflow: hidden; padding: 21px; position: relative; }
.metric-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--red), var(--gold), var(--green)); opacity: 0; transition: opacity var(--duration-normal) ease; }
.metric-card:hover::before { opacity: 1; }
.metric-card > span { color: var(--muted); display: block; font-size: 11px; margin-bottom: 13px; }
.metric-card > strong { display: block; font-family: "Syne", sans-serif; font-size: clamp(22px, 2.1vw, 31px); letter-spacing: -.04em; line-height: 1.05; font-feature-settings: "tnum" 1; }
.metric-card > small { color: #928b84; display: block; font-size: 10px; margin-top: 12px; }
.metric-card > small i { background: var(--green); border-radius: 50%; display: inline-block; height: 6px; margin-right: 5px; width: 6px; animation: statusPulse 2.5s ease-in-out infinite; }
.metric-card--hero { background: var(--red); border-color: var(--red); color: #fff; }
.metric-card--hero::before { background: linear-gradient(90deg, rgba(255,255,255,.2), rgba(255,255,255,.05)); opacity: 1; }
.metric-card--hero > span, .metric-card--hero > small { color: rgba(255,255,255,.65); }
.metric-card--hero > b { color: rgba(255,255,255,.1); font-family: "Noto Serif JP", serif; font-size: 94px; line-height: 1; position: absolute; right: -4px; top: 13px; }
.dashboard-grid { display: grid; gap: 18px; grid-template-columns: 1.45fr 1fr; }

/* Panel with hover lift */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; padding: 22px; }
.panel--wide { grid-row: span 2; }
.panel__head { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 18px; }
.panel__head h2 { font-family: "Syne", sans-serif; font-size: 17px; letter-spacing: -.025em; margin: 0; }
.panel__head a { color: var(--red); font-size: 10px; font-weight: 700; margin-top: 9px; transition: color var(--duration-fast) ease; }
.panel__head a:hover { color: var(--red-dark); }
.panel__head--tools { align-items: center; }

/* Table with slide-in row highlight */
.table-wrap { overflow-x: auto; position: relative; }
/* Scroll shadow indicators for horizontal tables */
.table-wrap::before, .table-wrap::after { content: ""; position: sticky; top: 0; bottom: 0; width: 20px; z-index: 2; pointer-events: none; }
table { border-collapse: collapse; min-width: 680px; width: 100%; }
th { border-bottom: 1px solid var(--line); color: #96908a; font-size: 9px; font-weight: 700; letter-spacing: .1em; padding: 10px 12px; text-align: left; text-transform: uppercase; }
td { border-bottom: 1px solid #eeeae5; color: #524d49; font-size: 11px; padding: 14px 12px; vertical-align: middle; transition: background var(--duration-fast) ease; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--duration-fast) ease; }
tbody tr:hover { background: #fbf8f4; }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.person { align-items: center; display: flex; gap: 9px; min-width: 150px; }
.person strong, .person small { display: block; }
.person strong { color: var(--ink); font-size: 11px; }
.person small { color: #98918b; font-size: 9px; margin-top: 3px; }
.person--compact .avatar { height: 28px; width: 28px; }
.table-main, .table-sub { display: block; }
.table-main { color: var(--ink); font-size: 11px; }
.table-sub { color: #98918b; font-size: 9px; margin-top: 4px; }

/* Badge with subtle shadow */
.badge { background: #eeeae5; border-radius: 30px; color: #68615c; display: inline-block; font-size: 8px; font-style: normal; font-weight: 800; letter-spacing: .04em; padding: 5px 9px; text-transform: uppercase; box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease; }
.badge:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.badge--active, .badge--paid, .badge--approved, .badge--final, .badge--open, .badge--ongoing { background: #e3f4e9; color: #227a4b; }
.badge--issued, .badge--planned, .badge--partial, .badge--pending { background: #fff0cf; color: #91630d; }
.badge--overdue, .badge--cancelled, .badge--void, .badge--rejected { background: #fde6e8; color: #a71b26; }
.badge--graduated, .badge--completed { background: #e9e6fa; color: #5b47a5; }
.class-pill { background: #f0edff; border-radius: 5px; color: #58479a; display: inline-block; font-size: 9px; font-weight: 800; padding: 5px 7px; }
.invoice-link, .row-action { color: var(--red); font-size: 10px; font-weight: 700; white-space: nowrap; transition: color var(--duration-fast) ease; }
.invoice-link:hover, .row-action:hover { color: var(--red-dark); }
.row-action--button { background: transparent; border: 0; padding: 6px; }
.schedule-list { display: grid; gap: 5px; }
.schedule-item { align-items: center; border-bottom: 1px solid #eeeae5; display: grid; gap: 10px; grid-template-columns: 42px 1fr auto; padding: 11px 0; transition: background var(--duration-fast) ease; }
.schedule-item:hover { background: rgba(244,238,232,.5); }
.schedule-item:last-child { border-bottom: 0; }
.date-chip { align-items: center; background: #f4eee8; border-radius: 8px; display: flex; flex-direction: column; height: 42px; justify-content: center; transition: transform var(--duration-fast) ease; }
.schedule-item:hover .date-chip { transform: scale(1.05); }
.date-chip strong { font-family: "Syne", sans-serif; font-size: 16px; line-height: 1; font-feature-settings: "tnum" 1; }
.date-chip span { color: var(--red); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.schedule-item > div:nth-child(2) strong, .schedule-item > div:nth-child(2) span, .schedule-item > div:nth-child(2) small { display: block; }
.schedule-item > div:nth-child(2) strong { font-size: 11px; }
.schedule-item > div:nth-child(2) span { color: #68625d; font-size: 9px; margin: 3px 0; }
.schedule-item > div:nth-child(2) small { color: #9b948d; font-size: 8px; }
.mini-level { color: var(--red); font-family: "Syne", sans-serif; font-size: 10px; font-weight: 800; }
.activity-list > div { display: flex; gap: 10px; padding: 8px 0; }
.activity-dot { background: var(--red); border: 4px solid #f9dfe1; border-radius: 50%; flex: 0 0 auto; height: 12px; margin-top: 3px; width: 12px; animation: statusPulse 3s ease-in-out infinite; }
.activity-list p { color: #6a645f; font-size: 10px; line-height: 1.45; margin: 0; }
.activity-list p strong { color: var(--ink); }
.activity-list small { color: #9e9790; display: block; font-size: 8px; margin-top: 2px; }
.empty-state { align-items: center; display: flex; flex-direction: column; justify-content: center; min-height: 310px; padding: 40px; text-align: center; }
.empty-state > span { align-items: center; background: #f6e8e9; border-radius: 50%; color: var(--red); display: flex; font-family: "Noto Serif JP", serif; font-size: 28px; height: 68px; justify-content: center; margin-bottom: 18px; width: 68px; }
.empty-state h3 { font-family: "Syne", sans-serif; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 12px; max-width: 310px; }
.search-field { align-items: center; background: white; border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 7px; min-width: min(290px, 40vw); padding: 0 10px; transition: border-color var(--duration-fast) ease, box-shadow var(--duration-normal) ease; }
.search-field:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,30,43,.08); }
.search-field span { color: #999; }
.search-field input { background: transparent; border: 0; font-size: 11px; height: 38px; outline: none; width: 100%; }

/* Classes and courses */
.class-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.class-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.class-card:hover { transform: translateY(-2px); }
.class-card__top { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 22px; }
.level-block { align-items: center; background: var(--red); border-radius: 8px; color: #fff; display: inline-flex; font-family: "Syne", sans-serif; font-size: 12px; font-weight: 800; height: 42px; justify-content: center; min-width: 42px; padding: 0 8px; }
.class-card h2, .course-row h2 { font-family: "Syne", sans-serif; font-size: 19px; letter-spacing: -.03em; margin: 0 0 4px; }
.jp-title { color: #928a84; font-family: "Noto Serif JP", serif; font-size: 11px; }
.class-facts { display: grid; gap: 14px 10px; grid-template-columns: repeat(2, 1fr); margin: 23px 0; }
.class-facts div { border-left: 2px solid #eee7e0; padding-left: 9px; }
.class-facts dt, .class-facts dd { margin: 0; }
.class-facts dt, .course-row dt { color: #9b948d; font-size: 8px; letter-spacing: .08em; margin-bottom: 4px; text-transform: uppercase; }
.class-facts dd { color: #4e4844; font-size: 10px; line-height: 1.45; }
.capacity { border-top: 1px solid var(--line); padding-top: 15px; }
.capacity > div:first-child { display: flex; font-size: 9px; justify-content: space-between; }
.capacity > div:first-child span { color: #827a74; }
.progress { background: #eee9e4; border-radius: 10px; height: 5px; margin: 9px 0 6px; overflow: hidden; }
.progress i { background: var(--red); border-radius: inherit; display: block; height: 100%; transition: width .6s var(--ease-out-expo); }
.capacity small { color: #9b948e; font-size: 8px; }
.course-list { display: grid; gap: 14px; }
.course-row { align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 24px; grid-template-columns: 75px minmax(260px, 1fr) auto auto; padding: 24px; }
.course-row:hover { transform: translateY(-2px); }
.course-row.is-archived { opacity: .62; }
.course-level { align-items: center; background: var(--charcoal); border-radius: 50%; color: #fff; display: flex; font-family: "Syne", sans-serif; font-size: 16px; font-weight: 800; height: 60px; justify-content: center; width: 60px; }
.course-main > p:last-child { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 9px 0 0; max-width: 650px; }
.course-row dl { display: grid; gap: 18px; grid-template-columns: repeat(3, auto); margin: 0; }
.course-row dl div { border-left: 1px solid var(--line); min-width: 95px; padding-left: 16px; }
.course-row dt, .course-row dd { margin: 0; }
.course-row dd { font-size: 11px; font-weight: 700; }

/* Staff & attendance */
.staff-summary, .content-summary { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.staff-summary article, .content-summary article { align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; display: flex; gap: 15px; padding: 20px; transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease; }
.staff-summary article:hover, .content-summary article:hover { transform: translateY(-2px); }
.summary-icon { align-items: center; border-radius: 10px; display: flex; flex: 0 0 auto; font-family: "Noto Serif JP", serif; font-size: 17px; height: 48px; justify-content: center; width: 48px; transition: transform var(--duration-fast) ease; }
.staff-summary article:hover .summary-icon, .content-summary article:hover .summary-icon { transform: scale(1.08); }
.summary-icon--red { background: #fae8e9; color: var(--red); }
.summary-icon--green { background: #e2f6e9; color: var(--green); }
.summary-icon--gold { background: #fbf0d5; color: #956d13; }
.staff-summary small, .staff-summary strong, .staff-summary p, .content-summary small, .content-summary strong, .content-summary p { display: block; margin: 0; }
.staff-summary small, .content-summary small { color: var(--muted); font-size: 9px; }
.staff-summary strong, .content-summary strong { font-family: "Syne", sans-serif; font-size: 24px; letter-spacing: -.04em; line-height: 1.1; margin: 4px 0; font-feature-settings: "tnum" 1; }
.staff-summary p, .content-summary p { color: #9b948d; font-size: 8px; }
.staff-directory { margin-bottom: 18px; }
.avatar--staff { background: var(--charcoal); }
.branch-pill { background: #f0ede8; border-radius: 5px; color: #665f59; display: inline-block; font-size: 9px; font-weight: 700; padding: 5px 8px; }
.attendance-state { align-items: center; color: #6d6660; display: inline-flex; font-size: 9px; font-weight: 700; gap: 7px; white-space: nowrap; }
.attendance-state--working { color: var(--green); }
.attendance-state--complete { color: #91630d; }
.attendance-state--inactive { color: #a71b26; }
.table-sub--wrap { max-width: 200px; white-space: normal; }
.timezone-note { color: #98918a; font-size: 9px; }
.attendance-panel { scroll-margin-top: 20px; }
.empty-state--compact { min-height: 230px; }
.empty-state--compact > span { height: 54px; width: 54px; }

/* Public content manager */
.content-section { margin-bottom: 18px; }
.permission-note { align-items: center; background: #fff7dd; border: 1px solid #eedc9b; border-radius: 10px; color: #725a0e; display: flex; font-size: 10px; gap: 10px; margin-bottom: 18px; padding: 12px 15px; }
.permission-note span { color: #907828; }
.story-snippet { -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #77706a; display: -webkit-box; font-size: 10px; line-height: 1.45; max-width: 260px; overflow: hidden; }
/* Better truncation with fade-out gradient */
.story-snippet::after { content: ""; display: block; }
.inquiry-status { align-items: center; display: flex; gap: 5px; }
.inquiry-status select { background: #fff; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-size: 9px; min-height: 32px; padding: 5px 7px; }
.inquiry-status button { background: var(--charcoal); border: 0; border-radius: 7px; color: #fff; font-size: 9px; font-weight: 700; min-height: 32px; padding: 5px 9px; transition: background var(--duration-fast) ease; }
.inquiry-status button:hover { background: var(--ink); }
.row-actions { align-items: center; display: flex; gap: 3px; }
.row-actions form { margin: 0; }
.row-action--danger { background: transparent; border: 0; color: #a71b26; font-size: 9px; font-weight: 700; padding: 6px; transition: color var(--duration-fast) ease; }
.row-action--restore { background: transparent; border: 0; color: var(--green); cursor: pointer; font-size: 9px; font-weight: 700; padding: 6px; }
.shift-history-link { color: rgba(255,255,255,.72); display: inline-block; font-size: 9px; font-weight: 700; margin-top: 10px; text-decoration: none; }
.shift-history-link:hover { color: #fff; }
.attendance-toolbar { align-items: end; display: flex; gap: 8px; }
.attendance-toolbar form { align-items: end; display: flex; gap: 6px; }
.attendance-toolbar label span { color: var(--muted); display: block; font-size: 8px; font-weight: 700; margin-bottom: 4px; text-transform: uppercase; }
.attendance-toolbar input { background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; min-height: 34px; padding: 6px 9px; }
.attendance-toolbar button, .day-nav { align-items: center; background: var(--charcoal); border: 0; border-radius: 8px; color: #fff; display: inline-flex; font-size: 9px; font-weight: 700; height: 34px; justify-content: center; min-width: 34px; padding: 0 10px; text-decoration: none; }
.attendance-toolbar button:hover, .day-nav:hover { background: var(--ink); }
.day-nav.is-disabled { cursor: default; opacity: .28; }
.attendance-day-summary { align-items: center; background: #f7f3ee; border: 1px solid var(--line); border-radius: 10px; display: flex; gap: 24px; margin-bottom: 15px; padding: 12px 15px; }
.attendance-day-summary span small, .attendance-day-summary span strong { display: block; }
.attendance-day-summary span small { color: var(--muted); font-size: 8px; }
.attendance-day-summary span strong { font-size: 13px; margin-top: 2px; }
.attendance-day-summary em { color: var(--muted); font-size: 8px; font-style: normal; margin-left: auto; }
.profile-hero { align-items: center; display: grid; gap: 20px; grid-template-columns: auto 1fr auto; margin-bottom: 16px; }
.profile-avatar { align-items: center; background: var(--charcoal); border-radius: 18px; color: #fff; display: flex; font-size: 24px; height: 76px; justify-content: center; width: 76px; }
.profile-hero h2 { font-size: 24px; margin: 4px 0; }
.profile-hero p, .profile-hero small { color: var(--muted); display: block; margin: 0; }
.profile-hero dl { display: grid; gap: 12px; grid-template-columns: repeat(3,auto); margin: 0; }
.profile-hero dl div { border-left: 1px solid var(--line); padding-left: 14px; }
.profile-hero dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.profile-hero dd { font-size: 10px; font-weight: 700; margin: 4px 0 0; }
.leave-balance-grid { display: grid; gap: 14px; grid-template-columns: repeat(3,1fr); margin-bottom: 16px; }
.leave-balance-card { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 12px; grid-template-columns: auto 1fr; overflow: hidden; padding: 17px; position: relative; }
.leave-balance-card > span { align-items: center; background: #fae8e9; border-radius: 10px; color: var(--red); display: flex; font-family: "Noto Serif JP",serif; height: 42px; justify-content: center; width: 42px; }
.leave-balance-card small,.leave-balance-card strong,.leave-balance-card p { display:block; margin:0; }
.leave-balance-card small,.leave-balance-card p { color:var(--muted); font-size:8px; }
.leave-balance-card strong { font-size:15px; margin:3px 0; }
.leave-balance-card > i { background:#eee7df; bottom:0; height:3px; left:0; position:absolute; right:0; }
.leave-balance-card > i::after { background:var(--red); content:""; display:block; height:100%; width:var(--balance); }
.profile-report-card,.security-card { align-items:center; display:flex; justify-content:space-between; margin-bottom:16px; }
.profile-report-card h2,.security-card h2 { margin:4px 0; }
.profile-report-card p,.security-card p { color:var(--muted); margin:0; }
.permission-note--urgent { border-color:#e3a3a8; background:#fff0f1; color:#8c1420; }
.compact-number { border:1px solid var(--line); border-radius:7px; font-size:10px; max-width:72px; padding:7px; }
.report-page { background:#ece8e2; padding:30px; }
.report-paper { background:#fff; box-shadow:var(--shadow); margin:auto; max-width:1100px; min-height:760px; padding:38px; }
.report-paper > header { align-items:flex-start; border-bottom:2px solid var(--ink); display:flex; justify-content:space-between; margin-bottom:24px; padding-bottom:20px; }
.report-paper h1 { font-size:26px; margin:5px 0; }
.report-paper header p,.report-paper footer { color:var(--muted); }
.report-actions,.report-filter { align-items:end; display:flex; gap:8px; }
.report-filter { background:#f7f3ee; border-radius:10px; margin-bottom:18px; padding:14px; }
.report-filter label span { color:var(--muted); display:block; font-size:8px; font-weight:700; margin-bottom:5px; text-transform:uppercase; }
.report-filter input,.report-filter select { background:#fff; border:1px solid var(--line); border-radius:8px; min-height:38px; padding:7px 10px; }
.report-paper footer { font-size:9px; margin-top:25px; text-align:right; }
.row-action--danger:hover { color: #d71e2b; }
.story-admin-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story-admin-card { background: #fbf8f4; border: 1px solid var(--line); border-radius: 10px; padding: 17px; transition: border-color var(--duration-normal) ease, box-shadow var(--duration-normal) ease, transform var(--duration-fast) ease; }
.story-admin-card:hover { border-color: #d8d0c7; box-shadow: 0 8px 25px rgba(42,31,27,.06); transform: translateY(-2px); }
.story-admin-card.is-archived { opacity: .62; }
.story-admin-card__top { align-items: center; display: flex; gap: 10px; }
.story-admin-card__top > div { min-width: 0; }
.story-admin-card__top strong, .story-admin-card__top small { display: block; }
.story-admin-card__top strong { font-size: 11px; }
.story-admin-card__top small { color: var(--muted); font-size: 9px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-admin-card__top .badge { margin-left: auto; }
.story-admin-card blockquote { color: #645e59; font-size: 11px; line-height: 1.65; margin: 16px 0; }
.story-admin-card footer { align-items: center; border-top: 1px solid var(--line); color: #956d13; display: flex; font-size: 9px; font-weight: 700; justify-content: space-between; padding-top: 11px; }

/* Payroll & executive signature */
.payroll-net { color: var(--ink); font-family: "Syne", sans-serif; font-size: 12px; font-feature-settings: "tnum" 1; }
.signature-mini { align-items: center; display: flex; gap: 8px; min-width: 155px; }
.signature-mini img { background: #fff; border-bottom: 1px solid #d8d1ca; height: 34px; object-fit: contain; width: 80px; }
.signature-mini span, .signature-mini small { display: block; }
.signature-mini span { color: var(--ink); font-size: 8px; }
.signature-mini small { color: var(--muted); font-size: 7px; margin-top: 2px; }
.signature-review { background: var(--charcoal); border-radius: 10px; color: white; margin-bottom: 16px; padding: 17px 19px; }
.signature-review span, .signature-review strong, .signature-review small { display: block; }
.signature-review span { color: var(--gold); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.signature-review strong { font-family: "Syne", sans-serif; font-size: 17px; margin: 7px 0 5px; }
.signature-review small { color: rgba(255,255,255,.42); font-size: 8px; }
.signature-pad { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 15px; overflow: hidden; }
.signature-pad__head { align-items: center; background: #f7f3ee; display: flex; font-size: 9px; font-weight: 700; justify-content: space-between; padding: 9px 12px; }
.signature-pad__head button { background: transparent; border: 0; color: var(--red); font-size: 9px; font-weight: 700; }
.signature-pad canvas { background: linear-gradient(180deg, #fff, #fffdf9); cursor: crosshair; display: block; height: 180px; touch-action: none; width: 100%; }
.signature-pad p { border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; margin: 0; padding: 8px 12px; }

/* Letterhead and document editor */
.document-workspace { align-items: start; display: grid; gap: 18px; grid-template-columns: 310px minmax(0, 1fr); margin-bottom: 18px; }
.brand-studio { position: sticky; top: 18px; }
.logo-drop { align-items: center; background: #faf7f2; border: 1px dashed #cfc6bc; border-radius: 11px; cursor: pointer; display: flex; flex-direction: column; min-height: 165px; padding: 18px; text-align: center; transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) ease, box-shadow var(--duration-normal) ease; }
.logo-drop:hover, .logo-drop.is-dragging { background: #fff0f1; border-color: var(--red); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(215,30,43,.08); }
.logo-drop input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.logo-drop > span { align-items: center; background: white; border: 1px solid var(--line); border-radius: 12px; display: flex; height: 70px; justify-content: center; margin-bottom: 12px; overflow: hidden; width: 92px; }
.logo-drop > span img { height: 100%; object-fit: contain; width: 100%; }
.logo-drop b { color: var(--red); font-family: "Noto Serif JP", serif; font-size: 34px; }
.logo-drop strong { font-size: 10px; }
.logo-drop small { color: var(--muted); font-size: 8px; margin-top: 4px; }
.color-field input { cursor: pointer; height: 46px; padding: 5px; }
.editor-grid { align-items: start; display: grid; gap: 24px; grid-template-columns: minmax(310px, .85fr) minmax(390px, 1.15fr); }
.document-form { display: grid; gap: 13px; }
.editor-toolbar { align-items: center; background: #f7f3ee; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; }
.editor-toolbar button { background: white; border: 1px solid var(--line); border-radius: 5px; font-size: 8px; font-weight: 700; padding: 6px 8px; transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease; }
.editor-toolbar button:hover { background: var(--canvas); border-color: #cfc7bd; }
.editor-toolbar span { color: var(--muted); font-size: 7px; margin-left: auto; }
.document-form__actions { display: flex; gap: 7px; }
.document-form__actions .button { flex: 1; }
.is-disabled { opacity: .45; pointer-events: none; }
.letter-preview { --letter-accent: var(--red); aspect-ratio: 8.5 / 11; background: white; border: 1px solid #ddd6cf; box-shadow: 0 18px 45px rgba(40,30,26,.11); color: #302b28; display: flex; flex-direction: column; min-height: 620px; overflow: hidden; padding: 42px 44px 28px; position: sticky; top: 18px; }
.letter-preview::before { background: var(--letter-accent); content: ""; height: 5px; inset: 0 0 auto; position: absolute; }
.letter-preview header { align-items: center; border-bottom: 2px solid var(--letter-accent); display: flex; gap: 13px; padding-bottom: 18px; }
.letter-preview__logo { align-items: center; background: var(--letter-accent); border-radius: 9px; color: white; display: flex; flex: 0 0 auto; font-family: "Noto Serif JP", serif; font-size: 24px; height: 52px; justify-content: center; overflow: hidden; width: 60px; }
.letter-preview__logo img { background: white; height: 100%; object-fit: contain; width: 100%; }
.letter-preview header strong, .letter-preview header small { display: block; }
.letter-preview header strong { font-family: "Syne", sans-serif; font-size: 15px; }
.letter-preview header small { color: #877f78; font-size: 7px; margin-top: 3px; }
.letter-preview__meta { display: grid; margin: 28px 0 20px; }
.letter-preview__meta span { color: #8e867f; font-size: 8px; margin-bottom: 19px; text-align: right; }
.letter-preview__meta strong { font-size: 10px; }
.letter-preview__meta small { color: #7d756f; font-size: 8px; margin-top: 4px; white-space: pre-line; }
.letter-preview h3 { color: var(--letter-accent); font-size: 10px; margin: 8px 0 20px; }
.letter-preview__body { color: #5f5853; font-family: Georgia, serif; font-size: 9px; line-height: 1.8; white-space: pre-wrap; }
.letter-preview footer { border-top: 1px solid #ddd6cf; color: #8a827b; display: flex; font-size: 7px; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.document-library { margin-bottom: 0; }

/* Motion */
.ui-reveal { animation: uiRise .55s cubic-bezier(.2,.7,.25,1) both; animation-delay: var(--reveal-delay, 0ms); }
.panel, .metric-card, .content-summary > article, .class-card, .course-row { transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease; }
.panel:hover, .content-summary > article:hover { border-color: #d8d0c7; box-shadow: 0 12px 35px rgba(42,31,27,.055); }
@keyframes uiRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Modals and forms */
.modal { background: var(--paper); border: 0; border-radius: 14px; box-shadow: 0 30px 90px rgba(24,18,16,.25); color: var(--ink); max-height: 92vh; max-width: 680px; padding: 0; width: calc(100% - 32px); animation: modalOpen .35s var(--ease-out-expo) both; }
.modal--large { max-width: 1040px; }
.modal::backdrop { background: rgba(26,22,21,.68); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: backdropIn .3s ease both; }
.modal > form { max-height: 92vh; overflow-y: auto; }
.modal__head { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 23px 27px 20px; }
.modal__head h2 { font-family: "Syne", sans-serif; font-size: 23px; letter-spacing: -.035em; margin: 0 0 5px; }
.modal__head p { color: var(--muted); font-size: 11px; margin: 0; }
.modal__head > button { background: #f1ede8; border: 0; border-radius: 50%; color: #6e6762; font-size: 20px; height: 34px; width: 34px; transition: background var(--duration-fast) ease, transform var(--duration-fast) ease; }
.modal__head > button:hover { background: #e5e0da; transform: rotate(90deg); }
.modal__body { padding: 26px 28px; }
.modal__foot { align-items: center; background: #f8f5f1; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; padding: 16px 27px; position: sticky; bottom: 0; z-index: 3; }
.modal-hint { color: #8d857e; font-size: 9px; margin-right: auto; }

/* Stepper with improved animations */
.stepper { align-items: center; background: #fbf8f4; display: flex; justify-content: center; padding: 14px; }
.stepper span { align-items: center; color: #8b837d; display: inline-flex; font-size: 9px; font-weight: 700; gap: 6px; transition: color var(--duration-normal) ease; }
.stepper span.is-active { color: var(--red); }
.stepper i { align-items: center; border: 1px solid #d7d0c9; border-radius: 50%; display: inline-flex; font-style: normal; height: 22px; justify-content: center; width: 22px; transition: all var(--duration-normal) var(--ease-out-expo); }
.stepper .is-active i { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 3px 10px rgba(215,30,43,.2); transform: scale(1.08); }
.stepper b { background: #ded8d1; height: 1px; margin: 0 12px; width: 50px; transition: background var(--duration-normal) ease; }
.form-section { border-top: 1px solid var(--line); padding: 24px 28px; }
.stepper + .form-section { border-top: 0; }
.form-section__title { align-items: flex-start; display: flex; gap: 11px; margin-bottom: 18px; }
.form-section__title > span { color: var(--red); font-family: "Syne", sans-serif; font-size: 10px; font-weight: 800; margin-top: 2px; }
.form-section__title h3 { font-family: "Syne", sans-serif; font-size: 14px; margin: 0 0 3px; }
.form-section__title p { color: #8f8881; font-size: 9px; margin: 0; }
.form-grid { display: grid; gap: 15px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--span-2 { grid-column: span 2; }
.field--span-3 { grid-column: span 3; }
.form-section--invoice { background: #fbf7f3; }
.invoice-builder { display: grid; gap: 25px; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .65fr); }
.money-input { position: relative; }
.money-input input { padding-right: 48px; }
.money-input b { color: #9b948d; font-size: 8px; position: absolute; right: 11px; top: 16px; }
.invoice-summary { background: var(--charcoal); border-radius: 10px; color: #fff; padding: 18px; }
.invoice-summary > span { color: rgba(255,255,255,.4); display: block; font-size: 8px; letter-spacing: .14em; margin-bottom: 18px; text-transform: uppercase; }
.invoice-summary > div { align-items: center; display: flex; justify-content: space-between; }
.invoice-summary p { color: rgba(255,255,255,.55); font-size: 9px; margin: 5px 0; }
.invoice-summary strong { font-size: 10px; font-feature-settings: "tnum" 1; }
.invoice-summary hr { border: 0; border-top: 1px solid rgba(255,255,255,.1); margin: 14px 0; }
.invoice-summary .invoice-total strong { color: #ffd65d; font-family: "Syne", sans-serif; font-size: 18px; }
.invoice-summary small { color: rgba(255,255,255,.35); display: block; font-size: 8px; line-height: 1.45; margin-top: 18px; }
.toggle-field { align-items: center; background: #f7f3ee; border: 1px solid var(--line); border-radius: 9px; display: flex; gap: 11px; padding: 12px 14px; transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease; }
.toggle-field:hover { border-color: #cfc7bd; background: #f4f0eb; }
.toggle-field input { accent-color: var(--red); height: 17px; width: 17px; }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field strong { font-size: 11px; }
.toggle-field small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.modal--wide { max-width: 900px; width: min(900px, calc(100% - 28px)); }
.permission-section { background: linear-gradient(145deg, #fbfaf8, #f5f1ec); border: 2px solid #d8d0c7; border-radius: 14px; padding: 18px; }
.permission-section__head { align-items: end; display: flex; justify-content: space-between; margin-bottom: 14px; }
.permission-section__head h3 { font-size: 17px; margin: 3px 0 0; }
.permission-section__tools { align-items: center; display: flex; gap: 7px; }
.permission-section__tools small { color: var(--muted); margin-right: 4px; }
.permission-section__tools button { background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; font-size: 9px; font-weight: 700; padding: 6px 9px; }
.permission-section__tools button:hover { border-color: var(--red); color: var(--red); }
.permission-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.permission-card { align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 11px; cursor: pointer; display: grid; gap: 10px; grid-template-columns: auto 1fr auto; min-height: 74px; padding: 12px; transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease; }
.permission-card:hover { border-color: #c4b8aa; box-shadow: 0 8px 18px rgba(35, 27, 20, .07); transform: translateY(-1px); }
.permission-card:has(input:checked) { background: #fff8f7; border-color: var(--red); box-shadow: inset 0 0 0 1px rgba(215, 30, 43, .12); }
.permission-card input { accent-color: var(--red); height: 18px; width: 18px; }
.permission-card strong, .permission-card small { display: block; }
.permission-card strong { font-size: 11px; }
.permission-card small { color: var(--muted); font-size: 9px; line-height: 1.35; margin-top: 3px; }
.permission-card i { align-items: center; background: var(--red); border-radius: 50%; color: #fff; display: flex; font-size: 9px; font-style: normal; height: 19px; justify-content: center; opacity: 0; transform: scale(.7); transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease; width: 19px; }
.permission-card:has(input:checked) i { opacity: 1; transform: scale(1); }

/* Invoice */
.invoice-page { background: #e9e5df; padding: 35px 20px 60px; }
.invoice-actions { display: flex; justify-content: space-between; margin: 0 auto 18px; max-width: 900px; }
.invoice-paper { background: #fff; box-shadow: var(--shadow); margin: auto; min-height: 1120px; padding: 58px 64px 40px; width: 900px; }
.invoice-header { align-items: flex-start; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; padding-bottom: 28px; }
.invoice-title { text-align: right; }
.invoice-title > span { color: var(--muted); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.invoice-title h1 { font-family: "Syne", sans-serif; font-size: 25px; letter-spacing: -.03em; margin: 4px 0 8px; }
.invoice-meta { display: grid; gap: 60px; grid-template-columns: 1fr auto; padding: 38px 0; }
.invoice-meta > div > span, .invoice-meta dt, .invoice-note > span { color: #96908a; display: block; font-size: 8px; font-weight: 700; letter-spacing: .14em; margin-bottom: 9px; text-transform: uppercase; }
.invoice-meta h2 { font-family: "Syne", sans-serif; font-size: 20px; margin: 0 0 8px; }
.invoice-meta p { color: #77706a; font-size: 10px; margin: 3px 0; }
.invoice-meta dl { display: grid; gap: 12px; margin: 0; min-width: 220px; }
.invoice-meta dl div { display: flex; gap: 30px; justify-content: space-between; }
.invoice-meta dt, .invoice-meta dd { margin: 0; }
.invoice-meta dd { font-size: 10px; font-weight: 700; }
.invoice-course { align-items: center; background: #f7f2ed; border-left: 3px solid var(--red); display: flex; gap: 14px; margin-bottom: 28px; padding: 14px 16px; }
.invoice-course .level-block { height: 36px; min-width: 36px; }
.invoice-course span { color: #918981; font-size: 8px; text-transform: uppercase; }
.invoice-course h3 { font-size: 11px; margin: 3px 0; }
.invoice-course p { color: #817a74; font-size: 9px; margin: 0; }
.invoice-items { min-width: 0; }
.invoice-items th { background: var(--charcoal); border: 0; color: #fff; padding: 12px; }
.invoice-items th:not(:first-child), .invoice-items td:not(:first-child) { text-align: right; }
.invoice-items td { padding: 16px 12px; }
.invoice-bottom { display: grid; gap: 60px; grid-template-columns: 1fr 300px; margin-top: 25px; }
.invoice-note p { color: var(--muted); font-size: 9px; line-height: 1.6; max-width: 310px; }
.payment-history-title { margin-top: 20px; }
.invoice-totals { margin: 0; }
.invoice-totals div { display: flex; font-size: 10px; justify-content: space-between; padding: 6px 0; }
.invoice-totals dt, .invoice-totals dd { margin: 0; }
.invoice-totals dt { color: var(--muted); }
.invoice-totals dd { font-weight: 700; font-feature-settings: "tnum" 1; }
.invoice-totals .balance { border-top: 2px solid var(--ink); font-family: "Syne", sans-serif; font-size: 16px; margin-top: 7px; padding-top: 14px; }
.invoice-totals .balance dt { color: var(--ink); }
.invoice-totals .balance dd { color: var(--red); }
.invoice-footer { align-items: flex-end; border-top: 1px solid var(--line); display: flex; font-size: 8px; justify-content: space-between; margin-top: 100px; padding-top: 17px; }
.invoice-footer strong, .invoice-footer span { display: block; margin-top: 3px; }
.invoice-footer > div:last-child { color: var(--muted); text-align: right; }

/* Official Yamato Academy crest */
.brand-mark { background: transparent; border-radius: 0; display: inline-block; flex: 0 0 auto; filter: drop-shadow(0 5px 10px rgba(0,0,0,.22)); height: 52px; width: 52px; }
.brand-mark img { height: 100%; object-fit: contain; width: 100%; }
.brand-mark--small { height: 42px; width: 42px; }

/* Alpine + FullCalendar schedule workspace */
[x-cloak] { display: none !important; }
.class-workspace { display: grid; gap: 18px; }
.calendar-view-switch { background: #ece7e0; border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: max-content; }
.calendar-view-switch button { background: transparent; border: 0; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 800; padding: 9px 14px; transition: background .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease; }
.calendar-view-switch button:hover { color: var(--ink); transform: translateY(-1px); }
.calendar-view-switch button.is-active { background: #fff; box-shadow: 0 5px 15px rgba(43,32,28,.09); color: var(--red); }
.schedule-calendar { overflow: hidden; padding: 0; }
.calendar-heading { align-items: flex-end; border-bottom: 1px solid var(--line); margin: 0; padding: 24px 26px 20px; }
.calendar-heading h2 { margin-bottom: 4px; }
.calendar-heading p { color: var(--muted); font-size: 10px; margin: 0; }
.calendar-timezone { background: #f4f0eb; border-radius: 999px; color: var(--muted); font-size: 8px; font-weight: 700; padding: 7px 10px; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; }
#class-calendar { min-width: 0; padding: 24px; --fc-border-color: #e8e2db; --fc-button-bg-color: #211c1b; --fc-button-border-color: #211c1b; --fc-button-hover-bg-color: #d71e2b; --fc-button-hover-border-color: #d71e2b; --fc-button-active-bg-color: #d71e2b; --fc-button-active-border-color: #d71e2b; --fc-today-bg-color: rgba(215,30,43,.055); }
#class-calendar .fc-toolbar-title { font-family: "Syne", sans-serif; font-size: 17px; letter-spacing: -.035em; }
#class-calendar .fc-button { box-shadow: none; font-size: 9px; font-weight: 700; padding: 7px 9px; text-transform: capitalize; }
#class-calendar .fc-col-header-cell-cushion, #class-calendar .fc-daygrid-day-number { color: var(--muted); font-size: 8px; padding: 7px; }
#class-calendar .fc-event { border-radius: 5px; cursor: pointer; font-size: 8px; padding: 2px 4px; transition: filter .15s ease, transform .15s ease; }
#class-calendar .fc-event:hover { filter: brightness(.94); transform: translateY(-1px); }
.calendar-detail { background: var(--charcoal); color: #fff; display: flex; flex-direction: column; min-width: 0; padding: 28px 23px; }
.calendar-detail__level { align-items: center; background: var(--red); border-radius: 11px; display: flex; font-family: "Noto Serif JP", serif; font-size: 18px; height: 48px; justify-content: center; margin-bottom: 28px; width: 48px; }
.calendar-detail > small { color: rgba(255,255,255,.42); font-size: 7px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.calendar-detail h3 { font-family: "Syne", sans-serif; font-size: 16px; line-height: 1.25; margin: 8px 0 22px; }
.calendar-detail dl { display: grid; gap: 14px; margin: 0 0 25px; }
.calendar-detail dl div { border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; }
.calendar-detail dt { color: rgba(255,255,255,.36); font-size: 7px; text-transform: uppercase; }
.calendar-detail dd { font-size: 9px; font-weight: 700; margin: 4px 0 0; }
.calendar-detail .badge { align-self: flex-start; margin-top: auto; }
.calendar-fallback { background: #fff7e8; border: 1px solid #ecd7a4; border-radius: 8px; color: #795a18; font-size: 10px; padding: 15px; }

@media (max-width: 1100px) {
    .workday-card { grid-template-columns: 1fr auto; }
    .workday-card__status { grid-column: 1 / -1; grid-template-columns: auto minmax(280px, 1fr) auto; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .class-grid { grid-template-columns: repeat(2, 1fr); }
    .course-row { grid-template-columns: 62px 1fr; }
    .course-row dl { grid-column: 2; }
    .course-row .row-actions { grid-column: 2; justify-content: flex-start; }
    .document-workspace { grid-template-columns: 270px minmax(0, 1fr); }
    .editor-grid { grid-template-columns: 1fr; }
    .letter-preview { position: relative; top: 0; }
    .calendar-layout { grid-template-columns: 1fr; }
    .calendar-detail { display: grid; gap: 14px; grid-template-columns: 60px 1fr; }
    .calendar-detail__level { grid-row: 1 / 4; margin: 0; }
    .calendar-detail h3, .calendar-detail > small { grid-column: 2; margin: 0; }
    .calendar-detail dl { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); margin: 5px 0; }
    .calendar-detail .badge { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-story { display: none; }
    .login-panel { min-height: 100vh; padding: 32px 22px; align-items: center; justify-content: center; }
    .mobile-brand-mark { background: transparent; border-radius: 0; display: block; filter: drop-shadow(0 5px 10px rgba(43,32,28,.16)); height: 58px; margin-bottom: 32px; width: 58px; animation: loginCardIn .6s var(--ease-out-back) both; }
    .mobile-brand-mark img { height: 100%; object-fit: contain; width: 100%; }
    .login-card { animation-delay: .1s; }
    .login-card h2 { font-size: 34px; }

    /* Sidebar with spring-like slide-in animation */
    .sidebar { box-shadow: 20px 0 50px rgba(0,0,0,.2); transform: translateX(-105%); transition: transform .35s var(--ease-spring); }
    .sidebar.is-open { transform: translateX(0); }

    /* Better scrim (backdrop) fade animation */
    .sidebar.is-open + .sidebar-scrim { background: rgba(23,18,16,.5); display: block; inset: 0; position: fixed; z-index: 19; animation: scrimFadeIn .3s ease both; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

    .sidebar-close, .menu-button { display: block; }
    .workspace { margin-left: 0; padding: 22px 20px 40px; }
    .topbar { align-items: flex-start; }
    .topbar > div:nth-child(2) { flex: 1; }
    .topbar p { display: none; }
    .topbar__actions .button { font-size: 0; gap: 0; padding: 9px 13px; }
    .topbar__actions .button::first-letter { font-size: 16px; }
    .hide-mobile { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .workday-card { grid-template-columns: 1fr auto; }
    .workday-card__status { grid-template-columns: 1fr; }
    .staff-summary, .content-summary { grid-template-columns: 1fr; }
    .story-admin-grid { grid-template-columns: 1fr; }
    .document-workspace { grid-template-columns: 1fr; }
    .brand-studio { position: relative; top: 0; }
    .panel--wide { grid-row: auto; }
    .class-grid { grid-template-columns: 1fr; }
    .invoice-builder { grid-template-columns: 1fr; }
    .invoice-summary { min-height: 170px; }
    .invoice-paper { min-height: 0; padding: 40px; width: 100%; }
    .invoice-bottom { grid-template-columns: 1fr; }

    /* Touch targets minimum 44px on mobile */
    .nav-item { min-height: 44px; }
    .button { min-height: 44px; }
    .menu-button { height: 44px; width: 44px; }
    .icon-button { min-height: 44px; min-width: 44px; }
    .row-action--button { min-height: 44px; min-width: 44px; }
}

@media (max-width: 600px) {
    .workspace { padding: 18px 13px 35px; }
    .topbar { gap: 10px; }
    .topbar h1 { font-size: 22px; }
    .topbar .eyebrow { display: none; }
    .metrics-grid, .metrics-grid--three { grid-template-columns: 1fr; }

    /* Better metric card stacking with improved gaps */
    .metrics-grid { gap: 10px; }

    .workday-card { align-items: start; gap: 18px; grid-template-columns: 1fr; padding: 23px 20px; }
    .live-time { border: 0; border-top: 1px solid rgba(255,255,255,.1); grid-template-columns: max-content max-content; min-width: 0; padding: 14px 0 0; width: 100%; }
    .clock-form { flex-direction: column; }
    .button--clock { width: 100%; }
    .shift-mini { justify-content: space-between; }
    .metric-card { min-height: 122px; padding: 17px; }
    .metric-card > strong { font-size: 20px; word-break: break-word; }
    .panel { padding: 17px 14px; }
    .panel__head--tools { align-items: stretch; flex-direction: column; gap: 13px; }
    .search-field { min-width: 100%; }
    .course-row { gap: 14px; grid-template-columns: 50px 1fr; padding: 18px; }
    .course-level { font-size: 12px; height: 46px; width: 46px; }
    .course-row dl { gap: 12px; grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
    .course-row dl div { min-width: 0; padding-left: 10px; }
    .course-row dd { font-size: 9px; }
    .course-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }

    /* Better modal presentation — slide from bottom on mobile */
    .modal { border-radius: 12px 12px 0 0; margin: auto 0 0; max-height: 94vh; width: 100%; animation: modalSlideUp .4s var(--ease-out-expo) both; }
    .modal > form { max-height: 94vh; }
    .modal__head, .form-section, .modal__body { padding-left: 18px; padding-right: 18px; }
    .modal__head h2 { font-size: 19px; }
    .stepper b { margin: 0 7px; width: 24px; }
    .form-grid--2, .form-grid--3, .permission-grid { grid-template-columns: 1fr; }
    .permission-section__head { align-items: start; flex-direction: column; gap: 5px; }
    .permission-section__tools { align-items: flex-start; flex-wrap: wrap; }
    .attendance-toolbar { align-items: stretch; flex-wrap: wrap; width: 100%; }
    .attendance-toolbar form { flex: 1; }
    .attendance-toolbar label { flex: 1; }
    .attendance-toolbar input { width: 100%; }
    .attendance-day-summary { align-items: flex-start; display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
    .attendance-day-summary em { grid-column: 1 / -1; margin-left: 0; }
    .profile-hero { align-items:start; grid-template-columns:auto 1fr; }
    .profile-hero dl { grid-column:1 / -1; grid-template-columns:1fr; }
    .leave-balance-grid { grid-template-columns:1fr; }
    .profile-report-card,.security-card,.report-paper > header,.report-filter { align-items:stretch; flex-direction:column; gap:14px; }
    .report-page { padding:0; }
    .report-paper { box-shadow:none; padding:22px 14px; }
    .field--span-2, .field--span-3 { grid-column: span 1; }
    .invoice-actions { gap: 9px; }
    .invoice-actions .button { flex: 1; font-size: 11px; }
    .invoice-page { padding: 15px 8px 30px; }
    .invoice-paper { padding: 27px 22px; }
    .invoice-header .brand small { display: none; }
    .invoice-title h1 { font-size: 16px; }
    .invoice-meta { gap: 25px; grid-template-columns: 1fr; }
    .invoice-meta dl { min-width: 0; }
    .invoice-footer { align-items: flex-start; flex-direction: column; gap: 12px; margin-top: 55px; }
    .invoice-footer > div:last-child { text-align: left; }
    .letter-preview { min-height: 520px; padding: 30px 25px 22px; }
    .document-form__actions { flex-direction: column; }
    .calendar-view-switch { width: 100%; }
    .calendar-view-switch button { flex: 1; }
    .calendar-heading { align-items: flex-start; gap: 12px; padding: 20px 17px; }
    .calendar-timezone { display: none; }
    #class-calendar { padding: 15px 10px; }
    #class-calendar .fc-header-toolbar { align-items: stretch; display: grid; gap: 9px; grid-template-columns: 1fr auto; }
    #class-calendar .fc-toolbar-chunk:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
    #class-calendar .fc-toolbar-chunk:nth-child(3) { grid-column: 2; }
    #class-calendar .fc-toolbar-title { font-size: 15px; }
    .calendar-detail { display: flex; padding: 22px 18px; }
    .calendar-detail__level { margin-bottom: 18px; }
    .calendar-detail h3 { margin: 7px 0 17px; }
    .calendar-detail dl { grid-template-columns: 1fr 1fr; width: 100%; }

    /* Better mobile font-size scaling */
    .topbar h1 { font-size: clamp(20px, 5vw, 22px); }
    .workday-card__intro h2 { font-size: 20px; }
    .live-time strong { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
    @page { margin: 0; size: A4; }
    body.invoice-page { background: #fff; padding: 0; }
    .no-print { display: none !important; }
    .invoice-paper { box-shadow: none; min-height: 297mm; padding: 17mm 18mm 12mm; width: 210mm; }
    .invoice-footer { margin-top: 25mm; }
}

/* ============================================
   PREMIUM ANIMATION KEYFRAMES
   ============================================ */

/* Login animated gradient */
@keyframes loginGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Dot-grid subtle drift on login story */
@keyframes dotDrift {
    from { background-position: 0 0; }
    to { background-position: 22px 44px; }
}

/* Ring pulse on login story decorative circle */
@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: .7; }
}

/* Login card slide-up + fade entrance */
@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to { opacity: 1; transform: none; }
}

/* Login panel background entrance */
@keyframes loginPanelIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Active nav indicator slide-in */
@keyframes activeSlideIn {
    from { height: 0; opacity: 0; }
    to { height: 20px; opacity: 1; }
}

/* Status dots pulsing (green dots, activity dots) */
@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(75,212,135,.12); }
    50% { box-shadow: 0 0 0 7px rgba(75,212,135,.06); }
}

/* Clock pulse (subtle) */
@keyframes clockPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .88; }
}

/* Workday card ring float */
@keyframes ringFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(2deg); }
    50% { transform: translate(-5px, -25px) rotate(-1deg); }
    75% { transform: translate(-15px, -10px) rotate(1deg); }
}

/* Toast slide-in from top */
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: none; }
}

/* Toast fade-out before auto-dismiss removal */
@keyframes toastFadeOut {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Toast auto-dismiss countdown bar */
@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Submit button loading spinner */
@keyframes buttonSpin {
    to { transform: rotate(360deg); }
}

/* Alert slide-in */
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

/* Modal open — scale + fade */
@keyframes modalOpen {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* Modal slide-up for mobile */
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: none; }
}

/* Backdrop fade-in */
@keyframes backdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrim fade-in for mobile sidebar */
@keyframes scrimFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
