* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background: #181818;
    color: white;
    font-family: Meiryo, sans-serif;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

a {
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    min-height: 100vh;
}

/* =========================
   上部ナビ
========================= */

.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;

    padding: 10px 16px;

    background: rgba(31, 31, 31, 0.96);
    border-bottom: 1px solid #3b3b3b;
    backdrop-filter: blur(8px);
}

.top-nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 14px;

    color: #bdbdbd;
    border-radius: 8px;

    text-decoration: none;
    font-size: 14px;
    font-weight: bold;

    transition:
        color 0.15s,
        background 0.15s,
        transform 0.15s;
}

.top-nav-link:hover {
    color: white;
    background: #333;
    transform: translateY(-1px);
}

.top-nav-link.active {
    color: #ffce54;
    background: #383224;
}

.top-nav-link.active::after {
    content: "";

    position: absolute;
    right: 12px;
    bottom: 3px;
    left: 12px;

    height: 2px;

    background: #d4af37;
    border-radius: 2px;
}

/* =========================
   下部ナビ
========================= */

.bottom-nav {
    display: none;
}

.bottom-nav-link {
    display: flex;
    min-width: 0;

    align-items: center;
    justify-content: center;
    flex: 1;
    flex-direction: column;
    gap: 3px;

    padding: 8px 3px;

    color: #999;
    text-decoration: none;
    font-size: 11px;

    transition:
        color 0.15s,
        background 0.15s;
}

.bottom-nav-link.active {
    color: #ffce54;
}

.bottom-nav-icon {
    font-size: 21px;
    line-height: 1;
    transition: transform 0.15s;
}

.bottom-nav-link.active .bottom-nav-icon {
    transform: translateY(-1px) scale(1.1);
}

/* =========================
   基本レイアウト
========================= */

.container {
    width: 92%;
    max-width: 850px;
    margin: 30px auto;
}

.header {
    margin-bottom: 24px;
    text-align: center;
}

.header-icon {
    margin-bottom: 6px;
    font-size: 38px;
}

h1 {
    margin: 0;
    font-size: 30px;
}

h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.subtitle {
    margin-top: 8px;
    color: #aaa;
    font-size: 14px;
}

/* =========================
   ホームメニュー
========================= */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.menu-button {
    display: flex;
    min-height: 82px;
    padding: 16px;

    align-items: center;
    justify-content: center;
    gap: 9px;

    background: #292929;
    color: white;

    border: 1px solid #393939;
    border-radius: 13px;

    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;

    transition:
        transform 0.15s,
        border-color 0.15s,
        background 0.15s;
}

.menu-button:hover {
    transform: translateY(-2px);
    background: #333;
    border-color: #d4af37;
}

.menu-icon {
    font-size: 22px;
}

/* =========================
   カード
========================= */

.card {
    margin-bottom: 20px;
    padding: 20px;

    background: #292929;
    border: 1px solid #333;
    border-radius: 14px;

    box-shadow: 0 0 14px rgba(0, 0, 0, 0.35);
}

.description {
    margin-top: 0;
    margin-bottom: 18px;

    color: #aaa;
    line-height: 1.7;
}

/* =========================
   手数料表示
========================= */

.fee-info {
    display: flex;
    margin-bottom: 18px;
    padding: 13px;

    align-items: center;
    justify-content: space-between;
    gap: 15px;

    background: #383224;
    border-left: 4px solid #d4af37;
    border-radius: 8px;
}

.fee-label {
    color: #ccc;
    font-size: 14px;
}

.fee-value {
    color: #ffce54;
    font-size: 21px;
    font-weight: bold;
    white-space: nowrap;
}

/* =========================
   入力欄
========================= */

label {
    display: block;
    margin-top: 13px;
    margin-bottom: 6px;
    color: #ddd;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;

    background: #3d3d3d;
    color: white;

    border: 1px solid #555;
    border-radius: 8px;

    font-size: 16px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #d4af37;
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.input-group {
    min-width: 0;
}

/* =========================
   ボタン
========================= */

.submit-button {
    width: 100%;
    margin-top: 20px;
    padding: 14px;

    background: #d4af37;
    color: black;

    border: none;
    border-radius: 9px;

    font-size: 17px;
    font-weight: bold;
    cursor: pointer;

    transition:
        opacity 0.15s,
        transform 0.15s;
}

.submit-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.submit-button:active {
    transform: translateY(0);
}

/* =========================
   補助テキスト
========================= */

.helper-text {
    margin-top: 7px;

    color: #999;
    font-size: 13px;
    line-height: 1.5;
}

.footer {
    margin-top: 28px;

    color: #777;
    text-align: center;
    font-size: 12px;
}

/* =========================
   スマートフォン
========================= */

@media (max-width: 650px) {
    body {
        padding-bottom: 72px;
    }

    .top-nav {
        display: none;
    }

    .bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;

        display: flex;
        height: 66px;

        align-items: stretch;
        justify-content: space-around;

        background: rgba(31, 31, 31, 0.98);
        border-top: 1px solid #444;
        box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(8px);
    }

    .bottom-nav-link.active {
        background: #302c21;
    }

    .container {
        margin-top: 20px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .menu-button {
        min-height: 66px;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .fee-info {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================
   ページ共通ヘッダー
========================= */

.page-header {
    display: flex;
    margin-bottom: 22px;

    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.page-header h1 {
    margin: 0;
}

.page-header .subtitle {
    margin-bottom: 0;
}

.page-action-button {
    display: inline-flex;
    min-height: 42px;
    padding: 10px 16px;

    align-items: center;
    justify-content: center;

    background: #d4af37;
    color: #111;

    border: none;
    border-radius: 9px;

    text-decoration: none;
    font-size: 14px;
    font-weight: bold;

    white-space: nowrap;
    cursor: pointer;

    transition:
        opacity 0.15s,
        transform 0.15s;
}

.page-action-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


/* =========================
   売上一覧・集計
========================= */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;

    margin-bottom: 20px;
}

.summary-card {
    padding: 18px;

    background: #292929;

    border: 1px solid #393939;
    border-radius: 13px;
}

.summary-card-profit {
    background: #383224;
    border-color: #5a4b26;
}

.summary-label {
    margin-bottom: 8px;

    color: #aaa;
    font-size: 13px;
}

.summary-value {
    color: #ffce54;
    font-size: 23px;
    font-weight: bold;
    word-break: break-all;
}

.summary-value-small {
    color: #eee;
    font-size: 20px;
}

.negative-value {
    color: #ff6b6b !important;
}


/* =========================
   売上カード
========================= */

.sales-list {
    display: grid;
    gap: 14px;
}

.sale-card {
    overflow: hidden;

    background: #292929;

    border: 1px solid #393939;
    border-radius: 14px;

    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
}

.sale-card-header {
    display: flex;
    padding: 17px 18px;

    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    background: #303030;
    border-bottom: 1px solid #3e3e3e;
}

.sale-date {
    font-size: 18px;
    font-weight: bold;
}

.sale-memo {
    margin-top: 6px;

    color: #aaa;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.sale-profit {
    display: flex;

    align-items: flex-end;
    flex-direction: column;
    gap: 3px;

    color: #ffce54;
    font-size: 20px;
    font-weight: bold;

    white-space: nowrap;
}

.sale-profit-label {
    color: #999;
    font-size: 11px;
    font-weight: normal;
}

.sale-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;

    background: #414141;
}

.sale-detail-item {
    display: flex;
    min-width: 0;
    padding: 14px;

    flex-direction: column;
    gap: 6px;

    background: #292929;
}

.sale-detail-label {
    color: #999;
    font-size: 12px;
}

.sale-detail-value {
    font-size: 15px;
    font-weight: bold;
    word-break: break-all;
}

.sale-card-footer {
    display: flex;
    padding: 14px 18px;

    align-items: center;
    justify-content: space-between;
    gap: 15px;

    border-top: 1px solid #393939;
}

.sale-total {
    display: flex;

    align-items: center;
    gap: 10px;

    color: #aaa;
    font-size: 13px;
}

.sale-total strong {
    color: white;
    font-size: 17px;
}

.delete-button {
    padding: 8px 15px;

    background: transparent;
    color: #ff7b7b;

    border: 1px solid #704040;
    border-radius: 8px;

    font-size: 13px;
    font-weight: bold;
    cursor: pointer;

    transition:
        background 0.15s,
        color 0.15s;
}

.delete-button:hover {
    background: #703535;
    color: white;
}


/* =========================
   データなし
========================= */

.empty-card {
    padding: 45px 20px;

    background: #292929;

    border: 1px solid #393939;
    border-radius: 14px;

    text-align: center;
}

.empty-card h2 {
    margin-bottom: 8px;
}

.empty-card p {
    margin-bottom: 22px;
    color: #aaa;
}

.empty-icon {
    margin-bottom: 12px;
    font-size: 42px;
}


/* =========================
   売上一覧・スマートフォン
========================= */

@media (max-width: 650px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-action-button {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        display: flex;

        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .summary-label {
        margin-bottom: 0;
    }

    .summary-value,
    .summary-value-small {
        font-size: 20px;
    }

    .sale-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .sale-profit {
        align-items: flex-start;
    }

    .sale-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sale-card-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .sale-total {
        justify-content: space-between;
    }

    .delete-button {
        width: 100%;
        min-height: 42px;
    }
}

/* =========================
   売掛管理
========================= */

.credit-paid-value {
    color: #72d89a;
}

.credit-remaining-summary {
    background: #3c2929;
    border-color: #654040;
}

.credit-remaining-value,
.credit-unpaid-text {
    color: #ff8585;
}

.credit-section {
    margin-top: 28px;
}

.section-heading {
    display: flex;
    margin-bottom: 14px;

    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.section-heading h2 {
    margin-bottom: 5px;
}

.section-heading p {
    margin: 0;

    color: #999;
    font-size: 13px;
}

.section-count {
    display: inline-flex;
    min-width: 44px;
    padding: 6px 10px;

    align-items: center;
    justify-content: center;

    background: #373737;
    color: #ddd;

    border: 1px solid #484848;
    border-radius: 999px;

    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.credit-customer-list {
    display: grid;
    gap: 16px;
}

.credit-customer-card {
    overflow: hidden;

    background: #292929;

    border: 1px solid #414141;
    border-radius: 14px;

    box-shadow: 0 0 13px rgba(0, 0, 0, 0.25);
}

.credit-customer-header {
    display: flex;
    padding: 18px;

    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;

    background: #313131;
    border-bottom: 1px solid #414141;
}

.credit-customer-name {
    font-size: 19px;
    font-weight: bold;
}

.credit-customer-date {
    margin-top: 5px;

    color: #999;
    font-size: 12px;
}

.credit-customer-remaining {
    display: flex;

    align-items: flex-end;
    flex-direction: column;
    gap: 3px;

    white-space: nowrap;
}

.credit-customer-remaining span {
    color: #999;
    font-size: 11px;
}

.credit-customer-remaining strong {
    color: #ff8585;
    font-size: 21px;
}

.credit-customer-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;

    background: #414141;
}

.credit-customer-summary > div {
    display: flex;
    padding: 13px;

    flex-direction: column;
    gap: 5px;

    background: #292929;
}

.credit-customer-summary span {
    color: #999;
    font-size: 11px;
}

.credit-customer-summary strong {
    font-size: 15px;
}

.credit-entry-list {
    padding: 12px;
}

.credit-entry {
    overflow: hidden;
    margin-bottom: 10px;

    background: #252525;

    border: 1px solid #3b3b3b;
    border-radius: 10px;
}

.credit-entry:last-child {
    margin-bottom: 0;
}

.credit-entry-summary {
    display: flex;
    padding: 14px;

    align-items: center;
    justify-content: space-between;
    gap: 14px;

    cursor: pointer;
    list-style: none;
}

.credit-entry-summary::-webkit-details-marker {
    display: none;
}

.credit-entry-summary::before {
    content: "▶";

    margin-right: 2px;

    color: #888;
    font-size: 10px;

    transition: transform 0.15s;
}

.credit-entry[open] > .credit-entry-summary::before {
    transform: rotate(90deg);
}

.credit-entry-summary > div:first-of-type {
    flex: 1;
}

.credit-entry-date {
    margin-bottom: 6px;
    font-weight: bold;
}

.credit-status {
    display: inline-flex;
    padding: 4px 8px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: bold;
}

.credit-status-unpaid {
    background: #522e2e;
    color: #ff9b9b;
}

.credit-status-partial {
    background: #514426;
    color: #ffda73;
}

.credit-status-paid {
    background: #294735;
    color: #85dfa5;
}

.credit-entry-amount {
    display: flex;

    align-items: flex-end;
    flex-direction: column;
    gap: 2px;

    white-space: nowrap;
}

.credit-entry-amount span {
    color: #999;
    font-size: 11px;
}

.credit-entry-amount strong {
    color: #ff8585;
    font-size: 17px;
}

.credit-entry-body {
    padding: 15px;

    background: #2c2c2c;
    border-top: 1px solid #3b3b3b;
}

.credit-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;

    margin-bottom: 18px;
}

.credit-entry-grid > div {
    display: flex;
    padding: 12px;

    flex-direction: column;
    gap: 5px;

    background: #242424;
    border-radius: 8px;
}

.credit-entry-grid span {
    color: #999;
    font-size: 11px;
}

.credit-payment-form,
.credit-rename-form {
    margin-top: 16px;
}

.credit-inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.credit-payment-button,
.credit-secondary-button {
    min-width: 74px;
    padding: 0 15px;

    background: #d4af37;
    color: #111;

    border: none;
    border-radius: 8px;

    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.credit-secondary-button {
    background: #555;
    color: white;
}

.credit-full-payment-button {
    margin-top: 8px;
    padding: 7px 10px;

    background: transparent;
    color: #d4af37;

    border: 1px solid #665729;
    border-radius: 7px;

    font-size: 12px;
    cursor: pointer;
}

.payment-history {
    margin-top: 18px;
    padding: 13px;

    background: #242424;
    border-radius: 8px;
}

.payment-history-title {
    margin-bottom: 8px;

    color: #aaa;
    font-size: 12px;
    font-weight: bold;
}

.payment-history-row {
    display: flex;
    padding: 7px 0;

    align-items: center;
    justify-content: space-between;
    gap: 10px;

    border-bottom: 1px solid #383838;

    font-size: 12px;
}

.payment-history-row:last-child {
    border-bottom: none;
}

.payment-history-row span {
    color: #999;
}

.payment-history-row strong {
    color: #85dfa5;
}

.credit-management-area {
    margin-top: 20px;
    padding-top: 4px;

    border-top: 1px solid #414141;
}

.credit-delete-button {
    width: 100%;
    min-height: 40px;
    margin-top: 12px;
}

.completed-credit-section {
    margin-bottom: 30px;
}

.completed-credit-details {
    overflow: hidden;

    background: #292929;

    border: 1px solid #3c3c3c;
    border-radius: 13px;
}

.completed-credit-summary {
    display: flex;
    padding: 17px;

    align-items: center;
    justify-content: space-between;
    gap: 12px;

    font-weight: bold;
    cursor: pointer;
}

.completed-credit-list {
    display: grid;
    gap: 1px;

    background: #3d3d3d;
    border-top: 1px solid #3d3d3d;
}

.completed-customer-card {
    display: flex;
    padding: 15px 17px;

    align-items: center;
    justify-content: space-between;
    gap: 15px;

    background: #292929;
}

.completed-customer-total {
    display: flex;

    align-items: flex-end;
    flex-direction: column;
    gap: 3px;

    white-space: nowrap;
}

.completed-customer-total span {
    color: #999;
    font-size: 11px;
}

.completed-customer-total strong {
    color: #85dfa5;
}


/* =========================
   売掛管理・スマートフォン
========================= */

@media (max-width: 650px) {
    .credit-customer-header {
        align-items: stretch;
        flex-direction: column;
    }

    .credit-customer-remaining {
        align-items: flex-start;
    }

    .credit-customer-summary {
        grid-template-columns: 1fr;
    }

    .credit-customer-summary > div {
        align-items: center;
        justify-content: space-between;
        flex-direction: row;
    }

    .credit-entry-summary {
        align-items: flex-start;
    }

    .credit-entry-grid {
        grid-template-columns: 1fr;
    }

    .credit-entry-grid > div {
        align-items: center;
        justify-content: space-between;
        flex-direction: row;
    }

    .credit-inline-form {
        grid-template-columns: 1fr;
    }

    .credit-payment-button,
    .credit-secondary-button {
        min-height: 42px;
    }

    .completed-customer-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .completed-customer-total {
        align-items: flex-start;
    }
}

/* =========================
   月次収支
========================= */

.monthly-selector-card {
    padding: 16px 18px;
}

.monthly-selector-form {
    display: flex;

    align-items: flex-end;
    gap: 12px;
}

.monthly-selector-input {
    flex: 1;
}

.monthly-selector-input label {
    margin-top: 0;
}

.monthly-display-button {
    min-width: 100px;
}


.monthly-main-summary {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 2fr;
    gap: 14px;

    margin-bottom: 20px;
}

.monthly-profit-card {
    display: flex;
    min-height: 175px;
    padding: 22px;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    background: #294233;

    border: 1px solid #3f664c;
    border-radius: 14px;

    text-align: center;
}

.monthly-profit-negative {
    background: #492c2c;
    border-color: #754444;
}

.monthly-profit-label {
    margin-bottom: 8px;

    color: #b9cfc0;
    font-size: 14px;
}

.monthly-profit-value {
    color: #8be0a8;
    font-size: 32px;
    font-weight: bold;
    word-break: break-all;
}

.monthly-profit-negative .monthly-profit-value {
    color: #ff8585;
}

.monthly-profit-margin {
    margin-top: 8px;

    color: #bbb;
    font-size: 13px;
}

.monthly-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.monthly-summary-item {
    display: flex;
    padding: 16px 18px;

    align-items: center;
    justify-content: space-between;
    gap: 15px;

    background: #292929;

    border: 1px solid #393939;
    border-radius: 12px;
}

.monthly-summary-item span {
    color: #aaa;
    font-size: 13px;
}

.monthly-summary-item strong {
    font-size: 19px;
    text-align: right;
}

.monthly-expense-text {
    color: #ff8585;
}


.monthly-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.monthly-breakdown-card {
    margin-bottom: 20px;
}

.monthly-breakdown-list {
    display: grid;
    gap: 1px;

    overflow: hidden;

    background: #414141;
    border-radius: 9px;
}

.monthly-breakdown-list > div {
    display: flex;
    padding: 13px;

    align-items: center;
    justify-content: space-between;
    gap: 12px;

    background: #252525;
}

.monthly-breakdown-list span {
    color: #aaa;
    font-size: 13px;
}

.monthly-breakdown-list strong {
    text-align: right;
}

.monthly-breakdown-total {
    background: #383224 !important;
}

.monthly-breakdown-total span,
.monthly-breakdown-total strong {
    color: #ffce54;
}


.monthly-chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}

.monthly-chart-card {
    min-width: 0;
}

.monthly-chart-container {
    position: relative;
    height: 330px;
}

.monthly-pie-container {
    height: 330px;
}

.monthly-chart-empty {
    display: flex;
    min-height: 200px;

    align-items: center;
    justify-content: center;

    color: #888;
    text-align: center;
}


.monthly-section {
    margin-top: 28px;
    margin-bottom: 22px;
}

.monthly-expense-list {
    display: grid;
    gap: 10px;
}

.monthly-expense-card {
    display: flex;
    padding: 15px 17px;

    align-items: center;
    justify-content: space-between;
    gap: 15px;

    background: #292929;

    border: 1px solid #3d3d3d;
    border-radius: 11px;
}

.monthly-expense-main {
    display: flex;
    min-width: 0;
    flex: 1;

    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.monthly-expense-category {
    font-weight: bold;
}

.monthly-expense-source {
    display: inline-flex;
    margin-top: 6px;
    padding: 3px 7px;

    background: #383224;
    color: #ffce54;

    border-radius: 999px;

    font-size: 10px;
}

.monthly-expense-memo {
    margin-top: 7px;

    color: #999;
    font-size: 12px;
    line-height: 1.5;
}

.monthly-expense-amount {
    color: #ff8585;
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
}

.monthly-expense-delete {
    white-space: nowrap;
}


.monthly-category-list {
    display: grid;
    gap: 1px;

    overflow: hidden;

    background: #414141;
    border-radius: 9px;
}

.monthly-category-row {
    display: flex;
    padding: 13px 14px;

    align-items: center;
    justify-content: space-between;
    gap: 12px;

    background: #252525;
}

.monthly-category-row span {
    color: #ccc;
}

.monthly-category-row strong {
    color: #ffce54;
}


.monthly-sales-list {
    display: grid;
    gap: 10px;
}

.monthly-sale-detail {
    overflow: hidden;

    background: #292929;

    border: 1px solid #3d3d3d;
    border-radius: 11px;
}

.monthly-sale-summary {
    display: flex;
    padding: 15px 17px;

    align-items: center;
    justify-content: space-between;
    gap: 15px;

    cursor: pointer;
    list-style: none;
}

.monthly-sale-summary::-webkit-details-marker {
    display: none;
}

.monthly-sale-summary::before {
    content: "▶";

    color: #888;
    font-size: 10px;

    transition: transform 0.15s;
}

.monthly-sale-detail[open]
> .monthly-sale-summary::before {
    transform: rotate(90deg);
}

.monthly-sale-summary > div:first-of-type {
    flex: 1;
}

.monthly-sale-date {
    font-weight: bold;
}

.monthly-sale-memo {
    margin-top: 5px;

    color: #999;
    font-size: 12px;
}

.monthly-sale-result {
    display: flex;

    align-items: flex-end;
    flex-direction: column;
    gap: 3px;

    white-space: nowrap;
}

.monthly-sale-result span {
    color: #999;
    font-size: 11px;
}

.monthly-sale-result strong {
    color: #8be0a8;
    font-size: 17px;
}

.monthly-sale-body {
    padding: 14px;

    background: #252525;
    border-top: 1px solid #3d3d3d;
}

.monthly-sale-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.monthly-sale-grid > div {
    display: flex;
    padding: 11px;

    flex-direction: column;
    gap: 5px;

    background: #2e2e2e;
    border-radius: 8px;
}

.monthly-sale-grid span {
    color: #999;
    font-size: 11px;
}

.monthly-sale-grid strong {
    font-size: 14px;
}


/* =========================
   月次収支・スマートフォン
========================= */

@media (max-width: 650px) {
    .monthly-selector-form {
        align-items: stretch;
        flex-direction: column;
    }

    .monthly-display-button {
        width: 100%;
    }

    .monthly-main-summary {
        grid-template-columns: 1fr;
    }

    .monthly-profit-card {
        min-height: 150px;
    }

    .monthly-profit-value {
        font-size: 28px;
    }

    .monthly-breakdown-grid,
    .monthly-chart-grid {
        grid-template-columns: 1fr;
    }

    .monthly-chart-container,
    .monthly-pie-container {
        height: 290px;
    }

    .monthly-expense-card,
    .monthly-expense-main {
        align-items: stretch;
        flex-direction: column;
    }

    .monthly-expense-delete {
        width: 100%;
        min-height: 40px;
    }

    .monthly-sale-summary {
        align-items: flex-start;
    }

    .monthly-sale-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================
   設定
========================= */

.settings-section-header h2 {
    margin-bottom: 7px;
}

.settings-section-header .description {
    margin-bottom: 18px;
}


.settings-recurring-summary {
    display: flex;
    margin-bottom: 20px;
    padding: 18px 20px;

    align-items: center;
    justify-content: space-between;
    gap: 18px;

    background: #383224;

    border: 1px solid #5b4e2c;
    border-left: 4px solid #d4af37;
    border-radius: 13px;
}

.settings-recurring-summary-label {
    margin-bottom: 5px;

    color: #ddd;
    font-size: 14px;
    font-weight: bold;
}

.settings-recurring-summary-help {
    color: #999;
    font-size: 12px;
}

.settings-recurring-summary-value {
    color: #ffce54;
    font-size: 26px;
    font-weight: bold;
    white-space: nowrap;
}


.settings-section {
    margin-top: 28px;
    margin-bottom: 24px;
}

.settings-expense-list {
    display: grid;
    gap: 12px;
}

.settings-expense-card {
    overflow: hidden;

    background: #292929;

    border: 1px solid #3e3e3e;
    border-radius: 13px;

    transition:
        opacity 0.15s,
        border-color 0.15s;
}

.settings-expense-disabled {
    opacity: 0.62;
    border-style: dashed;
}

.settings-expense-header {
    display: flex;
    padding: 17px 18px;

    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    background: #303030;
    border-bottom: 1px solid #3e3e3e;
}

.settings-expense-title-area {
    min-width: 0;
}

.settings-expense-title {
    display: inline-block;
    margin-right: 7px;

    font-size: 18px;
    font-weight: bold;
}

.settings-status {
    display: inline-flex;
    padding: 4px 8px;

    align-items: center;

    border-radius: 999px;

    font-size: 10px;
    font-weight: bold;
    vertical-align: 2px;
}

.settings-status-active {
    background: #294735;
    color: #85dfa5;
}

.settings-status-inactive {
    background: #494949;
    color: #aaa;
}

.settings-expense-memo {
    margin-top: 7px;

    color: #999;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.settings-expense-amount {
    display: flex;

    align-items: flex-end;
    flex-direction: column;
    gap: 3px;

    white-space: nowrap;
}

.settings-expense-amount span {
    color: #999;
    font-size: 11px;
}

.settings-expense-amount strong {
    color: #ffce54;
    font-size: 20px;
}


.settings-expense-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;

    padding: 13px 18px;
}

.settings-toggle-button {
    min-height: 40px;
    padding: 8px 14px;

    border-radius: 8px;

    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.settings-toggle-disable {
    background: transparent;
    color: #bbb;

    border: 1px solid #555;
}

.settings-toggle-enable {
    background: #294735;
    color: #85dfa5;

    border: 1px solid #3e684d;
}


.settings-edit-details {
    min-width: 0;
}

.settings-edit-summary {
    display: flex;
    min-height: 40px;
    padding: 8px 14px;

    align-items: center;
    justify-content: center;

    background: #3a3a3a;
    color: #ddd;

    border: 1px solid #4b4b4b;
    border-radius: 8px;

    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    list-style: none;
}

.settings-edit-summary::-webkit-details-marker {
    display: none;
}

.settings-edit-details[open] {
    grid-column: 1 / -1;
}

.settings-edit-details[open] .settings-edit-summary {
    background: #383224;
    color: #ffce54;

    border-color: #62552f;
    border-radius: 8px 8px 0 0;
}

.settings-edit-body {
    padding: 17px;

    background: #252525;

    border: 1px solid #51482e;
    border-top: none;
    border-radius: 0 0 9px 9px;
}

.settings-edit-body label:first-child {
    margin-top: 0;
}

.settings-save-button {
    width: 100%;
    min-height: 43px;
    margin-top: 17px;

    background: #d4af37;
    color: #111;

    border: none;
    border-radius: 8px;

    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.settings-delete-button {
    width: 100%;
    min-height: 41px;
    margin-top: 12px;
}


.settings-guide-card {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 20px;

    background: #222;

    border: 1px solid #353535;
    border-radius: 13px;
}

.settings-guide-card h2 {
    margin-bottom: 15px;
    font-size: 18px;
}

.settings-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.settings-guide-grid > div {
    padding: 14px;

    background: #292929;
    border-radius: 9px;
}

.settings-guide-grid strong {
    color: #ffce54;
    font-size: 13px;
}

.settings-guide-grid p {
    margin-top: 8px;
    margin-bottom: 0;

    color: #aaa;
    font-size: 12px;
    line-height: 1.65;
}


/* =========================
   設定・スマートフォン
========================= */

@media (max-width: 650px) {
    .settings-recurring-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .settings-recurring-summary-value {
        font-size: 24px;
    }

    .settings-expense-header {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-expense-amount {
        align-items: flex-start;
    }

    .settings-expense-actions {
        grid-template-columns: 1fr;
    }

    .settings-edit-details[open] {
        grid-column: auto;
    }

    .settings-guide-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   その他決済方法設定
========================= */

.payment-method-list {
    display: grid;
    gap: 12px;
}

.payment-method-card {
    overflow: hidden;

    background: #292929;

    border: 1px solid #3e3e3e;
    border-radius: 13px;
}

.payment-method-disabled {
    opacity: 0.62;
    border-style: dashed;
}

.payment-method-header {
    display: flex;
    padding: 17px 18px;

    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    background: #303030;
    border-bottom: 1px solid #3e3e3e;
}

.payment-method-name {
    display: inline-block;
    margin-right: 7px;

    font-size: 18px;
    font-weight: bold;
}

.payment-method-fee {
    display: flex;

    align-items: flex-end;
    flex-direction: column;
    gap: 3px;

    white-space: nowrap;
}

.payment-method-fee span {
    color: #999;
    font-size: 11px;
}

.payment-method-fee strong {
    color: #ffce54;
    font-size: 20px;
}

.payment-method-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;

    padding: 13px 18px;
}

.payment-method-actions form {
    margin: 0;
}


@media (max-width: 650px) {
    .payment-method-header {
        align-items: stretch;
        flex-direction: column;
    }

    .payment-method-fee {
        align-items: flex-start;
    }

    .payment-method-actions {
        grid-template-columns: 1fr;
    }
}

/* =========================
   売上登録・その他決済
========================= */

.other-payment-section {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 17px;

    background: #242424;

    border: 1px solid #3b3b3b;
    border-radius: 12px;
}

.other-payment-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.other-payment-heading h3 {
    margin: 0 0 5px;

    font-size: 16px;
}

.other-payment-heading p {
    margin: 0;

    color: #999;
    font-size: 12px;
}

.add-other-payment-button {
    display: inline-flex;
    min-height: 40px;
    padding: 9px 14px;

    align-items: center;
    justify-content: center;

    background: #383224;
    color: #ffce54;

    border: 1px solid #66572c;
    border-radius: 8px;

    text-decoration: none;
    font-size: 12px;
    font-weight: bold;

    white-space: nowrap;
    cursor: pointer;
}

.add-other-payment-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.other-payment-list {
    display: grid;
    gap: 10px;

    margin-top: 14px;
}

.other-payment-row {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        minmax(120px, 1fr)
        auto;

    padding: 13px;
    gap: 10px;

    align-items: end;

    background: #2e2e2e;

    border: 1px solid #414141;
    border-radius: 9px;
}

.other-payment-row label {
    margin-top: 0;
}

.other-payment-method-field,
.other-payment-amount-field {
    min-width: 0;
}

.other-payment-select {
    width: 100%;
    padding: 12px;

    background: #3d3d3d;
    color: white;

    border: 1px solid #555;
    border-radius: 8px;

    font-family: inherit;
    font-size: 16px;
}

.other-payment-select:focus {
    border-color: #d4af37;
    outline: none;
}

.other-payment-fee-text {
    margin-top: 6px;

    color: #d4af37;
    font-size: 11px;
}

.remove-other-payment-button {
    min-height: 43px;
    padding: 8px 13px;

    background: transparent;
    color: #ff8585;

    border: 1px solid #704040;
    border-radius: 8px;

    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.remove-other-payment-button:hover {
    background: #703535;
    color: white;
}

.other-payment-empty {
    margin-top: 14px;
    padding: 13px;

    background: #2d2d2d;
    color: #888;

    border-radius: 8px;

    text-align: center;
    font-size: 12px;
}


/* =========================
   その他決済・スマートフォン
========================= */

@media (max-width: 650px) {
    .other-payment-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .add-other-payment-button {
        width: 100%;
    }

    .other-payment-row {
        grid-template-columns: 1fr;
    }

    .remove-other-payment-button {
        width: 100%;
    }
}

/* =========================
   ログイン画面
========================= */

.login-page {
    min-height: 100vh;
    margin: 0;

    background:
        radial-gradient(
            circle at top,
            #302b20 0%,
            #171717 42%,
            #101010 100%
        );
}

.login-container {
    display: flex;
    min-height: 100vh;
    padding: 24px;

    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;

    background: rgba(38, 38, 38, 0.96);

    border: 1px solid #48412e;
    border-radius: 18px;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.45);
}

.login-icon {
    display: flex;
    width: 100px;
    height: 100px;
    margin: 0 auto 18px;

    align-items: center;
    justify-content: center;
}

.login-icon img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.login-card h1 {
    margin: 0;

    color: #ffce54;
    text-align: center;
    font-size: 30px;
}

.login-description {
    margin: 8px 0 25px;

    color: #aaa;
    text-align: center;
    font-size: 13px;
}

.login-error {
    margin-bottom: 17px;
    padding: 12px;

    background: #4b2929;
    color: #ff9b9b;

    border: 1px solid #744040;
    border-radius: 8px;

    text-align: center;
    font-size: 13px;
}

.login-button {
    margin-top: 22px;
}


@media (max-width: 650px) {
    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 25px 20px;
    }

    .login-icon {
        width: 82px;
        height: 82px;
    }

    .login-card h1 {
        font-size: 26px;
    }
}

.settings-logout-button {
    display: flex;
    width: 100%;
    min-height: 44px;

    align-items: center;
    justify-content: center;

    text-decoration: none;
}

.header-icon {
    display: flex;
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;

    align-items: center;
    justify-content: center;
}

.header-icon img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: contain;
}

@media (max-width: 650px) {
    .header-icon {
        width: 72px;
        height: 72px;
    }
}
