* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1f2d3d; background: #f5f7fa; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e1e6ec; position: sticky; top: 0; z-index: 10; }
.topbar-title { font-size: 17px; font-weight: 600; }
#who { color: #7b8a9a; font-weight: 400; font-size: 13px; margin-left: 8px; }

.btn { border: 1px solid #c7d0da; background: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #eef2f6; }
.btn-primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn-primary:hover { background: #2258c7; }
.btn-ok { background: #23a55a; border-color: #23a55a; color: #fff; }
.btn-no { background: #d64545; border-color: #d64545; color: #fff; }
.btn-sm { padding: 2px 8px; font-size: 12px; }

.layout { display: grid; grid-template-columns: 1fr 320px; gap: 12px; padding: 12px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.calendar-wrap { background: #fff; border: 1px solid #e1e6ec; border-radius: 8px; padding: 10px; min-height: 600px; }
#calendar { font-size: 13px; }

.fc .fc-daygrid-event { cursor: pointer; }
.ev-approved { background: #23a55a; border-color: #1c8548; color: #fff; }
.ev-pending  { background: #f0932b; border-color: #cf7a12; color: #fff; }
.ev-rejected { background: #d64545; border-color: #b03030; color: #fff; }
.ev-other    { background: #8fa3b8; border-color: #74889d; color: #fff; }
.ev-draft    { background: #e8edf3; border-color: #9fb2c8; color: #33475b; border-style: dashed; }

.sidebar { display: flex; flex-direction: column; gap: 12px; }
.panel { background: #fff; border: 1px solid #e1e6ec; border-radius: 8px; padding: 10px 12px; }
.panel h3 { margin: 0 0 8px; font-size: 14px; }
.badge { background: #e8edf3; border-radius: 10px; padding: 0 8px; font-size: 12px; }
.badge-orange { background: #ffe3c2; }
.list { max-height: 260px; overflow: auto; }
.list-item { border-bottom: 1px solid #eef2f6; padding: 6px 0; font-size: 13px; }
.list-item:last-child { border-bottom: none; }
.list-item .sub { color: #7b8a9a; font-size: 12px; }
.list-item .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.hint { color: #7b8a9a; font-size: 12px; margin: 8px 0 0; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; margin-right: 5px; }
.dot-approved { background: #23a55a; }
.dot-pending { background: #f0932b; }
.dot-rejected { background: #d64545; }
.dot-draft { background: #e8edf3; border: 1px dashed #9fb2c8; }
.dot-other { background: #8fa3b8; }
.legend { margin-left: 12px; font-size: 12px; color: #55677a; }
.legend .dot { margin-left: 8px; }
.legend-panel div { font-size: 13px; margin: 4px 0; }

/* Year view */
.year-nav { display: flex; align-items: center; gap: 10px; padding: 6px 4px 12px; }
.year-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .year-grid { grid-template-columns: repeat(3, 1fr); } }
.year-month { border: 1px solid #e1e6ec; border-radius: 8px; padding: 8px; background: #fff; }
.year-month h4 { margin: 0 0 6px; font-size: 13px; text-transform: capitalize; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; font-size: 10px; text-align: center; }
.mini .wd { color: #9aa8b6; font-weight: 600; }
.mini .d { padding: 2px 0; border-radius: 3px; position: relative; min-height: 16px; }
.mini .d.empty { visibility: hidden; }
.mini .d.today { outline: 1px solid #2f6fed; }
.mini .d .marks { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 1px; }
.mini .d .m { width: 4px; height: 4px; border-radius: 2px; display: inline-block; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(20,30,45,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: #fff; border-radius: 10px; padding: 18px 20px; width: 380px; max-width: 92vw; max-height: 85vh; overflow: auto; }
.modal-box h3 { margin: 0 0 12px; }
.modal-box label { display: block; font-size: 12px; color: #55677a; margin: 8px 0 2px; }
.modal-box input, .modal-box select, .modal-box textarea { width: 100%; padding: 6px 8px; border: 1px solid #c7d0da; border-radius: 6px; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.hidden { display: none !important; }

.expired { background: #ffe3c2; border: 1px solid #f0932b; padding: 10px 14px; font-size: 14px; }

.fc-event-needs-approval { position: relative; }
.fc-event-needs-approval::after { content: "⏳"; position: absolute; top: 0; right: 2px; font-size: 10px; }
