/* ============================================================
   SuperPro V2 — legacy SuperPRO 2019 palette and shell styles.
   Color sources (verified against the PB .srw files):
     backcolor 33521021            → #7D7DFF (lavender, every window)
     login form card               → #C8CACE (grey panel)
     panel edge (teal border)      → #1F87C7 / #6FC2EA
     field labels (KULLANICI/ŞİFRE)→ #002E66
     validation errors             → #CC1F1F
   Never hardcode these in components — use the custom properties.
   ============================================================ */

:root {
    --sp-surface: #7D7DFF;
    --sp-panel: #C8CACE;
    --sp-panel-edge: #1F87C7;
    --sp-panel-edge-light: #6FC2EA;
    --sp-label: #002E66;
    --sp-value-blue: #1C1C7A;     /* carihar.srw — büyük müşteri adı / başlık değeri (textsize -26) */
    --sp-danger: #CC1F1F;
    --sp-menubar-bg: #ECE9D8;     /* classic Win32 menu strip (legacy — kept for reference) */
    --sp-menubar-hover: #B8C7E0;
    /* Modern glass menu strip */
    --sp-menubar-glass: rgba(9, 20, 50, 0.62);
    --sp-menu-panel:    rgba(16, 28, 64, 0.96);   /* dropdown panel (mostly opaque for readability) */
    --sp-menu-hover:    rgba(255, 255, 255, 0.12);
    --sp-menu-text:     rgba(255, 255, 255, 0.86);
    --sp-menu-text-dim: rgba(255, 255, 255, 0.34);
    --sp-font: "Times New Roman", "Times New Roman TUR", serif;
    --sp-ui-font: Arial, "Arial TUR", sans-serif;

    /* ── Modern frosted-glass tiles (anamenu modernization) ──────────────
       Translucent panels that float over the wave background. Reusable for
       the planned app-wide tile/icon rollout. */
    --sp-glass-bg:        rgba(18, 34, 78, 0.32);   /* smoked frost — keeps white labels legible on the bright wave */
    --sp-glass-bg-hover:  rgba(30, 54, 112, 0.46);
    --sp-glass-border:    rgba(255, 255, 255, 0.38);
    --sp-glass-shadow:    rgba(6, 14, 46, 0.50);
    --sp-tile-label:      #FFFFFF;
    --sp-danger-bright:   #FF6B6B;   /* lighter red than --sp-danger, legible on dark glass (logout hover) */

    /* ── Modern light-modal + form system (whole-app page restyle) ───────
       Dialogs are clean light cards floating over the dark-glass shell.
       Use these everywhere in place of the legacy lavender/grey/teal-bevel. */
    --sp-modal:        #EEF2F8;   /* dialog body / page surface */
    --sp-card:         #FFFFFF;   /* cards, panels, inputs */
    --sp-card-alt:     #F4F7FC;   /* zebra rows / subtle alt fill */
    --sp-line:         #DCE3EE;   /* hairline border */
    --sp-line-strong:  #C4CEDD;   /* stronger border / input edge */
    --sp-ink:          #1E2A45;   /* body text on light */
    --sp-ink-soft:     #5B6680;   /* secondary text */
    --sp-field-border: #C4CEDD;
    --sp-focus-ring:   rgba(31, 135, 199, 0.26);
    --sp-accent:       #1F87C7;   /* primary accent (= panel-edge) */
    --sp-accent-2:     #2FB7D9;   /* gradient partner (teal) */
    --sp-accent-deep:  #17688F;
    --sp-card-shadow:  rgba(23, 44, 84, 0.10);
    --sp-modal-shadow: rgba(8, 18, 50, 0.42);

    /* Per-category accents — tint the SVG icon + tile edge/glow.
       Picked for contrast on the blue wave bg; reusable app-wide. */
    --sp-accent-cari:    #5BB0FF;   /* blue    */
    --sp-accent-stok:    #2FD9C6;   /* teal    */
    --sp-accent-fatura:  #93A4FF;   /* indigo  */
    --sp-accent-servis:  #FFC44D;   /* amber   */
    --sp-accent-cek:     #5BE08C;   /* emerald */
    --sp-accent-uretim:  #C58BFF;   /* violet  */
    /* Quick-tile accents (right panel) */
    --sp-accent-alissatis: #5BB0FF; /* blue    */
    --sp-accent-odeme:     #5BE08C; /* emerald */
    --sp-accent-restoran:  #FF8A6B; /* coral   */
    --sp-accent-magaza:    #2FD9C6; /* teal    */
    --sp-accent-kasa:      #93A4FF; /* indigo  */
    --sp-accent-analiz:    #C58BFF; /* violet  */

    /* Modern aurora shell background — pure CSS (replaces the low-res arkafon.png).
       Deep-blue base + soft magenta/violet/cyan/teal glows; crisp at any resolution. */
    --sp-aurora-base:   #0B2150;
    --sp-aurora-blue-1: #1A4E96;
    --sp-aurora-blue-2: #143F7E;
    --sp-aurora-magenta: rgba(255, 64, 156, 0.42);
    --sp-aurora-violet:  rgba(150, 92, 255, 0.40);
    --sp-aurora-cyan:    rgba(38, 196, 255, 0.34);
    --sp-aurora-teal:    rgba(46, 224, 214, 0.26);
    --sp-aurora-blue:    rgba(58, 132, 220, 0.32);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--sp-ui-font);
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ============================ Login (sifresor.srw) ============================ */

.login-backdrop {
    position: fixed;
    inset: 0;
    background-color: var(--sp-aurora-base);
    background-image:
        radial-gradient(58% 70% at 16% 118%, var(--sp-aurora-magenta) 0%, transparent 60%),
        radial-gradient(54% 64% at 52% 122%, var(--sp-aurora-violet) 0%, transparent 60%),
        radial-gradient(48% 60% at 88% 26%, var(--sp-aurora-cyan) 0%, transparent 62%),
        radial-gradient(42% 52% at 30% 6%, var(--sp-aurora-teal) 0%, transparent 58%),
        radial-gradient(72% 92% at 70% 60%, var(--sp-aurora-blue) 0%, transparent 60%),
        linear-gradient(160deg, var(--sp-aurora-blue-1) 0%, var(--sp-aurora-blue-2) 42%, var(--sp-aurora-base) 100%);
    background-repeat: no-repeat;
    display: grid;
    place-items: center;
}

.login-stage {
    position: relative;
    width: 420px;
}

.login-logo {
    position: absolute;
    top: -72px;
    left: 50%;
    transform: translateX(-50%);
    width: 128px;
    height: 128px;
    border-radius: 24px;
    border: 1px solid var(--sp-glass-border);
    background: #fff;
    object-fit: contain;
    z-index: 2;
    box-shadow: 0 10px 28px var(--sp-modal-shadow);
}

.login-card {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-radius: 20px;
    padding: 86px 44px 40px 44px;
    box-shadow: 0 24px 64px var(--sp-modal-shadow);
}

.login-label {
    display: block;
    color: var(--sp-label);
    font-family: var(--sp-ui-font);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.06em;
    margin: 16px 0 6px 0;
}

.login-field {
    display: flex;
    align-items: stretch;
    background: var(--sp-card);
    border: 1px solid var(--sp-field-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.login-field:focus-within {
    border-color: var(--sp-accent);
    box-shadow: 0 0 0 3px var(--sp-focus-ring);
}

.login-field .login-ico {
    display: grid;
    place-items: center;
    width: 42px;
    background: var(--sp-card-alt);
    border-right: 1px solid var(--sp-line);
}

.login-field input {
    flex: 1;
    border: none;
    outline: none;
    padding: 11px 12px;
    background: transparent;
    color: var(--sp-ink);
    font-family: var(--sp-ui-font);
    font-size: 1.05rem;
    font-weight: 600;
}

.login-submit {
    display: block;
    width: 100%;
    margin-top: 28px;
    padding: 12px 0;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-2));
    color: #fff;
    font-family: var(--sp-ui-font);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(31, 135, 199, 0.35);
    transition: filter 120ms ease, transform 60ms ease;
}
.login-submit:hover { filter: brightness(1.06); }
.login-submit:active { transform: translateY(1px); }
.login-submit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--sp-focus-ring), 0 8px 22px rgba(31, 135, 199, 0.35); }

.login-error {
    margin-top: 14px;
    color: var(--sp-danger);
    font-weight: 700;
    text-align: center;
}

/* ============================ Shell (anamenu1.srw) ============================ */

.shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--sp-aurora-base);   /* derin lacivert çerçeve — cam menü şeridi üstüne net oturur */
}

/* anamenu1.srw: dalga zemini üzerinde iki panel —
   sol modül kutuları (ol1..6) + KULLANICI, sağ logo11 + hızlı erişim kutuları + versiyon.
   Zemin: modern CSS aurora (eski düşük çözünürlüklü arkafon.png yerine; her çözünürlükte net). */
.shell-client {
    flex: 1;
    overflow: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1vw;
    padding: 2vh 2.5vw 1vh;
    background-color: var(--sp-aurora-base);
    background-image:
        radial-gradient(58% 70% at 16% 118%, var(--sp-aurora-magenta) 0%, transparent 60%),
        radial-gradient(54% 64% at 52% 122%, var(--sp-aurora-violet) 0%, transparent 60%),
        radial-gradient(48% 60% at 88% 26%, var(--sp-aurora-cyan) 0%, transparent 62%),
        radial-gradient(42% 52% at 30% 6%, var(--sp-aurora-teal) 0%, transparent 58%),
        radial-gradient(72% 92% at 70% 60%, var(--sp-aurora-blue) 0%, transparent 60%),
        linear-gradient(160deg, var(--sp-aurora-blue-1) 0%, var(--sp-aurora-blue-2) 42%, var(--sp-aurora-base) 100%);
    background-repeat: no-repeat;
}

.shell-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3vh;
    min-height: 0;
}

/* Legacy 2×3 picture-button grid (ol1..ol6 → ANA1..6.jpg) */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 210px));
    grid-template-rows: repeat(2, auto);
    gap: 3vh 2vw;
    justify-content: start;
    align-content: start;
    margin-top: 3vh;
}

/* KULLANICI — modern cam kullanıcı çipi (sol alt); tıkla = çıkış / kullanıcı değiştir. */
.shell-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin: auto 0 1vh 0;              /* margin-top:auto → sol kolonun en altına iter */
    padding: 9px 16px 9px 9px;
    border: 1px solid var(--sp-glass-border);
    border-radius: 999px;
    background: var(--sp-glass-bg);
    -webkit-backdrop-filter: blur(13px) saturate(1.25);
    backdrop-filter: blur(13px) saturate(1.25);
    box-shadow: 0 6px 20px var(--sp-glass-shadow), inset 0 1px 0 rgba(255,255,255,.22);
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: inherit;
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.shell-user:hover {
    background: var(--sp-glass-bg-hover);
    transform: translateY(-2px);
    border-color: var(--sp-danger-bright);
    box-shadow: 0 10px 26px var(--sp-glass-shadow), inset 0 0 0 1px var(--sp-danger-bright);
}
.shell-user:active { transform: translateY(0); }
.shell-user-logout {
    width: 20px; height: 20px; line-height: 0; margin-left: 6px;
    color: rgba(255,255,255,.62);
    transition: color 120ms ease, transform 120ms ease;
}
.shell-user-logout .sp-icon { width: 100%; height: 100%; }
.shell-user:hover .shell-user-logout { color: var(--sp-danger-bright); transform: translateX(2px); }
.shell-user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--sp-ui-font); font-weight: 800; font-size: 1.2rem; color: #fff;
    background: linear-gradient(135deg, var(--sp-accent-cari), var(--sp-accent-uretim));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 6px rgba(0,0,0,.35);
}
.shell-user-box { display: flex; flex-direction: column; line-height: 1.18; }
.shell-user-name {
    color: #fff; font-family: var(--sp-ui-font); font-weight: 700;
    font-size: 1.02rem; letter-spacing: .4px; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.shell-user-role {
    color: rgba(255,255,255,.72); font-family: var(--sp-ui-font); font-weight: 600;
    font-size: .76rem; letter-spacing: .3px;
}

/* Sağ panel: logo + hızlı erişim resim kutuları + versiyon */
.shell-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5vh;
    min-height: 0;
}
.shell-logo { height: 23vh; max-height: 220px; margin-top: 1vh; }

.quick-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 12px;
    width: 100%;
    max-width: 540px;
}
/* satır 1-2: büyük cam kutular (2'şer hücre); satır 3: 4 küçük cam kart.
   Modern frosted-glass + SVG ikon + etiket (legacy bitmaplerin yerine). */
.quick-tile {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    min-height: 98px;
    border: 1px solid var(--sp-glass-border);
    border-radius: 16px;
    background: var(--sp-glass-bg);
    -webkit-backdrop-filter: blur(13px) saturate(1.25);
    backdrop-filter: blur(13px) saturate(1.25);
    box-shadow: 0 6px 20px var(--sp-glass-shadow), inset 0 1px 0 rgba(255,255,255,.22);
    cursor: pointer;
    color: var(--tile-accent, var(--sp-panel-edge-light));
    position: relative;
    overflow: hidden;
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
/* aksan üst kenarı */
.quick-tile::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--tile-accent, var(--sp-panel-edge-light));
    opacity: .9;
}
.quick-tile.sm { grid-column: span 1; min-height: 84px; padding: 12px 8px; gap: 6px; }
.quick-tile .sp-icon { width: 42px; height: 42px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.4)); }
.quick-tile.sm .sp-icon { width: 30px; height: 30px; }
.quick-tile .tile-label { font-size: 1.05rem; }
.quick-tile.sm .tile-label { font-size: .8rem; }
.quick-tile:hover {
    background: var(--sp-glass-bg-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px var(--sp-glass-shadow),
                inset 0 0 0 1px var(--tile-accent, var(--sp-panel-edge-light));
    border-color: var(--tile-accent, var(--sp-glass-border));
}
.quick-tile:active { transform: translateY(-1px) scale(.99); }

/* quick-tile aksan renkleri (sağ panel) */
.quick-tile[data-tile="alissatis"] { --tile-accent: var(--sp-accent-alissatis); }
.quick-tile[data-tile="odeme"]     { --tile-accent: var(--sp-accent-odeme); }
.quick-tile[data-tile="restoran"]  { --tile-accent: var(--sp-accent-restoran); }
.quick-tile[data-tile="magaza"]    { --tile-accent: var(--sp-accent-magaza); }
.quick-tile[data-tile="cari"]      { --tile-accent: var(--sp-accent-cari); }
.quick-tile[data-tile="stok"]      { --tile-accent: var(--sp-accent-stok); }
.quick-tile[data-tile="kasa"]      { --tile-accent: var(--sp-accent-kasa); }
.quick-tile[data-tile="analiz"]    { --tile-accent: var(--sp-accent-analiz); }

.shell-version {
    font-family: "Times New Roman", serif;
    font-size: 1.9rem; font-weight: 700; color: #fff; letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,.6);
    align-self: flex-end;
    margin: auto 1vw 1vh 0;
    text-align: right;
}
.shell-version small { display: block; font-size: 0.85rem; font-weight: 400; }

@media (max-width: 900px) {
    .shell-client { grid-template-columns: 1fr; }
    .shell-right { margin-top: 2vh; }
}

/* Sol modül kutuları — modern frosted-glass kart + SVG ikon + başlık (§5). */
.module-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 12px;
    min-height: 138px;
    border: 1px solid var(--sp-glass-border);
    border-radius: 18px;
    background: var(--sp-glass-bg);
    -webkit-backdrop-filter: blur(13px) saturate(1.25);
    backdrop-filter: blur(13px) saturate(1.25);
    box-shadow: 0 6px 20px var(--sp-glass-shadow), inset 0 1px 0 rgba(255,255,255,.22);
    cursor: pointer;
    color: var(--tile-accent, var(--sp-panel-edge-light));
    position: relative;
    overflow: hidden;
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.module-tile::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--tile-accent, var(--sp-panel-edge-light));
    opacity: .9;
}
.module-tile .sp-icon { width: 46px; height: 46px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.4)); }
.module-tile .tile-label { font-size: .92rem; max-width: 16ch; }
.module-tile:hover {
    background: var(--sp-glass-bg-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px var(--sp-glass-shadow),
                inset 0 0 0 1px var(--tile-accent, var(--sp-panel-edge-light));
    border-color: var(--tile-accent, var(--sp-glass-border));
}
.module-tile:active { transform: translateY(-1px) scale(.99); }
.module-tile.active {
    background: var(--sp-glass-bg-hover);
    border-color: var(--tile-accent, var(--sp-panel-edge));
    box-shadow: 0 10px 26px var(--sp-glass-shadow),
                inset 0 0 0 2px var(--tile-accent, var(--sp-panel-edge));
}

/* modül aksan renkleri */
.module-tile[data-mod="cari"]      { --tile-accent: var(--sp-accent-cari); }
.module-tile[data-mod="stok"]      { --tile-accent: var(--sp-accent-stok); }
.module-tile[data-mod="fatura"]    { --tile-accent: var(--sp-accent-fatura); }
.module-tile[data-mod="servis"]    { --tile-accent: var(--sp-accent-servis); }
.module-tile[data-mod="cek-senet"] { --tile-accent: var(--sp-accent-cek); }
.module-tile[data-mod="uretim"]    { --tile-accent: var(--sp-accent-uretim); }

/* ── Ortak tile parçaları (module-tile + quick-tile) ── */
.sp-icon { display: block; width: 100%; height: 100%; }
.tile-ico { line-height: 0; color: var(--tile-accent, var(--sp-panel-edge-light)); }
.tile-label {
    color: var(--sp-tile-label);
    font-family: var(--sp-ui-font);
    font-weight: 700;
    letter-spacing: .4px;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* ============================ Menu strip ============================ */

/* Modern glass menu strip (eski bej Win32 şeridin yerine). */
.menubar {
    background: var(--sp-menubar-glass);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 10px rgba(6, 14, 46, 0.35);
    font-size: 0.86rem;
    color: var(--sp-menu-text);
    user-select: none;
    position: relative;
    z-index: 5000;   /* above floating dialog windows (z 600+) so you can always open new ones */
}

.menubar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menubar-root {
    display: flex;
    flex-wrap: wrap;
    padding: 5px 10px;
    gap: 2px;
}

.menu-item { position: relative; }

.menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 16px;
    border: none;
    border-radius: 9px;
    background: none;
    color: var(--sp-menu-text);
    font: inherit;
    font-weight: 600;
    letter-spacing: .2px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.menu-btn:disabled { color: var(--sp-menu-text-dim); cursor: default; }

.menu-item:hover > .menu-btn:not(:disabled) { background: var(--sp-menu-hover); color: #fff; }

.menu-caret { margin-left: auto; font-size: 0.7rem; opacity: .7; }

.submenu {
    display: none;
    position: absolute;
    min-width: 248px;
    padding: 6px;
    background: var(--sp-menu-panel);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(4, 10, 34, 0.55);
    z-index: 300;
}

/* submenüdeki öğeler — yuvarlatılmış satırlar */
.submenu .menu-btn { padding: 8px 14px; border-radius: 8px; font-weight: 500; }

/* top-level menus drop down; nested menus fly out right (flush — hover kaybı yok) */
.menu-item.depth-0 > .submenu { top: 100%; left: 0; }
.menu-item:not(.depth-0) > .submenu { top: -6px; left: 100%; }

.menu-item:hover > .submenu { display: block; }

.menu-sep {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 5px 8px;
}

/* ============================ Shared form widgets ============================ */

/* Modern buttons — neutral secondary by default; accent primary; red danger. */
.sp-btn {
    padding: 8px 16px;
    border: 1px solid var(--sp-line-strong);
    border-radius: 9px;
    background: var(--sp-card);
    color: var(--sp-ink);
    font-family: var(--sp-ui-font);
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 60ms ease, filter 120ms ease;
}

.sp-btn:hover:not(:disabled) { background: var(--sp-card-alt); border-color: var(--sp-accent); }
.sp-btn:active:not(:disabled) { transform: translateY(1px); }
.sp-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--sp-focus-ring); }
.sp-btn:disabled { color: #9aa3b6; background: #eef1f6; border-color: var(--sp-line); cursor: default; }

.sp-btn.active,
.sp-btn.primary {
    background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(31, 135, 199, 0.30);
}
.sp-btn.primary:hover:not(:disabled),
.sp-btn.active:hover:not(:disabled) { filter: brightness(1.06); background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-2)); }

.sp-btn.danger {
    background: linear-gradient(135deg, #FF7A7A, var(--sp-danger));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(204, 31, 31, 0.28);
}
.sp-btn.danger:hover:not(:disabled) { filter: brightness(1.06); background: linear-gradient(135deg, #FF7A7A, var(--sp-danger)); }

/* label + input grid used by the legacy-style card forms */
.sp-form {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 7px 10px;
    align-items: center;
    align-content: start;
}

.sp-form label {
    color: var(--sp-label);
    font-weight: 600;
    text-align: right;
}

.sp-form input,
.sp-form select {
    padding: 7px 10px;
    border: 1px solid var(--sp-field-border);
    border-radius: 8px;
    background: var(--sp-card);
    color: var(--sp-ink);
    font-family: var(--sp-ui-font);
    font-size: 0.95rem;
    font-weight: 600;
}

.sp-form-panel {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    padding: 12px 16px 16px 16px;
    box-shadow: 0 1px 3px var(--sp-card-shadow);
}

.sp-section-title {
    color: var(--sp-ink);
    font-weight: 700;
    margin: 6px 0 4px 0;
}

.sp-error { color: var(--sp-danger); font-weight: 700; margin-top: 10px; }
.sp-info  { color: var(--sp-accent-deep); font-weight: 700; margin-top: 10px; }

/* Modern input baseline for any bare field inside a dialog (scoped CSS may refine). */
.dlg-content input:not([type=checkbox]):not([type=radio]),
.dlg-content select,
.dlg-content textarea {
    font-family: var(--sp-ui-font);
    color: var(--sp-ink);
    background: var(--sp-card);
    border: 1px solid var(--sp-field-border);
    border-radius: 8px;
}
.dlg-content input:focus-visible,
.dlg-content select:focus-visible,
.dlg-content textarea:focus-visible,
.sp-form input:focus-visible,
.sp-form select:focus-visible {
    outline: none;
    border-color: var(--sp-accent);
    box-shadow: 0 0 0 3px var(--sp-focus-ring);
}

/* Cari sub-card dialogs (cariban / carikef / caridevir parity) */
.cari-sub {
    width: min(640px, 92vw);
    margin: 12px;
}

.cari-kefil { width: min(980px, 94vw); }

.cari-kefil-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cari-sub-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.cari-devir-grid {
    display: grid;
    grid-template-columns: 140px 1fr 1fr;
    gap: 7px 10px;
    align-items: center;
}

.cari-devir-grid label {
    color: var(--sp-label);
    font-weight: 700;
    text-align: right;
}

.cari-devir-grid input {
    padding: 7px 10px;
    border: 1px solid var(--sp-field-border);
    border-radius: 8px;
    background: var(--sp-card);
    color: var(--sp-ink);
    font-family: var(--sp-ui-font);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
}

.cari-devir-head {
    color: var(--sp-label);
    font-weight: 700;
    text-align: center;
}

/* Nüfus dialog (carinuf parity) */
.cari-nufus { width: min(1020px, 95vw); }
.cari-nufus-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cari-nufus-verildigi { grid-column: 1 / -1; }

.cari-ozel { width: min(560px, 92vw); }
.cari-ozel-text {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--sp-field-border);
    border-radius: 8px;
    background: var(--sp-card);
    color: var(--sp-ink);
    font-family: var(--sp-ui-font);
    font-weight: 600;
    resize: vertical;
    margin-top: 6px;
}

/* ============================ Dialogs (modeless floating windows) ============================ */
/* No blocking scrim: several windows can be open at once and the shell stays
   interactive. position:fixed + JS (superproDialog) handle drag/resize/cascade/
   bring-to-front. The CSS transform centres the window until JS sets left/top. */

.dlg-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--sp-modal);
    border: 1px solid var(--sp-line);
    border-radius: 16px;
    box-shadow: 0 24px 64px var(--sp-modal-shadow);
    min-width: 280px;
    min-height: 160px;
    max-width: 96vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;            /* clip titlebar + content to the rounded frame */
    z-index: 600;
}

/* bottom-right resize grip (drag to resize the window) */
.dlg-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    touch-action: none;
    z-index: 3;
    opacity: 0.55;
    background:
        linear-gradient(135deg,
            transparent 0 46%,
            var(--sp-line-strong) 46% 54%,
            transparent 54% 66%,
            var(--sp-line-strong) 66% 74%,
            transparent 74%);
    transition: opacity 120ms ease;
}
.dlg-resize:hover { opacity: 1; }

.dlg-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-2));
    color: #fff;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: move;
    touch-action: none;
}

.dlg-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dlg-close {
    border: 0;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    width: 28px;
    height: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 120ms ease;
}

.dlg-close:hover { background: var(--sp-danger-bright); }

.dlg-content {
    overflow: auto;
    flex: 1;
    min-height: 0;               /* allow the flex child to scroll when the window is resized smaller */
    background: var(--sp-modal);
}


/* Generic list-report dialog (stok raporları, etc.) */
.rapor { width: min(1100px, 96vw); padding: 16px; background: var(--sp-modal); }
.rapor-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.rapor-actions input { padding: 7px 10px; border: 1px solid var(--sp-field-border); border-radius: 8px; background: var(--sp-card); color: var(--sp-ink); font-weight: 600; }
.rapor-grid { background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 12px; max-height: 560px; overflow: auto; box-shadow: 0 1px 3px var(--sp-card-shadow); }

/* Stok rapor Başlangıç/Bitiş aralık çerçevesi (stofiylis/stokarlis/… sle_1..sle_6):
   etiket + iki sütun (Başlangıç / Bitiş). Renkler yalnız --sp-* paletinden. */
.sp-aralik {
    display: grid;
    grid-template-columns: max-content 9rem 9rem;
    align-items: center;
    gap: 6px 12px;
}
.sp-aralik-lbl { color: var(--sp-label); font-weight: 600; white-space: nowrap; }
.sp-aralik-col { color: var(--sp-ink-soft); font-weight: 700; text-align: center; }
.sp-aralik input { width: 9rem; padding: 7px 10px; border: 1px solid var(--sp-field-border); border-radius: 8px; font-weight: 600; background: var(--sp-card); color: var(--sp-ink); }
.sp-aralik-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Modern QuickGrid / report tables inside dialogs */
.dlg-content table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.dlg-content thead th,
.dlg-content table th {
    background: var(--sp-card-alt);
    color: var(--sp-ink);
    font-weight: 700;
    text-align: left;
    padding: 9px 11px;
    border-bottom: 2px solid var(--sp-line-strong);
    position: sticky;
    top: 0;
    z-index: 1;
}
.dlg-content table td {
    padding: 7px 11px;
    border-bottom: 1px solid var(--sp-line);
    color: var(--sp-ink);
}
.dlg-content table tbody tr:hover { background: var(--sp-card-alt); }
.dlg-content table tbody tr:nth-child(even):not(:hover) { background: color-mix(in srgb, var(--sp-card-alt) 55%, transparent); }


/* ===================== Legacy-parity helpers (carihar / carikartyen …) =====================
   Shared idioms for 1:1 screen reproduction: embossed serif titles, titled info/balance
   panels, stylized totals blocks, white/teal scroll lists, vertical button rails.
   Reused across Müşteri Hareketleri + Müşteri Hesap Kartı and future parity screens. */

/* Section title — modern (was an embossed serif outline). */
.sp-outline-title {
    font-family: var(--sp-ui-font);
    font-weight: 800;
    color: var(--sp-label);
    text-shadow: none;
    letter-spacing: .4px;
    line-height: 1.1;
}

/* Titled bordered info panel — BAKİYE DURUMU / SON DURUM / Limit Aşımı / Gecikmiş */
.sp-info-panel {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 1px 3px var(--sp-card-shadow);
}
.sp-info-panel-title {
    color: var(--sp-ink-soft);
    font-weight: 700;
    font-size: 0.78rem;
    text-align: center;
    margin-bottom: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.sp-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.sp-info-row > .sp-info-label { color: var(--sp-label); font-weight: 600; }
.sp-info-row > .sp-info-val {
    background: var(--sp-card-alt);
    border: 1px solid var(--sp-line);
    border-radius: 6px;
    padding: 2px 9px;
    min-width: 90px;
    text-align: right;
    font-family: var(--sp-ui-font);
    font-weight: 700;
    color: var(--sp-ink);
}

/* Stylized totals block — legacy footer bitmaps topusd.jpg / toplamtl.jpg */
.sp-total-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
}
.sp-total-block .sp-total-val {
    font-family: var(--sp-ui-font);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--sp-accent-deep);
}

/* Scroll list panel — datawindow grids + selection lists */
.sp-list-panel {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    overflow: auto;
    box-shadow: 0 1px 3px var(--sp-card-shadow);
}
.sp-list-panel-title {
    background: linear-gradient(135deg, var(--sp-accent), var(--sp-accent-2));
    color: #fff;
    font-weight: 700;
    text-align: center;
    padding: 6px 8px;
    letter-spacing: .6px;
    position: sticky;
    top: 0;
}

/* Vertical button rail — carikartyen center action column */
.sp-btn-rail {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sp-btn-rail .sp-btn {
    width: 100%;
    padding: 5px 4px;
    font-size: 0.76rem;
    line-height: 1.05;
}
