/* 請求書作成フォームのスタイル */
.invoice-create {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.invoice-create h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.invoice-create label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

.invoice-create input[type="text"],
.invoice-create input[type="number"],
.invoice-create input[type="date"],
.invoice-create textarea,
.invoice-create select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.invoice-create textarea {
    height: 100px;
}

.invoice-create .item-row {
    margin-top: 10px;
    display: block;
}

.invoice-create .item-description {
    margin-bottom: 10px;
}

.invoice-create .item-details {
    display: flex;
    gap: 10px;
    align-items: center;
}

.invoice-create .even-row {
    background-color: #e6f3ff; /* 薄い青色 */
}

.invoice-create .button-primary,
.invoice-create .button-delete {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.invoice-create .button-primary {
    background: #0073aa;
    color: #fff;
}

.invoice-create .button-delete {
    background: #d63638;
    color: #fff;
}

/* 請求書一覧のスタイル */
.invoice-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.invoice-list th,
.invoice-list td {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 14px;
    text-align: left;
    vertical-align: middle; /* ボタンの垂直位置を調整 */
}

.invoice-list .even-row {
    background-color: #f9f9f9;
}

.invoice-list .odd-row {
    background-color: #fff;
}

/* 列幅の調整 */
.invoice-list th:nth-child(1), .invoice-list td:nth-child(1) { width: 20%; } /* No. */
.invoice-list th:nth-child(2), .invoice-list td:nth-child(2) { width: 15%; } /* 発行者 */
.invoice-list th:nth-child(3), .invoice-list td:nth-child(3) { width: 10%; } /* 発行日 */
.invoice-list th:nth-child(4), .invoice-list td:nth-child(4) { width: 10%; } /* 支払い期限 */
.invoice-list th:nth-child(5), .invoice-list td:nth-child(5) { width: 15%; } /* 請求先 */
.invoice-list th:nth-child(6), .invoice-list td:nth-child(6) { width: 10%; } /* 合計 */
.invoice-list th:nth-child(7), .invoice-list td:nth-child(7) { width: 10%; } /* 状態 */
.invoice-list th:nth-child(8), .invoice-list td:nth-child(8) { width: 10%; } /* 請求書タイプ */
.invoice-list th:nth-child(9), .invoice-list td:nth-child(9) { width: 10%; min-width: 120px; } /* 操作 */

/* ボタンのスタイルを調整 */
.button-primary,
.button-delete {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 2px;
    display: inline-block;
    white-space: nowrap; /* 改行を防ぐ */
}

/* 請求書詳細ページのスタイル */
.invoice-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.invoice-header {
    text-align: center;
    margin-bottom: 20px;
}

.invoice-no-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.invoice-header h1 {
    font-size: 24px;
    margin: 10px 0;
    text-decoration: none; /* 下線を削除 */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.client-info {
    flex: 1;
    margin-right: 20px; /* ロゴとの間隔を確保 */
}

.client-info p {
    margin: 5px 0;
    font-size: 16px; /* 宛先の文字を大きく */
}

.issuer-logo-container {
    text-align: right;
    flex-shrink: 0; /* ロゴが縮まないように */
}

.issuer-logo {
    max-width: 300px; /* ロゴサイズを300pxに */
    height: auto;
}

.invoice-amount {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: baseline;
    clear: both; /* 前の要素との重なりを防ぐ */
}

.amount-label {
    font-size: 20px; /* 文字を大きく */
    margin-right: 20px; /* ラベルと金額の間を空ける */
    color: #000000; /* 黒に変更 */
}

.amount-value {
    font-size: 32px; /* 文字を大きく */
    font-weight: bold;
    color: #000000; /* 黒に変更 */
}

.invoice-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.invoice-items th,
.invoice-items td {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 12px; /* 表の文字を小さく */
}

.invoice-items th:nth-child(1),
.invoice-items td:nth-child(1) {
    text-align: left; /* No. */
    width: 5%;
}

.invoice-items th:nth-child(2),
.invoice-items td:nth-child(2) {
    text-align: left; /* 商品名/説明 */
    width: 40%;
}

.invoice-items th:nth-child(3),
.invoice-items td:nth-child(3) {
    text-align: right; /* 数量 */
    width: 10%;
    display: table-cell; /* 表示を強制 */
}

.invoice-items th:nth-child(4),
.invoice-items td:nth-child(4) {
    text-align: right; /* 単位 */
    width: 10%;
}

.invoice-items th:nth-child(5),
.invoice-items td:nth-child(5) {
    text-align: right; /* 単価 */
    width: 15%;
}

.invoice-items th:nth-child(6),
.invoice-items td:nth-child(6) {
    text-align: right; /* 税区分 */
    width: 10%;
}

.invoice-items th:nth-child(7),
.invoice-items td:nth-child(7) {
    text-align: right; /* 金額 */
    width: 10%;
}

.invoice-items th {
    background: #f5f5f5;
    font-weight: bold;
}

.invoice-items .even-row {
    background: #f9f9f9;
}

.invoice-items .odd-row {
    background: #fff;
}

.invoice-summary {
    margin-top: 20px;
    text-align: right;
}

.summary-item {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin: 5px 0;
}

.summary-item.total {
    font-weight: bold;
    font-size: 16px;
}

.invoice-footer {
    margin-top: 20px;
}

.invoice-footer p {
    margin: 5px 0;
}

.print-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

@media print {
  /* 印刷時は画面と同じレイアウトを維持し、印刷ボタンだけ非表示にする */
  .print-button {
      display: none;
  }
  @page {
      margin: 1cm;
  }
}

@media (max-width: 768px) {
    .invoice-create .item-details {
        flex-wrap: wrap;
    }

    .invoice-create .item-details input,
    .invoice-create .item-details select {
        width: 100%;
        margin-bottom: 10px;
    }

    .invoice-detail .header-content {
        flex-direction: column;
        align-items: center;
    }

    .invoice-detail .client-info,
    .invoice-detail .issuer-logo-container {
        text-align: center;
    }
}

/* 請求先登録ページのスタイル */
.client-register,
.bank-register,
.issuer-upload {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.client-register h2,
.bank-register h2,
.issuer-upload h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.client-register label,
.bank-register label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

.client-register input[type="text"],
.client-register input[type="email"],
.client-register textarea,
.bank-register textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.client-register textarea,
.bank-register textarea {
    height: 100px;
}

.client-register ul,
.bank-register ul {
    list-style: none;
    padding: 0;
}

.client-register li,
.bank-register li {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.button-primary,
.button-delete {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.button-primary {
    background: #0073aa;
    color: #fff;
}

.button-delete {
    background: #d63638;
    color: #fff;
}

/* 発行元ロゴアップロードページのスタイル */
.issuer-upload img {
    max-width: 300px;
    height: auto;
    margin-top: 10px;
}

/* ポップアップのスタイル */
.invoice-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.invoice-popup-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    position: relative;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close-popup {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-popup:hover,
.close-popup:focus {
    color: #000;
    text-decoration: none;
}

#invoice-popup-body {
    margin-bottom: 20px;
}