/* Case page — layout rebuilt: flex/grid, tablet shell tokens, no float hacks */

.tablet-page.case-page {
    --case-gap: 10px;
    --case-card-radius: var(--tablet-box-radius, 12px);
    --case-card-border: var(--tablet-box-border, rgba(255, 255, 255, 0.06));
    --case-card-bg: var(
        --tablet-box-bg,
        linear-gradient(165deg, rgba(22, 24, 28, 0.95), rgba(12, 14, 18, 0.92))
    );
    --case-card-shadow: var(--tablet-box-shadow, 0 4px 14px rgba(0, 0, 0, 0.22));
    color: var(--text-color);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    gap: 0;
    overflow: hidden;
}

/* index.css .tablet-bg > .tablet-page { overflow-y: auto } case içeriğini tablet dışına taşırabiliyor — case sayfasında taşmayı kes */
.tablet-bg > .tablet-page.case-page {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

.case-page-layout {
    flex: 1 1 0%;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--case-gap);
    box-sizing: border-box;
    overflow: hidden;
}

.case-page-top {
    flex-shrink: 0;
    min-height: 0;
}

.case-page-top-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--case-gap);
    align-items: stretch;
}

/* Grid: satır yüksekliği = layout’ta kalan alan; flex-basis 0 ile tablet yüksekliğini aşmaz */
.case-page-body {
    flex: 1 1 0%;
    height: 0;
    min-height: 0;
    max-height: none;
    min-width: 0;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 300px);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--case-gap);
    align-items: stretch;
    overflow: hidden;
}

.case-page-main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--case-gap);
    overflow: hidden;
}

/* —— Balance + deposit/withdraw —— */
.tablet-page-case-page-totalbalance-wrapper,
.tablet-page-case-page-section-wrapper {
    float: none;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    left: auto;
    top: auto;
    padding: 14px 16px;
    border-radius: var(--case-card-radius);
    border: 1px solid var(--case-card-border);
    background: var(--case-card-bg);
    box-shadow: var(--case-card-shadow);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tablet-page-case-page-totalbalance-header {
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    font-size: clamp(0.68rem, 1.1vh, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.75;
}

.tablet-page-case-page-totalbalance-balance {
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    font-size: clamp(2.35rem, 10.4vh, 2.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3%;
    white-space: nowrap;
}

.tablet-page-case-page-input {
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 100%;
    margin: 0;
    height: auto;
    min-height: 40px;
    padding: 10px 12px;
    text-align: center;
    font-size: clamp(0.85rem, 1.35vh, 1rem);
    font-weight: 600;
    color: var(--text-color);
    box-sizing: border-box;
}

.tablet-page-case-page-section-button-wrapper {
    width: 100%;
    margin: 0;
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    height: auto;
}

.tablet-page-case-page-section-button {
    float: none;
    width: auto;
    height: auto;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(0.72rem, 1.1vh, 0.85rem);
    font-weight: 600;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.tablet-page-case-page-section-button:hover {
    background: var(--hover-bg, rgba(255, 255, 255, 0.08));
    border-color: var(--hover-border, rgba(255, 255, 255, 0.18));
    font-weight: 700;
}

/* —— Graph / invoice segmented control —— */
.tablet-page-case-page-select-boxes {
    float: none;
    width: 100%;
    height: auto;
    min-height: 44px;
    flex-shrink: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--case-card-border);
    background: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.tablet-page-case-page-select-box {
    flex: 1;
    margin: 0;
    width: auto;
    height: auto;
    min-height: 40px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.72rem, 1.1vh, 0.85rem);
    font-weight: 600;
    color: var(--text-color);
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.tablet-page-case-page-select-box:hover {
    color: var(--button-color, #7cb9ff);
    background: rgba(255, 255, 255, 0.04);
}

.selectedCaseAppSide {
    color: var(--text-color, #fff);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--hover-border, rgba(255, 255, 255, 0.2));
}

/* —— Main panel (graph + invoice stack) —— */
.tablet-page-case-page-altbox-wrapper {
    float: none;
    width: 100%;
    flex: 1;
    min-height: 180px;
    max-height: none;
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--case-card-radius);
    border: 1px solid var(--case-card-border);
    background: var(--case-card-bg);
    box-shadow: var(--case-card-shadow);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tablet-page-case-page-graph,
.tablet-page-case-page-altbox-invoice {
    flex: 1;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.tablet-page-case-page-graph {
    float: none;
    padding: 8px 4px 4px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    color: var(--text-color);
    min-height: 0;
    overflow: hidden;
}

.case-page-chart-host.caseApp-graph[style*="flex"],
.case-page-chart-host.caseApp-graph[style*="block"] {
    display: flex !important;
}

.tablet-page-case-page-graph.card-body {
    background: transparent;
}

.case-page-chart-inner {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

#myChart {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
}

/* Invoice sub-panel */
.tablet-page-case-page-altbox-invoice {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    min-height: 0;
    overflow: hidden;
}

.tablet-page-case-page-altbox-invoice.caseApp-invoice[style*="flex"],
.tablet-page-case-page-altbox-invoice.caseApp-invoice[style*="block"] {
    display: flex !important;
}

.tablet-page-case-page-altbox-invoice-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tablet-page-case-page-altbox-invoice-search-wrapper {
    float: none;
    flex: 1;
    min-width: 140px;
    max-width: 100%;
    height: auto;
    min-height: 40px;
    margin: 0;
    top: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    box-sizing: border-box;
}

.tablet-page-case-page-altbox-invoice-search-icon {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.55;
    flex-shrink: 0;
}

.tablet-page-case-page-altbox-invoice-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    border-bottom: none;
    background: transparent;
    color: var(--text-color);
    font-size: clamp(0.72rem, 1.05vh, 0.85rem);
}

.tablet-page-case-page-altbox-create-invoice {
    float: none;
    width: auto;
    max-width: none;
    height: auto;
    min-height: 40px;
    margin: 0;
    margin-left: auto;
    top: auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    font-size: clamp(0.68rem, 1vh, 0.8rem);
    font-weight: 600;
    text-align: center;
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
}

.tablet-page-case-page-altbox-create-invoice:hover {
    background: var(--hover-bg, rgba(255, 255, 255, 0.1));
    border-color: var(--hover-border, rgba(255, 255, 255, 0.22));
}

.tablet-page-case-page-altbox-invoice-wrapper {
    width: 100%;
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
}

#invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-wrapper {
    white-space: nowrap;
}

.tableTH {
    font-size: clamp(0.58rem, 0.85vh, 0.68rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: rgba(14, 16, 20, 0.96);
    z-index: 1;
}

.tableTD {
    font-size: clamp(0.62rem, 0.9vh, 0.74rem);
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 9px 7px;
    vertical-align: middle;
}

.tableTD:last-child,
.tableTH:last-child {
    border-right: none;
}

.invoice-unpaid {
    background: rgba(255, 25, 25, 0.12);
    border-radius: 999px;
    border: 1px solid rgba(255, 80, 80, 0.45);
    font-size: clamp(0.52rem, 0.75vh, 0.62rem);
    font-weight: 700;
    text-align: center;
}

.invoice-paid {
    background: rgba(60, 160, 70, 0.18);
    border-radius: 999px;
    font-size: clamp(0.52rem, 0.75vh, 0.62rem);
    font-weight: 700;
    border: 1px solid rgba(120, 220, 130, 0.45);
}

.case-invoice-row-menu {
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

.case-invoice-row-menu:hover {
    background: rgba(255, 255, 255, 0.06);
}

.popup {
    display: none;
    position: fixed;
    background: linear-gradient(180deg, #121212, #0e0e0e);
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 10px;
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 2000;
    color: #eaeaea;
    min-width: 160px;
}

.popup.hidden {
    display: none;
}

.popup ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.popup ul li {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
}

.popup ul li:last-child {
    border-bottom: none;
}

.popup ul li:hover {
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

/* —— History: grid hücresi = satır yüksekliği; taşma hidden + dikey scroll —— */
.tablet-page-case-page-history.case-page-history,
.tablet-page-case-page-history {
    float: none;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    align-self: stretch;
    contain: size;
    position: relative;
    left: auto;
    top: auto;
    margin: 0;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: var(--case-card-radius);
    border: 1px solid var(--case-card-border);
    background: var(--case-card-bg);
    box-shadow: var(--case-card-shadow);
    box-sizing: border-box;
}

.tablet-page-case-page-history.case-page-history > *,
.tablet-page-case-page-history > * {
    min-width: 0;
    max-width: 100%;
}

/* Geçmiş satırı: ikon + metin sütunu (flex); grid+center üst üste bindiriyordu */
.tablet-page-case-page-box {
    float: none;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    flex-shrink: 0;
    margin: 0;
    padding: 10px 10px 10px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.12));
    color: var(--text-color);
    box-sizing: border-box;
}

.tablet-page-case-page-box-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.tablet-page-case-page-box-icon {
    float: none;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border-radius: 10px;
}

.depositBoxIcon {
    color: #0a8f3a;
    background: linear-gradient(145deg, rgba(80, 220, 140, 0.25), rgba(40, 120, 70, 0.15));
}

.withdrawBoxIcon {
    color: #e0454a;
    background: linear-gradient(145deg, rgba(255, 120, 120, 0.22), rgba(160, 40, 50, 0.12));
}

.tablet-page-case-page-box-header {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    font-weight: 600;
    font-size: clamp(0.65rem, 1.05vh, 0.8rem);
    text-align: left;
    line-height: 1.45;
    white-space: normal;
    opacity: 0.9;
    border-radius: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tablet-page-case-page-box-label {
    float: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-bottom: none;
    font-size: clamp(0.62rem, 0.95vh, 0.76rem);
    font-weight: 500;
    text-align: left;
    line-height: 1.4;
    white-space: normal;
    opacity: 0.82;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tablet-page-case-page-box-body > .tablet-page-case-page-box-label:last-of-type {
    font-weight: 700;
    font-size: clamp(0.72rem, 1.08vh, 0.9rem);
    opacity: 1;
}

.depositBoxAmount {
    color: #5ee08a !important;
}

.withdrawBoxAmount {
    color: #ff7a7e !important;
}

.tablet-page-case-page-box-amount {
    width: auto;
    margin: 0;
}

/* —— Invoice creator overlay (aligned with case page + tablet tokens) —— */
.tablet-page.case-page .tablet-page-case-page-invoice-creator {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 999;
    margin: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2.5vh, 22px);
    box-sizing: border-box;
    border: 1px solid var(--case-card-border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);  
    background: rgb(12 12 12 / 58%);
    backdrop-filter: blur(6px);
}

.tablet-page.case-page .tablet-page-case-page-invoice-creator .tablet-page-case-page-invoice-creator-box {
    width: min(560px, calc(100% - 20px));
    max-height: min(90vh, 720px);
    height: auto;
    margin: 0;
    padding: 14px 16px 12px;
    /* background: var(--case-card-bg); */
    border-radius: var(--case-card-radius);
    border: 1px solid var(--case-card-border);
    box-shadow: var(--case-card-shadow), 0 18px 44px rgba(0, 0, 0, 0.32);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    box-sizing: border-box;
    background: radial-gradient(165% 115% at 95% 10%, rgba(255, 255, 255, 0.08), transparent 57%), radial-gradient(120% 90% at 6% 95%, rgba(255, 255, 255, 0.06), transparent 61%), linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.24));
}

.case-invoice-creator-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 1100px) {
    .case-invoice-creator-fields {
        grid-template-columns: 1fr;
    }
}

.tablet-page-case-page-invoice-creator-form {
    float: none;
    position: relative;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 10px 10px 8px;
    background: var(--tablet-box-bg, linear-gradient(180deg, rgba(20, 20, 21, 0.35), rgba(12, 12, 13, 0.12)));
    border-radius: var(--tablet-box-radius, 12px);
    border: 1px solid var(--tablet-box-border, rgba(255, 255, 255, 0.06));
    box-shadow: var(--tablet-box-shadow, 0 2px 10px rgba(0, 0, 0, 0.12));
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-sizing: border-box;
}

.tablet-page-case-page-invoice-creator-form-header {
    width: auto;
    height: auto;
    margin: 0;
    font-size: clamp(0.68rem, 1.05vh, 0.8rem);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tablet-page-case-page-invoice-creator-form-label {
    width: auto;
    height: auto;
    margin: 0;
    font-size: clamp(0.58rem, 0.88vh, 0.68rem);
    font-weight: 500;
    opacity: 0.75;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tablet-page-case-page-invoice-creator-form-input {
    width: 100%;
    margin: 4px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-color);
    font-size: clamp(0.72rem, 1.05vh, 0.86rem);
    box-sizing: border-box;
    outline: none;
}

.tablet-page-case-page-invoice-creator-form-input:focus {
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#type-selector,
.type-selector {
    width: 100%;
    margin: 6px 0 0;
    min-height: 36px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-align: center;
    color: var(--text-color);
    font-size: clamp(0.68rem, 1vh, 0.8rem);
    cursor: pointer;
    box-sizing: border-box;
}

#type-selector:hover,
.type-selector:hover {
    border-color: var(--hover-border, rgba(255, 255, 255, 0.22));
}

.type-options {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: auto;
    margin-top: 6px;
    z-index: 50;
    padding: 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, #121212, #0e0e0e);
    border: 1px solid rgb(255 255 255 / 8%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.type-option {
    padding: 10px 12px;
    margin: 4px 0 0;
    border-radius: 8px;
    font-size: clamp(0.72rem, 1.05vh, 0.85rem);
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease;
    cursor: pointer;
}

.type-option:first-child {
    margin-top: 0;
}

.type-option:hover {
    background: var(--hover-bg, rgba(255, 255, 255, 0.1));
    font-weight: 600;
}

.tablet-page-case-page-invoice-creator-form-wrapper {
    float: none;
    width: 100%;
    flex: 1;
    flex-shrink: 1;
    min-height: 120px;
    max-height: min(36vh, 280px);
    margin: 0;
    padding: 8px;
    position: relative;
    background: var(--tablet-box-bg, linear-gradient(180deg, rgba(20, 20, 21, 0.28), rgba(12, 12, 13, 0.1)));
    border-radius: var(--tablet-box-radius, 12px);
    border: 1px solid var(--tablet-box-border, rgba(255, 255, 255, 0.06));
    box-shadow: var(--tablet-box-shadow, 0 2px 10px rgba(0, 0, 0, 0.12));
    overflow: auto;
    box-sizing: border-box;
}

.tablet-page-case-page-invoice-creator-form-box {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0 0 8px;
    display: grid;
    grid-template-columns: minmax(48px, 64px) minmax(0, 1fr) minmax(72px, 96px) 40px;
    gap: 8px;
    align-items: center;
    box-sizing: border-box;
}

.case-invoice-creator-form-box-static {
    opacity: 0.95;
}

.case-invoice-creator-form-box-static .case-invoice-creator-line-spacer {
    pointer-events: none;
}

.case-invoice-creator-line-spacer {
    width: 40px;
    height: 40px;
    margin: 0;
    box-sizing: border-box;
}

.tablet-page-case-page-invoice-creator-form-box:last-child {
    margin-bottom: 0;
}

.case-invoice-creator-footer {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.tablet-page-case-page-invoice-creator-totalamount {
    position: relative;
    float: none;
    width: auto;
    height: auto;
    top: auto;
    margin: 0;
    text-align: left;
    flex: 1 1 auto;
    min-width: min(100%, 140px);
}

.tablet-page-case-page-invoice-creator-totalamount-header {
    font-weight: 600;
    font-size: clamp(0.68rem, 1vh, 0.8rem);
    opacity: 0.78;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tablet-page-case-page-invoice-creator-totalamount-amount {
    font-weight: 700;
    font-size: clamp(1rem, 1.6vh, 1.28rem);
    color: #8ef5c4;
    text-shadow: 0 0 18px rgba(94, 224, 172, 0.22);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Onay / geri — gruplu dock, ikon + metin hizası */
.tablet-page-case-page-invoice-creator-boxes {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    position: relative;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    box-sizing: border-box;
}

.tablet-page-case-page-invoice-creator-boxes-box {
    margin: 0;
    width: auto;
    min-width: 128px;
    max-width: 100%;
    height: auto;
    min-height: 44px;
    padding: 10px 14px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: clamp(0.72rem, 1.05vh, 0.86rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 10px;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.12s ease;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

.tablet-page-case-page-invoice-creator-boxes-box i {
    flex-shrink: 0;
    font-size: 1.05em;
    opacity: 0.92;
}

.tablet-page-case-page-invoice-creator-boxes-box:focus-visible {
    outline: 2px solid rgba(142, 245, 196, 0.55);
    outline-offset: 2px;
}

.tablet-page-case-page-invoice-creator-boxes-box:active {
    transform: translateY(1px);
}

.invoiceCreatorConfirm {
    color: #fff;
    padding: 14px;
    background: linear-gradient(165deg, rgba(62, 168, 118, 0.95), rgba(36, 120, 82, 0.98));
    border-color: rgba(142, 245, 196, 0.35);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 4px 14px rgba(0, 0, 0, 0.28);
}

.invoiceCreatorConfirm:hover {
    background: linear-gradient(165deg, rgba(78, 188, 136, 1), rgba(44, 138, 96, 1));
    border-color: rgba(180, 255, 220, 0.45);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 6px 18px rgba(0, 0, 0, 0.32);
}

.invoiceCreatorReturn {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.invoiceCreatorReturn:hover {
    color: #fff;
    background: rgba(255, 96, 96, 0.14);
    border-color: rgba(255, 140, 140, 0.38);
    box-shadow: 0 0 0 1px rgba(255, 100, 100, 0.12);
}

/* Şirket kasasından öde — onay butonu ile aynı mint/yeşil UI dilinde (toplam tutar #8ef5c4 ailesi) */
.tablet-page-case-page-invoice-creator-boxes-box.invoiceCasePayBtn {
    color: #fff;
    padding: 12px 14px;
    min-width: min(100%, 152px);
    max-width: min(100%, 280px);
    white-space: normal;
    line-height: 1.28;
    text-align: center;
    background: linear-gradient(165deg, rgba(62, 168, 118, 0.95), rgba(36, 120, 82, 0.98));
    border-color: rgba(142, 245, 196, 0.35);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 4px 14px rgba(0, 0, 0, 0.28);
}

.tablet-page-case-page-invoice-creator-boxes-box.invoiceCasePayBtn i {
    color: rgba(200, 255, 228, 0.95);
    opacity: 0.95;
    filter: none;
}

.tablet-page-case-page-invoice-creator-boxes-box.invoiceCasePayBtn:hover {
    background: linear-gradient(165deg, rgba(78, 188, 136, 1), rgba(44, 138, 96, 1));
    border-color: rgba(180, 255, 220, 0.45);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 6px 18px rgba(0, 0, 0, 0.32);
}

.tablet-page-case-page-invoice-creator-boxes-box.invoiceCasePayBtn:focus-visible {
    outline: 2px solid rgba(142, 245, 196, 0.55);
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .case-invoice-creator-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tablet-page-case-page-invoice-creator-boxes {
        width: 100%;
        justify-content: stretch;
    }

    .tablet-page-case-page-invoice-creator-boxes-box {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }

    .tablet-page-case-page-invoice-creator-boxes-box.invoiceCasePayBtn {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.tablet-page-case-invoice-creator-form-box-qty {
    width: 100%;
    min-width: 0;
    margin: 0;
    outline: none;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-align: center;
    padding: 8px 6px;
    color: var(--text-color);
    font-size: clamp(0.7rem, 1vh, 0.82rem);
    box-sizing: border-box;
}

.tablet-page-case-invoice-creator-form-box-header {
    width: 100%;
    min-width: 0;
    margin: 0;
    outline: none;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-align: left;
    padding: 8px 10px;
    color: var(--text-color);
    font-size: clamp(0.7rem, 1vh, 0.82rem);
    box-sizing: border-box;
}

.tablet-page-case-invoice-creator-form-box-price {
    width: 100%;
    min-width: 0;
    margin: 0;
    outline: none;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-align: center;
    padding: 8px 6px;
    color: var(--text-color);
    font-size: clamp(0.7rem, 1vh, 0.82rem);
    box-sizing: border-box;
}

div.tablet-page-case-invoice-creator-form-box-qty,
div.tablet-page-case-invoice-creator-form-box-header,
div.tablet-page-case-invoice-creator-form-box-price {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
}

div.tablet-page-case-invoice-creator-form-box-header {
    justify-content: flex-start;
}

.tablet-page-case-page-invoice-creator-form-box-delete {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 80, 80, 0.15);
    border: 1px solid rgba(255, 120, 120, 0.35);
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.tablet-page-case-page-invoice-creator-form-box-delete:hover {
    background: rgba(255, 80, 80, 0.28);
}

/* Legacy header (if used elsewhere) */
.tablet-page-case-header {
    position: relative;
    width: 100%;
    min-height: 0;
    padding: 0 0 8px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    font-size: clamp(1rem, 2vh, 1.35rem);
    font-weight: 600;
}

.tablet-page-case-header-back-icon {
    background: rgba(255, 255, 255, 0.08);
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
    border-radius: 10px;
    margin: 0 10px 0 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, background 0.15s ease;
    cursor: pointer;
}

.tablet-page-case-header-back-icon:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.12);
}

/* Narrow tablet: üstte ana+grafik (1fr), altta geçmiş (sınırlı yükseklik + scroll) */
@media (max-width: 900px) {
    .case-page-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) clamp(220px, 40vh, 400px);
        height: 0;
    }

    .case-page-main {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        max-height: 100%;
        height: 100%;
    }

    .tablet-page-case-page-history.case-page-history,
    .tablet-page-case-page-history {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        max-width: none;
        min-height: 0;
        height: 100%;
        max-height: 100%;
    }
}
