@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --tg-navy: #1e293b;
    --tg-slate: #475569;
    --tg-bg: #f1f5f9;
    --tg-card: #ffffff;
    --tg-text: #334155;
    --tg-border: #e2e8f0;
    --sidebar-width: 260px;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--tg-bg);
    color: var(--tg-text);
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* サイドバー */
.sidebar {
    width: var(--sidebar-width);
    background: var(--tg-navy);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand { padding: 30px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-section { padding: 25px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sidebar-label { font-size: 12px; font-weight: bold; color: #94a3b8; margin-bottom: 10px; display: block; }

.btn-logout-sidebar {
    display: block;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #f87171;
    color: #f87171;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    transition: 0.2s;
}
.btn-logout-sidebar:active { background: rgba(248, 113, 113, 0.1); }

/* メインコンテンツ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

.main-content.no-sidebar {
    margin-left: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container { padding: 30px 40px; max-width: 1200px; margin: 0 auto; box-sizing: border-box; width: 100%; }
.no-sidebar .container { max-width: 500px; padding: 20px; }

.card { background: var(--tg-card); border-radius: 12px; padding: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); margin-bottom: 20px; }

.header { background: white; padding: 15px 30px; border-bottom: 1px solid var(--tg-border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50; }

.menu-toggle { display: none; background: none; border: none; color: var(--tg-navy); font-size: 24px; cursor: pointer; padding: 0; margin-right: 15px; }

.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 900; }

/* フォーム要素 */
input, select, textarea { font-size: 16px; padding: 12px; border: 1px solid var(--tg-border); border-radius: 8px; width: 100%; box-sizing: border-box; background: #fff; }

/* 登録用：ネイビー */
.btn-primary { background: var(--tg-navy); color: white; border: none; padding: 14px; border-radius: 8px; font-weight: bold; cursor: pointer; text-decoration: none; text-align: center; display: inline-block; transition: 0.2s; }
.btn-primary:active { opacity: 0.8; transform: translateY(1px); }

/* 確定用：エメラルドグリーン (形状・サイズはbtn-primaryと完全同一) */
.btn-success { background: #10b981; color: white; border: none; padding: 14px; border-radius: 8px; font-weight: bold; cursor: pointer; text-decoration: none; text-align: center; display: inline-block; transition: 0.2s; }
.btn-success:active { opacity: 0.8; transform: translateY(1px); }

/* テーブル */
.responsive-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.responsive-table th { background: #f8fafc; padding: 18px 15px; text-align: left; color: #64748b; border-bottom: 2px solid var(--tg-border); white-space: nowrap; cursor: pointer; }
.responsive-table td { padding: 18px 15px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; line-height: 1.5; }

/* タブ */
.tab-item { font-weight: 500; color: #94a3b8; border-bottom: 3px solid transparent; transition: 0.3s; }
.tab-item.active { color: var(--tg-navy); border-bottom-color: var(--tg-navy); background: rgba(30, 41, 59, 0.05); font-weight: bold; }

.tab-nav { display: flex; gap: 15px; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn { padding: 12px 5px; cursor: pointer; border: none; background: none; font-weight: bold; color: #94a3b8; border-bottom: 3px solid transparent; font-size: 14px; white-space: nowrap; }
.tab-btn.active { color: var(--tg-navy); border-bottom-color: var(--tg-navy); }

/* 案内バナー */
.next-action-banner {
    background: #fffbeb; 
    border: 1px solid #fde68a; 
    border-radius: 12px; 
    padding: 18px 25px; 
    margin-bottom: 25px; 
    display: flex; 
    align-items: center; 
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* マスタグリッド */
.master-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

/* モーダル */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
.modal-content { background: white; padding: 30px; border-radius: 12px; width: 90%; max-width: 500px; position: relative; }
.close-modal { position: absolute; top: 15px; right: 15px; font-size: 20px; cursor: pointer; color: #94a3b8; }

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; }
    .container { padding: 15px; }
    .tab-btn { font-size: 13px; padding: 10px 3px; }
    .master-grid { grid-template-columns: 1fr; gap: 20px; }
    .stats-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .main-grid-layout { display: block !important; }
    .next-action-banner { padding: 15px; flex-direction: column; text-align: center; }
    .responsive-table thead { display: none; }
    .responsive-table tr { display: block; background: white; border: 1px solid var(--tg-border); border-radius: 12px; margin-bottom: 15px; padding: 15px; position: relative; }
    .responsive-table td { display: block; padding: 5px 0; border: none; text-align: left; width: 100% !important; box-sizing: border-box; }
    .td-date { font-size: 12px; color: #64748b; }
    .td-info { font-size: 15px; font-weight: bold; margin-bottom: 5px; padding-right: 90px !important; }
    
    /* スマホ表示時の金額位置の修正 */
    .responsive-table td.td-amount { 
        position: absolute; 
        top: 15px; 
        right: 15px; 
        left: auto !important;
        width: auto !important; 
        font-size: 16px; 
        font-weight: bold; 
        color: var(--tg-navy);
        text-align: right;
        white-space: nowrap;
        padding: 0;
    }
    
    .td-action { margin-top: 10px; padding-top: 10px !important; border-top: 1px dashed #eee !important; display: flex; justify-content: flex-end; gap: 15px; }
}