/* 全体コンテナ */
.bs-area-graph-container {
    margin: 20px auto;
    font-family: Arial, sans-serif;
}

/* グラフタイトル */
.bs-area-graph-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

/* グラフラッパー */
.bs-area-graph-wrapper {
    width: 100%;
    height: calc(100% - 100px);
    min-height: 400px;
}

/* 指標エリア */
.bs-area-indicators {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

/* 個別指標 */
.indicator {
    margin-right: 20px;
    margin-bottom: 10px;
}

.indicator-label {
    font-weight: bold;
}

.indicator-value {
    margin-left: 5px;
}

/* 管理画面のスタイル */
.bs-area-form-container {
    display: flex;
    margin-bottom: 30px;
}

.bs-area-form {
    flex: 1;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    margin-right: 15px;
}

.bs-area-form h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4b9cd3;
}

.bs-area-form h3 {
    margin-top: 15px;
    color: #555;
}

.form-group {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.form-group label {
    width: 120px;
    display: inline-block;
}

.form-group input {
    width: 100px;
}

.form-group span {
    margin-left: 10px;
}

.bs-area-preview {
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.bs-area-actions {
    margin-top: 20px;
}

.bs-area-actions .description {
    margin-top: 10px;
    color: #666;
}

/* グラフの色設定 */
.asset-cash { background-color: rgba(54, 162, 235, 0.6); }
.asset-notes-receivable { background-color: rgba(75, 192, 192, 0.6); }
.asset-accounts-receivable { background-color: rgba(153, 102, 255, 0.6); }
.asset-inventory { background-color: rgba(255, 99, 132, 0.6); }
.asset-other-current { background-color: rgba(255, 159, 64, 0.6); }

.asset-buildings { background-color: rgba(255, 206, 86, 0.6); }
.asset-equipment { background-color: rgba(75, 192, 192, 0.6); }
.asset-land { background-color: rgba(153, 102, 255, 0.6); }
.asset-investments { background-color: rgba(255, 99, 132, 0.6); }
.asset-other-fixed { background-color: rgba(54, 162, 235, 0.6); }

.equity-retained-earnings { background-color: rgba(255, 206, 86, 0.6); }
.equity-capital { background-color: rgba(255, 159, 64, 0.6); }
.liab-long-loans { background-color: rgba(75, 192, 192, 0.6); }
.liab-other-fixed { background-color: rgba(153, 102, 255, 0.6); }
.liab-short-loans { background-color: rgba(255, 99, 132, 0.6); }
.liab-discounted-notes { background-color: rgba(54, 162, 235, 0.6); }
.liab-accounts-payable { background-color: rgba(255, 206, 86, 0.6); }
.liab-notes-payable { background-color: rgba(255, 159, 64, 0.6); }
.liab-other-current { background-color: rgba(75, 192, 192, 0.6); }


/* 全体レイアウト */
.bs-area-graph-layout {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

/* 左右の表 */
.bs-area-table-left,
.bs-area-table-right {
    flex: 0 0 30%;
    margin: 0 10px;
}

/* グラフ部分 */
.bs-area-graph-wrapper {
    flex: 0 0 35%;
    margin: 0 10px;
}

/* 表のスタイル */
.bs-area-table-header {
    background-color: #a8d8f0;
    color: #333;
    padding: 8px;
    margin: 0;
    text-align: center;
    font-size: 16px;
}

.bs-area-balance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bs-area-balance-table th,
.bs-area-balance-table td {
    border: 1px solid #ddd;
    padding: 4px 8px;
}

.bs-area-balance-table th {
    background-color: #f5f5f5;
    text-align: center;
}

.bs-area-balance-table td:nth-child(2),
.bs-area-balance-table td:nth-child(3) {
    text-align: right;
}

/* 項目区分のスタイル */
.category-header td {
    background-color: #f0f0f0;
    font-weight: bold;
}

.subtotal td {
    background-color: #f8f8f8;
    border-top: 2px solid #ddd;
}

.total td {
    background-color: #e6f2ff;
    font-weight: bold;
    border-top: 2px solid #aaa;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .bs-area-graph-layout {
        flex-direction: column;
    }
    
    .bs-area-table-left,
    .bs-area-table-right,
    .bs-area-graph-wrapper {
        flex: none;
        width: 100%;
        margin: 10px 0;
    }
}

/* 3カラムレイアウト */
.bs-area-three-column-layout {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin: 20px 0;
}

.bs-area-column {
    flex: 1;
    min-width: 0; /* flexboxの子要素が親コンテナをはみ出すのを防ぐ */
}

/* 各カラムの最小幅設定 */
.bs-area-table-left,
.bs-area-table-right {
    flex: 0 0 30%;
}

.bs-area-graph-wrapper {
    flex: 0 0 35%;
}

/* レスポンシブ対応 - 画面幅が狭い場合は縦並びに */
@media screen and (max-width: 992px) {
    .bs-area-three-column-layout {
        flex-direction: column;
    }
    
    .bs-area-column {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* 入力フォーム用スタイル */
.bs-area-balance-table.editable input.balance-input {
    width: 80px;
    text-align: right;
    padding: 4px;
    border: 1px solid #ddd;
}

.bs-area-balance-table .calculated-cell {
    font-weight: bold;
    background-color: #f0f8ff;
}

.bs-area-balance-table .percentage-cell {
    background-color: #f9f9f9;
    font-size: 0.9em;
    color: #666;
}

.indicators-input {
    margin-top: 20px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.indicators-table {
    width: 100%;
}

.indicators-table td:first-child {
    width: 40%;
}

.indicator-input {
    width: 80px;
    text-align: right;
    margin-right: 5px;
}

.bs-area-actions {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.balance-status {
    margin-right: 20px;
    padding: 5px 10px;
    border-radius: 3px;
}

.balance-status.ok {
    background-color: #dff0d8;
    color: #3c763d;
}

.balance-status.error {
    background-color: #f2dede;
    color: #a94442;
}

