/* DexCore screens. The design system (tokens, shell, records, dashboard) comes from DexUI (_content/DexUI);
   this file holds the base rules and the few DexCore-only parts. Colours come only from the dex-theme.css tokens. */

* { box-sizing: border-box; }
html { background: var(--dx-bg); }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--dx-bg);
    color: var(--dx-text);
    font-family: var(--dx-font);
    font-size: var(--dx-text-md);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; }
h1:focus { outline: none; }

#blazor-error-ui {
    position: fixed; inset: auto 16px 16px auto; z-index: 1000; display: none; gap: 12px; align-items: center;
    padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--dx-danger) 40%, var(--dx-line)); border-radius: 12px;
    background: var(--dx-surface); color: var(--dx-text); box-shadow: var(--dx-shadow); font-size: var(--dx-text-sm);
}
#blazor-error-ui .reload { color: var(--dx-accent-text); font-weight: 650; }
#blazor-error-ui .dismiss { cursor: pointer; color: var(--dx-muted); }

.dx-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95em; letter-spacing: -.01em; }
.dx-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ---- Lisanslar: banner, status strip, filter bar, (notice), list. The list takes the rest of the height; the
   strip and bar keep their own height however few licences there are. ---- */
.dx-records.dx-core-licenses { grid-template-rows: auto auto auto minmax(0, 1fr); }
.dx-records.dx-core-licenses:has(> .dx-notice) { grid-template-rows: auto auto auto auto minmax(0, 1fr); }

/* ---- State: a dot and a word (Aktif · Bitiyor · Süresi doldu · Pasif) ---- */
.dx-corestate { --tone: var(--dx-muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: var(--dx-text-xs); font-weight: 700;
    color: color-mix(in srgb, var(--tone) 82%, var(--dx-text)); }
.dx-corestate::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.dx-corestate.is-ok { --tone: var(--dx-success); }
.dx-corestate.is-warn { --tone: var(--dx-warning); }
.dx-corestate.is-bad { --tone: var(--dx-danger); }

/* ---- Customer avatar (initials) ---- */
.dx-coreavatar { flex: none; }
.dx-coreavatar--xl { width: 72px; height: 72px; border-radius: 22px; font-size: 26px; margin-bottom: 4px; }
.dx-coreperson { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* ---- Small icon tile in rows ---- */
.dx-coremark { --tone: var(--dx-accent); display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: color-mix(in srgb, var(--tone) 13%, var(--dx-surface)); color: color-mix(in srgb, var(--tone) 85%, var(--dx-text)); }
.dx-coremark .dx-ico { width: 16px; height: 16px; }
.dx-coremark.is-ok { --tone: var(--dx-success); }
.dx-coremark.is-warn { --tone: var(--dx-warning); }
.dx-coremark.is-bad { --tone: var(--dx-danger); }
.dx-coremark.is-off { --tone: var(--dx-muted); }

/* ---- Date block (licence end) ---- */
.dx-corewhen { --tone: var(--dx-accent); display: inline-grid; flex: none; place-items: center; width: 44px; height: 46px; border-radius: 11px; line-height: 1;
    border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); background: color-mix(in srgb, var(--tone) 11%, var(--dx-surface));
    color: color-mix(in srgb, var(--tone) 85%, var(--dx-text)); }
.dx-corewhen strong { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.dx-corewhen small { margin-top: -8px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.dx-corewhen.is-warn { --tone: var(--dx-warning); }
.dx-corewhen.is-bad { --tone: var(--dx-danger); }

/* ---- Widget rows: each opens the licence card ---- */
.dx-corerows { display: grid; margin: 0; padding: 4px 0; list-style: none; }
.dx-corerows li { border-top: 1px solid var(--dx-line); }
.dx-corerows li:first-child { border-top: 0; }
.dx-corerows a { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 18px; color: inherit; text-decoration: none; transition: background .15s; }
.dx-corerows a:hover { background: var(--dx-surface-2); }
.dx-corerows a:focus-visible { outline: 0; box-shadow: inset var(--dx-focus-ring); }
.dx-corerows .dx-person__text { flex: 1; min-width: 0; }
.dx-corerows .dx-person__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-corerows .dx-grid__muted { flex: none; font-size: var(--dx-text-xs); }

/* ---- Module spread ---- */
.dx-corebars { display: grid; margin: 0; padding: 8px 0; list-style: none; }
.dx-corebars a { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr) 32px; align-items: center; gap: 12px; padding: 7px 18px;
    color: inherit; font-size: var(--dx-text-sm); text-decoration: none; }
.dx-corebars a:hover { background: var(--dx-surface-2); }
.dx-corebars__name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dx-corebars__track { height: 8px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--dx-text) 8%, transparent); }
.dx-corebars__track span { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: var(--dx-accent); }
.dx-corebars__value { color: var(--dx-muted); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Module chips (list and card) ---- */
.dx-coremods { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.dx-coremod { max-width: 160px; overflow: hidden; padding: 2px 8px; border: 1px solid var(--dx-accent-line); border-radius: 999px; background: var(--dx-accent-soft);
    color: var(--dx-accent-text); font-size: var(--dx-text-xs); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.dx-coremod.is-more { border-color: var(--dx-line); background: var(--dx-surface-2); color: var(--dx-muted); }

/* ---- Installations used / allowed ---- */
.dx-coreseats { display: grid; gap: 5px; min-width: 70px; }
.dx-coreseats strong { font-size: var(--dx-text-sm); font-variant-numeric: tabular-nums; }
.dx-coreseats__bar { width: 72px; height: 5px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--dx-text) 9%, transparent); }
.dx-coreseats__bar span { display: block; height: 100%; border-radius: inherit; background: var(--dx-accent); }
.dx-coreseats.is-over strong { color: color-mix(in srgb, var(--dx-warning) 82%, var(--dx-text)); }
.dx-coreseats.is-over .dx-coreseats__bar span { background: var(--dx-warning); }
.dx-coregrid td[data-label="Müşteri"] { min-width: 240px; }

/* ---- Licence card: term box ---- */
.dx-coreterm { --tone: var(--dx-accent); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: 12px; padding: 12px 14px;
    border-radius: 14px; background: color-mix(in srgb, var(--tone) 9%, var(--dx-surface-2)); }
.dx-coreterm strong { color: color-mix(in srgb, var(--tone) 70%, var(--dx-text)); font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.dx-coreterm > span:last-child { color: var(--dx-muted); font-size: var(--dx-text-xs); font-variant-numeric: tabular-nums; }
.dx-coreterm__bar { width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--dx-text) 10%, transparent); }
.dx-coreterm__bar span { display: block; height: 100%; border-radius: inherit; background: var(--tone); }
.dx-coreterm.is-warn { --tone: var(--dx-warning); }
.dx-coreterm.is-bad { --tone: var(--dx-danger); }
.dx-coreterm.is-off { --tone: var(--dx-muted); }

/* ---- Licence card: form helpers ---- */
.dx-corehint { margin: 2px 0 12px; color: var(--dx-muted); font-size: var(--dx-text-sm); line-height: 1.5; }
.dx-corehint:last-child { margin: 12px 0 0; }
.dx-coreread { display: flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px dashed var(--dx-line); border-radius: 10px; color: var(--dx-muted);
    font-size: var(--dx-text-sm); font-weight: 600; }
.dx-corequick { display: flex; gap: 6px; min-height: 38px; align-items: center; }
.dx-coredanger { color: var(--dx-danger); }
.dx-coredanger .dx-ico { color: var(--dx-danger); }
.dx-coredanger:hover:not(:disabled) { border-color: color-mix(in srgb, var(--dx-danger) 40%, var(--dx-line)); background: color-mix(in srgb, var(--dx-danger) 9%, var(--dx-surface)); }
.dx-coredialog-field { width: 100%; margin-top: 6px; text-align: left; }

/* ---- Licence card: module picker ---- */
.dx-coremodpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.dx-coremodpick__item { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--dx-panel-line);
    border-radius: 12px; background: var(--dx-surface); cursor: pointer; transition: border-color .15s, background .15s; }
.dx-coremodpick__item:hover { border-color: color-mix(in srgb, var(--dx-accent) 40%, var(--dx-panel-line)); }
.dx-coremodpick__item input { position: absolute; opacity: 0; pointer-events: none; }
.dx-coremodpick__item:has(input:focus-visible) { box-shadow: var(--dx-focus-ring); }
.dx-coremodpick__box { display: grid; flex: none; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--dx-line); border-radius: 6px; color: transparent;
    background: var(--dx-surface); transition: background .15s, border-color .15s; }
.dx-coremodpick__box .dx-ico { width: 13px; height: 13px; }
.dx-coremodpick__item.is-on { border-color: var(--dx-accent-line); background: var(--dx-accent-soft); }
.dx-coremodpick__item.is-on .dx-coremodpick__box { border-color: transparent; background: var(--dx-accent-gradient); color: var(--dx-on-accent); }
.dx-coremodpick__item .dx-person__text { min-width: 0; }
.dx-coremodpick__item .dx-person__text small { color: var(--dx-muted); }
.dx-coremodpick__item.is-orphan .dx-person__text small { color: color-mix(in srgb, var(--dx-warning) 82%, var(--dx-text)); }

/* ---- Licence card: installations ---- */
.dx-coreinstalls { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dx-coreinstalls li { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, auto) auto; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--dx-panel-line); border-radius: 12px; background: var(--dx-surface); }
.dx-coreinstalls li.is-stale { border-color: color-mix(in srgb, var(--dx-danger) 30%, var(--dx-panel-line)); }
.dx-coreinstalls li.is-revoked { background: var(--dx-surface-2); }
.dx-coreinstalls li.is-revoked .dx-person__text strong { color: var(--dx-muted); text-decoration: line-through; }
.dx-coreinstalls .dx-person__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-coreinstalls__when span { font-size: var(--dx-text-sm); font-weight: 600; }

/* ---- Licence card: key ---- */
.dx-corekey { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--dx-panel-line); border-radius: 12px; background: var(--dx-surface-2); }
.dx-corekey__icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-corekey__icon .dx-ico { width: 17px; height: 17px; }
.dx-corekey__value { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; font-weight: 650; letter-spacing: .02em; }

/* ---- Small form parts used in Dexapp module styles (not yet in DexUI) ---- */
.dx-switchline { display: flex; align-items: center; gap: 8px; height: 38px; font-size: var(--dx-text-sm); }
.dx-switchline input { width: 16px; height: 16px; margin: 0; accent-color: var(--dx-accent); }
.dx-segmented--fill { display: flex; width: 100%; }
.dx-segmented--fill button { flex: 1; justify-content: center; }
.dx-coreclip { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-coreexcerpt { display: -webkit-box; margin: 0; overflow: hidden; color: var(--dx-muted); font-size: var(--dx-text-sm); line-height: 1.45;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.dx-coreexcerpt strong { color: var(--dx-text); }

/* ---- Modüller, Uygulama tanıtımları: same rows as Lisanslar (banner, strip, filter bar, list) ---- */
.dx-records.dx-core-modules,
.dx-records.dx-core-apps { grid-template-rows: auto auto auto minmax(0, 1fr); }
.dx-records.dx-core-import { grid-template-rows: auto auto minmax(0, 1fr); }

/* ---- Module icon (catalogue SVG path, the same as the Dexapp sign-in cards) ---- */
.dx-coreicon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--dx-accent-soft); color: var(--dx-accent-text); }
.dx-coreicon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dx-coreicon--lg { width: 64px; height: 64px; border-radius: 18px; }
.dx-coreicon--lg svg { width: 30px; height: 30px; }
.dx-coreicon--xl { width: 72px; height: 72px; margin-bottom: 4px; border-radius: 22px; background: var(--dx-accent-gradient); color: var(--dx-on-accent); }
.dx-coreicon--xl svg { width: 34px; height: 34px; }
.dx-coreiconedit { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }

/* ---- Application icon (uploaded image) and its sign-in animation ---- */
.dx-coreappicon { display: grid; flex: none; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 11px; background: var(--dx-surface-2); color: var(--dx-muted); }
.dx-coreappicon img { width: 100%; height: 100%; object-fit: contain; }
.dx-coreappicon .dx-ico { width: 18px; height: 18px; }
.dx-coreappicon--xl { width: 84px; height: 84px; margin-bottom: 4px; border-radius: 22px; }
.dx-coreappicon.is-glow { overflow: visible; animation: dx-core-glow 2.8s ease-in-out infinite; }
.dx-coreappicon.is-pulse { animation: dx-core-pulse 2.4s ease-in-out infinite; }
.dx-coreappicon.is-float { animation: dx-core-float 3.4s ease-in-out infinite; }
@keyframes dx-core-glow { 50% { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--dx-accent) 70%, transparent)); } }
@keyframes dx-core-pulse { 50% { transform: scale(1.07); } }
@keyframes dx-core-float { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .dx-coreappicon { animation: none !important; } }

/* ---- "How it looks on the Dexapp sign-in screen" (module card, application card) ---- */
.dx-corelogin { display: grid; gap: 6px; width: 100%; margin-top: 12px; text-align: left; }
.dx-corelogin > small { color: var(--dx-muted); font-size: var(--dx-text-xs); font-weight: 650; }
.dx-corelogin__card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--dx-accent-line); border-radius: 14px;
    background: var(--dx-surface); box-shadow: var(--dx-shadow-sm); }
.dx-corelogin__card .dx-person__text { min-width: 0; }
.dx-corelogin__card .dx-person__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-corelogin__card .dx-person__text small { display: -webkit-box; overflow: hidden; color: var(--dx-muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.dx-corecardlink { width: 100%; margin-top: 10px; justify-content: center; }

/* ---- Import steps, file drop ---- */
.dx-coresteps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dx-coresteps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--dx-panel-line); border-radius: 999px;
    background: var(--dx-panel-bg); color: var(--dx-muted); font-size: var(--dx-text-sm); font-weight: 650; }
.dx-coresteps li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--dx-surface-2); font-size: var(--dx-text-xs); }
.dx-coresteps li.is-current { border-color: var(--dx-accent-line); color: var(--dx-text); }
.dx-coresteps li.is-current span { background: var(--dx-accent-gradient); color: var(--dx-on-accent); }
.dx-coresteps li.is-done span { background: color-mix(in srgb, var(--dx-success) 16%, var(--dx-surface)); color: var(--dx-success); }
.dx-coreimport { display: grid; align-content: start; gap: 14px; padding: 16px; }
.dx-coreimport__summary { display: flex; flex-wrap: wrap; gap: 18px; }
.dx-coredrop { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 16px; border: 1.5px dashed var(--dx-line);
    border-radius: 14px; background: var(--dx-surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dx-coredrop:hover, .dx-coredrop:focus-within { border-color: var(--dx-accent); background: var(--dx-accent-soft); }
.dx-coredrop > .dx-ico { width: 22px; height: 22px; color: var(--dx-accent-text); }
.dx-coredrop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

@media (max-width: 760px) {
    .dx-coreinstalls li { grid-template-columns: auto minmax(0, 1fr); }
    .dx-coreinstalls__when { grid-column: 2; }
    .dx-coreinstalls li > .dx-button { grid-column: 1 / -1; justify-content: center; }
    .dx-corebars a { grid-template-columns: minmax(0, 1fr) 90px 28px; }
    .dx-section-actions .dx-button { flex: 1; justify-content: center; }
    .dx-coreiconedit { grid-template-columns: minmax(0, 1fr); }
    .dx-coreclip { max-width: 220px; }
}
