:root{ --bg:#f8fafc; --card:#ffffff; --ink:#0f172a; --muted:#64748b; --pri:#0ea5e9; --pri-ink:#fff; --warn:#f59e0b; --danger:#ef4444; }
*{ box-sizing:border-box; }
body{ margin:0; font-family: system-ui,-apple-system,Segoe UI,Roboto,'Hiragino Kaku Gothic ProN','Noto Sans JP',sans-serif; color:var(--ink); background:var(--bg); }
.container{ max-width:1200px; margin:0 auto; padding:16px; }
.header{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom: 16px; }
h1{ font-size:22px; margin:8px 0; }
h2,h3 { margin-top: 0; }
.whoami{ font-size:14px; color:var(--muted); }
.hidden{ display:none !important; }
.tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px;}
.tab{ border:none; background:transparent; padding:10px 14px; border-radius:12px; cursor:pointer; font-size: 15px; color: var(--muted); font-weight: 500;}
.tab.active{ background: #f1f5f9; color:var(--pri); }
.card{ background:var(--card); border:1px solid #e5e7eb; border-radius:16px; padding:24px; margin-bottom:16px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.card.colorful{ background:linear-gradient(135deg,#f0f9ff,#fdf2f8); }
.mt{ margin-top:24px; }
label{ font-size:14px; display:grid; gap:6px; }
input,select{ width:100%; padding:10px 12px; border-radius:12px; border:1px solid #e5e7eb; background:#fff; font-size:16px; }
input:disabled, select:disabled { background-color: #f8fafc; color: #94a3b8; cursor: not-allowed; }
input::placeholder{ color:#94a3b8; }
.actions{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:16px; }
.actions.end{ justify-content:flex-end; }
.btn{ padding:10px 14px; border-radius:12px; border:none; background:#e2e8f0; cursor:pointer; font-weight: 500; }
.btn.primary{ background:var(--pri); color:var(--pri-ink); }
.btn.warn{ background:var(--warn); color:#fff; }
.btn.danger{ background:var(--danger); color:#fff; }
.grid2{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; }
.grid3{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; }
.grid4{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; }
.chip{ display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:999px; background:#e2e8f0; font-size:12px; cursor: pointer; }
.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.calHeader{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.calTitle{ font-weight:700; font-size:20px; padding:0 8px; }
.calGrid{ display:grid; grid-template-columns:repeat(7,1fr); border-left:1px solid #e5e7eb; border-top:1px solid #e5e7eb; border-radius:12px; overflow:hidden; }
.dow{ background:#f8fafc; padding:8px; font-weight:600; text-align:center; border-right:1px solid #e5e7eb; border-bottom:1px solid #e5e7eb; font-size: 13px; color: var(--muted); }
.cell{ min-height:120px; border-right:1px solid #e5e7eb; border-bottom:1px solid #e5e7eb; padding:6px; display:flex; flex-direction:column; gap:4px; }
.cell.outside-month { background-color: #f8fafc; }
.dateNum{ font-size:13px; font-weight: 500; color:#334155; }
.ev{ display:flex; align-items:center; justify-content: space-between; gap:6px; font-size:12px; padding: 3px 6px; border-radius: 4px; overflow: hidden; position: relative; }
.ev .ev-text { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.ev .badge{ width:8px; height:8px; border-radius:2px; flex-shrink: 0; }
.ev.shift{ background-color: #eff6ff; color: #1e40af; }
.ev.shift .badge{ background:#60a5fa; }
.ev.cal{ background-color: #f0fdf4; color: #15803d; }
.ev.cal .badge{ background:#10b981; }
.delete-shift-btn { display: none; background: var(--danger); color: white; border: none; border-radius: 50%; width: 16px; height: 16px; font-size: 10px; line-height: 16px; text-align: center; cursor: pointer; position: absolute; top: 2px; right: 2px; }
.ev:hover .delete-shift-btn { display: block; }
.muted{ color:#64748b; font-size:13px; margin-top: 8px; }
h2,h3,button,input,select,label{ line-height:1.3; }
.banner{ position:sticky; top:0; z-index:9999; padding:12px 16px; border-radius:12px; margin:10px; }
.banner.error{ background:#fee2e2; color:#7f1d1d; border:1px solid #fecaca; }
.banner code{ background:rgba(0,0,0,.06); padding:2px 6px; border-radius:6px; }
.weekdayBox{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.weekdayBox label{ display:inline-flex; align-items:center; gap:6px; padding:6px 10px; background:#eef2ff; border-radius:999px; cursor: pointer; user-select: none; }

/* Modal Styles */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.modal-content { background: white; padding: 24px; border-radius: 16px; max-width: 400px; width: 90%; text-align: center; }
.modal-actions { display: flex; justify-content: center; gap: 16px; margin-top: 20px; }

/* Loader Styles */
.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.7); display: flex; align-items: center; justify-content: center; z-index: 10001; }
.loader-spinner { border: 4px solid #f3f3f3; border-top: 4px solid var(--pri); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Toast Notification */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 10002; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 20px; border-radius: 12px; color: #fff; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15); opacity: 0; transform: translateX(100%); transition: all 0.4s ease-in-out; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { background-color: #22c55e; }
.toast.error { background-color: #ef4444; }
.toast.info { background-color: #3b82f6; }
