/* Ana sayfa (personal workspace) and Ajanda. Colours come only from dex-theme.css variables;
   event and note colour tokens map to theme colours here. */

/* Event colour tokens */
.is-mavi { --ev: var(--dx-info); }
.is-yesil { --ev: var(--dx-success); }
.is-turuncu { --ev: var(--dx-warning); }
.is-kirmizi { --ev: var(--dx-danger); }
.is-mor { --ev: color-mix(in srgb, var(--dx-info) 55%, var(--dx-danger)); }
.is-gri { --ev: var(--dx-muted); }

/* Note colour tokens: soft paper tints. */
.is-sari, .is-note-sari { --note: var(--dx-warning); }
.is-note-mavi, .dx-notecard.is-mavi, .dx-notedialog.is-mavi { --note: var(--dx-info); }
.is-note-yesil, .dx-notecard.is-yesil, .dx-notedialog.is-yesil { --note: var(--dx-success); }
.is-pembe, .is-note-pembe { --note: var(--dx-danger); }
.is-note-mor, .dx-notecard.is-mor, .dx-notedialog.is-mor { --note: color-mix(in srgb, var(--dx-info) 55%, var(--dx-danger)); }
.is-note-gri, .dx-notecard.is-gri, .dx-notedialog.is-gri { --note: var(--dx-muted); }

/* Home dashboard: two widget rows that keep a readable height; the page scrolls on short screens. */
.dx-dash--home { --dx-widget-min: 610px; }
@container dash (min-width: 761px) {
    .dx-dash--home .dx-dash__widgets { grid-template-rows: minmax(340px, 4fr) minmax(254px, 3fr); grid-auto-rows: minmax(254px, auto); }
}

/* Week strip on the home page. */
.dx-weekstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.dx-weekstrip button {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 4px 10px;
    border: 1px solid var(--dx-line);
    border-radius: 12px;
    background: var(--dx-surface);
    color: var(--dx-text);
    font: inherit;
    cursor: pointer;
}
.dx-weekstrip button small { color: var(--dx-muted); font-size: var(--dx-text-xs); text-transform: capitalize; }
.dx-weekstrip button strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dx-weekstrip button.is-today strong { color: var(--dx-accent-text); }
.dx-weekstrip button[aria-selected="true"] { border-color: var(--dx-accent); background: var(--dx-accent-soft); box-shadow: inset 0 0 0 1px var(--dx-accent); }
.dx-weekstrip__dots { display: flex; gap: 3px; height: 6px; }
.dx-weekstrip__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ev, var(--dx-accent)); }
.dx-weekstrip em { position: absolute; top: 4px; right: 6px; color: var(--dx-muted); font-size: 10px; font-style: normal; font-weight: 700; }

.dx-dayagenda { margin-top: 14px; }
.dx-dayagenda__title { margin: 0 0 8px; color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.dx-agendalist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dx-agendaitem {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--dx-line);
    border-left: 4px solid var(--ev, var(--dx-accent));
    border-radius: 10px;
    background: var(--dx-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.dx-agendaitem:hover { background: var(--dx-surface-2); }
.dx-agendaitem.is-done strong { color: var(--dx-muted); text-decoration: line-through; }
.dx-agendaitem__time { flex: none; width: 92px; color: var(--dx-muted); font-size: var(--dx-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.dx-agendaitem__text { display: flex; flex-direction: column; min-width: 0; }
.dx-agendaitem__text strong { font-size: var(--dx-text-sm); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-agendaitem__text small { display: flex; flex-wrap: wrap; gap: 8px; color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-agendaitem__text small span { display: inline-flex; align-items: center; gap: 3px; }
.dx-agendaitem__text .dx-ico { width: 12px; height: 12px; }

.dx-widget-empty--action { display: flex; flex-direction: column; gap: 8px; padding: 18px 16px; text-align: center; }
.dx-widget-empty .dx-link { border: 0; background: none; color: var(--dx-accent-text); font: 600 var(--dx-text-sm) var(--dx-font); cursor: pointer; text-decoration: none; }
.dx-widget-more { display: block; padding: 10px 16px; border-top: 1px solid var(--dx-line); color: var(--dx-accent-text); font-size: var(--dx-text-sm); font-weight: 600; text-decoration: none; }
.dx-ticketmini a.needs-you { background: color-mix(in srgb, var(--dx-success) 6%, transparent); }

/* To-dos */
.dx-todos { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.dx-todos__add { display: flex; align-items: center; gap: 8px; margin: 12px 14px 6px; padding: 0 12px; border: 1px dashed var(--dx-panel-line); border-radius: 10px; background: var(--dx-surface); }
.dx-todos__add:focus-within { border-style: solid; border-color: var(--dx-accent); box-shadow: var(--dx-focus-ring); }
.dx-todos__add .dx-ico { flex: none; width: 15px; height: 15px; color: var(--dx-muted); }
.dx-todos__input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; background: transparent; color: var(--dx-text); font: inherit; font-size: var(--dx-text-sm); }
.dx-todos__list { flex: 1; min-height: 0; margin: 0; padding: 2px 0 6px; overflow: auto; list-style: none; }
.dx-todos__list li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--dx-line); }
.dx-todos__list li:last-child { border-bottom: 0; }
.dx-todos__item { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dx-todos__item > span { font-size: var(--dx-text-sm); font-weight: 600; overflow-wrap: anywhere; }
.dx-todos__item small { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-todos__item small span { display: inline-flex; align-items: center; gap: 3px; }
.dx-todos__item .dx-ico { width: 12px; height: 12px; }
.dx-todos__list li.is-late .dx-todos__due { color: var(--dx-danger); font-weight: 700; }
.dx-todocheck {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    padding: 0;
    border: 2px solid var(--dx-panel-line);
    border-radius: 6px;
    background: var(--dx-surface);
    cursor: pointer;
    transition: border-color .15s var(--dx-ease), background .15s var(--dx-ease);
}
.dx-todocheck:hover { border-color: var(--dx-success); background: color-mix(in srgb, var(--dx-success) 14%, var(--dx-surface)); }

/* Notes */
.dx-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.dx-notecard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    height: 118px;
    padding: 12px 12px 10px;
    border: 1px solid color-mix(in srgb, var(--note, var(--dx-warning)) 30%, var(--dx-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--note, var(--dx-warning)) 12%, var(--dx-surface));
    color: var(--dx-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.dx-notecard:hover { box-shadow: var(--dx-shadow-sm); }
.dx-notecard__text { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; font-size: var(--dx-text-sm); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.dx-notecard small { color: var(--dx-muted); font-size: 11px; }
.dx-notecard__pin { position: absolute; top: 8px; right: 8px; color: color-mix(in srgb, var(--note, var(--dx-warning)) 70%, var(--dx-text)); }
.dx-notecard__pin .dx-ico { width: 13px; height: 13px; }

/* Dialogs of the workspace */
.dx-pdialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); overflow: auto; scrollbar-width: thin; }
.dx-pdialog h2 { margin-bottom: 4px; }
.dx-pdialog .dx-form-field { margin-top: 10px; }
.dx-pdialog .dx-switch { margin-top: 10px; }
.dx-pdialog__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.dx-pdialog__row--center { align-items: center; margin-top: 10px; }
.dx-pdialog__row--center .dx-switch { margin-top: 0; }
.dx-pdialog__row--center .dx-form-field { margin-top: 0; }
.dx-notedialog .dx-pdialog__row--center .dx-switch { justify-self: end; }
.dx-pdialog__delete { margin-right: auto; }
.dx-colorpick { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-colordot { width: 26px; height: 26px; padding: 0; border: 2px solid var(--dx-surface); border-radius: 50%; background: var(--ev, var(--note)); box-shadow: 0 0 0 1px var(--dx-line); cursor: pointer; }
.dx-colordot[class*="is-note-"] { background: color-mix(in srgb, var(--note) 35%, var(--dx-surface)); }
.dx-colordot[aria-checked="true"] { box-shadow: 0 0 0 2px var(--dx-text); }
.dx-notedialog { background: color-mix(in srgb, var(--note, var(--dx-warning)) 6%, var(--dx-surface)); }
.dx-notedialog__text { margin-top: 8px; min-height: 160px; background: color-mix(in srgb, var(--note, var(--dx-warning)) 10%, var(--dx-surface)) !important; }

/* Ajanda page */
.dx-agenda__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dx-agenda__nav { display: flex; gap: 4px; }
.dx-agenda .dx-records__title h1 { text-transform: capitalize; }
.dx-agenda__panel { display: flex; flex-direction: column; overflow: hidden; }

.dx-month { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dx-month__head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--dx-line); }
.dx-month__head span { padding: 8px 10px; color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 700; text-transform: capitalize; }
.dx-month__grid { display: grid; flex: 1; min-height: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(78px, 1fr)); overflow: auto; }
.dx-month__day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 0; overflow: hidden; padding: 4px 6px 6px; border-right: 1px solid var(--dx-line); border-bottom: 1px solid var(--dx-line); cursor: pointer; }
.dx-month__day:nth-child(7n) { border-right: 0; }
.dx-month__day:hover { background: color-mix(in srgb, var(--dx-accent) 4%, transparent); }
.dx-month__day.is-other { background: color-mix(in srgb, var(--dx-surface-2) 60%, transparent); }
.dx-month__day.is-other .dx-month__num { color: var(--dx-muted); }
.dx-month__num { align-self: flex-start; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: 999px; background: none; color: var(--dx-text); font: 650 var(--dx-text-sm) var(--dx-font); cursor: pointer; }
.dx-month__num:hover { background: var(--dx-surface-2); }
.dx-month__day.is-today .dx-month__num { background: var(--dx-accent); color: var(--dx-on-accent); }
.dx-month__more { align-self: flex-start; padding: 0 4px; border: 0; background: none; color: var(--dx-muted); font: 600 var(--dx-text-xs) var(--dx-font); cursor: pointer; }

.dx-chip-event {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 2px 6px;
    border: 0;
    border-left: 3px solid var(--ev, var(--dx-accent));
    border-radius: 6px;
    background: color-mix(in srgb, var(--ev, var(--dx-accent)) 12%, var(--dx-surface));
    color: var(--dx-text);
    font: 500 var(--dx-text-xs) var(--dx-font);
    text-align: left;
    cursor: pointer;
}
.dx-chip-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-chip-event b { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.dx-chip-event.is-allday { background: color-mix(in srgb, var(--ev, var(--dx-accent)) 22%, var(--dx-surface)); }
.dx-chip-event.is-done span { text-decoration: line-through; color: var(--dx-muted); }

.dx-timegrid { --hour: 52px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dx-timegrid__head,
.dx-timegrid__allday { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr)); border-bottom: 1px solid var(--dx-line); }
.dx-timegrid__day { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 8px 4px; border: 0; border-left: 1px solid var(--dx-line); background: none; color: var(--dx-text); font: inherit; cursor: pointer; }
.dx-timegrid__day:disabled { cursor: default; }
.dx-timegrid__day small { color: var(--dx-muted); font-size: var(--dx-text-xs); text-transform: capitalize; }
.dx-timegrid__day strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.dx-timegrid__day.is-today strong { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 999px; background: var(--dx-accent); color: var(--dx-on-accent); font-size: 14px; }
.dx-timegrid__allday > span { display: flex; align-items: center; justify-content: flex-end; padding: 0 8px 0 0; color: var(--dx-muted); font-size: 10.5px; }
.dx-timegrid__allday > div { display: flex; flex-direction: column; gap: 3px; min-height: 30px; padding: 4px; border-left: 1px solid var(--dx-line); }
.dx-timegrid__body { position: relative; display: grid; flex: 1; min-height: 0; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr)); overflow: auto; scrollbar-width: thin; }
.dx-timegrid__hours { display: grid; grid-template-rows: repeat(var(--hours), var(--hour)); }
.dx-timegrid__hours span { padding: 0 8px 0 0; color: var(--dx-muted); font-size: 11px; text-align: right; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.dx-timegrid__hours span:first-child { transform: none; }
.dx-timegrid__col { position: relative; display: grid; grid-template-rows: repeat(var(--hours), var(--hour)); border-left: 1px solid var(--dx-line); }
.dx-timegrid__col.is-today { background: color-mix(in srgb, var(--dx-accent) 3%, transparent); }
.dx-timegrid__slot { border: 0; border-bottom: 1px solid color-mix(in srgb, var(--dx-line) 70%, transparent); background: none; cursor: pointer; }
.dx-timegrid__slot:hover { background: color-mix(in srgb, var(--dx-accent) 6%, transparent); }
.dx-timeevent {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-height: 22px;
    padding: 4px 7px;
    overflow: hidden;
    border: 0;
    border-left: 3px solid var(--ev, var(--dx-accent));
    border-radius: 7px;
    background: color-mix(in srgb, var(--ev, var(--dx-accent)) 16%, var(--dx-surface));
    color: var(--dx-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 2px color-mix(in srgb, #000 8%, transparent);
}
.dx-timeevent:hover { z-index: 2; background: color-mix(in srgb, var(--ev, var(--dx-accent)) 24%, var(--dx-surface)); }
.dx-timeevent strong { font-size: var(--dx-text-xs); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-timeevent small { color: var(--dx-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-timeevent.is-todo { justify-content: center; padding-block: 2px; border-left-style: dashed; }
.dx-timeevent.is-todo small { display: none; }
.dx-timeevent.is-done strong { text-decoration: line-through; color: var(--dx-muted); }
.dx-timegrid__now { position: absolute; left: 0; right: 0; z-index: 3; height: 2px; background: var(--dx-danger); pointer-events: none; }
.dx-timegrid__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--dx-danger); }

/* Phone: the week is a list of days (the hour grid is too narrow for seven columns). */
.dx-weeklist { display: none; margin: 0; padding: 8px 12px; list-style: none; overflow: auto; }
.dx-weeklist li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--dx-line); }
.dx-weeklist li:last-child { border-bottom: 0; }
.dx-weeklist__day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0; padding: 2px 0; border: 0; background: none; color: var(--dx-text); font: inherit; cursor: pointer; }
.dx-weeklist__day strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.dx-weeklist__day small { color: var(--dx-muted); font-size: var(--dx-text-xs); text-transform: capitalize; }
.dx-weeklist li.is-today .dx-weeklist__day strong { color: var(--dx-accent-text); }
.dx-weeklist__items { display: grid; gap: 6px; min-width: 0; }
.dx-weeklist__empty { justify-self: start; padding: 8px 0; border: 0; background: none; color: var(--dx-muted); font: inherit; font-size: var(--dx-text-sm); cursor: pointer; }

@container records (max-width: 640px) {
    .dx-weeklist { display: block; }
    .dx-weeklist .dx-agendaitem { flex-direction: column; align-items: flex-start; gap: 2px; }
    .dx-weeklist .dx-agendaitem__time { width: auto; font-size: var(--dx-text-xs); }
    .dx-timegrid.is-week { display: none; }
    .dx-timegrid__day { flex-direction: column; align-items: center; gap: 0; }
}

@media (max-width: 760px) {
    .dx-weekstrip { gap: 4px; }
    .dx-weekstrip button { padding: 6px 2px 8px; }
    .dx-weekstrip button strong { font-size: 15px; }
    .dx-agendaitem__time { width: 70px; }
    .dx-pdialog__row { grid-template-columns: 1fr; }
    .dx-month__grid { grid-template-rows: repeat(6, minmax(64px, 1fr)); }
    .dx-month__day .dx-chip-event span { display: none; }
    .dx-month__day .dx-chip-event { padding: 0; height: 6px; border-left: 0; background: var(--ev); }
    .dx-month__day .dx-chip-event b { display: none; }
    .dx-agenda__tools { width: 100%; }
    .dx-dash--home .dx-widget__meta,
    .dx-weekstrip em { display: none; }
    .dx-hide-sm { display: none; }
}
