/* === 興亜耐火工業 ラベル発行Webシステム — スタイルシート === */
/* ブランドカラーは興亜耐火工業 コーポレートサイト(koa-ref.co.jp)に準拠 */

:root {
    /* コーポレートブランドカラー */
    --koa-red: #cc0011;        /* 興亜レッド(ロゴマーク) */
    --koa-red-dark: #a3000d;
    --koa-red-light: #e8424f;
    --ink: #17120f;            /* ブランドダーク(構造色) */
    --ink-2: #211a16;
    --ink-soft: #2e2420;

    /* 既存クラス互換トークン(暖色トーンに統一) */
    --primary: #17120f;        /* ダーク: 構造・見出し・表ヘッダー */
    --primary-light: #cc0011;  /* レッド: リンク・主要ボタン・アクセント */
    --success: #2e7d32;
    --warning: #e08600;
    --danger: #cc0011;
    --paper: #f3efe9;          /* 用紙色の背景 */
    --paper-2: #ebe4da;
    --line: #ddd5c9;
    --line-strong: #c8bdac;
    --gray-50: #f3efe9;
    --gray-100: #e8e1d6;
    --gray-200: #d9d1c5;
    --gray-300: #b3a896;
    --gray-600: #574e47;
    --gray-800: #2a2420;

    /* タイポグラフィ */
    --font-main: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    --font-disp: "Oswald", "Zen Kaku Gothic New", sans-serif;  /* 数値・英字の見出し */
    --font-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", monospace;

    --sidebar-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background-color: var(--paper);
    background-image:
        linear-gradient(rgba(23,18,15,.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23,18,15,.022) 1px, transparent 1px);
    background-size: 34px 34px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ===================================================== */
/* アプリシェル — 左サイドバー型ナビゲーション           */
/* ===================================================== */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--ink);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 200;
}

/* ブランド */
.sidebar-brand {
    position: relative;
    padding: 24px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand::before {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 4px; height: 100%;
    background: var(--koa-red);
}
.sidebar-brand img { width: 100%; max-width: 200px; height: auto; display: block; }
.sidebar-sys {
    display: block;
    margin-top: 11px;
    font-family: var(--font-disp);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .34em;
    color: rgba(255,255,255,.42);
}

/* ナビゲーション本体 */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 18px; }
.snav-sec {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 20px 12px 8px;
    font-family: var(--font-disp);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255,255,255,.38);
}
.snav-num { color: var(--koa-red-light); font-weight: 700; }
.snav {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 13px;
    margin: 2px 0;
    color: rgba(255,255,255,.74);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    border-radius: 0 5px 5px 0;
    transition: background .15s, color .15s, border-color .15s;
}
.snav-ic {
    width: 19px; height: 19px;
    flex: 0 0 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .82;
}
.snav:hover { background: rgba(255,255,255,.06); color: #fff; }
.snav.is-active {
    background: linear-gradient(90deg, rgba(204,0,17,.22), rgba(204,0,17,.03));
    color: #fff;
    border-left-color: var(--koa-red);
    font-weight: 700;
}
.snav.is-active .snav-ic { opacity: 1; stroke: var(--koa-red-light); }

/* フッター(アカウント) */
.sidebar-foot {
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: rgba(255,255,255,.82);
}
.sidebar-user-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #46c46b;
    box-shadow: 0 0 0 3px rgba(70,196,107,.2);
}
.sidebar-logout {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    padding: 6px 13px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 3px;
    transition: .15s;
}
.sidebar-logout:hover { background: var(--koa-red); border-color: var(--koa-red); color: #fff; }

/* メインエリア */
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* トップバー(モバイル時のみ表示) */
.topbar { display: none; }
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px; height: 36px;
    padding: 7px;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.topbar-brand img { height: 20px; display: block; }
.sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(23,18,15,.5); z-index: 180; }

@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 0 50px rgba(0,0,0,.45);
    }
    .sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .topbar {
        display: flex;
        align-items: center;
        gap: 14px;
        height: 56px;
        padding: 0 14px;
        background: #fff;
        border-bottom: 3px solid var(--koa-red);
        position: sticky;
        top: 0;
        z-index: 150;
    }
    .sidebar-scrim.show { display: block; }
}

/* === コンテナ === */
.container {
    flex: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 44px 34px;
}
@media (max-width: 980px) { .container { padding: 26px 20px; } }

/* === フラッシュメッセージ === */
.flash {
    padding: 12px 18px;
    border-radius: 2px;
    margin-bottom: 16px;
    font-weight: 500;
}
.flash-success { background: #dceee0; color: #1e6b35; border-left: 4px solid var(--success); }
.flash-error { background: #f7dcdc; color: #8e1d20; border-left: 4px solid var(--danger); }

/* === メトリクス計器パネル(統計) === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 0;
    margin-bottom: 36px;
    background: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: 5px 5px 0 rgba(23,18,15,.08);
}
.stat-card {
    position: relative;
    background: var(--ink);
    color: #fff;
    border-radius: 0;
    padding: 22px 24px 20px;
    text-align: left;
    box-shadow: none;
    border-left: 1px solid rgba(255,255,255,.07);
    transition: background .15s;
}
.stat-card:first-child { border-left: none; }
.stat-card:hover { background: var(--ink-2); }
.stat-number {
    font-family: var(--font-disp);
    font-size: 46px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    letter-spacing: .01em;
}
.stat-label {
    font-size: 12px;
    color: rgba(255,255,255,.58);
    margin-top: 8px;
    letter-spacing: .05em;
}
.stat-label::before { content: "▸ "; color: var(--koa-red-light); }
.stat-link {
    display: inline-block;
    margin-top: 13px;
    color: var(--koa-red-light);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.stat-link:hover { color: #fff; }

/* === クイック操作(設計図ブロック) === */
.quick-actions h2 { margin-bottom: 16px; }
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(204px, 1fr));
    gap: 14px;
}
.action-btn {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 20px 22px;
    border-radius: 0;
    text-decoration: none;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    font-weight: 700;
    font-size: 14.5px;
    box-shadow: 4px 4px 0 rgba(23,18,15,.06);
    overflow: hidden;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.action-btn::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--koa-red);
}
.action-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(204,0,17,.18);
    border-color: var(--ink);
}
.action-ic {
    width: 30px; height: 30px;
    flex: 0 0 30px;
    fill: none;
    stroke: var(--koa-red);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* 旧カラーバリアントは統一トーンへ */
.action-upload, .action-cards, .action-pallets, .action-export { background: #fff; color: var(--ink); }

/* === ボタン === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .02em;
    font-family: var(--font-main);
    transition: transform .12s, box-shadow .12s, background .15s, border-color .15s;
}
.btn-primary { background: var(--koa-red); color: #fff; box-shadow: 3px 3px 0 rgba(23,18,15,.16); }
.btn-primary:hover { background: var(--koa-red-dark); transform: translate(-1px,-1px); box-shadow: 4px 4px 0 rgba(23,18,15,.22); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--paper-2); border-color: var(--ink); }
.btn-success { background: var(--success); color: #fff; box-shadow: 3px 3px 0 rgba(23,18,15,.16); }
.btn-success:hover { background: #25682c; transform: translate(-1px,-1px); }
.btn-lg { padding: 13px 30px; font-size: 15px; }
.btn-sm { padding: 5px 11px; font-size: 12px; box-shadow: none; }
.btn-back { margin-bottom: 16px; }

/* === 検索フォーム === */
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.search-input {
    flex: 1;
    max-width: 400px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    font-size: 14px;
    font-family: var(--font-main);
    background: #fff;
}
.search-input:focus { outline: none; border-color: var(--koa-red); box-shadow: 0 0 0 3px rgba(204,0,17,.12); }

/* === テーブル(台帳スタイル) === */
.table-wrapper { overflow-x: auto; border: 1px solid var(--line-strong); box-shadow: 4px 4px 0 rgba(23,18,15,.05); }
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0;
}
.data-table th, .data-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table th {
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .05em;
}
.data-table tbody tr:hover { background: #faf2ea; }
.data-table a:not(.btn) { color: var(--koa-red); text-decoration: none; font-weight: 500; }
.data-table a:not(.btn):hover { text-decoration: underline; }
.result-count { margin-top: 8px; color: var(--gray-600); font-size: 13px; }
.no-data { text-align: center; padding: 40px; color: var(--gray-600); }

/* === ラベル種別の注記（パレット一覧） === */
.spec-note {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fce9ea;
    color: var(--koa-red-dark);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* === 詳細テーブル === */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
.detail-section { margin-bottom: 24px; }
.detail-section h2 { margin-bottom: 12px; font-size: 18px; color: var(--primary); }
.detail-table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.detail-table th, .detail-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
}
.detail-table th { background: var(--gray-50); width: 140px; font-weight: 600; }

/* === アップロード === */
.upload-section { margin-bottom: 32px; }
.upload-form {
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    max-width: 600px;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-group select, .form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-main);
}
.file-drop-zone {
    border: 2px dashed var(--gray-200);
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
    border-color: var(--primary-light);
    background: #eaf2f8;
}
.file-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.file-name { color: var(--primary-light); font-weight: 600; margin-top: 8px; }

.csv-info { margin-top: 32px; }
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.info-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.info-card h3 { color: var(--primary); margin-bottom: 8px; }
.info-note { color: var(--gray-600); font-size: 12px; margin-top: 8px; font-style: italic; }

/* === アクションバー === */
.action-bar { display: flex; gap: 12px; margin-bottom: 20px; }

/* ============================= */
/* ラベル印刷用スタイル          */
/* ============================= */
.label-controls { margin-bottom: 24px; display: flex; gap: 12px; align-items: center; }

.label-page {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
    max-width: 800px;
}

.label-sheet {
    font-family: "Meiryo", "MS Gothic", sans-serif;
}

.label-header {
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.label-title { font-size: 20px; font-weight: bold; }
.label-recipient { font-size: 22px; }
.label-honorific { margin-left: 8px; font-size: 16px; }
.label-meta { font-size: 12px; color: var(--gray-600); margin-top: 4px; }
.label-type-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 13px;
    margin-right: 12px;
    vertical-align: middle;
}

.label-body-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.label-body-table th, .label-body-table td {
    border: 1px solid #333;
    padding: 6px 10px;
    font-size: 13px;
}
.label-body-table th { background: #f0f0f0; font-weight: bold; text-align: center; }
.label-body-table td.num { text-align: right; }
.col-hinmei { width: 35%; }
.col-hinshitsu { width: 20%; }
.col-tanju { width: 15%; text-align: center; }
.col-suryo { width: 15%; text-align: center; }
.col-juryo { width: 15%; text-align: center; }
.total-row { background: #f9f9f9; font-weight: bold; }

.label-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 12px;
    border-top: 2px solid #000;
}
.label-footer-left { flex: 1; }
.label-footer-center { flex: 0 0 auto; text-align: center; padding: 0 16px; }
.label-footer-right { flex: 0 0 auto; }
.company-name { font-size: 14px; font-weight: bold; margin-bottom: 4px; }
.of-code { font-size: 18px; font-weight: bold; color: var(--primary); }
.pal-info { font-size: 12px; color: var(--gray-600); }
.qr-code { width: 120px; height: 120px; }
.stamp-area { display: flex; gap: 8px; }
.stamp-box {
    width: 60px;
    height: 60px;
    border: 2px solid #333;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}
.stamp-title { font-size: 10px; font-weight: bold; }

.label-sheet-kenshu { border: 2px solid var(--primary); padding: 16px; }
.label-sheet-kenshu .label-header { border-bottom-color: var(--primary); }
.label-sheet-kenshu .label-footer { border-top-color: var(--primary); }

.qr-content {
    background: var(--gray-50);
    padding: 12px;
    border-radius: 4px;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* === フッター === */
.footer {
    text-align: center;
    padding: 28px 20px 30px;
    color: var(--gray-600);
    font-size: 12px;
    margin-top: auto;
    border-top: 1px solid var(--line-strong);
    background: transparent;
}
.footer-logo {
    height: 17px;
    display: block;
    margin: 0 auto 10px;
    opacity: .45;
}
.footer-since {
    font-family: var(--font-disp);
    letter-spacing: .16em;
    text-transform: uppercase;
    font-size: 10.5px;
    color: var(--gray-300);
    margin-top: 6px;
}

/* === 見出し(エディトリアル) === */
h1 {
    position: relative;
    font-size: 30px;
    line-height: 1.18;
    margin-bottom: 26px;
    padding-top: 17px;
    color: var(--ink);
    font-weight: 900;
    letter-spacing: .01em;
    border: none;
}
h1::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 48px; height: 4px;
    background: var(--koa-red);
}
h1 small { font-weight: 500; color: var(--gray-600); }
h2 {
    font-size: 17px;
    margin-bottom: 14px;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: .01em;
}

/* ============================= */
/* ラベル制御パネル              */
/* ============================= */
.lbl-ctrl-panel {
    background: #fff;
    border-bottom: 2px solid var(--primary);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.lbl-ctrl-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.lbl-ctrl-bottom {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.lbl-ctrl-of    { font-size: 16px; }
.lbl-ctrl-nounyu { color: var(--gray-600); font-size: 14px; }

/* 指定ラベル種別バッジ */
.spec-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: var(--ink);   /* 既定色: 未割当の種別でも必ず読める */
    white-space: nowrap;
}
.spec-generic        { background: #6a615a; }
.spec-spec_30018     { background: #0f7d68; }
.spec-spec_shinagawa,
.spec-spec_shinagawa_h { background: #7d3c98; }
.spec-spec_kansai    { background: #b9770e; }
.spec-spec_kitaetsu  { background: #1f6aa5; }
.spec-spec_nippon    { background: #b0392b; }
.spec-spec_utsunomiya{ background: #c0522a; }
.spec-spec_jfe       { background: #1e8a4c; }
.spec-spec_kobelco   { background: #1a5276; }
.spec-spec_daido_a,
.spec-spec_daido_b   { background: #5d4037; }

/* 枝番セレクタ */
.suffix-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.suffix-label { font-weight: bold; font-size: 14px; }
.suffix-btn.active-sfx { box-shadow: 0 0 0 2px #000; }

/* 印刷枚数入力 */
.print-math-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.print-math-input {
    width: 64px;
    padding: 6px 8px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 16px;
    font-family: var(--font-main);
    text-align: center;
}
.lbl-ctrl-btns { display: flex; gap: 8px; }

/* ============================= */
/* ラベル共通スタイル            */
/* ============================= */
#label-area {
    padding: 24px;
    background: var(--gray-50);
}
.label-page {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 24px 28px;
    margin: 0 auto 32px;
    max-width: 780px;
    font-family: "Meiryo", "MS Gothic", sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.lbl-ochu { font-size: 0.65em; vertical-align: middle; margin-left: 4px; }
.lbl-g-meta {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 4px;
    border-top: 1px solid var(--gray-200);
    padding-top: 4px;
}

/* ラベル共通テーブル */
.lbl-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.lbl-table th, .lbl-table td {
    border: 1px solid #555;
    padding: 5px 8px;
}
.lbl-table th {
    background: #e8e8e8;
    font-weight: bold;
    text-align: center;
}
.lbl-table .num { text-align: right; }
.total-row { background: #f5f5f5; font-weight: bold; }
.total-label { text-align: center; }

/* 列幅 */
.col-hinmei    { width: 38%; }
.col-hinshitsu { width: 22%; }
.col-tanju     { width: 13%; text-align: center; }
.col-suryo     { width: 13%; text-align: center; }
.col-juryo     { width: 14%; text-align: center; }

/* ============================= */
/* 通常ラベル                    */
/* ============================= */
.lbl-generic {}
.lbl-g-header { margin-bottom: 10px; }
.lbl-g-title {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 4px;
}
.lbl-g-company { font-size: 14px; font-weight: bold; }
.lbl-g-nounyu  { font-size: 26px; font-weight: bold; margin: 6px 0 2px; }

.lbl-g-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 2px solid #333;
    padding-top: 10px;
    margin-top: 8px;
}
.lbl-g-footer-left  { flex: 1; }
.lbl-g-footer-center{ flex: 0 0 auto; text-align: center; padding: 0 16px; }
.lbl-g-footer-right { flex: 0 0 auto; }
.of-code { font-size: 18px; font-weight: bold; color: var(--primary); }
.pal-info { font-size: 12px; color: var(--gray-600); }
.qr-code { width: 120px; height: 120px; }
.stamp-area { display: flex; gap: 8px; }
.stamp-box {
    width: 64px;
    height: 64px;
    border: 2px solid #333;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}
.stamp-title { font-size: 11px; font-weight: bold; }

/* ============================= */
/* シンプル指定ラベル            */
/* （30018・品川系・北越・日鉄）*/
/* ============================= */
.lbl-spec-simple {}
.spec-nounyu-large {
    font-size: 34px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #333;
    padding: 10px;
    margin-bottom: 6px;
}
.lbl-table-spec .col-hinmei    { width: 48%; }
.lbl-table-spec .col-hinshitsu { width: 30%; }
.lbl-table-spec .col-suryo     { width: 22%; text-align: center; }

.spec-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 2px solid #333;
    padding-top: 10px;
    margin-top: 8px;
}
.spec-footer-left  { flex: 1; }
.spec-footer-center{ flex: 0 0 auto; padding: 0 16px; }
.spec-footer-right { flex: 0 0 auto; }
.spec-lot { font-size: 14px; margin-bottom: 4px; }
.spec-ofcode-bc {
    font-family: "Libre Barcode 39", "CODE39", monospace;
    font-size: 28px;
    letter-spacing: 2px;
}
.spec-company-footer {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border-top: 1px solid #333;
    padding-top: 8px;
    margin-top: 8px;
}

/* ============================= */
/* JFE/Kobelco/大同スタイル     */
/* ============================= */
.lbl-jfe {}
.jfe-tokki {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 4px;
    border: 1px solid #555;
    margin-bottom: 4px;
}
.jfe-nounyu-large {
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #333;
    padding: 8px;
    margin-bottom: 6px;
}
.lbl-table-jfe .jfe-col-left  { width: 55%; }
.lbl-table-jfe .jfe-col-right { width: 45%; text-align: right; }
.jfe-hinmei    { font-size: 15px; font-weight: bold; }
.jfe-hinshitsu { font-size: 13px; padding-left: 12px !important; }
.jfe-weight    { font-size: 18px; font-weight: bold; vertical-align: bottom; }
.jfe-qty-detail { font-size: 12px; color: var(--gray-600); }
.jfe-row-top td { border-bottom: none; padding-bottom: 2px; }
.jfe-row-btm td { border-top: none; padding-top: 2px; }

.jfe-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 2px solid #333;
    padding-top: 10px;
    margin-top: 8px;
}
.jfe-footer-left  { flex: 1; }
.jfe-footer-right { flex: 0 0 auto; text-align: center; }
.jfe-ofcode-label { font-size: 11px; color: var(--gray-600); }
.jfe-lot { font-size: 13px; margin-top: 6px; }
.jfe-company-footer { font-size: 16px; font-weight: bold; margin-top: 8px; }

/* ============================= */
/* 印刷用CSS                    */
/* ============================= */
@media print {
    .no-print, .navbar, .sidebar, .topbar, .sidebar-scrim,
    .footer, .lbl-ctrl-panel,
    .label-controls, .flash { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .container { max-width: none !important; padding: 0 !important; }
    body { background: #fff !important; }
    #label-area { padding: 0; background: #fff; }
    .label-page {
        border: none;
        box-shadow: none;
        padding: 12mm 10mm;
        margin: 0;
        max-width: 100%;
        page-break-after: always;
    }
    /* 選択されていない枝番は印刷しない */
    .label-page:not(.print-active) { display: none !important; }
    .label-page:last-child { page-break-after: auto; }
    body { background: #fff; }

    .lbl-g-nounyu    { font-size: 22px; }
    .spec-nounyu-large { font-size: 28px; }
    .jfe-nounyu-large  { font-size: 24px; }
    .lbl-table th, .lbl-table td { font-size: 11px; padding: 4px 6px; }
    .qr-code { width: 100px; height: 100px; }
    .of-code { font-size: 15px; }
}

/* ============================= */
/* 認証 (ログイン / 2段階認証)   */
/* ============================= */
.flash-warning { background: #fdf2dc; color: #9c6a0e; border-left: 4px solid var(--warning); }

.auth-body {
    background:
        url("/img/koa-mark-white.svg") no-repeat right -60px bottom -40px,
        linear-gradient(150deg, var(--ink) 0%, #3a1416 55%, var(--koa-red-dark) 100%);
    background-size: 420px auto, cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    background: #fff;
    width: 100%;
    max-width: 392px;
    border-radius: 2px;
    border-top: 4px solid var(--koa-red);
    box-shadow: 14px 14px 0 rgba(0,0,0,.22);
    padding: 34px 34px 28px;
}
.auth-logo {
    display: block;
    height: 24px;
    margin: 0 auto 20px;
}
.auth-title {
    text-align: center;
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 4px;
    padding-top: 0;
}
.auth-title::before { display: none; }
.auth-sub {
    text-align: center;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}
.auth-form { display: flex; flex-direction: column; }
.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 12px 0 4px;
}
.auth-input {
    padding: 11px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 3px;
    font-size: 15px;
    font-family: var(--font-main);
}
.auth-input:focus {
    outline: none;
    border-color: var(--koa-red);
    box-shadow: 0 0 0 3px rgba(204,0,17,.14);
}
.auth-code {
    letter-spacing: 8px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
}
.auth-btn {
    margin-top: 24px;
    padding: 13px;
    background: var(--koa-red);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(23,18,15,.18);
    transition: background .2s, transform .12s, box-shadow .12s;
}
.auth-btn:hover { background: var(--koa-red-dark); transform: translate(-1px,-1px); box-shadow: 5px 5px 0 rgba(23,18,15,.24); }
.auth-resend { text-align: center; margin-top: 14px; }
.auth-link-btn {
    background: none;
    border: none;
    color: var(--primary-light);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}
.auth-note {
    margin-top: 18px;
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.6;
    text-align: center;
}
.auth-note a { color: var(--koa-red); }
