/* Çalışma alanı → Takvim (calendar.js) */
.cal-panel { padding: 0; overflow: hidden; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { margin: 0 0 0 10px; font: 700 17px Manrope, sans-serif; letter-spacing: -.3px; text-transform: capitalize; }
.cal-tools { display: flex; align-items: center; gap: 14px; }
.cal-crm-only { font-size: 12px !important; }
.cal-user { max-width: 260px; height: 34px; padding: 0 10px; border: 1px solid #e7e8ef; border-radius: 8px; color: #44485e; background: #fff; font-size: 13px; }
.cal-user.other { border-color: #c9c2f8; color: var(--purple); background: #f8f7ff; font-weight: 600; }
.cal-viewing { display: inline-block; margin-left: 10px; padding: 3px 9px; border-radius: 99px; color: var(--purple); background: #efedfd; font: 600 11px 'DM Sans', sans-serif; letter-spacing: 0; text-transform: none; vertical-align: middle; }
.cal-body { min-height: 300px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #e9ebf3; border-left: 3px solid #a5a9bb; }
.cal-dot.crm { background: #efedfd; border-left-color: var(--purple); }
.cal-dot.tentative { background: repeating-linear-gradient(135deg, #fff 0 3px, #eceef4 3px 6px); border-left-color: #a5a9bb; }
.cal-dot.cancelled { background: #fdf0f1; border-left-color: #d07a85; }

/* Etkinlik görünümü (ortak) */
.cal-ev { display: block; width: 100%; overflow: hidden; border: 0; border-left: 3px solid #a5a9bb; border-radius: 5px; color: #3b3f55;
  background: #eef0f6; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.35; }
.cal-ev:hover { filter: brightness(.97); box-shadow: 0 1px 4px #20243a1f; }
.cal-ev:focus-visible { outline: 2px solid #988ef0; outline-offset: 1px; }
.cal-ev.crm { border-left-color: var(--purple); color: #3d3197; background: #efedfd; }
.cal-ev.tentative { background-image: repeating-linear-gradient(135deg, #ffffff99 0 4px, transparent 4px 8px); }
.cal-ev.free { opacity: .75; }
.cal-ev.oof { border-left-color: #9a63c9; }
.cal-ev.cancelled { border-left-color: #d07a85; color: #9a6870; background: #fdf0f1; text-decoration: line-through; }

/* Ay */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mhead { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.cal-mcell { display: flex; flex-direction: column; gap: 3px; min-height: 112px; padding: 5px 6px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-mcell:nth-child(7n) { border-right: 0; }
.cal-mcell.other { background: #fafbfd; }
.cal-mcell.other .cal-daynum { color: #b6b9c7; }
.cal-mday { display: flex; align-items: center; justify-content: space-between; }
.cal-daynum { padding: 2px 6px; border: 0; border-radius: 6px; color: #4d5165; background: transparent; font-size: 12px; font-weight: 600; }
.cal-daynum:hover { background: #f2f3f7; }
.cal-mcell.today .cal-daynum { color: #fff; background: var(--purple); }
.cal-add { visibility: hidden; padding: 0 6px; border: 0; border-radius: 5px; color: var(--purple); background: transparent; font-size: 13px; }
.cal-mcell:hover .cal-add { visibility: visible; }
.cal-add:hover { background: #f1effe; }
.cal-chip { padding: 2px 6px; }
.cal-more { padding: 1px 6px; border: 0; color: var(--purple); background: transparent; font-size: 11px; font-weight: 600; text-align: left; }

/* Hafta / gün */
.cal-grid-wrap { display: flex; flex-direction: column; }
.cal-ghead-row, .cal-allday-row, .cal-grid { display: grid; }
.cal-ghead-row { border-bottom: 1px solid var(--line); }
.cal-ghead { padding: 6px 4px; text-align: center; }
.cal-ghead .cal-daynum { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 10px; }
.cal-ghead .cal-daynum small { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.cal-ghead .cal-daynum b { font: 700 18px Manrope, sans-serif; }
.cal-ghead.today .cal-daynum b { color: var(--purple); }
.cal-allday-row { border-bottom: 1px solid var(--line); background: #fafbfd; }
.cal-allday-label { padding: 6px 4px; color: var(--muted); font-size: 10px; text-align: right; }
.cal-allday-cell { display: flex; flex-direction: column; gap: 2px; min-height: 26px; padding: 3px; border-left: 1px solid var(--line); }
.cal-scroll { height: min(640px, calc(100vh - 330px)); min-height: 360px; overflow-y: auto; }
.cal-hours { position: relative; }
.cal-hour { position: relative; border-bottom: 1px solid transparent; }
.cal-hour span { position: absolute; top: -7px; right: 8px; color: #a0a3b2; font-size: 10px; }
.cal-hour:first-child span { display: none; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: cell;
  background-image: repeating-linear-gradient(to bottom, transparent 0 45px, var(--line) 45px 46px); }
.cal-col.today { background-color: #fbfaff; }
.cal-block { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 3px 6px; white-space: normal; cursor: pointer; z-index: 1; }
.cal-block b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cal-block small { overflow: hidden; color: inherit; opacity: .8; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.cal-block.short { flex-direction: row; align-items: center; gap: 4px; padding-top: 1px; padding-bottom: 1px; }
.cal-crm-note { font-weight: 600; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #e0475b; z-index: 2; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e0475b; }

/* Diyaloglar */
.cal-dialog { width: min(600px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.cal-dialog textarea { width: 100%; padding: 9px 10px; border: 1px solid #e7e8ef; border-radius: 7px; outline: 0; color: #44485e; font: inherit; font-size: 13px; resize: vertical; }
.cal-dialog textarea:focus { border-color: #988ef0; box-shadow: 0 0 0 3px #7162df14; }
.cal-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cal-dt { display: flex; gap: 6px; }
.cal-dt input[type=time] { flex: 0 0 104px; }
.cal-allday { margin: 12px 0 0 !important; }
.cal-attendees { padding: 6px; border: 1px solid #e7e8ef; border-radius: 7px; }
.cal-attendees:focus-within { border-color: #988ef0; box-shadow: 0 0 0 3px #7162df14; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cal-chips:not(:empty) { margin-bottom: 6px; }
.cal-att-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 9px; border-radius: 99px; color: #44485e; background: #f2f3f7; font-size: 12px; }
.cal-att-chip.crm { color: #3d3197; background: #efedfd; }
.cal-att-chip small { color: var(--muted); }
.cal-att-chip button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; line-height: 1; }
.cal-att-chip button:hover { background: #20243a14; }
.cal-attendee-search { position: relative; }
.cal-attendees input { height: 30px !important; border: 0 !important; box-shadow: none !important; padding: 0 4px !important; }
.cal-suggest { position: absolute; left: -7px; right: -7px; top: calc(100% + 6px); z-index: 5; max-height: 260px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 12px 30px #20243a26; }
.cal-suggest button { display: flex; flex-direction: column; width: 100%; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
.cal-suggest button b { color: var(--ink); font-size: 13px; font-weight: 600; }
.cal-suggest button small { color: var(--muted); font-size: 11px; }
.cal-suggest button.active, .cal-suggest button:hover { background: #f4f2ff; }

.cal-event-body { margin-top: 6px; }
.cal-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cal-badge { padding: 3px 9px; border-radius: 99px; color: #5b5f73; background: #f2f3f7; font-size: 11px; font-weight: 600; }
.cal-badge.crm { color: #3d3197; background: #efedfd; }
.cal-badge.teams { color: #fff; background: #5b5fc7; }
.cal-badge.danger { color: #9c2f3d; background: #fdecee; }
.cal-loc { margin: 4px 0 10px; color: #4d5165; font-size: 13px; }
.cal-section { margin-top: 14px; }
.cal-section h3 { margin: 0 0 7px; color: #74788c; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.cal-people { display: flex; flex-direction: column; gap: 6px; max-height: 260px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.cal-people li { display: flex; align-items: center; gap: 10px; }
.cal-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--purple); background: #efedfd; font-size: 12px; font-weight: 700; }
.cal-person { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.cal-person b { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cal-person small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cal-crm-link { flex: 0 0 auto; max-width: 180px; overflow: hidden; padding: 3px 8px; border: 1px solid #ddd8fb; border-radius: 6px; color: var(--purple);
  background: #f8f7ff; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cal-crm-link:hover { background: #efedfd; }
.cal-resp { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.cal-resp.accepted { color: var(--green); }
.cal-resp.declined { color: #b84350; }
.cal-resp.tentativelyAccepted { color: #a36a12; }
.cal-desc { max-height: 240px; overflow-y: auto; padding: 10px 12px; border-radius: 8px; color: #44485e; background: #fafbfd; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cal-event-actions { flex-wrap: wrap; }
.cal-rsvp { display: inline-flex; gap: 4px; }
.cal-rsvp .button.active { border-color: var(--purple); color: var(--purple); }
.teams-button { border-color: #5b5fc7 !important; color: #fff !important; background: #5b5fc7 !important; }
.cd-schedule { margin-right: auto; }

@media (max-width: 760px) {
  .cal-toolbar { align-items: flex-start; flex-direction: column; }
  .cal-mcell { min-height: 78px; padding: 3px; }
  .cal-chip b { display: none; }
  .cal-form-grid { grid-template-columns: 1fr; }
}
