* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fa;
    color: #222;
    font-size: 14px;
}

a {
    color: #1298c7;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================================================
   Header
========================================================= */

.admin-header {
    width: 100%;
}

.admin-header-top {
    height: 44px;
    background: #2f3438;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-size: 14px;
}

.admin-header-main {
    min-height: 48px;
    background: #27acd3;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.admin-company {
    font-weight: bold;
}

.admin-logo {
    margin-right: 28px;
    font-size: 24px;
    font-weight: bold;
    white-space: nowrap;
}

.admin-logo a {
    color: #fff;
    text-decoration: none;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-nav > a,
.admin-dropdown-btn {
    color: #fff;
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    padding: 14px 12px;
    display: block;
}

.admin-nav > a:hover,
.admin-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.admin-dropdown {
    position: relative;
}

.admin-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #d9e1e7;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    z-index: 9999;
}

.admin-dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    background: #fff;
    border-bottom: 1px solid #eef2f5;
    text-decoration: none;
    font-size: 14px;
}

.admin-dropdown-menu a:hover {
    background: #f5f7fa;
}

.admin-dropdown:hover .admin-dropdown-menu {
    display: block;
}

/* =========================================================
   Layout
========================================================= */

.admin-main,
.admin-container {
    max-width: 1680px;
    margin: 0 auto;
    padding: 70px 32px 60px;
}

.admin-page {
    width: 100%;
}

.admin-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 24px;
}

.admin-page-title {
    margin: 0 0 14px;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
}

.admin-page-description {
    margin: 0;
    color: #555;
    line-height: 1.8;
}

.admin-page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 4px;
}

.admin-card,
.admin-box {
    background: #fff;
    border: 1px solid #cfe3ec;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 22px;
}

.admin-card-header,
.admin-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: -20px -20px 0;
    padding: 18px 20px;
    border-bottom: 1px solid #d9eaf1;
    background: #f8fcfe;
    border-radius: 6px 6px 0 0;
}

.admin-card-title,
.admin-box-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.admin-card-body,
.admin-box-body {
    padding-top: 18px;
}

.admin-page-header {
    margin-bottom: 24px;
}

/* =========================================================
   Compact Card
========================================================= */

.admin-card-compact {
    padding: 16px 20px;
}

.admin-card-compact .admin-card-header {
    margin: -16px -20px 12px;
    padding: 14px 20px;
}

.admin-card-compact .admin-card-body {
    padding-top: 0;
}

/* =========================================================
   Messages
========================================================= */

.admin-summary,
.admin-summary-box {
    padding: 16px 18px;
    margin-bottom: 20px;
    background: #fff8df;
    border: 1px solid #ead68a;
    border-radius: 4px;
}

.admin-message,
.admin-message-success {
    padding: 13px 16px;
    margin-bottom: 18px;
    border-radius: 4px;
    background: #e9f8ef;
    border: 1px solid #a7dfbd;
    color: #207a3b;
}

.admin-error,
.admin-message-error {
    padding: 13px 16px;
    margin-bottom: 18px;
    border-radius: 4px;
    background: #fff0f0;
    border: 1px solid #f0b0b0;
    color: #c62828;
}

.admin-alert {
    padding: 13px 16px;
    margin-bottom: 18px;
    border-radius: 4px;
    background: #fff8df;
    border: 1px solid #ead68a;
    color: #7a5b00;
}

.admin-empty {
    padding: 20px;
    background: #fff;
    border: 1px solid #d9e1e7;
    border-radius: 4px;
    color: #666;
}

/* =========================================================
   Form
========================================================= */

.admin-form-row {
    margin-bottom: 18px;
}

.admin-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="month"],
input[type="file"],
input[type="number"],
select,
textarea {
    padding: 8px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

textarea {
    line-height: 1.6;
}

.admin-input-sm {
    width: 90px;
}

.admin-input-md {
    width: 180px;
}

.admin-input-lg {
    width: 320px;
    max-width: 100%;
}

.admin-textarea-wide {
    width: 100%;
    min-height: 90px;
}

/* =========================================================
   Filter
========================================================= */

.admin-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.admin-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-filter label {
    font-weight: bold;
    font-size: 14px;
}

.admin-filter input,
.admin-filter select {
    min-width: 220px;
}

.admin-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* =========================================================
   Compact Filter
========================================================= */

.admin-filter-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-filter-compact .admin-filter-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.admin-filter-compact label {
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
}

.admin-filter-compact input,
.admin-filter-compact select {
    min-width: 170px;
    height: 34px;
    padding: 6px 8px;
}

.admin-filter-compact .admin-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   Buttons
========================================================= */

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.admin-btn,
.admin-actions a,
.admin-actions button,
.admin-filter button,
.admin-filter a,
.admin-filter-compact button,
.admin-filter-compact a {
    display: inline-block;
    padding: 9px 18px;
    border: 0;
    border-radius: 4px;
    background: #27acd3;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
}

.admin-btn:hover,
.admin-actions a:hover,
.admin-actions button:hover,
.admin-filter button:hover,
.admin-filter a:hover,
.admin-filter-compact button:hover,
.admin-filter-compact a:hover {
    background: #1d9bc0;
    color: #fff;
    text-decoration: none;
}

.admin-btn-primary {
    background: #27acd3;
    color: #fff;
}

.admin-btn-green {
    background: #22a957;
    color: #fff;
}

.admin-btn-green:hover {
    background: #1b9149;
}

.admin-btn-secondary,
.admin-actions a.admin-btn-secondary,
.admin-actions button.admin-btn-secondary,
.admin-filter a.admin-btn-secondary,
.admin-filter button.admin-btn-secondary,
.admin-filter-compact a.admin-btn-secondary,
.admin-filter-compact button.admin-btn-secondary {
    background: transparent;
    color: #1298c7;
    border: 0;
    padding-left: 0;
    padding-right: 0;
}

.admin-btn-secondary:hover,
.admin-actions a.admin-btn-secondary:hover,
.admin-actions button.admin-btn-secondary:hover,
.admin-filter a.admin-btn-secondary:hover,
.admin-filter button.admin-btn-secondary:hover,
.admin-filter-compact a.admin-btn-secondary:hover,
.admin-filter-compact button.admin-btn-secondary:hover {
    background: transparent;
    color: #0c7fa8;
    text-decoration: underline;
}

.admin-btn-danger {
    background: #d93025;
    color: #fff;
}

.admin-btn-danger:hover {
    background: #b3261e;
}

.admin-btn-small {
    padding: 7px 12px;
    font-size: 13px;
}

.admin-link-btn {
    display: inline-block;
    margin-left: 10px;
}

/* =========================================================
   Table
========================================================= */

.admin-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.admin-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
    table-layout: fixed;
}

.admin-table th,
.admin-table td {
    padding: 13px 12px;
    border: 1px solid #d9e1e7;
    vertical-align: middle;
}

.admin-table th {
    background: #35aeca;
    color: #fff;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

.admin-table tbody tr:hover {
    background: #f5fbff;
}

.admin-table .num {
    text-align: right;
    white-space: nowrap;
}

.admin-table .center {
    text-align: center;
}

.admin-table .nowrap {
    white-space: nowrap;
}

.admin-table td {
    word-break: break-word;
}

.admin-table input[type="number"],
.admin-table input[type="text"] {
    width: 100%;
    max-width: 100%;
}

.admin-table input[type="number"] {
    text-align: right;
}

.admin-table-normal,
.admin-table-product,
.admin-table-wide,
.admin-table-xwide {
    min-width: 0;
}

/* =========================================================
   Stock receive table
   通常入庫・KIZUNA入庫用
========================================================= */

.admin-table th.stock-maker-col,
.admin-table td.stock-maker-col {
    width: 7%;
}

.admin-table th.stock-name-col,
.admin-table td.stock-name-col {
    width: 25%;
}

.admin-table th.stock-model-col,
.admin-table td.stock-model-col {
    width: 12%;
}

.admin-table th.stock-order-code-col,
.admin-table td.stock-order-code-col {
    width: 12%;
}

.admin-table th.stock-jan-col,
.admin-table td.stock-jan-col {
    width: 13%;
}

.admin-table th.stock-color-col,
.admin-table td.stock-color-col {
    width: 10%;
}

.admin-table th.stock-size-col,
.admin-table td.stock-size-col {
    width: 8%;
}

.admin-table th.stock-now-col,
.admin-table td.stock-now-col {
    width: 6%;
    text-align: right;
    white-space: nowrap;
}

.admin-table th.stock-qty-col,
.admin-table td.stock-qty-col {
    width: 7%;
    text-align: right;
    white-space: nowrap;
}

.admin-table .stock-qty-input {
    width: 86px;
    max-width: 100%;
    height: 34px;
    padding: 6px 8px;
    text-align: right;
}

.admin-table td.stock-name-col,
.admin-table td.stock-model-col,
.admin-table td.stock-order-code-col,
.admin-table td.stock-jan-col,
.admin-table td.stock-color-col,
.admin-table td.stock-size-col {
    white-space: normal;
    word-break: break-word;
}

/* =========================================================
   Stock list table
   在庫一覧専用
========================================================= */

.admin-table-product {
    width: 100%;
    table-layout: fixed;
}

/*
 * PC表示では基本的に画面内へ収める。
 * ただし狭い画面では横スクロールできるようにしておく。
 */
.admin-table-product-wrap,
.admin-table-wrap:has(.admin-table-product) {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table th.stock-list-id-col,
.admin-table td.stock-list-id-col {
    width: 55px;
    min-width: 55px;
}

.admin-table th.stock-list-barcode-col,
.admin-table td.stock-list-barcode-col {
    width: 130px;
    min-width: 130px;
}

.admin-table th.stock-list-name-col,
.admin-table td.stock-list-name-col {
    width: 30%;
}

.admin-table th.stock-list-code-col,
.admin-table td.stock-list-code-col {
    width: 140px;
}

.admin-table th.stock-list-maker-col,
.admin-table td.stock-list-maker-col {
    width: 110px;
}

.admin-table th.stock-list-category-col,
.admin-table td.stock-list-category-col {
    width: 100px;
}

.admin-table th.stock-list-price-col,
.admin-table td.stock-list-price-col {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
}

.admin-table th.stock-list-stock-col,
.admin-table td.stock-list-stock-col {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
}

.admin-table th.stock-list-amount-col,
.admin-table td.stock-list-amount-col {
    width: 95px;
    min-width: 95px;
    max-width: 95px;
}

.admin-table th.stock-list-action-col,
.admin-table td.stock-list-action-col {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

.admin-table td.stock-list-name-col,
.admin-table td.stock-list-code-col,
.admin-table td.stock-list-maker-col,
.admin-table td.stock-list-category-col {
    white-space: normal;
    word-break: break-word;
    line-height: 1.6;
}

.admin-table td.stock-list-price-col,
.admin-table td.stock-list-stock-col,
.admin-table td.stock-list-amount-col {
    white-space: nowrap;
}

.admin-table td.stock-list-action-col {
    white-space: normal !important;
    text-align: center;
    padding: 8px 6px;
}

/* =========================================================
   Stock list operation buttons
========================================================= */

.stock-row-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.stock-row-actions .admin-btn,
.stock-row-actions .admin-btn-small,
.stock-row-btn {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 7px 4px;
    border-radius: 4px;
    text-align: center;
    line-height: 1.2;
    font-size: 12px;
    white-space: nowrap;
}

.stock-row-btn-detail {
    background: #27acd3;
    color: #fff;
}

.stock-row-btn-detail:hover {
    background: #1d9bc0;
    color: #fff;
}

.stock-row-btn-history {
    background: #555;
    color: #fff;
}

.stock-row-btn-history:hover {
    background: #444;
    color: #fff;
}

.stock-row-actions br,
td.stock-list-action-col br {
    display: none;
}

/* =========================================================
   Stock page action buttons
========================================================= */

.stock-main-actions,
.stock-list-actions {
    gap: 10px;
}

.stock-action-receive {
    background: #2ca9c9;
}

.stock-action-kizuna {
    background: #1f9d55;
}

.stock-action-adjust {
    background: #6f8fb3;
}

.stock-action-receipt-history {
    background: #337ab7;
}

.stock-action-history {
    background: #555;
}

/* =========================================================
   Label / Status
========================================================= */

.admin-label {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eee;
    color: #333;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.admin-label-blue {
    background: #e8f1ff;
    color: #1c5fb8;
}

.admin-label-green {
    background: #24a957;
    color: #fff;
}

.admin-label-red {
    background: #fff0f0;
    color: #c62828;
}

.admin-label-yellow {
    background: #fff8df;
    color: #7a5b00;
}

.admin-label-gray {
    background: #eef2f5;
    color: #555;
}

.admin-status-ok {
    color: #207a3b;
    font-weight: bold;
}

.admin-status-ng {
    color: #c62828;
    font-weight: bold;
}

.admin-status-muted {
    color: #777;
}

/* =========================================================
   Detail / Count
========================================================= */

.admin-count {
    margin: 0;
    color: #555;
}

.admin-note {
    color: #666;
    font-size: 13px;
    line-height: 1.7;
}

.admin-small {
    font-size: 12px;
    color: #666;
}

.admin-detail-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.admin-detail-table th,
.admin-detail-table td {
    padding: 12px;
    border: 1px solid #d9e1e7;
    vertical-align: top;
}

.admin-detail-table th {
    width: 180px;
    background: #35aeca;
    color: #fff;
    text-align: left;
    white-space: nowrap;
}

/* =========================================================
   Pagination
========================================================= */

.admin-pagination,
.admin-pager {
    margin-top: 20px;
    text-align: center;
}

.admin-pagination a,
.admin-pagination span,
.admin-pager a,
.admin-pager span {
    display: inline-block;
    min-width: 34px;
    padding: 7px 10px;
    margin: 0 2px 6px;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
}

.admin-pagination a:hover,
.admin-pager a:hover {
    background: #f1f5f8;
    text-decoration: none;
}

.admin-pagination-current,
.admin-pager .current {
    display: inline-block;
    min-width: 34px;
    padding: 7px 10px;
    margin: 0 2px 6px;
    border: 1px solid #27acd3;
    border-radius: 4px;
    background: #27acd3;
    color: #fff;
    font-weight: bold;
}

/* =========================================================
   Utility
========================================================= */

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #777;
}

.mt-0 {
    margin-top: 0;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* =========================================================
   Responsive
========================================================= */

@media screen and (max-width: 768px) {
    .admin-header-main {
        display: block;
        padding: 10px 14px;
    }

    .admin-logo {
        margin: 0 0 8px;
        font-size: 22px;
    }

    .admin-nav {
        display: block;
    }

    .admin-nav > a,
    .admin-dropdown-btn {
        width: 100%;
        text-align: left;
        padding: 10px 8px;
    }

    .admin-dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border-radius: 4px;
        margin-bottom: 6px;
    }

    .admin-dropdown:hover .admin-dropdown-menu {
        display: block;
    }

    .admin-main,
    .admin-container {
        max-width: none;
        width: 100%;
        padding: 24px 10px 40px;
    }

    .admin-page-head {
        display: block;
    }

    .admin-page-title {
        font-size: 30px;
    }

    .admin-page-actions {
        margin-top: 16px;
    }

    .admin-card,
    .admin-box {
        padding: 16px;
    }

    .admin-card-header,
    .admin-box-header {
        margin: -16px -16px 0;
        padding: 14px 16px;
    }


    .admin-filter {
        display: block;
    }

    .admin-filter-item {
        margin-bottom: 12px;
    }

    .admin-filter input,
    .admin-filter select {
        width: 100%;
        min-width: 0;
    }

    .admin-filter-actions {
        display: block;
    }

    .admin-filter-actions a,
    .admin-filter-actions button {
        margin-bottom: 6px;
    }

    .admin-filter-compact {
        display: block;
    }

    .admin-filter-compact .admin-filter-item {
        display: block;
        margin-bottom: 10px;
    }

    .admin-filter-compact input,
    .admin-filter-compact select {
        width: 100%;
        min-width: 0;
    }

    .admin-filter-compact .admin-filter-actions {
        display: flex;
        gap: 8px;
    }

    .admin-actions {
        display: block;
    }

    .admin-actions a,
    .admin-actions button {
        margin-bottom: 6px;
    }

    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        table-layout: auto;
    }

    .admin-table-product,
    .admin-table-wide,
    .admin-table-xwide {
        min-width: 1180px;
    }

    .admin-table th.stock-maker-col,
    .admin-table td.stock-maker-col {
        width: 90px;
        min-width: 90px;
    }

    .admin-table th.stock-name-col,
    .admin-table td.stock-name-col {
        width: 260px;
        min-width: 260px;
    }

    .admin-table th.stock-model-col,
    .admin-table td.stock-model-col {
        width: 130px;
        min-width: 130px;
    }

    .admin-table th.stock-order-code-col,
    .admin-table td.stock-order-code-col {
        width: 130px;
        min-width: 130px;
    }

    .admin-table th.stock-jan-col,
    .admin-table td.stock-jan-col {
        width: 140px;
        min-width: 140px;
    }

    .admin-table th.stock-color-col,
    .admin-table td.stock-color-col {
        width: 110px;
        min-width: 110px;
    }

    .admin-table th.stock-size-col,
    .admin-table td.stock-size-col {
        width: 100px;
        min-width: 100px;
    }

    .admin-table th.stock-now-col,
    .admin-table td.stock-now-col {
        width: 90px;
        min-width: 90px;
    }

    .admin-table th.stock-qty-col,
    .admin-table td.stock-qty-col {
        width: 110px;
        min-width: 110px;
    }

    .admin-table th.stock-list-action-col,
    .admin-table td.stock-list-action-col {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
    }

    .stock-row-actions {
        gap: 6px;
    }

    .stock-row-actions .admin-btn,
    .stock-row-actions .admin-btn-small,
    .stock-row-btn {
        padding: 8px 6px;
        font-size: 12px;
    }

    .admin-detail-table th,
    .admin-detail-table td {
        display: block;
        width: 100%;
    }

    .admin-detail-table th {
        border-bottom: 0;
    }
}
/* =========================================================
   Stringing orders table
   ガット受付一覧：表ヘッダーを見やすくする
========================================================= */

.admin-table thead th,
table.admin-table thead th {
    background: #35aeca !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    border: 1px solid #2c9fba !important;
    padding: 12px 10px !important;
    white-space: nowrap;
}

/* th の中に span / a などがあっても白文字にする */
.admin-table thead th *,
table.admin-table thead th * {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* データなし行も薄すぎないようにする */
.admin-table tbody td {
    color: #222222;
    opacity: 1;
}

/* 「受付データがありません。」の行 */
.admin-table tbody td.text-center,
.admin-table tbody td[colspan] {
    color: #555555;
    background: #ffffff;
    font-weight: 500;
}
