:root {
  color-scheme: light;
  --navy: #0b192c;
  --blue: #1e3e62;
  --orange: #ff6500;
  --green: #167b59;
  --ink: #111827;
  --muted: #667085;
  --line: #dfe4eb;
  --soft: #f2f5f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; min-height: 100%; }
body { margin: 0; color: var(--ink); background: #e9edf2; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
svg { width: 24px; height: 24px; stroke-width: 1.9; }

.personal-workspace { width: 100%; height: 100%; min-height: 100dvh; display: grid; place-items: center; }
.personal-shell { width: min(100%, 480px); height: 100%; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; position: relative; overflow: hidden; background: #f5f6f8; box-shadow: 0 0 60px rgba(11, 25, 44, .15); }
.personal-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(102px + env(safe-area-inset-bottom)); }
.is-login .personal-content { padding-bottom: 0; }

.personal-topbar { min-height: 68px; display: grid; place-items: center; padding-top: env(safe-area-inset-top); color: #fff; background: var(--navy); }
.personal-topbar strong { font-size: 18px; }

.login-screen, .loading-screen { min-height: 100%; background: #f5f6f8; }
.login-brand { min-height: 350px; display: grid; align-content: center; justify-items: center; padding: calc(40px + env(safe-area-inset-top)) 28px 44px; color: #fff; text-align: center; background: radial-gradient(circle at 72% 14%, #2e5a86 0, transparent 35%), linear-gradient(145deg, #061526, #0b192c 64%, #07111d); }
.login-brand img { width: 92px; height: 92px; border-radius: 22px; box-shadow: 0 18px 38px rgba(255, 101, 0, .2); }
.login-brand span, .intro-copy > span, .section-heading > div > span { margin-top: 28px; color: var(--orange); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.login-brand h1 { margin: 7px 0 10px; font-size: 38px; line-height: 1; }
.login-brand p { max-width: 310px; margin: 0; color: rgba(255,255,255,.7); line-height: 1.5; }

.login-form, .leave-form, .settings-form { display: grid; gap: 18px; padding: 26px 24px calc(36px + env(safe-area-inset-bottom)); }
label { display: grid; gap: 8px; color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
label small { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
input, select, textarea { width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid #d3dae4; border-radius: 10px; outline: none; color: var(--ink); background: #fff; font-size: 16px; letter-spacing: 0; }
textarea { min-height: 105px; padding-top: 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 101, 0, .12); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 50px; }
.password-field button { width: 42px; height: 42px; position: absolute; right: 5px; top: 5px; display: grid; place-items: center; color: var(--muted); background: transparent; }

.primary-button, .secondary-button { min-height: 54px; border-radius: 10px; font-weight: 800; }
.primary-button { color: #fff; background: var(--orange); box-shadow: 0 12px 24px rgba(255, 101, 0, .24); }
.secondary-button { color: var(--navy); border: 1px solid var(--line); background: #fff; }
.form-notice { padding: 12px 14px; border-radius: 9px; color: #17553e; background: #e5f6ef; font-size: 13px; line-height: 1.4; }
.form-notice.is-error { color: #8d2930; background: #fff0f1; }

.loading-screen { display: grid; place-items: center; align-content: center; gap: 24px; background: var(--navy); }
.loading-screen img { width: 88px; height: 88px; border-radius: 22px; }
.spinner { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dashboard-screen { min-height: 100%; padding-bottom: 28px; }
.dashboard-hero { padding: calc(34px + env(safe-area-inset-top)) 22px 36px; color: #fff; background: radial-gradient(circle at 80% 6%, #315f8c 0, transparent 34%), linear-gradient(145deg, #061526, #0b192c 70%); }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.dashboard-header span { color: rgba(255,255,255,.62); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.dashboard-header h1 { margin: 5px 0 0; font-size: 32px; letter-spacing: 0; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: #fff; background: rgba(255,255,255,.08); }
.balance-panel { display: grid; grid-template-columns: 158px 1fr; gap: 18px; align-items: center; padding: 22px; border-radius: 8px; color: var(--navy); background: #fff; box-shadow: 0 22px 48px rgba(0,0,0,.22); }
.balance-ring { --progress: 0deg; width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #fff 0 56%, transparent 57%), conic-gradient(var(--orange) 0 var(--progress), #e3e8ee var(--progress) 360deg); }
.balance-ring > div { display: grid; justify-items: center; }
.balance-ring span, .balance-ring em { color: var(--muted); font-size: 12px; font-style: normal; }
.balance-ring strong { font-size: 43px; line-height: 1; }
.balance-details { display: grid; gap: 13px; }
.balance-details div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.balance-details div:last-child { border-bottom: 0; padding-bottom: 0; }
.balance-details strong { font-size: 23px; }
.balance-details span { color: var(--muted); font-size: 12px; text-align: right; }
.add-main-button { width: 100%; min-height: 58px; display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 16px; border-radius: 8px; color: #fff; background: var(--orange); box-shadow: 0 14px 28px rgba(255, 101, 0, .25); font-weight: 850; }

.recent-section, .plain-screen { padding: 26px 20px 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading > div > span { margin: 0; }
.section-heading h1, .section-heading h2 { margin: 4px 0 0; color: var(--navy); font-size: 25px; }
.section-heading button { padding: 8px 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 800; }
.history-heading { align-items: center; margin-top: 4px; }
.history-heading > strong { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); }
.leave-list { display: grid; gap: 10px; }
.leave-card { min-height: 88px; display: grid; grid-template-columns: 68px 1fr 38px; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(11,25,44,.06); }
.leave-card.is-planned { border-left: 4px solid var(--orange); }
.leave-card.is-used { opacity: .76; }
.leave-date { display: grid; gap: 4px; padding-right: 12px; border-right: 1px solid var(--line); }
.leave-date strong { font-size: 16px; }
.leave-date span { color: var(--muted); font-size: 14px; }
.leave-copy { min-width: 0; display: grid; gap: 3px; }
.leave-copy > span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.leave-copy strong { font-size: 18px; }
.leave-copy em { overflow: hidden; color: var(--green); font-size: 12px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.is-used .leave-copy em { color: var(--muted); }
.leave-actions { display: grid; gap: 6px; }
.edit-button, .delete-button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; }
.edit-button { color: #1e3e62; background: #e9f0f7; }
.delete-button { color: #a7333a; background: #fff0f1; }
.edit-button svg, .delete-button svg { width: 18px; height: 18px; }
.empty-state { padding: 34px 18px; border: 1px dashed #c8d0dc; border-radius: 8px; color: var(--muted); text-align: center; }

.plain-screen { min-height: 100%; padding-bottom: 32px; }
.intro-copy { padding: 4px 4px 10px; }
.intro-copy > span { margin: 0; }
.intro-copy h1 { margin: 5px 0 8px; color: var(--navy); font-size: 30px; }
.intro-copy p { margin: 0; color: var(--muted); line-height: 1.5; }
.leave-form, .settings-form { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(11,25,44,.07); }
.range-calendar { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.range-calendar-head { height: 52px; display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: center; border-bottom: 1px solid var(--line); }
.range-calendar-head strong { text-align: center; font-size: 15px; }
.range-calendar-head button { width: 38px; height: 38px; display: grid; place-items: center; margin: auto; border-radius: 8px; color: var(--navy); background: var(--soft); font-size: 25px; line-height: 1; }
.range-weekdays, .range-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.range-weekdays { padding: 10px 5px 4px; color: var(--muted); font-size: 9px; text-align: center; }
.range-days { gap: 2px; padding: 3px 5px 8px; }
.range-day { width: 100%; min-width: 0; height: 38px; display: grid; place-items: center; align-content: center; gap: 1px; padding: 0; border-radius: 8px; color: var(--navy); background: transparent; font-size: 12px; }
.range-day em { font-size: 7px; line-height: 1; font-style: normal; font-weight: 850; }
.range-day.is-outside { color: #b2bac6; }
.range-day.is-free { color: #d14b54; }
.range-day.is-occupied { color: #6b7482; background: #e7ebf0; }
.range-day.is-range { color: #fff; border-radius: 5px; background: #274f79; }
.range-day.is-anchor { color: #fff; border-radius: 50%; background: var(--orange); }
.range-day:disabled { cursor: default; }
.selected-range { display: grid; gap: 5px; padding: 13px 14px; border: 1px solid rgba(255,101,0,.18); border-radius: 8px; background: #fff5ee; }
.selected-range span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.selected-range strong { font-size: 14px; }
.half-day-options { display: grid; gap: 8px; }
.half-day-options label { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 12px; letter-spacing: 0; text-transform: none; }
.half-day-options input { width: 20px; min-height: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--orange); }
.half-day-options span { line-height: 1.3; }
.days-preview { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-radius: 8px; color: var(--navy); background: #eef2f6; }
.days-preview span { font-size: 13px; font-weight: 700; }
.days-preview strong { font-size: 30px; }
.settings-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.settings-summary div { display: grid; justify-items: center; gap: 3px; padding: 14px 4px; background: var(--soft); }
.settings-summary strong { font-size: 23px; }
.settings-summary span { color: var(--muted); font-size: 10px; }

.bottom-tabs { width: min(calc(100% - 28px), 452px); min-height: 78px; display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 50%; right: auto; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 8; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.7); border-radius: 24px; overflow: hidden; background: rgba(255,255,255,.94); box-shadow: 0 16px 34px rgba(11,25,44,.2); backdrop-filter: blur(18px); }
.bottom-tabs button { display: grid; place-items: center; align-content: center; gap: 3px; color: #6b7482; background: transparent; font-size: 10px; }
.bottom-tabs button.active { color: var(--orange); }
.bottom-tabs svg { width: 23px; height: 23px; }

.confirm-backdrop { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: rgba(11,25,44,.42); backdrop-filter: blur(6px); }
.confirm-dialog { width: min(100%, 340px); padding: 22px; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.confirm-dialog h2 { margin: 0; font-size: 21px; }
.confirm-dialog p { margin: 8px 0 20px; color: var(--muted); }
.confirm-dialog > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-dialog button { min-height: 44px; border-radius: 8px; color: var(--navy); background: var(--soft); font-weight: 800; }
.confirm-dialog button.danger { color: #fff; background: #b52c35; }
.toast { position: absolute; left: 24px; right: 24px; bottom: 106px; z-index: 20; padding: 13px 16px; border-radius: 8px; color: #fff; background: rgba(11,25,44,.94); text-align: center; font-size: 13px; animation: toast-in .18s ease; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 380px) {
  .balance-panel { grid-template-columns: 132px 1fr; padding: 18px 14px; }
  .balance-ring { width: 130px; height: 130px; }
  .balance-ring strong { font-size: 36px; }
  .leave-card { grid-template-columns: 58px 1fr 34px; padding: 12px 10px; }
  .leave-form { padding: 14px; }
  .range-day { height: 34px; }
}

@media (min-width: 700px) {
  .personal-shell { border-radius: 12px; }
}
