:root {
    --app-font: "Segoe UI Variable", "Segoe UI", Inter, "Noto Sans", Arial, sans-serif;
    --ink: #102027;
    --muted: #5f6f73;
    --line: #dce5e4;
    --panel: #ffffff;
    --soft: #f3f8f7;
    --teal: #343a40;
    --green: #2f9e44;
    --navy: #153447;
    --gold: #d49a2a;
    --table-hover: #eef1ee;
    --control-hover: #d9c3a0;
    /* Tema değişkenleri (light mod varsayılan) */
    --page: #ffffff;
    --header: rgba(255, 255, 255, 0.92);
    --shadow: rgba(21, 52, 71, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--app-font);
    font-size: 15px;
    color: var(--ink);
    background: var(--page);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font: inherit;
}

input,
select,
textarea {
    font: inherit;
}

.site-shell {
    min-height: 100vh;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 80px;
    padding: 14px clamp(18px, 4vw, 56px);
    background: var(--header);
    border-bottom: 1px solid color-mix(in srgb, var(--gold) 16%, var(--line));
    box-shadow: 0 1px 0 rgba(21, 52, 71, 0.03);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: box-shadow .2s ease;
}

.brand,
.header-actions,
.main-nav {
    display: flex;
    align-items: center;
}

.brand {
    gap: 11px;
    color: var(--navy);
    white-space: nowrap;
}

.brand-logo {
    display: block;
    height: 64px;
    width: auto;
    flex: 0 0 auto;
    transition: opacity .15s ease;
}

.brand:hover .brand-logo {
    opacity: .88;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid color-mix(in srgb, #d9c3a0 55%, var(--line));
    border-radius: 12px;
    color: #d9c3a0;
    background:
        linear-gradient(145deg, rgba(217, 195, 160, .16), rgba(255, 255, 255, .04)),
        #252b2f;
    box-shadow: 0 10px 24px rgba(36, 40, 45, .16);
}

.brand-mark svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-text {
    display: grid;
    gap: 1px;
    line-height: 1;
}

.brand-text strong {
    color: var(--navy);
    font-size: .98rem;
    font-weight: 900;
}

.brand-text small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
}

.main-nav {
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.main-nav a {
    position: relative;
    padding: 8px 14px;
    border-radius: 999px;
    letter-spacing: .01em;
    font-weight: 600;
    transition: color .15s ease, background .15s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform .18s ease;
    transform-origin: left;
}

.main-nav a:hover {
    color: var(--navy);
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.main-nav a:hover::after,
.main-nav a.active-link {
    transform: scaleX(1);
}

.main-nav a.active-link {
    color: var(--navy);
    font-weight: 800;
}

.nav-divider {
    width: 1px;
    height: 26px;
    margin: 0 2px;
    background: color-mix(in srgb, var(--gold) 20%, var(--line));
}

.header-actions {
    gap: 12px;
}

.nav-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--gold), #a97416);
    color: #1c1204;
    font-size: .78rem;
    font-weight: 900;
}

/* ---------- Kullanıcı menüsü (avatar + açılır menü) ---------- */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 5px;
    border: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 6%, var(--panel));
    transition: background .14s ease, border-color .14s ease;
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
    background: color-mix(in srgb, var(--gold) 12%, var(--panel));
}

.user-menu-chevron {
    width: 14px;
    height: 14px;
    color: var(--muted);
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}

.user-menu-trigger[aria-expanded="true"] .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5;
    background: transparent;
    cursor: default;
    border: 0;
    padding: 0;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 20;
    display: grid;
    gap: 2px;
    width: max-content;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: 0 20px 48px var(--shadow);
}

.user-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.user-menu-head .nav-avatar {
    width: 34px;
    height: 34px;
    font-size: .85rem;
}

.user-menu-head-text {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.user-menu-head-text strong {
    color: var(--navy);
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-head-text small {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--navy);
    font: inherit;
    font-size: .89rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    transition: background .12s ease;
}

.user-menu-item svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-menu-item:hover {
    background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.user-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--line);
}

.user-menu-item.user-menu-danger {
    color: #b42323;
}

.user-menu-item.user-menu-danger:hover {
    color: #b42323;
    background: #fff5f5;
}

.main-nav-public {
    gap: 28px;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--navy);
    font-weight: 700;
    white-space: nowrap;
    transition: background .15s ease;
}

.ghost-link:hover {
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.site-header .small-action {
    border-radius: 999px;
    background: linear-gradient(135deg, #1c2126, #12161a);
    box-shadow: 0 10px 24px rgba(18, 22, 26, 0.22);
}

.site-header .small-action:hover {
    opacity: 1;
    background: linear-gradient(135deg, #23292f, #171b1f);
    box-shadow: 0 12px 28px rgba(18, 22, 26, 0.28);
}

.small-action,
.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 800;
}

.small-action,
.primary-action {
    color: #ffffff;
    background: var(--teal);
    transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}

.small-action:hover,
.primary-action:hover {
    opacity: .86;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--shadow);
}

.secondary-action {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.7);
    transition: opacity .15s ease;
}

.secondary-action:hover {
    opacity: .85;
}

.hero-section {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 120px clamp(20px, 5vw, 76px) 72px;
}

.hero-image,
.hero-shade {
    position: absolute;
    inset: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    background:
        linear-gradient(90deg, rgba(11, 31, 42, 0.91) 0%, rgba(11, 31, 42, 0.72) 42%, rgba(11, 31, 42, 0.16) 100%),
        linear-gradient(180deg, rgba(11, 31, 42, 0.24), rgba(11, 31, 42, 0.52));
}

.hero-content {
    position: relative;
    max-width: 720px;
    color: #ffffff;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--gold);
    font-weight: 900;
    font-size: 0.78rem;
    letter-spacing: 0;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(3.2rem, 9vw, 7.6rem);
    line-height: 0.9;
    letter-spacing: 0;
}

h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: 0;
}

h3 {
    margin: 18px 0 10px;
    font-size: 1.2rem;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 620px;
    margin: 24px 0;
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.hero-actions,
.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-metrics {
    margin-top: 34px;
}

.hero-metrics span {
    min-width: 168px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
}

.hero-metrics strong {
    display: block;
    color: #ffffff;
}

.section {
    padding: 86px clamp(20px, 5vw, 76px);
}

.section-heading {
    max-width: 780px;
    margin-bottom: 36px;
}

.feature-band {
    background: var(--soft);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.feature-grid article,
.price-panel {
    min-height: 250px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.price-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 34px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--navy);
    font-weight: 900;
}

.feature-grid p,
.split-band p,
.price-panel p {
    color: var(--muted);
    line-height: 1.65;
}

.split-band {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 42px;
    align-items: start;
}

.proof-list {
    display: grid;
    gap: 14px;
}

.proof-list div {
    padding: 20px;
    border-left: 5px solid var(--green);
    background: #f7fbfa;
}

.proof-list strong,
.proof-list span {
    display: block;
}

.proof-list span {
    margin-top: 6px;
    color: var(--muted);
}

.pricing-band {
    background: #f8faf9;
}

.pricing-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 920px;
}

.price-panel.emphasized {
    border-color: rgba(8, 127, 140, 0.45);
    box-shadow: 0 18px 55px rgba(8, 127, 140, 0.16);
}

.price {
    margin: 12px 0;
    color: var(--teal) !important;
    font-size: 2rem;
    font-weight: 900;
}

.final-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 48px clamp(20px, 5vw, 76px);
    color: #ffffff;
    background: var(--navy);
}

.final-cta h2 {
    max-width: 760px;
}

.form-page,
.panel-page {
    min-height: 100vh;
    padding: 128px clamp(20px, 5vw, 76px) 72px;
    background: linear-gradient(180deg, #f4faf9, #ffffff 34%);
}

.form-page {
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(320px, 560px);
    gap: 42px;
    align-items: start;
}

.form-page.compact {
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 460px);
}

.form-intro h1,
.panel-heading h1 {
    color: var(--navy);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
}

.form-intro p:not(.eyebrow) {
    color: var(--muted);
    font-size: 1.16rem;
    line-height: 1.7;
}

/* Register sol vitrin karti (login ekranindaki gibi) - .form-intro sinifi
   sadece Register.razor'da kullaniliyor, bu yuzden buradan dogrudan
   restyle etmek guvenli. Not: bu kurallar onceden Register.razor'un kendi
   <style> blogunda idi; Razor derleyicisi o inline <style> etiketini
   parse ederken bozulup dosyanin geri kalanini (@code) da bozdugu icin
   (butun "model/isBusy/message/SubmitAsync yok" hatalari buradan geldi)
   app.css'e tasindi. */
.form-intro {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 560px;
    max-width: none;
    overflow: hidden;
    padding: clamp(28px, 5vw, 54px);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(21, 52, 71, .92), rgba(8, 127, 140, .78)),
        url("/images/register-erp-hero.png") center / cover no-repeat;
    box-shadow: 0 28px 90px rgba(21, 52, 71, .18);
}

.form-intro::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 127, 140, .05), rgba(5, 21, 27, .5));
}

.form-intro-copy {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.form-intro-copy .eyebrow {
    color: #ffd37a;
}

.form-intro-copy h1 {
    color: #ffffff;
    max-width: 600px;
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    line-height: 1.1;
}

.form-intro-copy p:not(.eyebrow) {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .88);
    font-size: 1.05rem;
    line-height: 1.65;
}

/* form-page zaten 1100px ve altinda tek sutuna dusuyor (bkz. asagidaki
   @media (max-width: 1100px) bloklari); sol vitrin karti mobilde
   tamamen kalksin, sadece form gorunsun. */
@media (max-width: 1100px) {
    .form-intro {
        display: none;
    }
}

.crm-form {
    display: grid;
    gap: 16px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(21, 52, 71, 0.12);
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.crm-form label {
    display: grid;
    gap: 8px;
    color: var(--navy);
    font-weight: 800;
}

.crm-form input {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.crm-form input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(52, 58, 64, 0.12);
}

.check-line {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
}

.check-line input {
    width: 18px;
    min-height: 18px;
}

.form-submit {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--teal);
    font-weight: 900;
    transition: opacity .15s ease, transform .15s ease;
}

.form-submit:hover:not(:disabled) {
    opacity: .88;
    transform: translateY(-1px);
}

.form-submit:active:not(:disabled) {
    transform: translateY(0);
}

.form-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-message,
.empty-state {
    padding: 14px 18px;
    border: 1px solid rgba(21, 52, 71, 0.12);
    border-radius: 10px;
    color: var(--navy);
    background: color-mix(in srgb, var(--teal) 6%, var(--panel));
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    background: var(--soft);
    border: 1px dashed var(--line);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.customer-table {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
    background: #ffffff;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
    gap: 20px;
    align-items: start;
}

.customers-page {
    padding-top: 110px;
}

.customer-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1.55fr);
    gap: 18px;
    align-items: end;
    margin-bottom: 22px;
}

.customer-toolbar h1 {
    color: var(--navy);
    font-size: clamp(2.3rem, 4vw, 4.8rem);
    line-height: 0.95;
}

.customer-toolbar-filters {
    display: grid;
    grid-template-columns: minmax(170px, 1.2fr) repeat(3, minmax(105px, 0.72fr)) auto auto;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.customer-toolbar-filters label,
.customer-edit-form label {
    display: grid;
    gap: 6px;
    color: var(--navy);
    font-size: 0.86rem;
    font-weight: 800;
}

.customer-toolbar-filters input,
.customer-toolbar-filters select,
.customer-edit-form input,
.customer-edit-form select,
.customer-edit-form textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.customer-toolbar-filters input:focus,
.customer-toolbar-filters select:focus,
.customer-edit-form input:focus,
.customer-edit-form select:focus,
.customer-edit-form textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(21, 52, 71, 0.1);
}

.customer-edit-form textarea {
    min-height: 84px;
    resize: vertical;
}

.customer-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.customer-edit-form {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.customer-edit-form .field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.wide-field {
    grid-column: 1 / -1;
}

.split-actions {
    align-items: center;
    justify-content: space-between;
}

.split-actions > div {
    display: flex;
    gap: 10px;
}

.list-panel,
.detail-panel {
    min-width: 0;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(110px, 0.8fr)) auto auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.filter-bar label,
.inline-form label {
    display: grid;
    gap: 6px;
    color: var(--navy);
    font-size: 0.86rem;
    font-weight: 800;
}

.filter-bar input,
.filter-bar select,
.inline-form input,
.inline-form select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
}

.icon-button,
.ghost-button {
    min-height: 40px;
    border-radius: 8px;
    padding: 0 14px;
    font-weight: 800;
    transition: opacity .15s ease, transform .15s ease;
}

.icon-button {
    border: 0;
    color: #ffffff;
    background: var(--teal);
}

.icon-button:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.ghost-button {
    border: 1px solid var(--line);
    color: var(--navy);
    background: #ffffff;
}

.ghost-button:hover {
    background: var(--soft);
    border-color: var(--navy);
}

.panel-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
}

.inline-form {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.table-row {
    display: grid;
    grid-template-columns: 0.8fr 1.4fr 1fr 1.4fr 0.8fr;
    min-width: 820px;
    border-top: 1px solid var(--line);
}

.table-row:first-child {
    border-top: 0;
}

.table-row span {
    padding: 14px 16px;
    overflow-wrap: anywhere;
}

.table-head {
    color: var(--navy);
    background: #f2f7f6;
    font-weight: 900;
}

.selectable .data-row {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
    border-top: 1px solid var(--line);
    color: var(--ink);
    text-align: left;
    background: #ffffff;
    font: inherit;
}

.selectable .data-row:hover,
.selectable .data-row.selected {
    background: var(--table-hover);
}

.detail-panel {
    position: sticky;
    top: 92px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 4px 24px var(--shadow);
}

.static-panel {
    position: static;
}

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.detail-head h2 {
    font-size: 1.6rem;
}

.detail-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.status-pill {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--teal);
    background: #e7f5f3;
    font-weight: 900;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.dashboard-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 28px;
}

.purchase-summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
}

.summary-grid div {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform .16s ease, box-shadow .16s ease;
}

.dashboard-cards div {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform .16s ease, box-shadow .16s ease;
}

.dashboard-cards div:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.summary-grid span,
.info-line span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.dashboard-cards span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-grid strong {
    display: block;
    margin-top: 6px;
    color: var(--navy);
    font-size: 1rem;
}

.dashboard-cards strong {
    display: block;
    margin-top: 8px;
    color: var(--navy);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.detail-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.detail-tabs button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: var(--panel);
    font-weight: 800;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.detail-tabs button:hover:not(.active) {
    background: var(--soft);
    border-color: var(--navy);
}

.detail-tabs button.active {
    color: #ffffff;
    border-color: var(--teal);
    background: var(--teal);
}

.detail-section {
    display: grid;
    gap: 10px;
}

.info-line {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.info-line.full {
    display: block;
    line-height: 1.5;
}

.quick-entry {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.mini-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfb;
}

.mini-form label {
    display: grid;
    gap: 5px;
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 800;
}

.mini-form input {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 9px;
}

.mini-form .form-submit {
    grid-column: 1 / -1;
}

.side-form {
    display: grid;
    gap: 14px;
}

.side-form .field-grid {
    grid-template-columns: 1fr;
}

.side-form label {
    display: grid;
    gap: 6px;
    color: var(--navy);
    font-size: 0.86rem;
    font-weight: 800;
}

.side-form input,
.side-form select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--panel);
}

.erp-list-page,
.erp-detail-page {
    padding-top: 112px;
}

.jewelry-erp-page.erp-list-page {
    padding-top: 82px;
}

.erp-page-head,
.erp-detail-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.erp-detail-head {
    align-items: flex-start;
    justify-content: flex-start;
}

.erp-page-head h1,
.erp-page-head h2,
.erp-detail-head h1 {
    color: var(--navy);
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
}

.erp-page-head h2 {
    margin: 0;
}

.erp-add-button {
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border: 1px solid transparent;
    color: var(--teal);
    background: transparent;
    line-height: 1;
    font-weight: 900;
}

.erp-add-button svg,
.erp-filter-icon-button svg,
.erp-delete-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.erp-add-button svg {
    width: 34px;
    height: 34px;
    stroke-width: 2.6;
}

.erp-add-button:hover {
    color: var(--navy);
}

.erp-filter-card {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(120px, .58fr)) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 14px 38px var(--shadow);
}

.erp-filter-card label,
.erp-form-card label {
    display: grid;
    gap: 6px;
    color: var(--navy);
    font-size: .84rem;
    font-weight: 800;
}

.erp-filter-card input,
.erp-filter-card select,
.erp-form-card input,
.erp-form-card select,
.erp-form-card textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--panel);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.erp-filter-card input:focus,
.erp-filter-card select:focus,
.erp-form-card input:focus,
.erp-form-card select:focus,
.erp-form-card textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(21, 52, 71, 0.1);
}

.erp-form-card textarea {
    min-height: 92px;
    resize: vertical;
}

.erp-search-field {
    min-width: 0;
}

.erp-table-card,
.erp-form-card,
.erp-side-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 4px 24px var(--shadow);
}

.erp-table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
}

.erp-table-meta span {
    color: var(--muted);
    font-size: .9rem;
}

.selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.selection-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.selection-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid var(--jewel-line, var(--line));
    background: var(--panel);
    color: var(--jewel-ink, var(--navy));
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease;
}

.selection-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.selection-btn-ghost:hover:not(:disabled) {
    border-color: var(--jewel-charcoal, var(--navy));
    background: var(--jewel-soft, var(--soft));
}

.selection-btn-primary {
    border-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 45%, var(--jewel-line, var(--line)));
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 14%, var(--panel));
    color: var(--jewel-charcoal, var(--navy));
}

.selection-btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 26%, var(--panel));
}

.selection-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.selection-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--jewel-charcoal, var(--navy));
    color: #fff;
    font-size: .74rem;
    font-weight: 900;
}

.erp-customer-table {
    overflow-x: auto;
}

.erp-customer-row {
    display: grid;
    grid-template-columns: 64px minmax(98px, .7fr) minmax(200px, 1.3fr) minmax(90px, .55fr) minmax(130px, .75fr) minmax(190px, 1.15fr) minmax(80px, .45fr) minmax(120px, .65fr) 72px;
    min-width: 1110px;
    align-items: center;
}

.erp-customer-table-selectable .erp-customer-row {
    grid-template-columns: 44px 64px minmax(98px, .7fr) minmax(200px, 1.3fr) minmax(90px, .55fr) minmax(130px, .75fr) minmax(190px, 1.15fr) minmax(80px, .45fr) minmax(120px, .65fr) 72px;
    min-width: 1154px;
}

.customer-photo-cell {
    justify-content: center;
    padding: 6px 8px !important;
}

.customer-thumb {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 50%;
    background: var(--panel);
    overflow: hidden;
    flex-shrink: 0;
}

button.customer-thumb {
    cursor: zoom-in;
    transition: border-color .14s ease, box-shadow .14s ease;
}

button.customer-thumb:hover {
    border-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 60%, var(--jewel-line, var(--line)));
    box-shadow: 0 3px 10px var(--shadow);
}

.customer-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.customer-thumb-empty svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: color-mix(in srgb, var(--muted) 55%, transparent);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.row-select-cell {
    justify-content: center;
    padding: 0 !important;
}

.row-select-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--jewel-gold, var(--gold));
    cursor: pointer;
}

.erp-customer-data.is-row-selected {
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 10%, var(--panel)) !important;
}

.erp-customer-row > span {
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 11px 14px;
    overflow-wrap: anywhere;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.erp-customer-row > span strong {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.erp-customer-head {
    color: var(--navy);
    background: color-mix(in srgb, var(--teal) 8%, var(--panel));
    border-bottom: 1px solid var(--line);
    font-weight: 900;
}

.erp-customer-data {
    cursor: pointer;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    transition: background .12s ease;
}

.erp-customer-data:nth-child(odd) {
    background: var(--panel);
}

.erp-customer-data:nth-child(even) {
    background: color-mix(in srgb, var(--teal) 4%, var(--panel));
}

.erp-customer-data:hover,
.erp-customer-data:focus-visible {
    outline: none;
    background: var(--table-hover);
}

.row-action-cell {
    justify-content: center;
}

.erp-delete-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #b42323;
    background: transparent;
    font-weight: 900;
    transition: color .16s ease, transform .16s ease;
}

.erp-delete-icon:hover {
    color: #d9c3a0;
    transform: scale(1.16);
}

.erp-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 18px;
    align-items: start;
}

.erp-form-card,
.erp-side-card {
    padding: 20px;
}

.erp-side-card {
    position: sticky;
    top: 92px;
}

.jewelry-erp-page {
    --jewel-gold: #ad8350;
    --jewel-gold-soft: #efe3d1;
    --jewel-line: #dde2df;
    --jewel-surface: #ffffff;
    --jewel-soft: #f4f6f4;
    --jewel-ink: #24282d;
    --jewel-charcoal: #262b2f;
    --jewel-deep: #1f2528;
    background:
        linear-gradient(180deg, #f4f6f4 0, #ffffff 360px),
        var(--page);
}

.jewelry-erp-page .eyebrow {
    color: #d9c3a0;
}

.jewelry-erp-page .erp-page-head {
    padding: 20px 22px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
        #252b2f;
    box-shadow: 0 18px 45px rgba(20, 24, 27, .18);
}

.jewelry-erp-page .customers-hero {
    position: relative;
    min-height: 112px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 14px 82px;
    border: 0;
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .68), rgba(24, 28, 31, .4)),
        url("/images/customers-erp-hero.png") center / cover no-repeat;
    box-shadow: 0 14px 34px rgba(24, 28, 31, .16);
}

.jewelry-erp-page .customers-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(12, 15, 17, .08);
    backdrop-filter: blur(1px);
}

.customers-hero-title {
    position: relative;
    z-index: 1;
    text-align: center;
}

.jewelry-erp-page .erp-page-head h2 {
    color: #ffffff;
    font-size: clamp(1.55rem, 2.4vw, 2.65rem);
    font-weight: 900;
}

.jewelry-erp-page .customers-hero h2 {
    font-size: clamp(1.7rem, 2.7vw, 3rem);
    text-shadow: 0 10px 26px rgba(0, 0, 0, .34);
}

.jewelry-erp-page .customers-hero .eyebrow {
    color: #ead8bb;
    margin-bottom: 10px;
}

.jewelry-erp-page .erp-add-button {
    color: #ffffff;
    border-color: rgba(217, 195, 160, .35);
    background: rgba(255, 255, 255, .04);
}

.jewelry-erp-page .customers-hero .erp-add-button {
    position: absolute;
    z-index: 2;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    color: #ffffff;
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px);
}

.jewelry-erp-page .customers-hero .erp-hero-action-group {
    position: absolute;
    z-index: 2;
    right: 18px;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(-50%);
}

.jewelry-erp-page .customers-hero .erp-hero-action-group .erp-add-button {
    position: static;
    transform: none;
}

.jewelry-erp-page .purchases-hero {
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .72), rgba(24, 28, 31, .42)),
        url("/images/purchases-erp-hero.png") center / cover no-repeat;
}

.jewelry-erp-page .users-hero {
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .72), rgba(24, 28, 31, .42)),
        url("/images/users-erp-hero.png") center / cover no-repeat;
}

.jewelry-erp-page .islemler-hero {
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .72), rgba(24, 28, 31, .38)),
        url("/images/islemler-erp-hero.png") center / cover no-repeat;
}

.jewelry-erp-page .dashboard-hero {
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .72), rgba(24, 28, 31, .42)),
        url("/images/dashboard-erp-hero.png") center / cover no-repeat;
}

.jewelry-erp-page .profile-hero {
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .72), rgba(24, 28, 31, .42)),
        url("/images/profile-erp-hero.png") center / cover no-repeat;
}

.dashboard-hero-status {
    margin: 8px 0 0;
    color: #ead8bb;
    font-size: .92rem;
    font-weight: 700;
}

.jewelry-erp-page .customers-hero .erp-hero-left {
    left: 24px;
    right: auto;
}

.jewelry-erp-page .customers-hero .erp-add-button svg {
    width: 22px;
    height: 22px;
}

.jewelry-erp-page .erp-add-button:hover {
    color: #1f2528;
    border-color: #d9c3a0;
    background: #d9c3a0;
}

.jewelry-filter-card {
    border-color: var(--jewel-line);
    background: linear-gradient(180deg, #ffffff, #f9faf9);
    box-shadow: 0 18px 45px rgba(36, 40, 45, .1);
}

.jewelry-filter-card label {
    color: var(--jewel-ink);
}

.jewelry-filter-card input:focus,
.jewelry-filter-card select:focus {
    outline: 3px solid rgba(47, 52, 55, .12);
    border-color: var(--jewel-charcoal);
}

.jewelry-table-card {
    border-color: var(--jewel-line);
    box-shadow: 0 18px 45px rgba(36, 40, 45, .1);
}

.jewelry-erp-page .erp-table-meta {
    background: linear-gradient(180deg, #ffffff, #f7f8f7);
}

.jewelry-erp-page .erp-table-meta strong {
    color: var(--jewel-ink);
}

.jewelry-erp-page .erp-customer-head {
    color: #f7f1e8;
    background: #30363a;
}

.jewelry-erp-page .erp-customer-data:nth-child(odd) {
    background: #ffffff;
}

.jewelry-erp-page .erp-customer-data:nth-child(even) {
    background: #f7f8f7;
}

.jewelry-erp-page .erp-customer-data:hover,
.jewelry-erp-page .erp-customer-data:focus-visible {
    background: var(--table-hover);
}

.purchase-filter-card-list {
    grid-template-columns: minmax(240px, 1.4fr) repeat(2, minmax(150px, .7fr)) auto auto;
}

.erp-purchase-table {
    overflow-x: auto;
}

.erp-purchase-row {
    display: grid;
    grid-template-columns: 76px minmax(200px, 1.3fr) minmax(130px, .75fr) minmax(120px, .68fr) minmax(110px, .62fr) minmax(135px, .75fr) minmax(150px, .75fr) 72px;
    min-width: 1100px;
    align-items: center;
}

.purchase-thumb-cell {
    justify-content: center;
}

.purchase-thumb {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 8px;
    background: var(--panel);
    overflow: hidden;
    flex-shrink: 0;
}

button.purchase-thumb {
    cursor: zoom-in;
    transition: border-color .14s ease, box-shadow .14s ease;
}

button.purchase-thumb:hover {
    border-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 55%, var(--jewel-line, var(--line)));
    box-shadow: 0 3px 10px var(--shadow);
}

.purchase-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.purchase-thumb-empty svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: color-mix(in srgb, var(--muted) 55%, transparent);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.erp-purchase-row > span {
    display: flex;
    align-items: center;
    min-height: 54px;
    min-width: 0;
    padding: 11px 14px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.erp-purchase-row > span strong {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.erp-purchase-head {
    color: #f7f1e8;
    background: #30363a;
    border-bottom: 1px solid var(--line);
    font-weight: 900;
}

.erp-purchase-data {
    cursor: pointer;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    transition: background .12s ease;
}

.erp-purchase-data:nth-child(odd) {
    background: #ffffff;
}

.erp-purchase-data:nth-child(even) {
    background: #f7f8f7;
}

.erp-purchase-data:hover,
.erp-purchase-data:focus-visible {
    outline: none;
    background: var(--table-hover);
}

.users-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 18px;
    align-items: start;
}

.users-list-card,
.user-detail-card {
    min-width: 0;
}

.erp-user-table {
    overflow-x: auto;
    scrollbar-width: thin;
}

.erp-user-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(210px, 1.15fr) minmax(120px, .7fr) minmax(105px, .58fr) minmax(120px, .7fr);
    width: 100%;
    min-width: 760px;
    align-items: center;
}

button.erp-user-row {
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease;
}

.erp-user-row > span {
    display: flex;
    align-items: center;
    min-height: 54px;
    min-width: 0;
    padding: 11px 14px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.erp-user-row > span strong {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.erp-user-head {
    color: #f7f1e8;
    background: #30363a;
    font-weight: 900;
}

.erp-user-data:nth-child(odd) {
    background: #ffffff;
}

.erp-user-data:nth-child(even) {
    background: #f7f8f7;
}

.erp-user-data:hover,
.erp-user-data:focus-visible,
.erp-user-data.is-selected {
    outline: none;
    background: var(--table-hover);
}

.status-chip.status-active {
    color: #1f6f35;
    background: rgba(47, 158, 68, .12);
}

.status-chip.status-passive {
    color: #6d6255;
    background: rgba(217, 195, 160, .22);
}

.user-detail-card {
    position: sticky;
    top: 92px;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(36, 40, 45, .1);
}

.user-detail-card .card-section-heading {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #30363a;
}

.user-detail-card .card-section-heading strong {
    color: #ffffff;
    font-size: 1.08rem;
    letter-spacing: 0;
}

.user-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-detail-form {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.user-detail-form .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-detail-form .wide-field {
    grid-column: 1 / -1;
}

.user-detail-form label {
    display: grid;
    gap: 7px;
    color: var(--jewel-ink);
    font-size: .84rem;
    font-weight: 800;
}

.user-detail-form input,
.user-detail-form select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--jewel-line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.user-detail-form input[readonly] {
    color: var(--muted);
    background: #f7f8f7;
}

.user-detail-form input:focus,
.user-detail-form select:focus {
    outline: 3px solid rgba(47, 52, 55, .12);
    border-color: var(--jewel-charcoal);
}

.user-detail-form select:hover,
.user-detail-form select option:hover,
.user-detail-form select option:checked {
    border-color: #d9c3a0;
    background: #d9c3a0;
}

.detail-save-icon,
.detail-cancel-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

.detail-save-icon {
    color: #1f2528;
    border-color: #d9c3a0;
    background:
        linear-gradient(145deg, #f2e4cc, #d9c3a0 62%, #b89461);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .55),
        0 12px 24px rgba(0, 0, 0, .22);
}

.detail-save-icon:hover {
    color: #1f2528;
    border-color: #f2e4cc;
    background: #f2e4cc;
    transform: translateY(-1px);
}

.detail-cancel-icon {
    color: #f7f1e8;
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .08);
}

.detail-cancel-icon:hover {
    color: #1f2528;
    border-color: #d9c3a0;
    background: #d9c3a0;
    transform: translateY(-1px);
}

.user-detail-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.user-meta-item {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.user-meta-item span {
    display: block;
    color: #6d6255;
    font-size: .72rem;
    font-weight: 900;
}

.user-meta-item input {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.users-message {
    margin-bottom: 12px;
}

.purchase-detail-hero {
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .82), rgba(24, 28, 31, .5)),
        url("/images/purchases-erp-hero.png") center / cover no-repeat;
}

.erp-filter-icon-button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-height: 44px;
    border: 1px solid #cfd5d1;
    border-radius: 8px;
    color: #384044;
    background: linear-gradient(180deg, #ffffff, #f3f5f4);
    font-weight: 900;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.erp-filter-icon-button:hover {
    color: #1f2528;
    border-color: #d9c3a0;
    background: #d9c3a0;
    transform: translateY(-1px);
}

.erp-filter-clear {
    color: #7a3333;
}

.erp-filter-clear:hover {
    border-color: #d9c3a0;
    background: #d9c3a0;
}

.mobile-filter-shell {
    display: grid;
    gap: 10px;
}

.mobile-filter-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 8px;
    color: var(--jewel-charcoal, var(--navy));
    background: var(--panel);
    font-weight: 900;
}

/* --jewel-charcoal sabit koyu bir renk (temadan bağımsız) olduğu için koyu
   modda --panel (koyu) arka plan üzerinde metin/ikon görünmez hale geliyordu.
   Koyu modda yazı ve ikon rengini açık renge (--ink) zorluyoruz. */
:root[data-theme="dark"] .mobile-filter-toggle {
    color: var(--ink);
}

.mobile-filter-toggle svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
}

.customer-detail-page {
    background:
        linear-gradient(180deg, #f4f6f4 0, #ffffff 340px),
        var(--page);
}

.customer-detail-hero {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 112px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 8px;
    color: #ffffff;
    background:
        linear-gradient(90deg, rgba(24, 28, 31, .82), rgba(24, 28, 31, .5)),
        url("/images/customers-erp-hero.png") center / cover no-repeat;
    box-shadow: 0 16px 38px rgba(24, 28, 31, .17);
}

.customer-detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(12, 15, 17, .08);
    backdrop-filter: blur(1px);
}

.detail-back-link,
.customer-detail-title,
.detail-hero-actions {
    position: relative;
    z-index: 1;
}

.detail-hero-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(8px);
}

.detail-back-link {
    align-items: center;
}

.detail-hero-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-hero-icon:hover {
    color: #1f2528;
    border-color: #d9c3a0;
    background: #d9c3a0;
}

.detail-hero-icon:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.detail-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.detail-hero-actions button {
    font: inherit;
}

.detail-hero-danger:hover {
    color: #1f2528;
}

.customer-detail-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 0;
    text-align: center;
}

.customer-detail-title .eyebrow {
    margin-bottom: 8px;
    color: #ead8bb;
}

.customer-detail-title h1 {
    color: #ffffff;
    font-size: clamp(1.9rem, 3.6vw, 4rem);
    text-shadow: 0 10px 26px rgba(0, 0, 0, .34);
}

.customer-detail-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
}

.customer-card-form,
.customer-side-card {
    border-color: var(--jewel-line);
    background: linear-gradient(180deg, #ffffff, #fbfcfb);
    box-shadow: 0 18px 45px rgba(36, 40, 45, .1);
}

.customer-detail-page .customer-card-form,
.customer-detail-page .customer-side-card {
    overflow: hidden;
    padding: 0;
    border: 0;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(36, 40, 45, .1);
}

.customer-detail-page .customer-card-form .card-section-heading,
.customer-detail-page .customer-side-card .card-section-heading {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #30363a;
}

.customer-detail-page .customer-card-form .card-section-heading span,
.customer-detail-page .customer-side-card .card-section-heading span {
    color: #d9c3a0;
}

.customer-detail-page .customer-card-form .card-section-heading strong,
.customer-detail-page .customer-side-card .card-section-heading strong {
    color: #ffffff;
}

.card-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--jewel-line);
}

.card-section-heading span {
    display: block;
    color: var(--jewel-gold);
    font-size: .75rem;
    font-weight: 900;
}

.card-section-heading strong {
    display: block;
    margin-top: 4px;
    color: var(--jewel-ink);
    font-size: 1.08rem;
}

.customer-card-form .customer-edit-form {
    gap: 16px;
    margin-bottom: 0;
}

.customer-detail-page .customer-card-form .customer-edit-form {
    padding: 18px;
}

.customer-detail-page .customer-side-card .summary-grid,
.customer-detail-page .customer-side-card .detail-section {
    margin: 18px;
}

.customer-detail-page .customer-side-card .detail-section {
    margin-top: 0;
}

.customer-card-form .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-card-form label {
    color: var(--jewel-ink);
}

.customer-card-form input,
.customer-card-form select,
.customer-card-form textarea {
    min-height: 42px;
    background: #ffffff;
}

.customer-card-form input:focus,
.customer-card-form select:focus,
.customer-card-form textarea:focus {
    outline: 3px solid rgba(47, 52, 55, .12);
    border-color: var(--jewel-charcoal);
}

.customer-card-form input.input-error {
    border-color: #b42323;
    background: #fff7f7;
}

.field-warning {
    color: #9f1f1f;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.35;
}

.customer-card-form select:hover {
    border-color: #d9c3a0;
}

.customer-card-form select option:hover,
.customer-card-form select option:checked {
    color: #1f2528;
    background: #d9c3a0;
}

.erp-combobox-field {
    min-width: 0;
}

.erp-combobox {
    position: relative;
    min-width: 0;
}

.erp-combobox-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--jewel-line);
    border-radius: 8px;
    color: var(--jewel-ink);
    background: #ffffff;
    font: inherit;
    text-align: left;
}

.erp-combobox-trigger:hover,
.erp-combobox-trigger[aria-expanded="true"] {
    border-color: #d9c3a0;
}

.erp-combobox-trigger:focus-visible {
    outline: 3px solid rgba(47, 52, 55, .12);
    border-color: var(--jewel-charcoal);
}

.erp-combobox-trigger span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.erp-combobox-trigger svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.erp-combobox-menu {
    position: absolute;
    z-index: 6;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--jewel-line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(36, 40, 45, .16);
}

.erp-combobox-option {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    color: var(--jewel-ink);
    background: transparent;
    font: inherit;
    text-align: left;
}

.erp-combobox-option:hover,
.erp-combobox-option:focus-visible,
.erp-combobox-option.is-selected {
    color: #1f2528;
    background: #d9c3a0;
    outline: none;
}

.jewelry-filter-card .erp-combobox-trigger {
    min-height: 42px;
}

.jewelry-filter-card .erp-combobox-menu {
    max-height: 230px;
}

.customer-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.customer-summary-grid div {
    padding: 12px 10px;
    border: 1px solid var(--jewel-line);
    background: #ffffff;
}

.customer-summary-grid span {
    font-size: .74rem;
}

.customer-summary-grid strong {
    color: var(--jewel-ink);
    font-size: .95rem;
    overflow-wrap: break-word;
}

@media (max-width: 560px) {
    .customer-summary-grid {
        gap: 6px;
    }

    .customer-summary-grid div {
        padding: 10px 6px;
    }

    .customer-summary-grid span {
        font-size: .68rem;
    }

    .customer-summary-grid strong {
        font-size: .82rem;
    }
}

.account-summary-grid {
    align-items: stretch;
}

.account-summary-grid > div {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.account-summary-grid strong {
    margin-top: 4px;
}

.account-summary-grid strong:first-of-type {
    margin-top: 6px;
}

.account-summary-empty-inline {
    color: var(--muted) !important;
    font-style: italic;
    font-weight: 500 !important;
}

.currency-balance-negative {
    color: #a1291f !important;
}

:root[data-theme="dark"] .currency-balance-negative {
    color: #f5a9a1 !important;
}

.customer-info-section {
    margin-top: 14px;
}

.customer-info-section .info-line {
    border-color: var(--jewel-line);
    background: #ffffff;
}

/* --- Purchase detay sayfası düzeni --- */

/* Sol form kartı daraltıldı (1.35fr yerine 1.05fr); medya sorgusu,
   1100px altındaki tek kolon kuralını ezmemek için gerekli. */
@media (min-width: 1101px) {
    .purchase-detail-page .customer-detail-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
        align-items: stretch;
    }

    .purchase-detail-page .customer-side-card {
        position: static;
        align-self: stretch;
        height: auto;
    }

    /* NOT alanı kartın en altına kadar uzar; alttaki boşluğu formun
       18px paddingi sağlar. */
    .purchase-detail-page .customer-card-form {
        display: flex;
        flex-direction: column;
    }

    .purchase-detail-page .customer-card-form .customer-edit-form {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* DİKKAT: 1fr her zaman SON satırda (Ürün açıklaması) kalmalı.
       3 kolonlu gridde 8 alan = 3 satır + açıklama satırı = 4 satır.
       Forma alan eklenip satır sayısı değişirse burası da güncellenmeli;
       aksi halde 1fr bir input satırına denk gelir ve o satırdaki alanlar
       dikeyde gerilir (2026-07-09'da Tutar/Para birimi ile yaşandı). */
    .purchase-detail-page .purchase-detail-form .field-grid {
        flex: 1;
        min-height: 0;
        grid-template-rows: repeat(3, auto) minmax(0, 1fr);
    }

    .purchase-detail-page .purchase-detail-form .wide-field {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 7px;
        min-height: 0;
    }

    .purchase-detail-page .purchase-detail-form .wide-field textarea {
        height: 100%;
        min-height: 84px;
        resize: none;
    }
}

/* İşlem durumu kartında satış tarihi ve müşteri yan yana. */
.purchase-detail-page .customer-info-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.purchase-detail-page .customer-info-section .info-line {
    grid-template-columns: 1fr;
    gap: 2px;
}

.purchase-detail-page .customer-info-section .info-line strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Çok dar ekranda tarih + müşteri alt alta düşer. */
@media (max-width: 560px) {
    .purchase-detail-page .customer-info-section {
        grid-template-columns: 1fr;
    }
}

.customer-side-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.customer-side-stack .erp-side-card {
    position: static;
}

/* İki kolonlu düzende sağ sütun (hesap özeti + satın alım geçmişi) form
   kartının yüksekliğine sabitlenir; geçmiş listesi kalan alanı doldurup
   fazla kayıtta kendi içinde kaydırılır. height:0 + min-height:100%
   sütunun satır yüksekliğine katkı vermemesini sağlar. */
@media (min-width: 1101px) {
    .customer-side-stack {
        height: 0;
        min-height: 100%;
    }

    .customer-purchase-history-card {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .customer-purchase-history-card .purchase-history-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        align-content: start;
    }
}

/* Tek kolonlu (dar) düzende liste sayfayı sonsuz uzatmasın. */
@media (max-width: 1100px) {
    .customer-purchase-history-card .purchase-history-list {
        max-height: 420px;
        overflow-y: auto;
    }
}

.customer-purchase-history-card .purchase-history-list {
    display: grid;
    gap: 10px;
    margin: 18px;
    padding: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 55%, var(--jewel-line, var(--line))) transparent;
}

.customer-purchase-history-card .purchase-history-list::-webkit-scrollbar {
    width: 8px;
}

.customer-purchase-history-card .purchase-history-list::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 55%, var(--jewel-line, var(--line)));
}

.purchase-history-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "date amount"
        "belge amount"
        "aciklama amount";
    align-items: center;
    column-gap: 12px;
    row-gap: 3px;
    padding: 12px;
    border: 1px solid var(--jewel-line);
    border-radius: 8px;
    background: #ffffff;
}

.purchase-history-date {
    grid-area: date;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--jewel-ink);
    font-weight: 800;
    font-size: 1.05rem;
}

.purchase-history-belge {
    grid-area: belge;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .82rem;
}

.purchase-history-aciklama {
    grid-area: aciklama;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .8rem;
}

.purchase-history-amount {
    grid-area: amount;
    color: var(--jewel-ink);
    font-size: 1rem;
    white-space: nowrap;
}

.customer-purchase-history-card .empty-state {
    margin: 18px;
}

/* Satın alım geçmişi satırları tıklanabilir; özet modalını açar. */
.purchase-history-item-clickable {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.purchase-history-item-clickable:hover,
.purchase-history-item-clickable:focus-visible {
    border-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 60%, var(--jewel-line, var(--line)));
    box-shadow: 0 4px 14px rgba(21, 52, 71, 0.1);
    transform: translateY(-1px);
    outline: none;
}

/* ─── Satın alma özeti modalı ───────────────────────────────── */

.purchase-summary-modal {
    max-width: 480px;
}

.purchase-summary-body {
    display: grid;
    gap: 16px;
}

.purchase-summary-image {
    display: flex;
    justify-content: center;
}

.purchase-summary-image img {
    max-width: 100%;
    max-height: 220px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 10px;
    object-fit: contain;
    background: #ffffff;
}

.purchase-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.purchase-summary-line {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 8px;
    background: var(--soft);
}

.purchase-summary-line span {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.purchase-summary-line strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--jewel-ink, var(--ink));
    font-size: .95rem;
}

/* Tutar satırı tam genişlik; para birimi Money() ile tutarın yanında yazılır. */
.purchase-summary-amount {
    grid-column: 1 / -1;
}

.purchase-summary-amount strong {
    font-size: 1.15rem;
}

@media (max-width: 560px) {
    .purchase-summary-grid {
        grid-template-columns: 1fr;
    }
}

.detail-message.success {
    color: #4d3718;
    border: 1px solid color-mix(in srgb, var(--jewel-gold) 30%, var(--jewel-line));
    background: color-mix(in srgb, var(--jewel-gold) 18%, #ffffff);
}

/* ─── Dashboard ─────────────────────────────────────────────── */

.dash-card {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform .16s ease, box-shadow .16s ease;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.dash-card span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dash-card strong {
    display: block;
    margin-top: 10px;
    color: var(--navy);
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.dash-card-warn {
    border-color: rgba(212, 154, 42, 0.3);
    background: color-mix(in srgb, var(--gold) 6%, var(--panel));
}

.dash-card-warn strong {
    color: #9a6d10;
}

.dash-card-accent {
    border-color: rgba(21, 52, 71, 0.22);
    background: color-mix(in srgb, var(--navy) 5%, var(--panel));
}

.dash-card-accent strong {
    color: var(--navy);
}

.dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.dash-panel-head h2 {
    font-size: 1.05rem;
    color: var(--navy);
    margin: 0;
}

.dash-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    border: 1px solid var(--line);
}

.dash-reminder-item {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    margin-bottom: 8px;
    line-height: 1.5;
}

.dashboard-side-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.dash-sale-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-sale-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.dash-sale-item:hover {
    border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
    box-shadow: 0 4px 14px var(--shadow);
    transform: translateY(-1px);
}

.dash-sale-info {
    min-width: 0;
}

.dash-sale-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.dash-date {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 4px;
}

.dash-title {
    display: block;
    font-weight: 700;
    color: var(--navy);
}

.dash-desc {
    display: block;
    font-size: 0.86rem;
    color: var(--muted);
    margin-top: 3px;
}

.dash-doc {
    display: block;
    font-weight: 800;
    color: var(--navy);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-amount {
    font-size: 1.02rem;
    font-weight: 900;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dash-amount small {
    margin-left: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.dash-type {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
}

.dash-sale-meta .status-chip {
    min-height: 20px;
    padding: 2px 9px;
    font-size: .7rem;
}

.status-chip.dash-status-approved {
    color: #1f6f35;
    background: #dcf5e3;
    border-color: #b7e4c7;
}

.status-chip.dash-status-pending {
    color: #55606b;
    background: #e7e9ec;
    border-color: #d3d7dc;
}

.skeleton-card {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line {
    display: block;
    border-radius: 4px;
    background: var(--line);
}

.skeleton-line.short {
    width: 55%;
    height: 10px;
    margin-bottom: 12px;
}

.skeleton-line.long {
    width: 70%;
    height: 22px;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Dark mode dashboard */
:root[data-theme="dark"] .dash-card {
    background: var(--panel);
    border-color: var(--line);
}

:root[data-theme="dark"] .dash-card strong {
    color: var(--ink);
}

:root[data-theme="dark"] .dash-card-warn {
    background: color-mix(in srgb, var(--gold) 8%, var(--panel));
}

:root[data-theme="dark"] .dash-card-warn strong {
    color: var(--gold);
}

:root[data-theme="dark"] .dash-card-accent {
    background: color-mix(in srgb, var(--teal) 8%, var(--panel));
}

:root[data-theme="dark"] .dash-card-accent strong {
    color: var(--teal);
}

:root[data-theme="dark"] .dash-reminder-item,
:root[data-theme="dark"] .dash-sale-item {
    background: var(--panel);
    border-color: var(--line);
}

:root[data-theme="dark"] .dash-title,
:root[data-theme="dark"] .dash-doc,
:root[data-theme="dark"] .dash-panel-head h2 {
    color: var(--ink);
}

:root[data-theme="dark"] .skeleton-card {
    background: var(--panel);
}

/* ─────────────────────────────────────────────────────────── */

#blazor-error-ui {
    display: none;
}

/* ---------- Mobil menü aç/kapa (hamburger) ---------- */
.mobile-menu-toggle {
    display: none;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    min-height: 40px;
    padding: 0;
    margin-right: -4px;
    border: 0;
    color: var(--navy);
    background: transparent;
}

@media (max-width: 1100px) {
    .site-header {
        position: sticky;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 16;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: auto;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        margin: 0 10px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--panel);
        box-shadow: 0 24px 48px var(--shadow);
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a {
        padding: 12px 14px;
    }

    .main-nav a::after {
        display: none;
    }

    .main-nav a.active-link {
        background: color-mix(in srgb, var(--gold) 10%, transparent);
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 5;
        background: rgba(7, 15, 18, 0.28);
        border: 0;
        padding: 0;
        cursor: default;
    }

    .hero-section {
        min-height: 760px;
        padding-top: 56px;
    }

    .hero-shade {
        background: linear-gradient(180deg, rgba(11, 31, 42, 0.92), rgba(11, 31, 42, 0.7));
    }

    .feature-grid,
    .split-band,
    .pricing-row,
    .form-page,
    .workspace-grid,
    .customer-toolbar,
    .customer-toolbar-filters,
    .customer-edit-form .field-grid,
    .erp-filter-card,
    .erp-detail-grid,
    .filter-bar,
    .mini-form {
        grid-template-columns: 1fr;
    }

    .dashboard-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-panel,
    .erp-side-card {
        position: static;
    }

    .final-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .customer-detail-page {
        padding-top: 8px;
    }

    .customer-detail-hero {
        grid-template-columns: auto minmax(0, 1fr) auto;
        min-height: 96px;
        padding: 12px;
    }

    .customer-detail-title {
        text-align: center;
    }

    .customer-detail-title h1 {
        font-size: clamp(1.7rem, 6vw, 3rem);
    }

    .customer-card-form .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-hero-icon {
        width: 40px;
        height: 40px;
    }

    .detail-hero-icon svg {
        width: 20px;
        height: 20px;
    }

    .detail-hero-actions {
        gap: 6px;
    }

    .jewelry-erp-page.erp-list-page {
        padding-top: 8px;
    }

    /* Müşteriler hero'sunda iki buton olduğu için 136px boşluk gerekiyor;
       başlık ortalı kalsın diye boşluk iki yana simetrik verilir (mutlak
       konumlu butonlar başlığın üstüne binmesin). */
    .jewelry-erp-page .customers-hero {
        padding: 14px 136px;
        justify-content: center;
    }

    .jewelry-erp-page .customers-hero .erp-hero-action-group {
        right: 16px;
        gap: 8px;
    }

    .mobile-filter-toggle {
        display: flex;
    }

    .mobile-filter-shell .erp-filter-card {
        display: none;
        margin-bottom: 10px;
        padding: 10px;
        gap: 8px;
        box-shadow: 0 8px 22px rgba(36, 40, 45, .08);
    }

    .mobile-filter-shell .erp-filter-card.is-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .mobile-filter-shell .erp-search-field {
        grid-column: 1 / -1;
    }

    .mobile-filter-shell .erp-filter-card label {
        gap: 4px;
        font-size: .76rem;
    }

    .mobile-filter-shell .erp-filter-card input,
    .mobile-filter-shell .erp-filter-card select,
    .mobile-filter-shell .erp-combobox-trigger {
        min-height: 36px;
        padding: 7px 9px;
        font-size: .9rem;
    }

    .mobile-filter-shell .erp-combobox-menu {
        max-height: 190px;
    }

    .erp-customer-table {
        overflow: visible;
    }

    .jewelry-erp-page .erp-customer-head,
    .erp-customer-head,
    .erp-purchase-head {
        display: none !important;
    }

    .erp-customer-row {
        position: relative;
        display: grid;
        grid-template-columns: 1fr auto;
        min-width: 0;
        gap: 4px 12px;
        margin-bottom: 9px;
        padding: 12px 58px 12px 14px;
        border: 1px solid var(--line);
        border-radius: 8px;
        overflow: hidden;
    }

    .erp-customer-row > span {
        display: none;
        min-height: 0;
        padding: 0;
        border-bottom: 0;
    }

    .erp-customer-row > span[data-label="Foto"],
    .erp-customer-row > span[data-label="Kod"],
    .erp-customer-row > span[data-label="Ad / Firma"],
    .erp-customer-row > span[data-label="Telefon"],
    .erp-customer-row > span[data-label="İl"],
    .erp-customer-row > .row-action-cell,
    .erp-customer-row > .row-select-cell {
        display: flex;
    }

    .erp-customer-row > span[data-label="Foto"] {
        justify-content: flex-start;
        margin-bottom: 4px;
    }

    .erp-customer-row > span[data-label="Foto"] .customer-thumb-empty {
        display: none;
    }

    .erp-customer-table-selectable .erp-customer-row {
        /* Masaüstündeki grid-template-columns (10 kolon) ve min-width: 1154px
           kuralları, buradaki tek-class'lı .erp-customer-row kuralından daha
           özgül (specificity) olduğu için mobilde geçersiz kılınamıyordu ve
           satır hem 10 kolonlu masaüstü ızgarasını korumaya çalışıyor hem de
           kart genişliğini aşıyordu; ikisini de aynı özgüllükte tekrar
           sıfırlıyoruz. */
        grid-template-columns: 1fr auto;
        min-width: 0;
        padding-left: 42px;
    }

    .erp-customer-row > .row-select-cell {
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
    }

    .erp-customer-row > span[data-label="Ad / Firma"] {
        grid-column: 1 / -1;
        color: var(--jewel-ink, var(--navy));
        font-size: 1rem;
    }

    .erp-customer-row > span[data-label="Kod"],
    .erp-customer-row > span[data-label="Telefon"],
    .erp-customer-row > span[data-label="İl"] {
        color: var(--muted);
        font-size: .82rem;
        white-space: normal;
    }

    .erp-customer-row > span[data-label="Ad / Firma"],
    .erp-customer-row > span[data-label="Ad / Firma"] strong {
        white-space: normal;
    }

    .erp-customer-row > span[data-label="Kod"]::before {
        content: "Kod: ";
        margin-right: 4px;
        font-weight: 800;
    }

    .erp-customer-row > span[data-label="Telefon"]::before {
        content: "Tel: ";
        margin-right: 4px;
        font-weight: 800;
    }

    .erp-customer-row > span[data-label="İl"]::before {
        content: "İl: ";
        margin-right: 4px;
        font-weight: 800;
    }

    .erp-customer-row > span[data-label="İl"] {
        display: flex;
        color: var(--muted);
        font-size: .82rem;
    }

    .erp-customer-row > span[data-label="İl"]::before {
        content: "İl: ";
        margin-right: 4px;
        font-weight: 800;
    }

    .row-action-cell {
        position: absolute;
        right: 10px;
        top: 50%;
        justify-content: center;
        transform: translateY(-50%);
    }

    .erp-filter-icon-button {
        width: 100%;
        min-height: 38px;
    }

    .erp-purchase-table {
        overflow: visible;
    }

    .erp-purchase-row {
        position: relative;
        display: grid;
        grid-template-columns: 1fr auto;
        min-width: 0;
        gap: 4px 12px;
        margin-bottom: 9px;
        padding: 12px 58px 12px 14px;
        border: 1px solid var(--line);
        border-radius: 8px;
        overflow: hidden;
    }

    .erp-purchase-row > span {
        display: none;
        min-height: 0;
        padding: 0;
    }

    .erp-purchase-row > span[data-label="Görsel"],
    .erp-purchase-row > span[data-label="Müşteri"],
    .erp-purchase-row > span[data-label="Belge"],
    .erp-purchase-row > span[data-label="Tutar"],
    .erp-purchase-row > span[data-label="Durum"],
    .erp-purchase-row > .row-action-cell {
        display: flex;
    }

    .erp-purchase-row > span[data-label="Görsel"] {
        justify-content: flex-start;
        margin-bottom: 4px;
    }

    .erp-purchase-row > span[data-label="Görsel"] .purchase-thumb-empty {
        display: none;
    }

    .erp-purchase-row > span[data-label="Müşteri"] {
        grid-column: 1 / -1;
        color: var(--jewel-ink, var(--navy));
        font-size: 1rem;
    }

    .erp-purchase-row > span[data-label="Müşteri"],
    .erp-purchase-row > span[data-label="Müşteri"] strong {
        white-space: normal;
    }

    .erp-purchase-row > span[data-label="Belge"],
    .erp-purchase-row > span[data-label="Tutar"],
    .erp-purchase-row > span[data-label="Durum"] {
        color: var(--muted);
        font-size: .82rem;
        white-space: normal;
    }

    .erp-purchase-row > span[data-label="Belge"]::before {
        content: "Belge: ";
        margin-right: 4px;
        font-weight: 800;
    }

    .erp-purchase-row > span[data-label="Tutar"]::before {
        content: "Tutar: ";
        margin-right: 4px;
        font-weight: 800;
    }
}

@media (max-width: 560px) {
    .hero-metrics span {
        width: 100%;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erp-detail-head,
    .erp-table-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .jewelry-erp-page {
        background: linear-gradient(180deg, #f4f6f4 0, #ffffff 250px);
    }

    .jewelry-erp-page.erp-list-page {
        padding-top: 8px;
    }

    .jewelry-erp-page .customers-hero {
        min-height: 104px;
        /* İki butonlu müşteriler hero'su için 108px yeterli (2x44px + boşluk);
           başlık ortalı kalsın diye boşluk iki yana simetrik. */
        padding: 14px 108px;
        justify-content: center;
        margin-bottom: 12px;
    }

    .jewelry-erp-page .customers-hero h2 {
        font-size: clamp(1.4rem, 7vw, 2.7rem);
    }

    .jewelry-erp-page .customers-hero .eyebrow {
        margin-bottom: 6px;
        font-size: .68rem;
    }

    .jewelry-erp-page .customers-hero .erp-add-button {
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .jewelry-erp-page .customers-hero .erp-hero-action-group {
        right: 10px;
        gap: 6px;
    }

    .jewelry-erp-page .customers-hero .erp-add-button svg {
        width: 24px;
        height: 24px;
    }

    .customers-hero-title {
        text-align: center;
    }

    .customer-card-form .field-grid {
        grid-template-columns: 1fr;
    }

    .customer-detail-hero {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .customer-detail-title .eyebrow {
        font-size: .65rem;
        margin-bottom: 5px;
    }

    .customer-detail-title h1 {
        font-size: clamp(1.35rem, 6vw, 2rem);
    }

    .detail-hero-icon {
        width: 36px;
        height: 36px;
    }

    .detail-hero-icon svg {
        width: 18px;
        height: 18px;
    }

    .detail-hero-actions {
        gap: 4px;
    }
}

/* Dark mod: kullanıcı menüsü */
:root[data-theme="dark"] .user-menu-item {
    color: var(--ink);
}

:root[data-theme="dark"] .user-menu-item.user-menu-danger,
:root[data-theme="dark"] .user-menu-item.user-menu-danger:hover {
    color: #ffb4b4;
}

:root[data-theme="dark"] .user-menu-item.user-menu-danger:hover {
    background: #3a1518;
}

/* Dark mod overrides */
:root[data-theme="dark"] {
    --ink: #e8f2f1;
    --muted: #a8bbb8;
    --line: #2a4648;
    --panel: #10262b;
    --soft: #0d2024;
    --teal: #25a8b5;
    --green: #55c878;
    --navy: #dcefed;
    --gold: #f0b84f;
    --page: #071619;
    --header: rgba(7, 22, 25, 0.92);
    --shadow: rgba(0, 0, 0, 0.28);
    --table-hover: #1b4248;
}

.site-header {
    background: var(--header);
}

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--navy);
    background: var(--panel);
    font-weight: 800;
}

.mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle:hover {
    color: #1f2528;
    border-color: #d9c3a0;
    background: #d9c3a0;
}

.narrow-page {
    max-width: 920px;
    margin: 0 auto;
}

.profile-form {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

.profile-page .form-message {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 640px) {
    .profile-form {
        max-width: 100%;
        padding: 18px 16px;
    }
}

.purchase-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(130px, .6fr) minmax(150px, .7fr) auto auto;
}

.purchase-table .table-row {
    grid-template-columns: 1.4fr .9fr .8fr .8fr .8fr;
}

:root[data-theme="dark"] .form-page,
:root[data-theme="dark"] .panel-page {
    background: linear-gradient(180deg, var(--soft), var(--page) 34%);
}

:root[data-theme="dark"] .crm-form,
:root[data-theme="dark"] .inline-form,
:root[data-theme="dark"] .filter-bar,
:root[data-theme="dark"] .customer-toolbar-filters,
:root[data-theme="dark"] .customer-table,
:root[data-theme="dark"] .erp-filter-card,
:root[data-theme="dark"] .erp-table-card,
:root[data-theme="dark"] .erp-form-card,
:root[data-theme="dark"] .erp-side-card,
:root[data-theme="dark"] .detail-panel,
:root[data-theme="dark"] .feature-grid article,
:root[data-theme="dark"] .price-panel,
:root[data-theme="dark"] .info-line,
:root[data-theme="dark"] .selectable .data-row {
    background: var(--panel);
}

:root[data-theme="dark"] .summary-grid div,
:root[data-theme="dark"] .mini-form,
:root[data-theme="dark"] .proof-list div,
:root[data-theme="dark"] .pricing-band {
    background: var(--soft);
}

/* Koyu modda .feature-icon arkaplani (var(--navy)) acik renge donuyor;
   ustundeki sabit beyaz yazi bu yuzden kayboluyor - sadece yazi rengini
   koyu moda gore zorluyoruz, arkaplan aynen kaliyor. */
:root[data-theme="dark"] .feature-icon {
    color: #10262b;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .ghost-button {
    color: var(--ink);
    background: #0b1d21;
    border-color: var(--line);
}

/* Tarayici otomatik doldurma (autofill) e-posta/sifre gibi alanlara kendi
   acik renk temasini zorluyor; normal background/color kurallari bunun
   uzerine yazamiyor, bu yuzden -webkit-autofill icin ayri override gerekiyor.
   .login-form icin zaten uygulanmisti, .crm-form (register/profil) icin de
   ekliyoruz. */
:root[data-theme="dark"] .crm-form input:-webkit-autofill,
:root[data-theme="dark"] .crm-form input:-webkit-autofill:hover,
:root[data-theme="dark"] .crm-form input:-webkit-autofill:focus,
:root[data-theme="dark"] .crm-form input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px #0b1d21 inset;
    box-shadow: 0 0 0 1000px #0b1d21 inset;
    transition: background-color 600000s ease-in-out 0s;
}

:root[data-theme="dark"] option {
    color: var(--ink);
    background: var(--panel);
}

:root[data-theme="dark"] .erp-combobox-trigger,
:root[data-theme="dark"] .erp-combobox-menu {
    color: var(--ink);
    border-color: var(--line);
    background: var(--panel);
}

:root[data-theme="dark"] .erp-combobox-trigger:hover,
:root[data-theme="dark"] .erp-combobox-trigger[aria-expanded="true"] {
    border-color: #d9c3a0;
    background: color-mix(in srgb, #d9c3a0 10%, var(--panel));
}

:root[data-theme="dark"] .erp-combobox-option {
    color: var(--ink);
}

:root[data-theme="dark"] .erp-combobox-option:hover,
:root[data-theme="dark"] .erp-combobox-option:focus-visible,
:root[data-theme="dark"] .erp-combobox-option.is-selected {
    color: #1f2528;
    background: #d9c3a0;
}

:root[data-theme="dark"] .form-message,
:root[data-theme="dark"] .empty-state {
    color: var(--ink);
    background: #123236;
    border-color: #1e4a50;
}

:root[data-theme="dark"] .dashboard-cards div,
:root[data-theme="dark"] .summary-grid div {
    background: var(--panel);
    border-color: var(--line);
}

:root[data-theme="dark"] .dashboard-cards div:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .dashboard-cards strong {
    color: var(--ink);
}

:root[data-theme="dark"] .panel-heading {
    border-color: var(--line);
}

:root[data-theme="dark"] .table-head {
    background: #17353a;
}

:root[data-theme="dark"] .erp-customer-head,
:root[data-theme="dark"] .erp-customer-data:nth-child(even) {
    background: #17353a;
}

:root[data-theme="dark"] .erp-customer-data:nth-child(odd) {
    background: var(--panel);
}

:root[data-theme="dark"] .erp-purchase-head {
    color: #e8f2f1;
    background: #17353a;
}

:root[data-theme="dark"] .erp-purchase-data:nth-child(odd) {
    color: var(--ink);
    background: #10262b;
}

:root[data-theme="dark"] .erp-purchase-data:nth-child(even) {
    color: var(--ink);
    background: #0d2024;
}

:root[data-theme="dark"] .erp-purchase-data:hover,
:root[data-theme="dark"] .erp-purchase-data:focus-visible {
    color: var(--ink);
    background: #1b4248;
}

:root[data-theme="dark"] .erp-customer-data:hover,
:root[data-theme="dark"] .erp-customer-data:focus-visible {
    background: var(--table-hover);
}

:root[data-theme="dark"] .erp-user-head,
:root[data-theme="dark"] .erp-user-data:nth-child(even) {
    background: #17353a;
}

:root[data-theme="dark"] .erp-user-data:nth-child(odd),
:root[data-theme="dark"] .user-detail-card {
    background: var(--panel);
}

/* Koyu modda .jewelry-erp-page'in acik renk --jewel-line degeri tablo
   kartinin cevresinde beyaz gorunen bir cerceve birakiyor. */
:root[data-theme="dark"] .jewelry-table-card {
    border-color: var(--line);
}

/* Koyu modda yatay scroll alani acik renk kaliyor. */
:root[data-theme="dark"] .erp-user-table,
:root[data-theme="dark"] .erp-purchase-table {
    scrollbar-color: var(--line) var(--soft);
}

:root[data-theme="dark"] .erp-user-table::-webkit-scrollbar,
:root[data-theme="dark"] .erp-purchase-table::-webkit-scrollbar {
    height: 10px;
}

:root[data-theme="dark"] .erp-user-table::-webkit-scrollbar-track,
:root[data-theme="dark"] .erp-purchase-table::-webkit-scrollbar-track {
    background: var(--soft);
}

:root[data-theme="dark"] .erp-user-table::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .erp-purchase-table::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 8px;
}

:root[data-theme="dark"] .erp-user-data:hover,
:root[data-theme="dark"] .erp-user-data:focus-visible,
:root[data-theme="dark"] .erp-user-data.is-selected {
    background: var(--table-hover);
}

:root[data-theme="dark"] .user-detail-form input,
:root[data-theme="dark"] .user-detail-form select {
    color: var(--ink);
    border-color: var(--line);
    background: #0b1d21;
}

:root[data-theme="dark"] .user-detail-form input[readonly] {
    color: var(--muted);
    background: var(--soft);
}

:root[data-theme="dark"] .detail-save-icon {
    color: #1f2528;
    border-color: #d9c3a0;
    background:
        linear-gradient(145deg, #f2e4cc, #d9c3a0 62%, #b89461);
}

:root[data-theme="dark"] .detail-cancel-icon {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, .06);
}

:root[data-theme="dark"] .user-detail-card .card-section-heading {
    border-color: var(--line);
    background: #17353a;
}

:root[data-theme="dark"] .customer-detail-page .customer-card-form,
:root[data-theme="dark"] .customer-detail-page .customer-side-card {
    background: var(--panel);
}

:root[data-theme="dark"] .customer-detail-page .customer-card-form .card-section-heading,
:root[data-theme="dark"] .customer-detail-page .customer-side-card .card-section-heading {
    border-color: var(--line);
    background: #17353a;
}

:root[data-theme="dark"] .user-detail-form label {
    color: var(--ink);
}

/* Müşteri/satın alma detay kartı: alan başlıkları (--jewel-ink) koyu modda
   sabit koyu renkte kalıyor ve kartın koyu zemininde okunmuyordu. */
:root[data-theme="dark"] .customer-card-form label,
:root[data-theme="dark"] .card-section-heading strong {
    color: var(--ink);
}

/* Müşteriler/Satın almalar filtre kartı: aynı --jewel-ink sorunu filtre
   alan başlıklarında da vardı (Arama/Ülke/İl/Tip, satın alma filtreleri). */
:root[data-theme="dark"] .jewelry-filter-card label {
    color: var(--ink);
}

/* Mobil kart görünümünde müşteri "Ad / Firma" ve satın alma "Müşteri"
   isimleri de aynı sabit koyu renkle çiziliyordu. */
:root[data-theme="dark"] .erp-customer-row > span[data-label="Ad / Firma"],
:root[data-theme="dark"] .erp-purchase-row > span[data-label="Müşteri"] {
    color: var(--ink);
}

/* Müşteriler sayfası seçim araç çubuğu: Tümünü Seç / Temizle / Seçili Müşterilere
   Mail Gönder butonlarının yazısı --jewel-ink/--jewel-charcoal sabit koyu renk
   kullandığı için koyu modda koyu zemin üstünde görünmüyordu. */
:root[data-theme="dark"] .selection-btn {
    color: var(--ink);
}

:root[data-theme="dark"] .selection-btn-primary {
    color: var(--ink);
}

/* Gönderim Geçmişi off-canvas paneli: başlık, meta etiketleri, istatistik sayıları,
   içerik kutusu ve alıcı adları da aynı --jewel-ink sabit koyu renk sorununu
   taşıyordu; koyu modda panel neredeyse okunmaz durumdaydı. */
:root[data-theme="dark"] .email-history-row-main strong,
:root[data-theme="dark"] .email-history-detail-head h4,
:root[data-theme="dark"] .email-history-detail-meta strong,
:root[data-theme="dark"] .email-history-stat strong,
:root[data-theme="dark"] .email-history-content-body,
:root[data-theme="dark"] .email-history-recipient-info strong {
    color: var(--ink);
}

:root[data-theme="dark"] .email-history-cleanup-btn {
    color: #f5a9a1;
}

:root[data-theme="dark"] .customer-card-form input.input-error {
    border-color: #d97373;
    background: #2a1414;
}

:root[data-theme="dark"] .customer-summary-grid div,
:root[data-theme="dark"] .customer-info-section .info-line {
    border-color: var(--line);
    background: var(--soft);
}

:root[data-theme="dark"] .customer-summary-grid strong {
    color: var(--ink);
}

:root[data-theme="dark"] .customer-summary-grid span {
    color: var(--muted);
}

:root[data-theme="dark"] .purchase-history-item {
    border-color: var(--line);
    background: var(--soft);
}

:root[data-theme="dark"] .purchase-history-date,
:root[data-theme="dark"] .purchase-history-amount {
    color: var(--ink);
}

:root[data-theme="dark"] .purchase-history-belge,
:root[data-theme="dark"] .purchase-history-aciklama {
    color: var(--muted);
}

:root[data-theme="dark"] .detail-message.success {
    color: var(--ink);
    border-color: color-mix(in srgb, var(--gold) 30%, var(--line));
    background: color-mix(in srgb, var(--gold) 16%, var(--panel));
}

:root[data-theme="dark"] .user-meta-item span {
    color: #d9c3a0;
}

:root[data-theme="dark"] .erp-delete-icon:hover {
    color: #d9c3a0;
    background: transparent;
    border-color: transparent;
}

.purchases-page {
    padding-top: 118px;
}

.purchases-list-page {
    /* jewelry-erp-page + erp-list-page zaten tanımlı, bu birleştirir */
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.purchase-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
    gap: 20px;
    align-items: start;
}

.purchase-list-panel,
.purchase-editor-card,
.purchase-filter-card,
.purchase-table-card {
    min-width: 0;
}

.purchase-filter-card,
.purchase-editor-card,
.purchase-table-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 48px var(--shadow);
}

.purchase-filter-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.55fr) minmax(160px, 0.65fr) auto auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    margin-bottom: 14px;
}

.purchase-filter-card label,
.purchase-form label {
    display: grid;
    gap: 6px;
    color: var(--navy);
    font-size: 0.86rem;
    font-weight: 800;
}

.purchase-filter-card input,
.purchase-filter-card select,
.purchase-form input,
.purchase-form select,
.purchase-form textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--panel);
    font: inherit;
}

.purchase-form textarea {
    min-height: 96px;
    resize: vertical;
}

.primary-button,
.secondary-button,
.text-button,
.danger-button {
    min-height: 40px;
    border-radius: 8px;
    padding: 0 14px;
    font-weight: 800;
    transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}

.primary-button {
    border: 0;
    color: #ffffff;
    background: var(--teal);
}

.primary-button:hover {
    opacity: .88;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--shadow);
}

.secondary-button {
    border: 1px solid var(--line);
    color: var(--navy);
    background: var(--panel);
}

.secondary-button:hover {
    background: var(--soft);
    border-color: var(--navy);
}

.text-button {
    border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
    color: var(--teal);
    background: color-mix(in srgb, var(--teal) 8%, var(--panel));
}

.text-button:hover {
    background: color-mix(in srgb, var(--teal) 14%, var(--panel));
}

.danger-button {
    border: 1px solid #e3b1b1;
    color: #b42323;
    background: #fff5f5;
}

.danger-button:hover {
    background: #ffe8e8;
    border-color: #c84040;
}

.purchase-table-card {
    overflow: auto;
}

.purchase-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(120px, 0.75fr) minmax(130px, 0.75fr) minmax(170px, 0.85fr);
    min-width: 930px;
    border-top: 1px solid var(--line);
}

.purchase-row:first-child {
    border-top: 0;
}

.purchase-row > span {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 12px 14px;
    overflow-wrap: anywhere;
}

.purchase-head {
    color: var(--navy);
    background: color-mix(in srgb, var(--teal) 8%, var(--panel));
    font-weight: 900;
}

.purchase-row.selected,
.purchase-row:hover:not(.purchase-head) {
    background: var(--table-hover);
}

.row-actions {
    gap: 8px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--navy);
    background: color-mix(in srgb, var(--navy) 10%, var(--panel));
    border: 1px solid color-mix(in srgb, var(--navy) 16%, var(--line));
    font-weight: 800;
    font-size: 0.82rem;
    white-space: nowrap;
}

.purchase-editor-card {
    position: sticky;
    top: 92px;
    padding: 20px;
}

.editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.editor-heading h2 {
    font-size: 1.55rem;
}

.purchase-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.purchase-form .wide-field,
.editor-actions {
    grid-column: 1 / -1;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

:root[data-theme="dark"] .danger-button {
    color: #ffb4b4;
    background: #3a1518;
    border-color: #6f2a2f;
}

@media (max-width: 1100px) {
    .purchase-shell,
    .purchase-filter-card,
    .purchase-form {
        grid-template-columns: 1fr;
    }

    .purchase-editor-card {
        position: static;
    }

    .users-shell {
        grid-template-columns: 1fr;
    }

    .user-detail-card {
        position: static;
    }
}

@media (max-width: 1100px) {
    .site-header {
        gap: 8px;
        min-height: 0;
        padding: 10px 14px;
    }

    .brand {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .brand-logo {
        height: 52px;
        max-width: 100%;
    }

    .header-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }

    /* Menü artık hamburger ile açılan bir panel; header tek satırda kalıyor,
       bu yüzden sayfa içeriğinin üst boşluğu masaüstüne yakın bir değere
       çekilebiliyor (aşırı boşluk bırakmadan). */
    .form-page,
    .panel-page,
    .login-page {
        padding-top: 96px;
    }

    /* Müşteri/satın alma detay (hero'lu) sayfalar: liste sayfalarıyla
       (jewelry-erp-page.erp-list-page) aynı şekilde header'ın hemen
       altından başlasın, minik bir boşluk yeterli. */
    .erp-detail-page,
    .customer-detail-page {
        padding-top: 8px;
    }

}

@media (max-width: 560px) {
    .site-header {
        align-items: center;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .brand-mark svg {
        width: 23px;
        height: 23px;
    }

    .brand-logo {
        height: 44px;
    }

    .brand-text strong {
        font-size: .88rem;
    }

    .brand-text small {
        font-size: .62rem;
    }

    .header-actions {
        width: auto;
        justify-content: flex-end;
        gap: 7px;
    }

    .user-menu-dropdown {
        min-width: 200px;
    }

    .theme-toggle {
        width: 36px;
        min-height: 36px;
    }

    .theme-toggle svg {
        width: 17px;
        height: 17px;
    }

    .small-action,
    .ghost-link {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 0 10px;
        font-size: .84rem;
    }

    .jewelry-erp-page .customers-hero .erp-add-button {
        width: 40px;
        height: 40px;
    }

    .jewelry-erp-page .customers-hero .erp-add-button svg {
        width: 19px;
        height: 19px;
    }

    .jewelry-erp-page .customers-hero .erp-hero-left {
        left: 14px;
    }

    .user-menu-trigger {
        padding: 4px;
    }

    .user-menu-trigger .user-menu-chevron {
        display: none;
    }

    .erp-user-table {
        overflow: visible;
    }

    .erp-user-head {
        display: none;
    }

    .erp-user-row {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        min-width: 0;
        gap: 4px;
        margin-bottom: 9px;
        padding: 12px 14px 12px 16px;
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    .erp-user-row > span {
        min-height: 0;
        padding: 0;
        white-space: normal;
    }

    .erp-user-row > span[data-label="Ad Soyad"] {
        color: var(--jewel-ink, var(--navy));
        font-size: 1rem;
    }

    .erp-user-row > span[data-label="E-posta"],
    .erp-user-row > span[data-label="Rol"],
    .erp-user-row > span[data-label="Son giriş"] {
        color: var(--muted);
        font-size: .82rem;
    }

    .erp-user-row > span[data-label="Rol"]::before {
        content: "Rol: ";
        margin-right: 4px;
        font-weight: 800;
    }

    .erp-user-row > span[data-label="Son giriş"]::before {
        content: "Son giriş: ";
        margin-right: 4px;
        font-weight: 800;
    }

    .user-detail-form .field-grid,
    .user-detail-meta {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Toplu mail: durum rozetleri (status-chip varyantları)
   ========================================================================== */

.status-chip svg {
    width: 14px;
    height: 14px;
    margin-right: 5px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    vertical-align: -2px;
}

.status-chip.status-ok {
    color: #1f6f35;
    background: #dcf5e3;
    border-color: #b7e4c7;
}

.status-chip.status-fail {
    color: #a1291f;
    background: #fbe2df;
    border-color: #f1bcb5;
}

.status-chip.status-partial {
    color: #92660f;
    background: #faedd0;
    border-color: #efd49b;
}

.status-chip.status-scheduled {
    color: #3a5a78;
    background: #e2ecf5;
    border-color: #c3d7e8;
}

:root[data-theme="dark"] .status-chip.status-ok {
    color: #7fe0a0;
    background: color-mix(in srgb, #1f6f35 35%, var(--panel));
    border-color: color-mix(in srgb, #1f6f35 55%, var(--line));
}

:root[data-theme="dark"] .status-chip.status-fail {
    color: #f5a9a1;
    background: color-mix(in srgb, #a1291f 35%, var(--panel));
    border-color: color-mix(in srgb, #a1291f 55%, var(--line));
}

:root[data-theme="dark"] .status-chip.status-partial {
    color: #f2cf8c;
    background: color-mix(in srgb, #92660f 35%, var(--panel));
    border-color: color-mix(in srgb, #92660f 55%, var(--line));
}

:root[data-theme="dark"] .status-chip.status-scheduled {
    color: #a7c7e6;
    background: color-mix(in srgb, #3a5a78 35%, var(--panel));
    border-color: color-mix(in srgb, #3a5a78 55%, var(--line));
}

/* ==========================================================================
   Genel modal (overlay + panel) - Toplu mail gönderim popup'ı için
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 24, 22, .55);
    backdrop-filter: blur(2px);
    animation: modal-fade-in .15s ease;
}

.modal-panel {
    width: 100%;
    max-width: 560px;
    max-height: min(88vh, 780px);
    display: flex;
    flex-direction: column;
    background: var(--jewel-surface, var(--panel));
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 20, 18, .35);
    overflow: hidden;
    animation: modal-pop-in .18s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-pop-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--jewel-line, var(--line));
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 8%, var(--jewel-surface, var(--panel)));
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-title svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--jewel-gold, var(--gold));
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.modal-header-title h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--jewel-ink, var(--navy));
}

.modal-close-btn,
.offcanvas-close-btn,
.offcanvas-back-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--jewel-ink, var(--navy));
    cursor: pointer;
    transition: background .14s ease, color .14s ease;
}

.modal-close-btn:hover,
.offcanvas-close-btn:hover,
.offcanvas-back-btn:hover {
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 16%, transparent);
}

.modal-close-btn svg,
.offcanvas-close-btn svg,
.offcanvas-back-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bulk-mail-recipient-line {
    margin: 0;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--jewel-soft, var(--soft));
    border: 1px solid var(--jewel-line, var(--line));
    color: var(--jewel-ink, var(--navy));
    font-size: .92rem;
}

.bulk-mail-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9px;
    background: #faedd0;
    border: 1px solid #efd49b;
    color: #7a561c;
    font-size: .84rem;
}

.bulk-mail-warning svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bulk-mail-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .84rem;
    font-weight: 700;
    color: var(--jewel-ink, var(--navy));
}

.bulk-mail-field-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.bulk-mail-field-label svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--jewel-gold, var(--gold));
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.bulk-mail-field input[type="text"],
.bulk-mail-field textarea {
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 9px;
    padding: 10px 12px;
    font-family: var(--app-font);
    font-size: .92rem;
    font-weight: 500;
    color: var(--jewel-ink, var(--navy));
    background: var(--jewel-surface, var(--panel));
    resize: vertical;
}

.bulk-mail-field input[type="text"]:focus,
.bulk-mail-field textarea:focus {
    outline: none;
    border-color: var(--jewel-charcoal, var(--navy));
}

.bulk-mail-field-hint {
    font-size: .74rem;
    font-weight: 500;
    color: var(--muted);
}

.bulk-mail-field-hint code {
    background: var(--jewel-soft, var(--soft));
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .74rem;
}

.bulk-mail-preview {
    border: 1px dashed var(--jewel-line, var(--line));
    border-radius: 9px;
    padding: 12px 14px;
    background: var(--jewel-soft, var(--soft));
}

.bulk-mail-preview-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 8px;
}

.bulk-mail-preview-head svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bulk-mail-preview-subject {
    font-weight: 800;
    color: var(--jewel-ink, var(--navy));
    margin-bottom: 6px;
}

.bulk-mail-preview-body {
    font-size: .88rem;
    color: var(--jewel-ink, var(--navy));
    background: var(--jewel-surface, var(--panel));
    border-radius: 7px;
    padding: 10px 12px;
    border: 1px solid var(--jewel-line, var(--line));
    max-height: 220px;
    overflow-y: auto;
}

.bulk-mail-schedule {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid var(--jewel-line, var(--line));
}

.bulk-mail-schedule-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--jewel-ink, var(--navy));
    cursor: pointer;
}

.bulk-mail-schedule-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--jewel-gold, var(--gold));
}

.bulk-mail-schedule-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--jewel-gold, var(--gold));
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bulk-mail-schedule-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bulk-mail-schedule-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
}

.bulk-mail-schedule-fields input {
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 8px;
    padding: 8px 10px;
    font-family: var(--app-font);
    font-size: .88rem;
    color: var(--jewel-ink, var(--navy));
    background: var(--jewel-surface, var(--panel));
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--jewel-line, var(--line));
    background: var(--jewel-soft, var(--soft));
    flex-wrap: wrap;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 9px;
    border: 1px solid var(--jewel-line, var(--line));
    background: var(--panel);
    color: var(--jewel-ink, var(--navy));
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .14s ease, opacity .14s ease, transform .14s ease;
}

.modal-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.modal-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.modal-btn-ghost {
    background: var(--panel);
}

.modal-btn-primary {
    border-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 55%, var(--jewel-line, var(--line)));
    background: linear-gradient(145deg, var(--jewel-gold, var(--gold)), #8a6635);
    color: #fff;
}

.modal-btn-cancel {
    background: transparent;
    color: #a1291f;
    border-color: #f1bcb5;
}

.modal-btn-cancel:hover:not(:disabled) {
    background: #fbe2df;
}

.modal-btn-spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    animation: modal-spin .7s linear infinite;
}

@keyframes modal-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Off-canvas panel - Gönderim geçmişi için
   ========================================================================== */

.offcanvas-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    background: rgba(20, 24, 22, .5);
    animation: modal-fade-in .15s ease;
}

.offcanvas-panel {
    width: 100%;
    max-width: 460px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--jewel-surface, var(--panel));
    border-left: 1px solid var(--jewel-line, var(--line));
    box-shadow: -20px 0 60px rgba(15, 20, 18, .3);
    animation: offcanvas-slide-in .2s ease;
}

@keyframes offcanvas-slide-in {
    from { transform: translateX(24px); opacity: .4; }
    to { transform: translateX(0); opacity: 1; }
}

.offcanvas-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px;
    border-bottom: 1px solid var(--jewel-line, var(--line));
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 8%, var(--jewel-surface, var(--panel)));
}

.offcanvas-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    color: var(--jewel-ink, var(--navy));
}

.offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-history-cleanup {
    display: flex;
    justify-content: flex-end;
}

.email-history-cleanup-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 9px;
    border: 1px solid color-mix(in srgb, #a1291f 40%, var(--jewel-line, var(--line)));
    background: color-mix(in srgb, #a1291f 8%, var(--panel));
    color: #a1291f;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease, opacity .14s ease;
}

.email-history-cleanup-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.email-history-cleanup-btn:hover:not(:disabled) {
    background: color-mix(in srgb, #a1291f 16%, var(--panel));
}

.email-history-cleanup-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.email-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 10px;
    background: var(--panel);
    text-align: left;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease;
    font-family: var(--app-font);
}

.email-history-row:hover,
.email-history-row:focus-visible {
    outline: none;
    background: var(--jewel-soft, var(--soft));
    border-color: var(--jewel-charcoal, var(--navy));
}

.email-history-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.email-history-row-main strong {
    color: var(--jewel-ink, var(--navy));
    font-size: .94rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-history-row-meta {
    font-size: .76rem;
    color: var(--muted);
}

.email-history-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.email-history-detail-head h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--jewel-ink, var(--navy));
}

.email-history-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 14px 0;
    font-size: .82rem;
    color: var(--muted);
}

.email-history-detail-meta strong {
    color: var(--jewel-ink, var(--navy));
}

.email-history-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.email-history-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 9px;
    background: var(--jewel-soft, var(--soft));
}

.email-history-stat strong {
    font-size: 1.2rem;
    color: var(--jewel-ink, var(--navy));
}

.email-history-stat span {
    font-size: .72rem;
    color: var(--muted);
}

.email-history-stat-ok strong {
    color: #1f6f35;
}

.email-history-stat-fail strong {
    color: #a1291f;
}

.email-history-content-head {
    font-size: .78rem;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.email-history-content-box {
    margin-bottom: 16px;
}

.email-history-content-body {
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 9px;
    padding: 12px 14px;
    background: var(--jewel-soft, var(--soft));
    font-size: .88rem;
    color: var(--jewel-ink, var(--navy));
    max-height: 220px;
    overflow-y: auto;
}

.email-history-recipient-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--jewel-line, var(--line)) 78%, transparent);
}

.email-history-recipient-row:last-child {
    border-bottom: 0;
}

.email-history-recipient-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.email-history-recipient-info strong {
    font-size: .88rem;
    color: var(--jewel-ink, var(--navy));
}

.email-history-recipient-info span {
    font-size: .78rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .modal-panel {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .modal-overlay {
        padding: 0;
    }

    .offcanvas-panel {
        max-width: 100%;
    }

    .modal-footer {
        justify-content: stretch;
    }

    .modal-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================================================
   Dashboard: Hızlı Mail widget'ı
   ========================================================================== */

.dashboard-mail-panel .dash-mail-row:last-child {
    margin-bottom: 0;
}

.dash-mail-row {
    display: grid;
    grid-template-columns: 82px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    margin-bottom: 8px;
    color: inherit;
    transition: background .14s ease, border-color .14s ease;
}

.dash-mail-row:hover {
    background: var(--table-hover);
    border-color: var(--jewel-charcoal, var(--navy));
}

.dash-mail-date {
    font-size: .82rem;
    font-weight: 800;
    color: var(--gold);
}

.dash-mail-country {
    font-weight: 700;
    color: var(--navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-mail-count {
    font-size: .82rem;
    color: var(--muted);
    white-space: nowrap;
}

.dash-mail-status {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
}

.dash-mail-status svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dash-mail-status-ok svg {
    stroke: #1f6f35;
}

.dash-mail-status-fail svg {
    stroke: #a1291f;
}

@media (max-width: 640px) {
    .dash-mail-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "date status"
            "country status"
            "count status";
    }

    .dash-mail-date {
        grid-area: date;
    }

    .dash-mail-country {
        grid-area: country;
    }

    .dash-mail-count {
        grid-area: count;
    }

    .dash-mail-status {
        grid-area: status;
    }
}

/* ==========================================================================
   Satın alma detay: ürün görseli
   ========================================================================== */

.purchase-image-section {
    display: grid;
    gap: 10px;
}

.purchase-image-heading {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.purchase-image-input {
    display: none;
}

.purchase-image-drop {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 14px 16px;
    border: 2px dashed color-mix(in srgb, var(--jewel-gold, var(--gold)) 45%, var(--jewel-line, var(--line)));
    border-radius: 12px;
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 5%, var(--panel));
    cursor: pointer;
    text-align: center;
    transition: border-color .14s ease, background .14s ease;
}

.purchase-image-drop:hover {
    border-color: var(--jewel-gold, var(--gold));
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 10%, var(--panel));
}

.purchase-image-drop.is-busy {
    opacity: .6;
    pointer-events: none;
}

.purchase-image-drop svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--jewel-gold, var(--gold));
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.purchase-image-drop strong {
    color: var(--jewel-ink, var(--navy));
    font-size: .9rem;
    font-weight: 800;
}

.purchase-image-drop small {
    color: var(--muted);
    font-size: .74rem;
}

.purchase-image-frame {
    position: relative;
    border-radius: 12px;
}

.purchase-image-preview {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .14s ease, box-shadow .14s ease;
}

.purchase-image-preview:hover {
    border-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 55%, var(--jewel-line, var(--line)));
    box-shadow: 0 6px 18px var(--shadow);
}

.purchase-image-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 220px;
    object-fit: cover;
}

.purchase-image-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: rgba(24, 28, 31, .72);
    color: #ffb4b4;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease;
}

.purchase-image-frame:hover .purchase-image-delete,
.purchase-image-delete:focus-visible {
    opacity: 1;
}

.purchase-image-delete:hover {
    background: #a1291f;
    color: #ffffff;
}

.purchase-image-delete svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Dokunmatik cihazlarda hover olmadığı için silme düğmesi hep görünür. */
@media (hover: none) {
    .purchase-image-delete {
        opacity: 1;
    }
}

.purchase-image-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: default;
}

.purchase-image-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 45;
    display: grid;
    min-width: 200px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 16px 44px rgba(20, 24, 27, .3);
    overflow: hidden;
    animation: modal-pop-in .16s ease;
}

.purchase-image-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--jewel-ink, var(--navy));
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: background .14s ease;
}

.purchase-image-menu-item + .purchase-image-menu-item {
    border-top: 1px solid var(--jewel-line, var(--line));
}

.purchase-image-menu-item:hover {
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 12%, var(--panel));
}

.purchase-image-menu-item svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--jewel-gold, var(--gold));
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-theme="dark"] .purchase-image-drop {
    border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
    background: color-mix(in srgb, var(--gold) 7%, var(--panel));
}

:root[data-theme="dark"] .purchase-image-drop strong {
    color: var(--ink);
}

:root[data-theme="dark"] .purchase-image-preview,
:root[data-theme="dark"] .purchase-image-menu,
:root[data-theme="dark"] .purchase-image-menu-item + .purchase-image-menu-item {
    border-color: var(--line);
}

:root[data-theme="dark"] .purchase-image-menu {
    background: var(--panel);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
}

:root[data-theme="dark"] .purchase-image-menu-item {
    color: var(--ink);
}

/* Menü öğesi artık button da olabildiği için form reset'i gerekiyor. */
button.purchase-image-menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}

/* --- Müşteri fotoğrafı (hero'da, küçük yuvarlak) --- */

.customer-hero-photo {
    position: relative;
    flex-shrink: 0;
    z-index: 2;
}

.customer-hero-photo-drop {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 2px dashed rgba(255, 255, 255, .55);
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease;
}

.customer-hero-photo-drop:hover {
    border-color: #d9c3a0;
    background: rgba(217, 195, 160, .24);
}

.customer-hero-photo-drop.is-busy {
    opacity: .6;
    pointer-events: none;
}

.customer-hero-photo-drop svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.customer-hero-photo-frame {
    position: relative;
    width: 58px;
    height: 58px;
}

.customer-hero-photo-preview {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 2px solid rgba(217, 195, 160, .8);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .14s ease, box-shadow .14s ease;
}

.customer-hero-photo-preview:hover {
    border-color: #d9c3a0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

.customer-hero-photo-preview:disabled {
    cursor: wait;
    opacity: .6;
}

.customer-hero-photo-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Menü küçük dairenin altında açılır; hero'nun dışına taşabilir. */
.customer-hero-photo .customer-hero-photo-menu {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
}

@media (max-width: 640px) {
    .customer-hero-photo-drop,
    .customer-hero-photo-frame {
        width: 46px;
        height: 46px;
    }

    .customer-hero-photo-drop svg {
        width: 19px;
        height: 19px;
    }

    .customer-hero-photo .customer-hero-photo-menu {
        left: 0;
        transform: none;
    }
}

/* --- Tam ekran görsel (lightbox): siyah değil, transparan + blur arka plan --- */

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(30, 36, 40, .3);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: modal-fade-in .15s ease;
}

.image-lightbox img {
    max-width: min(1100px, 100%);
    max-height: 100%;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 20, 18, .45);
    object-fit: contain;
    animation: modal-pop-in .18s ease;
}

.image-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 12px;
    background: rgba(24, 28, 31, .55);
    color: #ffffff;
    cursor: pointer;
    transition: background .14s ease, transform .14s ease;
}

.image-lightbox-close:hover {
    background: rgba(24, 28, 31, .8);
    transform: scale(1.05);
}

.image-lightbox-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}

:root[data-theme="dark"] .image-lightbox {
    background: rgba(7, 22, 25, .35);
}

@media (max-width: 640px) {
    .image-lightbox {
        padding: 16px;
    }

    .image-lightbox-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    /* Detay sayfasındaki önizleme mobilde tam genişlikte fazla yer kaplıyordu. */
    .purchase-image-preview {
        max-width: 240px;
        margin: 0 auto;
    }

    .purchase-image-preview img {
        aspect-ratio: 16 / 9;
    }

    .purchase-image-frame {
        display: grid;
        justify-items: center;
    }

    .purchase-image-delete {
        top: 6px;
        right: calc(50% - 114px);
    }
}

/* ==========================================================================
   Anımsatıcı bildirimleri (üstten gelen toast'lar)
   ========================================================================== */

.reminder-toast-stack {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(440px, calc(100vw - 24px));
    pointer-events: none;
}

/* Açık temada sarı (altın), koyu temada kırmızı arka plan: koyu hero/panel
   üzerinde kaybolmasın, dikkat çeksin. */
.reminder-toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #c9a24d;
    border-radius: 12px;
    background: #f6dfa0;
    box-shadow: 0 14px 40px rgba(20, 24, 27, .28);
    pointer-events: auto;
    animation: reminder-toast-in .25s ease;
}

@keyframes reminder-toast-in {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}

.reminder-toast-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .5);
    border: 1px solid #c9a24d;
}

.reminder-toast-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #8a6414;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reminder-toast-body {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.reminder-toast-body strong {
    color: #4d3718;
    font-size: .9rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reminder-toast-body small {
    color: #6d5720;
    font-size: .76rem;
    font-weight: 700;
}

.reminder-toast-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reminder-toast-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(77, 55, 24, .35);
    border-radius: 8px;
    background: transparent;
    color: #6d5720;
    cursor: pointer;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.reminder-toast-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reminder-toast-btn:hover {
    background: rgba(255, 255, 255, .55);
    color: #3f2f12;
}

.reminder-toast-done:hover {
    color: #1f6f35;
    border-color: #b7e4c7;
    background: #dcf5e3;
}

:root[data-theme="dark"] .reminder-toast {
    background: #5f1b14;
    border-color: #a14237;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}

:root[data-theme="dark"] .reminder-toast-icon {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(242, 184, 174, .45);
}

:root[data-theme="dark"] .reminder-toast-icon svg {
    stroke: #f2b8ae;
}

:root[data-theme="dark"] .reminder-toast-body strong {
    color: #ffe3de;
}

:root[data-theme="dark"] .reminder-toast-body small {
    color: #f0b3aa;
}

:root[data-theme="dark"] .reminder-toast-btn {
    border-color: rgba(255, 255, 255, .3);
    color: #f0b3aa;
}

:root[data-theme="dark"] .reminder-toast-btn:hover {
    background: rgba(0, 0, 0, .25);
    color: #ffffff;
}

:root[data-theme="dark"] .reminder-toast-done:hover {
    color: #55c878;
    border-color: #2a5a3a;
    background: #12332a;
}

@media (max-width: 560px) {
    .reminder-toast-stack {
        top: 72px;
    }
}

/* ==========================================================================
   İşlemlerim sayfası
   ========================================================================== */

.islem-filter-card {
    grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(150px, .65fr));
}

.islem-list-card {
    padding: 14px;
}

.islem-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.islem-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 10px;
    background: var(--panel);
    cursor: pointer;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.islem-row:hover,
.islem-row:focus-visible {
    border-color: color-mix(in srgb, var(--jewel-gold, var(--gold)) 45%, var(--jewel-line, var(--line)));
    box-shadow: 0 4px 14px var(--shadow);
    transform: translateY(-1px);
    outline: none;
}

.islem-check {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid color-mix(in srgb, var(--jewel-gold, var(--gold)) 55%, var(--jewel-line, var(--line)));
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease;
}

.islem-check svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity .14s ease;
}

.islem-check:hover {
    border-color: var(--jewel-gold, var(--gold));
}

.islem-row.is-done .islem-check {
    border-color: var(--jewel-gold, var(--gold));
    background: var(--jewel-gold, var(--gold));
}

.islem-row.is-done .islem-check svg {
    opacity: 1;
}

.islem-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.islem-title {
    font-weight: 800;
    color: var(--jewel-ink, var(--navy));
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.islem-desc {
    font-size: .84rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.islem-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.islem-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
}

.islem-chip svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.islem-chip-tip {
    color: #6d5a3a;
    background: color-mix(in srgb, var(--jewel-gold, var(--gold)) 16%, var(--panel));
    border: 1px solid color-mix(in srgb, var(--jewel-gold, var(--gold)) 36%, var(--jewel-line, var(--line)));
}

.islem-chip-remind {
    color: #55606b;
    background: var(--soft);
    border: 1px solid var(--line);
}

.islem-chip-remind.is-overdue {
    color: #a1291f;
    background: #fbe9e7;
    border-color: #f0c4bf;
}

.islem-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.islem-date {
    font-size: .8rem;
    font-weight: 800;
    color: var(--muted);
    white-space: nowrap;
}

.islem-amount {
    font-size: 1rem;
    font-weight: 900;
    color: var(--jewel-ink, var(--ink));
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.islem-amount small {
    margin-left: 4px;
    font-size: .7rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: .04em;
}

/* tamamlanan satırlar */
.islem-row.is-done .islem-title,
.islem-row.is-done .islem-desc {
    text-decoration: line-through;
    color: var(--muted);
}

.islem-row.is-done {
    opacity: .72;
}

/* düzenleme modalı */
.islem-modal {
    max-width: 640px;
}

.islem-modal-form {
    padding: 0;
}

.islem-modal-form textarea {
    width: 100%;
    min-height: 84px;
    padding: 9px 11px;
    border: 1px solid var(--jewel-line, var(--line));
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    resize: vertical;
}

.islem-modal-form .check-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    accent-color: var(--jewel-gold, var(--gold));
}

.islem-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    font-size: .8rem;
    color: var(--muted);
}

.islem-modal-footer .islem-modal-footer-gap {
    flex: 1;
}

.modal-btn-danger {
    color: #a1291f;
    border-color: color-mix(in srgb, #a1291f 35%, var(--jewel-line, var(--line)));
}

.modal-btn-danger:hover:not(:disabled) {
    background: #fbe9e7;
}

/* Koyu mod */
:root[data-theme="dark"] .islem-row {
    background: var(--panel);
    border-color: var(--line);
}

:root[data-theme="dark"] .islem-title {
    color: var(--ink);
}

:root[data-theme="dark"] .islem-check {
    background: var(--soft);
}

:root[data-theme="dark"] .islem-row.is-done .islem-check {
    background: var(--gold);
    border-color: var(--gold);
}

:root[data-theme="dark"] .islem-row.is-done .islem-check svg {
    stroke: #10262b;
}

:root[data-theme="dark"] .islem-chip-tip {
    color: var(--gold);
}

:root[data-theme="dark"] .islem-chip-remind {
    color: var(--muted);
}

:root[data-theme="dark"] .islem-chip-remind.is-overdue {
    color: #ffb4b4;
    background: #3a1518;
    border-color: #6f2a2f;
}

:root[data-theme="dark"] .islem-amount {
    color: var(--ink);
}

:root[data-theme="dark"] .modal-btn-danger {
    color: #ffb4b4;
    border-color: color-mix(in srgb, #ffb4b4 35%, var(--line));
}

:root[data-theme="dark"] .modal-btn-danger:hover:not(:disabled) {
    background: #3a1518;
}

/* ==========================================================================
   İşlemler sayfası mobil düzeni
   ========================================================================== */

/* Filtre kartı: genel 1100px kuralını .islem-filter-card'ın kendi 3 kolonlu
   kuralı eziyordu; mobilde önce 2, sonra 1 kolona düşür. */
@media (max-width: 900px) {
    .islem-filter-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .islem-filter-card .erp-search-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .islem-filter-card {
        grid-template-columns: 1fr;
    }

    .islem-list-card {
        padding: 10px;
    }

    .islem-row {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 8px 12px;
        padding: 10px 12px;
    }

    /* Başlık ve açıklama tek satır kesme yerine sarsın. */
    .islem-title,
    .islem-desc {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
    }

    /* Tarih + tutar sağ kolondan çıkıp içeriğin altına yatay geçer. */
    .islem-side {
        grid-column: 2;
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        margin-top: 2px;
        padding-top: 8px;
        border-top: 1px dashed var(--jewel-line, var(--line));
    }

    /* Modal: dar ekranda alanlar tek kolon, panel ekrana sığsın. */
    .modal-overlay {
        padding: 10px;
    }

    .islem-modal {
        max-height: calc(100dvh - 20px);
    }

    .islem-modal .field-grid {
        grid-template-columns: 1fr;
    }

    .islem-modal-footer {
        gap: 8px;
    }

    .islem-modal-footer .modal-btn {
        flex: 1;
        justify-content: center;
    }

    .islem-modal-footer .islem-modal-footer-gap {
        display: none;
    }
}