/* Dexapp Studio list and form screens (records). Every business screen follows the flow
   list -> open / new record -> form (docs/architecture). Colours come only from tokens; panels use
   the dashboard panel tokens (--dx-panel-*) so lists and forms match the dashboards in both themes.
   Like dashboards, a list or form fills the workspace on desktops: headers stay, the grid or form
   panel scrolls inside. */

.dx-workspace:has(> .dx-records),
.dx-workspace:has(> .dx-record) { padding-top: 20px; padding-bottom: var(--dx-foot-gap); }

.dx-records,
.dx-record {
    container: records / inline-size;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    height: 100%;
    max-width: 1680px;
    margin: 0 auto;
}

.dx-record { grid-template-rows: auto auto minmax(0, 1fr); }
.dx-record:not(:has(> .dx-notice)) { grid-template-rows: auto minmax(0, 1fr); }

/* ---- Heading ---- */

.dx-records__head,
.dx-record__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
}

.dx-records__title h1,
.dx-record__title h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 750;
    letter-spacing: -.02em;
}

.dx-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    color: var(--dx-muted);
    font-size: var(--dx-text-xs);
    font-weight: 600;
}

.dx-crumbs a { color: var(--dx-accent-text); text-decoration: none; }
.dx-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dx-crumbs .dx-ico { width: 13px; height: 13px; opacity: .6; }

.dx-count {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--dx-accent-soft);
    color: var(--dx-accent-text);
    font-size: var(--dx-text-xs);
    font-weight: 700;
    letter-spacing: 0;
}

.dx-records__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-records__actions .dx-ico,
.dx-button .dx-ico { width: 17px; height: 17px; }

.dx-button--danger {
    background: var(--dx-danger);
    color: #fff;
    box-shadow: 0 10px 22px -12px var(--dx-danger);
}

.dx-button--danger:hover:not(:disabled) { filter: brightness(1.06); }

/* ---- Filter bar ---- */

.dx-filterbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.dx-filterbar__search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 180px;
    min-width: 170px;
    max-width: 340px;
}

/* Refresh and "new" sit at the right end of the filter row, above the grid. */
.dx-filterbar__end { margin-left: auto; flex-wrap: nowrap; }
.dx-filterbar__end .dx-button { white-space: nowrap; }
.dx-button--icon { width: 38px; padding: 0; }
.dx-select { min-width: 140px; }

.dx-filterbar__search .dx-ico {
    position: absolute;
    left: 12px;
    width: 17px;
    height: 17px;
    color: var(--dx-muted);
    pointer-events: none;
}

.dx-filterbar__search input,
.dx-select {
    width: 100%;
    height: 38px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 11px;
    background: var(--dx-panel-bg);
    color: var(--dx-text);
    font: 500 var(--dx-text-sm) var(--dx-font);
}

.dx-filterbar__search input { padding: 0 12px 0 38px; }
.dx-select { width: auto; min-width: 150px; padding: 0 12px; cursor: pointer; }
.dx-filterbar__search input:focus,
.dx-select:focus { outline: 0; border-color: var(--dx-accent); box-shadow: var(--dx-focus-ring); }
.dx-select option { background: var(--dx-surface); color: var(--dx-text); }

.dx-segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 12px;
    background: var(--dx-panel-bg);
}

.dx-segmented button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--dx-muted);
    font: 600 var(--dx-text-sm) var(--dx-font);
    cursor: pointer;
    white-space: nowrap;
}

.dx-segmented button span {
    padding: 0 6px;
    border-radius: 999px;
    background: var(--dx-surface-2);
    font-size: 11px;
}

.dx-segmented button:hover { color: var(--dx-text); }

.dx-segmented button[aria-selected="true"],
.dx-segmented button[aria-checked="true"] {
    background: var(--dx-accent);
    color: var(--dx-on-accent);
}

.dx-segmented button[aria-selected="true"] span { background: color-mix(in srgb, var(--dx-on-accent) 22%, transparent); }

/* ---- List panel ---- */

.dx-records__panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--dx-panel-line);
    border-radius: 16px;
    background: var(--dx-panel-bg);
    box-shadow: var(--dx-panel-shadow);
}

.dx-records__scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }

.dx-records__state {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    min-height: 220px;
    height: 100%;
    padding: 24px;
    color: var(--dx-muted);
    font-size: var(--dx-text-sm);
    text-align: center;
}

.dx-records__state strong { color: var(--dx-text); font-size: var(--dx-text-md); }
.dx-records__state--error { color: var(--dx-danger); font-weight: 600; grid-auto-flow: column; }

.dx-records__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 16px;
    border-top: 1px solid var(--dx-panel-head-line);
    color: var(--dx-muted);
    font-size: var(--dx-text-xs);
    font-weight: 600;
}

.dx-records__message { color: var(--dx-success); }
.dx-records__message.is-error { color: var(--dx-danger); }

/* Data grid (visible column lines, owner request for a real grid) */
.dx-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--dx-text-sm); }

.dx-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 40px;
    padding: 0 14px;
    border-bottom: 1px solid var(--dx-panel-head-line);
    background: color-mix(in srgb, var(--dx-accent) 5%, var(--dx-surface-2));
    color: var(--dx-muted);
    font-size: var(--dx-text-xs);
    font-weight: 700;
    letter-spacing: .02em;
    text-align: left;
    white-space: nowrap;
}

.dx-grid td {
    height: 54px;
    padding: 6px 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--dx-accent) 8%, var(--dx-line));
    vertical-align: middle;
}

.dx-grid th + th,
.dx-grid td + td { border-left: 1px solid color-mix(in srgb, var(--dx-accent) 6%, var(--dx-line)); }

.dx-grid tbody tr { cursor: pointer; transition: background .15s; }
.dx-grid tbody tr:hover td { background: color-mix(in srgb, var(--dx-accent) 6%, transparent); }
.dx-grid tbody tr:focus-visible { outline: 2px solid var(--dx-accent); outline-offset: -2px; }
.dx-grid__muted { color: var(--dx-muted); }
.dx-grid__actions { width: 52px; text-align: center !important; }

.dx-person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.dx-person__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.dx-person__text strong { font-weight: 650; }
.dx-person__text small { color: var(--dx-muted); font-size: var(--dx-text-xs); }

.dx-avatar--sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }

.dx-avatar--xl {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    font-size: 26px;
    box-shadow: 0 14px 30px -14px var(--dx-accent);
}

.dx-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.dx-tag--accent { background: var(--dx-accent-soft) !important; color: var(--dx-accent-text) !important; margin-left: 4px; }
.dx-status--danger { background: color-mix(in srgb, var(--dx-danger) 14%, var(--dx-surface)); color: var(--dx-danger); }

.dx-online { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }

.dx-online > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dx-success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dx-success) 22%, transparent);
}

.dx-row-menu {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--dx-muted);
    cursor: pointer;
}

.dx-row-menu:hover,
.dx-row-menu[aria-expanded="true"] { border-color: var(--dx-panel-line); background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-row-menu .dx-ico { width: 18px; height: 18px; }

.dx-row-menu__list { top: calc(100% + 4px); min-width: 190px; padding: 6px; }

.dx-row-menu__list button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--dx-text);
    font: 500 var(--dx-text-sm) var(--dx-font);
    text-align: left;
    cursor: pointer;
}

.dx-row-menu__list button:hover { background: var(--dx-accent-soft); }
.dx-row-menu__list .dx-ico { width: 16px; height: 16px; color: var(--dx-accent-text); }

.dx-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Form ---- */

.dx-dirty {
    padding: 2px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--dx-warning) 16%, var(--dx-surface));
    color: var(--dx-warning);
    font-size: var(--dx-text-xs);
    font-weight: 650;
    letter-spacing: 0;
}

/* Standard form bar (same on every form): Yeni, Kaydet, Sil (+ Aç, Yazdır when a form needs them). */
.dx-formbar {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 13px;
    background: var(--dx-panel-bg);
    box-shadow: var(--dx-panel-shadow);
}

.dx-formbar__button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--dx-text);
    font: 600 var(--dx-text-sm) var(--dx-font);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.dx-formbar__button .dx-ico { width: 17px; height: 17px; color: var(--dx-accent-text); }
.dx-formbar__button:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--dx-accent-soft); }
.dx-formbar__button--primary { background: var(--dx-accent-gradient); color: var(--dx-on-accent); }
.dx-formbar__button--primary .dx-ico { color: inherit; }
.dx-formbar__button--primary:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--dx-accent-gradient); color: var(--dx-on-accent); filter: brightness(1.06); }
.dx-formbar__button--danger .dx-ico { color: var(--dx-danger); }
.dx-formbar__button--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--dx-danger) 12%, transparent) !important; color: var(--dx-danger); }
.dx-formbar__button:disabled,
.dx-formbar__button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.dx-formbar__button:focus-visible { outline: 0; box-shadow: var(--dx-focus-ring); }

.dx-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 14px;
    border: 1px solid;
    border-radius: 12px;
    font-size: var(--dx-text-sm);
    font-weight: 600;
    animation: dx-pop .18s var(--dx-ease);
}

.dx-notice span { flex: 1; }
.dx-notice .dx-ico { width: 17px; height: 17px; }
.dx-notice button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: inherit; cursor: pointer; }
.dx-notice button .dx-ico { width: 14px; height: 14px; }
.dx-notice.is-success { border-color: color-mix(in srgb, var(--dx-success) 40%, var(--dx-line)); background: color-mix(in srgb, var(--dx-success) 10%, var(--dx-surface)); color: var(--dx-success); }
.dx-notice.is-error { border-color: color-mix(in srgb, var(--dx-danger) 40%, var(--dx-line)); background: color-mix(in srgb, var(--dx-danger) 10%, var(--dx-surface)); color: var(--dx-danger); }

.dx-record__body {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
}

/* Profile card (left) */
.dx-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 0;
    overflow: auto;
    padding: 24px 18px 18px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 16px;
    background:
        radial-gradient(120% 40% at 50% 0%, color-mix(in srgb, var(--dx-accent) 14%, transparent), transparent 70%),
        var(--dx-panel-bg);
    box-shadow: var(--dx-panel-shadow);
    scrollbar-width: thin;
}

.dx-profile-card__name { margin-top: 8px; font-size: var(--dx-text-lg); font-weight: 700; text-align: center; }
.dx-profile-card__user { color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-profile-card__pills { display: flex; gap: 6px; margin: 6px 0 4px; }
.dx-profile-card__facts { align-self: stretch; margin-top: 10px; }
.dx-profile-card__facts > div { font-size: var(--dx-text-xs); }
.dx-profile-card__actions { display: grid; align-self: stretch; gap: 8px; margin-top: 12px; }
.dx-profile-card__actions .dx-button { width: 100%; }

.dx-session-box,
.dx-reset-box {
    display: grid;
    align-self: stretch;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--dx-panel-line);
    border-radius: 12px;
    font-size: var(--dx-text-sm);
}

.dx-session-box small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-reset-box { gap: 10px; border-style: solid; background: color-mix(in srgb, var(--dx-accent) 5%, transparent); }

/* Main (right): tabs + panel */
.dx-record__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--dx-panel-line);
    border-radius: 16px;
    background: var(--dx-panel-bg);
    box-shadow: var(--dx-panel-shadow);
}

.dx-tabbar {
    display: flex;
    gap: 4px;
    flex: none;
    padding: 0 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--dx-panel-head-line);
    scrollbar-width: none;
}

.dx-tabbar button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: var(--dx-muted);
    font: 600 var(--dx-text-sm) var(--dx-font);
    white-space: nowrap;
    cursor: pointer;
}

.dx-tabbar button .dx-ico { width: 17px; height: 17px; }
.dx-tabbar button:hover { color: var(--dx-text); }
.dx-tabbar button[aria-selected="true"] { color: var(--dx-text); }
.dx-tabbar button[aria-selected="true"] .dx-ico { color: var(--dx-accent-text); }

.dx-tabbar button[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--dx-accent);
}

.dx-record__panel { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 20px; scrollbar-width: thin; }

.dx-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    max-width: 920px;
}

/* Compact form standard: fields are 36px high, hints sit on the label line so a form fits one screen. */
.dx-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dx-form-field--span2 { grid-column: span 2; }

.dx-form-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-width: 0; align-content: start; font-size: var(--dx-text-sm); }
.dx-form-field > span { font-weight: 600; }
.dx-form-field em { color: var(--dx-danger); font-style: normal; }
.dx-form-field--wide { grid-column: 1 / -1; }
.dx-form-field .dx-input { width: 100%; height: 36px; background: var(--dx-surface); }
.dx-form-field .dx-input:disabled { opacity: .7; cursor: not-allowed; }
.dx-form-field .dx-input.is-invalid { border-color: var(--dx-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dx-danger) 18%, transparent); }
.dx-textarea { height: auto !important; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.dx-form-field__label { display: flex; align-items: baseline; gap: 4px; min-width: 0; white-space: nowrap; }
.dx-form-field__label small {
    min-width: 0;
    margin-left: auto;
    padding-left: 10px;
    overflow: hidden;
    color: var(--dx-muted);
    font-size: var(--dx-text-xs);
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dx-textarea--line { min-height: 36px; padding: 7px 12px; }
.dx-form-field__hint { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-form-field__error { color: var(--dx-danger); font-size: var(--dx-text-xs); font-weight: 600; }

.dx-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.dx-switch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 12px;
    background: var(--dx-surface);
    cursor: pointer;
    font-size: var(--dx-text-sm);
}

.dx-reset-box .dx-switch { padding: 0; border: 0; background: transparent; align-items: center; }

.dx-switch input { position: absolute; opacity: 0; pointer-events: none; }

.dx-switch > span:first-of-type {
    position: relative;
    flex: none;
    width: 38px;
    height: 22px;
    margin-top: 1px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--dx-text) 22%, transparent);
    transition: background .2s;
}

.dx-switch > span:first-of-type::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s var(--dx-ease);
}

.dx-switch input:checked + span { background: var(--dx-accent); }
.dx-switch input:checked + span::after { transform: translateX(16px); }
.dx-switch input:focus-visible + span { box-shadow: var(--dx-focus-ring); }
.dx-switch input:disabled + span { opacity: .5; }
.dx-switch__text { display: grid; gap: 2px; }
.dx-switch__text small { color: var(--dx-muted); font-size: var(--dx-text-xs); }

.dx-panel-lead { margin: 0 0 14px; color: var(--dx-muted); font-size: var(--dx-text-sm); }

/* Selectable cards (roles) */
.dx-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

.dx-choice {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 13px;
    background: var(--dx-surface);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.dx-choice input { position: absolute; opacity: 0; pointer-events: none; }
.dx-choice:hover { border-color: var(--dx-accent-line); }
.dx-choice:focus-within { box-shadow: var(--dx-focus-ring); }
.dx-choice.is-selected { border-color: var(--dx-accent); background: color-mix(in srgb, var(--dx-accent) 7%, var(--dx-surface)); }
.dx-choice.is-muted { opacity: .65; }

.dx-choice__check {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    border: 2px solid var(--dx-panel-line);
    border-radius: 7px;
    color: transparent;
}

.dx-choice__check .dx-ico { width: 14px; height: 14px; stroke-width: 2.6; }
.dx-choice.is-selected .dx-choice__check { border-color: var(--dx-accent); background: var(--dx-accent); color: var(--dx-on-accent); }
.dx-choice__text { display: grid; flex: 1; gap: 3px; min-width: 0; }
.dx-choice__text strong { font-size: var(--dx-text-sm); font-weight: 650; }
.dx-choice__text small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-choice__meta { color: var(--dx-muted); font-size: 11px; font-weight: 600; white-space: nowrap; }

/* Confirmation dialog */
.dx-dialog-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(4, 10, 20, .45); backdrop-filter: blur(2px); animation: dx-fade .2s ease; }

@keyframes dx-fade { from { opacity: 0; } }

.dx-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 91;
    display: grid;
    justify-items: center;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    padding: 26px 24px 20px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 18px;
    background: var(--dx-surface);
    box-shadow: var(--dx-shadow);
    text-align: center;
    transform: translate(-50%, -50%);
    animation: dx-pop .18s var(--dx-ease);
}

.dx-dialog h2 { margin: 4px 0 0; font-size: var(--dx-text-lg); }
.dx-dialog p { margin: 0; color: var(--dx-muted); font-size: var(--dx-text-sm); line-height: 1.5; }
.dx-dialog p strong { color: var(--dx-text); }

.dx-dialog__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--dx-danger) 14%, var(--dx-surface));
    color: var(--dx-danger);
}

.dx-dialog__icon .dx-ico { width: 24px; height: 24px; }
.dx-dialog__actions { display: flex; gap: 8px; margin-top: 10px; }

/* Form sections */
.dx-form-sections { display: grid; gap: 14px; max-width: 1080px; }

.dx-form-section {
    margin: 0;
    padding: 8px 16px 14px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--dx-surface) 60%, transparent);
}

.dx-form-section legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    margin-left: -4px;
    color: var(--dx-accent-text);
    font-size: var(--dx-text-sm);
    font-weight: 700;
}

.dx-form-section legend .dx-ico { width: 17px; height: 17px; }
.dx-form-section .dx-form-grid { max-width: none; }
.dx-switch--inline { align-self: end; }
.dx-switch--compact { min-height: 36px; padding: 6px 12px; align-items: center; border-radius: 10px; }
.dx-switch--compact { min-width: 0; }
.dx-switch--compact .dx-switch__text { display: flex; flex: 1 1 auto; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; }
.dx-switch--compact .dx-switch__text strong { flex: none; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dx-switch--compact .dx-switch__text small { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dx-choice--compact { padding: 8px 12px; align-items: center; border-radius: 11px; }
.dx-choice--compact .dx-choice__text { gap: 1px; }
.dx-choice--compact .dx-choice__text strong { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.dx-choice--compact .dx-tag { flex: none; }
.dx-choice__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dx-choice--compact .dx-choice__text small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dx-role-options:has(.dx-choice--compact) { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.dx-role-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dx-choice--radio .dx-choice__check { border-radius: 50%; }

.dx-password-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px dashed var(--dx-panel-line);
    border-radius: 10px;
}

.dx-password-dots { letter-spacing: .15em; font-weight: 700; }
.dx-password-row small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-password-row .dx-link { margin-left: auto; }

.dx-notice.is-info { border-color: var(--dx-accent-line); background: var(--dx-accent-soft); color: var(--dx-accent-text); margin-bottom: 12px; }

/* Permission objects */
.dx-perm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.dx-perm-legend { display: inline-flex; gap: 6px; margin-left: auto; }
.dx-perm-toolbar + .dx-notice,
.dx-notice + /* Permission matrix: fixed action columns in the same order on every row; a filled tick is granted,
   a faint cross is denied, an empty cell means the object has no such action. */
.dx-perm-scroll {
    overflow-x: auto;
    border: 1px solid var(--dx-panel-line);
    border-radius: 12px;
    background: var(--dx-surface);
    scrollbar-width: thin;
}

.dx-perm-table { min-width: 860px; font-size: var(--dx-text-sm); }

.dx-perm-row {
    --dx-perm-cols: minmax(210px, 1fr) repeat(7, 62px) minmax(110px, .5fr) 104px 44px;
    display: grid;
    grid-template-columns: var(--dx-perm-cols);
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 0 10px 0 14px;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--dx-accent) 8%, var(--dx-line));
    background: transparent;
    color: var(--dx-text);
    font: inherit;
    text-align: left;
}

.dx-perm-table > :last-child { border-bottom: 0; }

.dx-perm-row--head {
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 40px;
    background: color-mix(in srgb, var(--dx-accent) 6%, var(--dx-surface-2));
    color: var(--dx-muted);
    font-size: 11.5px;
    font-weight: 700;
}

.dx-perm-col { display: grid; place-items: center; text-align: center; }

/* Vertical guides behind the action columns */
.dx-perm-row:not(.dx-perm-row--group) > .dx-perm-col { align-self: stretch; border-left: 1px solid color-mix(in srgb, var(--dx-accent) 6%, var(--dx-line)); }
.dx-perm-row:not(.dx-perm-row--group) > .dx-perm-col + :not(.dx-perm-col) { border-left: 1px solid color-mix(in srgb, var(--dx-accent) 6%, var(--dx-line)); align-self: stretch; display: flex; align-items: center; padding-left: 10px; }
.dx-perm-row--head > span:not(.dx-perm-col):not(:first-child) { padding-left: 10px; }

.dx-perm-row--group {
    display: flex;
    min-height: 38px;
    background: color-mix(in srgb, var(--dx-accent) 5%, transparent);
    cursor: pointer;
}

.dx-perm-row--group:hover { background: color-mix(in srgb, var(--dx-accent) 9%, transparent); }
.dx-perm-row.has-exception { background: color-mix(in srgb, var(--dx-warning) 8%, transparent); }
.dx-perm-row.has-exception > .dx-perm-name { box-shadow: inset 3px 0 0 var(--dx-warning); margin-left: -14px; padding-left: calc(14px + var(--depth, 0) * 18px); align-self: stretch; }
.dx-perm-row.is-editing { background: var(--dx-accent-soft); }

.dx-perm-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 6px 10px 6px calc(var(--depth, 0) * 18px);
    line-height: 1.3;
}

.dx-perm-row--group .dx-perm-name { flex-direction: row; align-items: center; gap: 8px; }
.dx-perm-name .dx-ico { width: 15px; height: 15px; color: var(--dx-accent-text); }
.dx-perm-name strong { font-weight: 600; }
.dx-perm-row--group .dx-perm-name strong { font-weight: 700; }
.dx-perm-name code { overflow: hidden; color: var(--dx-muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.dx-perm-edit { display: grid; place-items: center; }

.dx-perm-cell {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    font: inherit;
}

.dx-perm-cell .dx-ico { width: 15px; height: 15px; stroke-width: 2.6; }
.dx-perm-cell.is-on { background: var(--dx-accent); color: var(--dx-on-accent); }
.dx-perm-cell.is-off { background: transparent; color: color-mix(in srgb, var(--dx-muted) 55%, transparent); }
.dx-perm-cell.is-off .dx-ico { width: 12px; height: 12px; stroke-width: 2.2; }
button.dx-perm-cell { cursor: pointer; box-shadow: 0 0 0 1px var(--dx-accent-line); }
button.dx-perm-cell.is-off { background: var(--dx-surface); }
button.dx-perm-cell:hover { transform: scale(1.08); }
button.dx-perm-cell:focus-visible { outline: 0; box-shadow: var(--dx-focus-ring); }

/* Yes/no and other single values span the action columns */
.dx-perm-span { grid-column: 2 / span 8; display: flex; align-items: center; padding-left: 18px; }
.dx-perm-text { color: var(--dx-text); font-weight: 600; }

.dx-perm-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--dx-muted);
    font: 600 var(--dx-text-sm) var(--dx-font);
}

.dx-perm-switch > span {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--dx-text) 20%, transparent);
    transition: background .2s;
}

.dx-perm-switch > span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s var(--dx-ease);
}

.dx-perm-switch.is-on { color: var(--dx-accent-text); }
.dx-perm-switch.is-on > span { background: var(--dx-accent); }
.dx-perm-switch.is-on > span::after { transform: translateX(14px); }
button.dx-perm-switch { cursor: pointer; }

.dx-perm-other { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }

.dx-perm-tag {
    padding: 2px 7px;
    border: 1px dashed color-mix(in srgb, var(--dx-muted) 45%, transparent);
    border-radius: 6px;
    background: transparent;
    color: color-mix(in srgb, var(--dx-muted) 75%, transparent);
    font: 500 11px var(--dx-font);
    text-decoration: line-through;
}

.dx-perm-tag.is-on { border: 1px solid transparent; background: var(--dx-accent-soft); color: var(--dx-accent-text); font-weight: 700; text-decoration: none; }
button.dx-perm-tag { cursor: pointer; }

.dx-source { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.dx-source--role { background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-source--exception { background: color-mix(in srgb, var(--dx-warning) 18%, var(--dx-surface)); color: var(--dx-warning); }
.dx-source--full { background: color-mix(in srgb, var(--dx-success) 14%, var(--dx-surface)); color: var(--dx-success); }
.dx-source--default { background: var(--dx-surface-2); color: var(--dx-muted); }

.dx-perm-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--dx-accent-line);
    background: color-mix(in srgb, var(--dx-accent) 6%, var(--dx-surface));
}

.dx-perm-editor__hint { display: inline-flex; align-items: center; gap: 6px; flex-basis: 100%; color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-perm-editor__hint .dx-ico { width: 14px; height: 14px; color: var(--dx-accent-text); }
.dx-perm-editor__hint strong { color: var(--dx-text); }
.dx-perm-editor .dx-input { flex: 1 1 260px; height: 36px; }

/* ---- Narrow screens ---- */

@container records (max-width: 1180px) {
    .dx-record__body { grid-template-columns: 260px minmax(0, 1fr); }
}

@container records (max-width: 980px) {
    .dx-record__body { grid-template-columns: minmax(0, 1fr); overflow: auto; }
    .dx-profile-card { overflow: visible; }
    .dx-record__main { min-height: 480px; overflow: visible; }
}

@container records (max-width: 760px) {
    .dx-form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container records (max-width: 640px) {
    .dx-records__title h1,
    .dx-record__title h1 { font-size: 21px; }
    .dx-filterbar__search { max-width: none; flex-basis: 100%; }
    .dx-segmented { width: 100%; overflow-x: auto; }
    .dx-form-grid,
    .dx-form-grid--3,
    .dx-switches { grid-template-columns: 1fr; }
    .dx-form-field--span2 { grid-column: auto; }
    .dx-formbar { width: 100%; }
    .dx-formbar__button { flex: 1; justify-content: center; }
    .dx-record__panel { padding: 16px; }

    /* Grid rows become cards */
    .dx-grid thead { display: none; }
    .dx-grid,
    .dx-grid tbody,
    .dx-grid tr,
    .dx-grid td { display: block; width: auto; }
    .dx-grid tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--dx-panel-head-line); }
    .dx-grid td { height: auto; padding: 3px 0; border: 0 !important; }
    .dx-grid td[data-label="E-posta"],
    .dx-grid td[data-label="Son giriş"],
    .dx-grid td[data-label="Oturum"] { display: none; }
    .dx-grid td[data-label="Rol"],
    .dx-grid td[data-label="Durum"] { display: inline-flex; margin: 6px 8px 0 0; vertical-align: middle; }
    .dx-grid td[data-label="Kullanıcı"] { padding-right: 44px; }
    .dx-grid__actions { position: absolute; top: 14px; right: 10px; width: auto; }
}

/* Phone: no page padding fight with the bottom menu; lists and forms scroll with the page */
@media (max-width: 760px) {
    .dx-records,
    .dx-record { height: auto; grid-template-rows: none; }
    .dx-records__panel { min-height: 0; overflow: visible; }
    .dx-records__scroll { overflow: visible; }
    .dx-record__body { overflow: visible; }
}

/* ---- Permission matrix: bulk editing ---- */

.dx-perm-group-toggle {
    flex: 1;
    justify-content: flex-start;
    align-self: stretch;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dx-perm-row--group { cursor: default; }
.dx-perm-groupbtns { display: inline-flex; gap: 6px; padding-right: 6px; }

.dx-perm-groupbtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 8px;
    background: var(--dx-surface);
    color: var(--dx-muted);
    font: 600 11.5px var(--dx-font);
    cursor: pointer;
}

.dx-perm-groupbtn .dx-ico { width: 13px; height: 13px; stroke-width: 2.4; }
.dx-perm-groupbtn:hover { border-color: var(--dx-danger); color: var(--dx-danger); }
.dx-perm-groupbtn.is-grant { border-color: var(--dx-accent-line); color: var(--dx-accent-text); }
.dx-perm-groupbtn.is-grant:hover { background: var(--dx-accent); color: var(--dx-on-accent); }

.dx-perm-colbtn {
    width: 100%;
    height: 100%;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--dx-accent-text);
    font: 700 11.5px var(--dx-font);
    text-decoration: underline dashed;
    text-underline-offset: 4px;
    cursor: pointer;
}

.dx-perm-colbtn:hover { background: var(--dx-accent-soft); }

.dx-perm-name:has(> .dx-perm-rowbtn) { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
.dx-perm-name__text { display: flex; flex-direction: column; min-width: 0; }

.dx-perm-rowbtn {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--dx-accent-line);
    border-radius: 7px;
    background: var(--dx-surface);
    color: var(--dx-accent-text);
    cursor: pointer;
}

.dx-perm-rowbtn .dx-ico { width: 13px; height: 13px; stroke-width: 2.6; }
.dx-perm-rowbtn:hover { background: var(--dx-accent-soft); }
.dx-perm-rowbtn.is-full { border-color: var(--dx-accent); background: var(--dx-accent); color: var(--dx-on-accent); }
.dx-perm-rowbtn.is-some { border-color: var(--dx-accent); }
.dx-perm-rowbtn__dash { width: 10px; height: 2px; border-radius: 2px; background: var(--dx-accent); }

/* Changed but not saved yet */
.dx-perm-row.is-changed { background: color-mix(in srgb, var(--dx-accent) 7%, transparent); }
.dx-perm-cell.is-changed,
.dx-perm-switch.is-changed > span { outline: 2px dashed var(--dx-warning); outline-offset: 2px; }

.dx-perm-bulk-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px dashed var(--dx-accent-line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--dx-accent) 5%, transparent);
    color: var(--dx-muted);
    font-size: var(--dx-text-xs);
    line-height: 1.5;
}

.dx-perm-bulk-hint .dx-ico { flex: none; width: 15px; height: 15px; margin-top: 1px; color: var(--dx-accent-text); }
.dx-perm-bulk-hint strong { color: var(--dx-text); }

.dx-perm-bulkbar {
    position: sticky;
    bottom: -20px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 12px -20px -20px;
    padding: 12px 20px;
    border-top: 1px solid var(--dx-panel-line);
    background: color-mix(in srgb, var(--dx-surface) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dx-perm-bulkbar.has-changes { border-top-color: var(--dx-accent); box-shadow: 0 -10px 24px -18px var(--dx-accent); }
.dx-perm-bulkbar__count { color: var(--dx-muted); font-size: var(--dx-text-sm); white-space: nowrap; }
.dx-perm-bulkbar__count strong { color: var(--dx-text); font-size: var(--dx-text-md); }
.dx-perm-bulkbar .dx-input { flex: 1 1 240px; height: 36px; }

/* ---- Users | Roles switch, role badge, member list ---- */

.dx-subnav {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 12px;
    background: var(--dx-panel-bg);
}

.dx-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 14px;
    border-radius: 9px;
    color: var(--dx-muted);
    font: 600 var(--dx-text-sm) var(--dx-font);
    text-decoration: none;
}

.dx-subnav a .dx-ico { width: 16px; height: 16px; }
.dx-subnav a:hover { color: var(--dx-text); }
.dx-subnav a.is-active { background: var(--dx-accent); color: var(--dx-on-accent); }

.dx-role-badge {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    background: var(--dx-accent-soft);
    color: var(--dx-accent-text);
}

.dx-role-badge .dx-ico { width: 18px; height: 18px; }
.dx-role-badge.is-full { background: var(--dx-accent-gradient); color: var(--dx-on-accent); }
.dx-role-badge--xl { width: 76px; height: 76px; border-radius: 22px; box-shadow: 0 14px 30px -14px var(--dx-accent); }
.dx-role-badge--xl .dx-ico { width: 36px; height: 36px; stroke-width: 1.7; }
.dx-grid .is-num { text-align: right; font-variant-numeric: tabular-nums; }

.dx-member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }

.dx-member {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 12px;
    background: var(--dx-surface);
    color: var(--dx-text);
    text-decoration: none;
}

.dx-member .dx-person__text { flex: 1; }
.dx-member:hover { border-color: var(--dx-accent-line); }
.dx-member:hover .dx-quick__go { color: var(--dx-accent-text); transform: translateX(3px); }
.dx-perm-scroll.no-source .dx-perm-row { --dx-perm-cols: minmax(210px, 1fr) repeat(7, 62px) minmax(110px, .5fr); }
.dx-perm-message { margin-bottom: 12px; }
.dx-perm-textinput { height: 32px; max-width: 240px; }

/* ---- Mail account and signature (user card "E-posta", Hesabım) ---- */

.dx-mail { display: flex; flex-direction: column; min-height: 100%; }
.dx-mail .dx-perm-message { margin-bottom: 12px; }
.dx-mail__grid { display: grid; flex: 1; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.dx-mail__account { max-width: none; align-content: start; }
.dx-mail__serverrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dx-mail__source { flex: none; }
.dx-mail__serverrow .dx-mail__server { flex: 1; min-width: 0; }
.dx-mail__serverrow .dx-mail__server:not(.is-missing) > .dx-ico { display: none; }
.dx-segmented button:disabled { cursor: default; opacity: .7; }

.dx-mail__server {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px dashed var(--dx-panel-line);
    border-radius: 10px;
    font-size: var(--dx-text-sm);
}

.dx-mail__server > .dx-ico { width: 17px; height: 17px; flex: none; color: var(--dx-accent-text); }
.dx-mail__server > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dx-mail__server .dx-link { margin-left: auto; }
.dx-mail__server.is-missing { border-color: color-mix(in srgb, var(--dx-warning) 55%, transparent); color: var(--dx-warning); }
.dx-mail__server.is-missing > .dx-ico { color: inherit; }

.dx-mail__own { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1.3fr); gap: 12px 16px; }

.dx-mail__signature { display: flex; flex-direction: column; gap: 8px; min-width: 0; container: sig / inline-size; }
.dx-mail__signature > .dx-switch { align-self: stretch; }
.dx-sig__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dx-sig__head > .dx-switch { flex: 1; }
.dx-sig__modes { flex: none; margin-left: auto; }
.dx-mail .dx-password-row { flex-wrap: nowrap; }
.dx-mail .dx-password-row small { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dx-mail .dx-password-row .dx-link { flex: none; }

.dx-mail__test { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; min-width: 0; color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-mail__test .dx-ico { width: 16px; height: 16px; flex: none; }
.dx-mail__test span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dx-mail__test.is-ok { color: var(--dx-success); }
.dx-mail__test.is-fail { color: var(--dx-danger); }

.dx-sig {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 230px;
    overflow: hidden;
    border: 1px solid var(--dx-panel-line);
    border-radius: 12px;
    background: var(--dx-surface);
}

.dx-sig:focus-within { border-color: var(--dx-accent); box-shadow: var(--dx-focus-ring); }

.dx-sig__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 5px 6px;
    border-bottom: 1px solid var(--dx-panel-line);
    background: color-mix(in srgb, var(--dx-panel-bg) 70%, var(--dx-surface));
}

.dx-sig__modes { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--dx-text) 6%, transparent); }

.dx-sig__modes button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--dx-muted);
    font: 600 var(--dx-text-xs) var(--dx-font);
    cursor: pointer;
}

.dx-sig__modes button .dx-ico { width: 14px; height: 14px; }
.dx-sig__modes button[aria-selected="true"] { background: var(--dx-surface); color: var(--dx-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.dx-sig__sep { width: 1px; height: 18px; margin: 0 3px; background: var(--dx-panel-line); }

.dx-sig__tool {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--dx-text);
    cursor: pointer;
}

.dx-sig__tool .dx-ico { width: 17px; height: 17px; }
.dx-sig__tool:hover, .dx-sig__tool.is-on { background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-sig__tool input[type="file"], .dx-sig__tool input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dx-sig__swatch { width: 16px; height: 16px; border: 2px solid var(--dx-surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--dx-panel-line); }

.dx-sig__size {
    width: 74px;
    height: 28px;
    padding: 0 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--dx-text);
    font: 500 var(--dx-text-xs) var(--dx-font);
    cursor: pointer;
}

.dx-sig__size:hover { background: var(--dx-accent-soft); }

.dx-sig__link { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--dx-panel-line); }
.dx-sig__link .dx-input { flex: 1; height: 32px; }
.dx-sig > .dx-form-field__error { padding: 6px 10px 0; }

.dx-sig__body { position: relative; display: flex; flex: 1; min-height: 0; }

.dx-sig__editor {
    flex: 1;
    min-height: 140px;
    padding: 14px 16px;
    overflow: auto;
    outline: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #1f2937;
    background: #fff;
}

.dx-sig__editor[hidden] { display: none; }
.dx-sig__editor:empty::before { content: attr(data-placeholder); color: #9ca3af; pointer-events: none; }
.dx-sig__editor img, .dx-sig__mail img { max-width: 100%; height: auto; }
.dx-sig__editor p, .dx-sig__mail-signature p { margin: 0 0 4px; }
.dx-sig__editor a, .dx-sig__mail a { color: #1d4ed8; }

.dx-sig__mail { flex: 1; overflow: auto; background: #fff; color: #1f2937; font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
.dx-sig__mail-head { display: grid; gap: 2px; padding: 10px 16px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; color: #475569; font-size: 12.5px; }
.dx-sig__mail-head b { display: inline-block; min-width: 52px; color: #1f2937; font-weight: 600; }
.dx-sig__mail-body { padding: 12px 16px 16px; }
.dx-sig__mail-body > p { margin: 0 0 10px; }
.dx-sig__mail-signature { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e5e7eb; }

.dx-sig.is-readonly .dx-sig__editor { background: #fbfbfc; }

.dx-dialog--form { width: min(520px, calc(100vw - 32px)); justify-items: stretch; text-align: left; }
.dx-dialog--form .dx-dialog__icon { justify-self: start; background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-dialog--form .dx-dialog__actions { justify-content: flex-end; }
.dx-dialog--form h2 { margin-bottom: 6px; }

@container records (max-width: 900px) {
    .dx-mail__grid { grid-template-columns: minmax(0, 1fr); }
    .dx-sig { min-height: 260px; }
}

@container records (max-width: 640px) {
    .dx-mail__own { grid-template-columns: 1fr 1fr; }
    .dx-mail__own > :first-child { grid-column: 1 / -1; }
    .dx-mail__test { flex-basis: 100%; }
}

@container sig (max-width: 440px) {
    .dx-sig__head .dx-switch__text small { display: none; }
    .dx-sig__modes button { width: 30px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
    .dx-sig__modes button .dx-ico { width: 15px; height: 15px; }
    .dx-sig__size { width: 64px; }
}

/* ---- User history (Geçmiş tab) ---- */

.dx-history2 { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 360px; }
.dx-history2__filters { gap: 8px; }
.dx-history2__search { flex: 1 1 200px; }
.dx-history2__dates { display: inline-flex; align-items: center; gap: 6px; color: var(--dx-muted); }
.dx-history2__dates .dx-input { width: 148px; height: 36px; }
.dx-history2__panel { flex: 1; min-height: 0; box-shadow: none; }

.dx-history2__grid td { vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
.dx-history2__grid td:nth-child(2) { min-width: 210px; }
.dx-history2__source { display: grid; gap: 1px; white-space: nowrap; }
.dx-history2__source small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-history2__refresh { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.dx-history2__refresh .dx-ico { width: 14px; height: 14px; }
.dx-history2__grid tr.is-static { cursor: default; }
.dx-history2__grid tr.is-open > td { background: color-mix(in srgb, var(--dx-accent) 6%, transparent); }
.dx-history2__date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dx-history2__mono { font-variant-numeric: tabular-nums; white-space: nowrap; }

.dx-history2__action { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.dx-history2__chevron { width: 14px; height: 14px; color: var(--dx-muted); transition: transform .15s; }
tr.is-open .dx-history2__chevron { transform: rotate(180deg); }

.dx-history2__kind {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
    background: color-mix(in srgb, var(--dx-kind) 14%, transparent);
    color: var(--dx-kind);
}

.dx-history2__kind .dx-ico { width: 14px; height: 14px; }
.dx-history2__kind.is-login { --dx-kind: var(--dx-success); }
.dx-history2__kind.is-fail { --dx-kind: var(--dx-danger); }
.dx-history2__kind.is-logout { --dx-kind: var(--dx-muted); }
.dx-history2__kind.is-did { --dx-kind: var(--dx-accent); }
.dx-history2__kind.is-done { --dx-kind: var(--dx-warning); }

.dx-history2__object { display: grid; gap: 1px; min-width: 0; }
.dx-history2__object strong { font-weight: 600; }
.dx-history2__object small { color: var(--dx-muted); font-size: var(--dx-text-xs); }

.dx-history2__detail > td { padding: 0 16px 12px !important; background: color-mix(in srgb, var(--dx-accent) 6%, transparent); cursor: default; }
.dx-history2__values { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 10px 12px; border: 1px dashed var(--dx-panel-line); border-radius: 10px; background: var(--dx-surface); }
.dx-history2__values > .dx-ico { width: 16px; height: 16px; margin-top: 20px; color: var(--dx-muted); }
.dx-history2__values span { color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dx-history2__values p { margin: 4px 0 0; font-size: var(--dx-text-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.dx-history2__warn { display: inline-flex; align-items: center; gap: 6px; color: var(--dx-warning); }
.dx-history2__warn .dx-ico { width: 15px; height: 15px; }

@container records (max-width: 640px) {
    .dx-history2__search { max-width: none; }
    /* Phone: one compact card per row: action, object, then date · actor · source */
    .dx-history2__grid tr { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 14px !important; }
    .dx-history2__grid td { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
    .dx-history2__grid td::before { display: none !important; }
    .dx-history2__grid td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
    .dx-history2__grid td:nth-child(3) { grid-column: 1 / -1; padding-left: 35px !important; }
    .dx-history2__grid td.dx-history2__date { grid-row: 3; padding-left: 35px !important; color: var(--dx-muted); font-size: var(--dx-text-xs); }
    .dx-history2__grid td[data-label="Yapan"] { display: none; }
    .dx-history2__grid td[data-label="Kayıt no"] { display: none; }
    .dx-history2__grid td.dx-history2__date { grid-column: 1 / -1; }
    .dx-history2__grid td[data-label="Kaynak"] { grid-column: 1 / -1; grid-row: 4; padding-left: 35px !important; }
    .dx-history2__grid td[data-label="Kaynak"] .dx-history2__source { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: var(--dx-text-xs); color: var(--dx-muted); }
    .dx-history2__grid td[data-label="Nesne"] .dx-grid__muted { display: none; }
    .dx-history2__detail { display: block !important; padding: 0 14px 10px !important; }
    .dx-history2__values { grid-template-columns: 1fr; }
    .dx-history2__values > .dx-ico { display: none; }
}

/* ---- Uygulamalar (application cards and install wizard) ---- */

.dx-apps__panel { background: transparent; border: 0; box-shadow: none; }
.dx-apps__panel > .dx-records__scroll { padding: 2px; }
.dx-apps__panel > .dx-records__foot { border-top: 0; padding: 10px 2px 0; }
.dx-apps__licence { margin-bottom: 12px; }

.dx-apps__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dx-app-card {
    --dx-app: var(--dx-accent);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 168px;
    padding: 16px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 16px;
    background: var(--dx-panel-bg);
    box-shadow: var(--dx-panel-shadow);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

.dx-app-card:hover { border-color: var(--dx-accent-line); transform: translateY(-1px); }
.dx-app-card.is-locked { --dx-app: var(--dx-muted); }
.dx-app-card.is-locked .dx-app-card__title strong,
.dx-app-card.is-locked .dx-app-card__text { color: var(--dx-muted); }
.dx-app-card.is-disabled { --dx-app: var(--dx-warning); }

.dx-app-card__head { display: flex; align-items: center; gap: 12px; min-width: 0; }

.dx-app-card__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 13px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--dx-app, var(--dx-accent)) 22%, var(--dx-surface)), color-mix(in srgb, var(--dx-app, var(--dx-accent)) 9%, var(--dx-surface)));
    color: color-mix(in srgb, var(--dx-app, var(--dx-accent)) 85%, var(--dx-text));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dx-app, var(--dx-accent)) 25%, transparent);
}

.dx-app-card__icon .dx-ico { width: 22px; height: 22px; }
.dx-app-card.is-installed .dx-app-card__icon { background: linear-gradient(135deg, var(--dx-accent), var(--dx-accent-2)); color: var(--dx-on-accent); box-shadow: 0 8px 18px -10px var(--dx-accent); }

.dx-app-card__title { display: grid; flex: 1; gap: 2px; min-width: 0; }
.dx-app-card__title strong { overflow: hidden; font-size: var(--dx-text-md); font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.dx-app-card__title small { color: var(--dx-muted); font-size: var(--dx-text-xs); letter-spacing: .02em; }

.dx-app-card__state {
    flex: none;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--dx-app) 13%, transparent);
    color: color-mix(in srgb, var(--dx-app) 80%, var(--dx-text));
    font-size: 11.5px;
    font-weight: 650;
}

.dx-app-card.is-installed .dx-app-card__state { background: color-mix(in srgb, var(--dx-success) 14%, transparent); color: var(--dx-success); }

.dx-app-card__text { flex: 1; margin: 0; color: var(--dx-text); font-size: var(--dx-text-sm); line-height: 1.5; }

.dx-app-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--dx-panel-head-line);
}

.dx-app-card__meta { min-width: 0; overflow: hidden; color: var(--dx-muted); font-size: var(--dx-text-xs); white-space: nowrap; text-overflow: ellipsis; }

.dx-wizard {
    width: min(620px, calc(100vw - 32px));
    gap: 0;
    padding: 0;
    overflow: hidden;
    justify-items: stretch;
    text-align: left;
}

.dx-wizard__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.dx-wizard__title { display: grid; flex: 1; gap: 2px; }
.dx-wizard__title strong { font-size: var(--dx-text-lg); }
.dx-wizard__title small { color: var(--dx-muted); font-size: var(--dx-text-xs); }
.dx-wizard__close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--dx-muted); cursor: pointer; }
.dx-wizard__close:hover { background: var(--dx-accent-soft); color: var(--dx-text); }
.dx-wizard__close .dx-ico { width: 16px; height: 16px; }

.dx-wizard__progress { display: grid; gap: 8px; padding: 0 20px 12px; border-bottom: 1px solid var(--dx-panel-line); }
.dx-wizard__bar { display: flex; gap: 4px; }
.dx-wizard__bar span { flex: 1; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--dx-text) 10%, transparent); transition: background .2s; }
.dx-wizard__bar span.is-done { background: color-mix(in srgb, var(--dx-accent) 55%, transparent); }
.dx-wizard__bar span.is-current { background: var(--dx-accent); }
.dx-wizard__where { color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-wizard__where strong { color: var(--dx-text); }

.dx-wizard__body { min-height: 250px; max-height: min(60vh, 520px); overflow: auto; padding: 18px 20px; }
.dx-wizard .dx-wizard__lead.dx-wizard__lead--sm { margin: 0 0 16px; color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-wizard__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.dx-wizard__field.is-wide { grid-column: 1 / -1; }
.dx-wizard__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-wizard__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 13px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 999px;
    background: var(--dx-surface);
    color: var(--dx-text);
    font: 600 var(--dx-text-sm) var(--dx-font);
    cursor: pointer;
}
.dx-wizard__chip .dx-ico { width: 14px; height: 14px; stroke-width: 2.6; }
.dx-wizard__chip.is-on { border-color: var(--dx-accent); background: var(--dx-accent-soft); color: var(--dx-accent-text); }

/* Chip input: type a name, Enter adds it; existing entries are shown faded and cannot be removed. */
.dx-chipinput {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid var(--dx-panel-line);
    border-radius: 10px;
    background: var(--dx-surface);
    cursor: text;
}
.dx-chipinput:focus-within { border-color: var(--dx-accent); box-shadow: var(--dx-focus-ring); }
.dx-chipinput.is-disabled { opacity: .7; }
.dx-chipinput__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 6px 0 11px;
    border: 1px solid var(--dx-accent);
    border-radius: 999px;
    background: var(--dx-accent-soft);
    color: var(--dx-accent-text);
    font: 600 var(--dx-text-sm) var(--dx-font);
    white-space: nowrap;
}
.dx-chipinput__chip.is-existing { padding-right: 11px; border-color: var(--dx-line); background: var(--dx-surface-2); color: var(--dx-muted); }
.dx-chipinput__chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.dx-chipinput__chip button:hover { background: color-mix(in srgb, var(--dx-accent) 18%, transparent); }
.dx-chipinput__chip .dx-ico { width: 12px; height: 12px; stroke-width: 2.6; }
.dx-chipinput__input { flex: 1 1 160px; min-width: 120px; height: 30px; padding: 0 4px; border: 0; outline: 0; background: transparent; color: var(--dx-text); font: inherit; font-size: var(--dx-text-sm); }
.dx-chipinput__hint { color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 400; }
.dx-chipinput__hint kbd { padding: 0 5px; border: 1px solid var(--dx-line); border-radius: 4px; background: var(--dx-surface-2); font: 600 10.5px var(--dx-font); }
.dx-wizard__preview { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border: 1px dashed var(--dx-panel-line); border-radius: 10px; color: var(--dx-muted); font-size: var(--dx-text-sm); }
.dx-wizard__preview .dx-ico { width: 16px; height: 16px; color: var(--dx-accent-text); }
.dx-wizard__preview strong { color: var(--dx-text); font-variant-numeric: tabular-nums; }
.dx-wizard__summary { display: grid; gap: 10px; }
.dx-wizard__summary > div { padding: 10px 12px; border: 1px solid var(--dx-panel-line); border-radius: 12px; }
.dx-wizard__summary span { color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 650; letter-spacing: .03em; text-transform: uppercase; }
.dx-wizard__summary p { margin: 4px 0 0; font-size: var(--dx-text-sm); line-height: 1.5; }
.dx-wizard__error { display: block; margin-top: 12px; }

@media (max-width: 560px) {
    .dx-wizard__fields { grid-template-columns: 1fr; }
}
.dx-wizard .dx-wizard__lead { margin: 0 0 14px; color: var(--dx-text); font-size: var(--dx-text-md); line-height: 1.5; }
.dx-wizard__list, .dx-wizard__checks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dx-wizard__list li { display: flex; gap: 10px; color: var(--dx-muted); font-size: var(--dx-text-sm); line-height: 1.5; }
.dx-wizard__list li strong { color: var(--dx-text); }
.dx-wizard__list .dx-ico { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--dx-accent-text); }

.dx-wizard__checks li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--dx-panel-line); border-radius: 12px; }
.dx-wizard__checks li > .dx-ico { width: 20px; height: 20px; flex: none; padding: 3px; border-radius: 50%; }
.dx-wizard__checks li.is-ok > .dx-ico { background: color-mix(in srgb, var(--dx-success) 15%, transparent); color: var(--dx-success); }
.dx-wizard__checks li.is-fail { border-color: color-mix(in srgb, var(--dx-danger) 40%, transparent); }
.dx-wizard__checks li.is-fail > .dx-ico { background: color-mix(in srgb, var(--dx-danger) 15%, transparent); color: var(--dx-danger); }
.dx-wizard__checks li > span { display: grid; gap: 2px; font-size: var(--dx-text-sm); }
.dx-wizard__checks li small { color: var(--dx-muted); font-size: var(--dx-text-xs); }

.dx-wizard__result { display: grid; justify-items: center; gap: 8px; padding: 18px 0 6px; text-align: center; }
.dx-wizard__result strong { font-size: var(--dx-text-md); }
.dx-wizard__result small { max-width: 400px; color: var(--dx-muted); font-size: var(--dx-text-sm); line-height: 1.5; }
.dx-wizard__badge { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; }
.dx-wizard__badge .dx-ico { width: 26px; height: 26px; }
.dx-wizard__result.is-ok .dx-wizard__badge { background: color-mix(in srgb, var(--dx-success) 15%, transparent); color: var(--dx-success); }
.dx-wizard__result.is-fail .dx-wizard__badge { background: color-mix(in srgb, var(--dx-danger) 15%, transparent); color: var(--dx-danger); }
.dx-wizard__spinner { width: 40px; height: 40px; border: 3px solid var(--dx-accent-soft); border-top-color: var(--dx-accent); border-radius: 50%; animation: dx-spin .8s linear infinite; }

@keyframes dx-spin { to { transform: rotate(360deg); } }

.dx-wizard__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--dx-panel-line); background: color-mix(in srgb, var(--dx-panel-bg) 60%, var(--dx-surface)); }

@container records (max-width: 640px) {
    .dx-apps .dx-filterbar__end { display: none; }
    .dx-apps__grid { grid-template-columns: minmax(0, 1fr); }
}
