/* ========================================
   スタンド制作管理 - カスタムスタイル
======================================== */

/* 共通 */
body {
    font-family: 'Hiragino Sans', 'Meiryo', 'Yu Gothic UI', sans-serif;
    background-color: #f7f8fa;
    color: #222;
}

/* ---- 管理者・発注者ページ ---- */
.sidebar {
    min-height: 100vh;
    background-color: #1e2a38;
    color: #c9d0d8;
    width: 220px;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid #111d28;
}

.sidebar .brand {
    padding: 14px 18px;
    font-size: 13px;
    font-weight: bold;
    background-color: #141e2b;
    border-bottom: 1px solid #111d28;
    color: #e8ecf0;
    text-decoration: none;
    display: block;
}

.sidebar .brand small {
    display: block;
    font-size: 10px;
    color: #6b7a8d;
    font-weight: normal;
    margin-top: 2px;
}

.sidebar nav a {
    display: block;
    padding: 8px 18px;
    color: #9aa5b4;
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: background 0.1s, color 0.1s;
}

.sidebar nav a:hover {
    background-color: #263040;
    color: #dde3ea;
}

.sidebar nav a.active {
    background-color: #263040;
    color: #fff;
    border-left-color: #4a90d9;
}

.sidebar .nav-section {
    padding: 10px 18px 3px;
    font-size: 10px;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

.sidebar .back-link {
    display: block;
    padding: 8px 18px;
    color: #4a5568;
    text-decoration: none;
    font-size: 12px;
    border-top: 1px solid #263040;
    margin-top: 8px;
}

.sidebar .back-link:hover {
    color: #9aa5b4;
}

.main-content {
    margin-left: 220px;
    padding: 20px 28px;
    min-height: 100vh;
    background-color: #f7f8fa;
}

.page-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d8dde4;
}

.page-header h1 {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: #1a2332;
}

/* ダッシュボードカード */
.stat-card {
    background: #fff;
    border-radius: 4px;
    padding: 14px 18px;
    border: 1px solid #d8dde4;
    border-left: 4px solid #4a90d9;
}

.stat-card.danger  { border-left-color: #c0392b; }
.stat-card.warning { border-left-color: #d68910; }
.stat-card.success { border-left-color: #1e8449; }

.stat-card .label {
    font-size: 11px;
    color: #6b7a8d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 26px;
    font-weight: bold;
    color: #1a2332;
    display: flex;
    align-items: baseline;
    gap: 3px;
    line-height: 1.2;
}

.stat-card .unit {
    font-size: 13px;
    color: #6b7a8d;
}

/* テーブル */
.table-container {
    background: #fff;
    border-radius: 4px;
    padding: 18px 20px;
    border: 1px solid #d8dde4;
    margin-bottom: 18px;
}

.table th {
    background-color: #f0f2f5;
    font-size: 12px;
    white-space: nowrap;
    color: #3a4556;
    font-weight: 600;
    border-bottom: 2px solid #d8dde4;
}

.table td {
    font-size: 13px;
    vertical-align: middle;
    border-color: #eaecef;
}

.table-hover tbody tr:hover td {
    background-color: #f4f6f9;
}

/* 在庫不足 */
.shortage-row {
    background-color: #fef9ec !important;
}

.stock-danger {
    color: #c0392b;
    font-weight: bold;
}

.stock-warning {
    color: #d68910;
    font-weight: bold;
}

/* フォーム */
.form-container {
    background: #fff;
    border-radius: 4px;
    padding: 22px 24px;
    border: 1px solid #d8dde4;
    max-width: 820px;
}

.form-section {
    border: 1px solid #d8dde4;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 14px;
    background: #fafbfc;
}

.form-section-title {
    font-size: 13px;
    font-weight: bold;
    color: #1a2332;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d8dde4;
}

/* ---- 制作者ページ (スマホ対応) ---- */
.maker-body {
    background: #f7f8fa;
    min-height: 100vh;
}

.maker-header {
    background: #1e2a38;
    color: #e8ecf0;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #111d28;
}

.maker-header .maker-name {
    font-size: 17px;
    font-weight: bold;
}

.maker-header .maker-period {
    font-size: 11px;
    color: #6b7a8d;
}

.maker-nav {
    background: #fff;
    border-bottom: 1px solid #d8dde4;
    padding: 0 8px;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.maker-nav a {
    color: #4a5568;
    text-decoration: none;
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

.maker-nav a.active,
.maker-nav a:hover {
    color: #1a2332;
    border-bottom-color: #4a90d9;
}

.maker-main {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* 制作者選択ボタン */
.maker-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 12px;
}

.maker-select-btn {
    background: #fff;
    border: 1px solid #b0bac7;
    border-radius: 4px;
    padding: 22px 16px;
    font-size: 17px;
    font-weight: bold;
    color: #1a2332;
    text-align: center;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    text-decoration: none;
    display: block;
}

.maker-select-btn:hover,
.maker-select-btn:active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}

/* 制作登録ボタン */
.btn-production {
    background: #1e8449;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 18px;
    font-size: 18px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
    margin-bottom: 14px;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-production:hover {
    background: #176b3a;
    color: #fff;
}

/* 在庫カード (制作者) */
.stock-item {
    background: #fff;
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #d8dde4;
}

.stock-item.shortage {
    border-left: 4px solid #c0392b;
    background: #fef9f9;
}

.stock-item .part-name {
    flex: 1;
    font-weight: bold;
    font-size: 14px;
}

.stock-item .stock-num {
    font-size: 20px;
    font-weight: bold;
    color: #1a2332;
    min-width: 56px;
    text-align: right;
}

.stock-item .stock-num.low {
    color: #c0392b;
}

/* 確認画面 */
.confirm-box {
    background: #fff;
    border-radius: 4px;
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid #d8dde4;
}

.confirm-box .confirm-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1a2332;
}

/* TOPページ */
.top-body {
    min-height: 100vh;
    background: #f7f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-card {
    background: #fff;
    border-radius: 4px;
    padding: 36px 44px;
    text-align: center;
    border: 1px solid #d8dde4;
    max-width: 420px;
    width: 90%;
}

.top-card h1 {
    font-size: 22px;
    font-weight: bold;
    color: #1a2332;
    margin-bottom: 6px;
}

.top-card .subtitle {
    color: #6b7a8d;
    font-size: 13px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.top-btn {
    display: block;
    padding: 13px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.1s;
}

.top-btn:hover {
    opacity: 0.88;
}

.btn-admin  { background: #1e2a38; color: #fff; }
.btn-order  { background: #6c3483; color: #fff; }
.btn-maker  { background: #1e8449; color: #fff; }

/* モバイルトップバー */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 200;
    background: #1e2a38;
    color: #e8ecf0;
    padding: 10px 16px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #111d28;
}

.mobile-topbar .mobile-title {
    font-size: 15px;
    font-weight: bold;
    flex: 1;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: #e8ecf0;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 149;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .mobile-topbar { display: flex; }
    .sidebar {
        display: block;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 150;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; padding: 12px; }
}

/* パーツ画像サムネイル */
.part-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d8dde4;
    flex-shrink: 0;
    display: block;
}

.part-thumb-lg {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d8dde4;
    display: block;
}

.part-thumb-empty {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    border: 1px dashed #c0c8d4;
    background: #f0f2f5;
    flex-shrink: 0;
}

/* ユーティリティ */
.text-yen::before { content: '¥'; }
.bg-white-shadow {
    background: #fff;
    border: 1px solid #d8dde4;
    border-radius: 4px;
}
.no-data { text-align: center; color: #9aa5b4; padding: 36px; font-size: 14px; }
