/* ==============================
   パートナー専用サイト固有スタイル
   ------------------------------
   共通部品は common.css に集約済み。
   ログイン/2要素認証は login.css を使用。
   common.css を先に読み込むこと。
============================== */

/* ------------------------------
   パートナーサイト ヘッダー
------------------------------ */

.partner-header {
    background: #123a63;
    border-bottom: 3px solid #4aa3e0;
}

.partner-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #fff;
    color: #123a63;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.02em;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    margin: 0;
    font-size: 20px;
    color: #fff;
    line-height: 1.3;
}

.brand-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: #b8cbdd;
    line-height: 1.4;
}

.logo {
  width: 145px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.header-login {
    font-size: 13px;
    color: #b8cbdd;
    white-space: nowrap;
}

.header-login strong {
    color: #fff;
    font-size: 14px;
}

/* アカウント設定ホバーメニュー */

.account-menu {
    position: relative;
    display: inline-block;
}

.account-menu .header-login {
    cursor: pointer;
    padding: 6px 4px;
}

.account-menu .header-login strong {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 3px;
}

.account-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 20;
    min-width: 220px;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    /* 既定は非表示。ホバーで表示 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

/* ホバーとメニューの間の隙間でメニューが消えないよう、透明な橋を渡す */
.account-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.account-menu:hover .account-dropdown,
.account-menu:focus-within .account-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-dropdown-head {
    margin: 0;
    padding: 10px 16px;
    background: #f5f6f8;
    border-bottom: 1px solid #e2e6ec;
    font-size: 12px;
    font-weight: bold;
    color: #77808b;
}

.account-dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #1f2933;
    font-size: 14px;
    font-weight: bold;
}

.account-dropdown-item:hover {
    background: #f0f7ff;
    text-decoration: none;
}

.header-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: 1px solid #6f8bab;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.header-logout:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #9fb4cc;
    text-decoration: none;
}

/* ------------------------------
   本文幅
------------------------------ */

.partner-main {
    max-width: 1280px;
}

/* ------------------------------
   製品タブ
------------------------------ */

.product-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.product-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border: 1px solid #d5dbe3;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
}

.product-tab:hover {
    border-color: #90caf9;
    background: #f0f7ff;
    text-decoration: none;
}

.product-tab.is-active {
    background: #1565c0;
    border-color: #1565c0;
    color: #fff;
}

.product-tab.is-active:hover {
    background: #1565c0;
}

/* ------------------------------
   レイアウト（左サイド + 右一覧）
------------------------------ */

.partner-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

/* ------------------------------
   絞り込みパネル
------------------------------ */

.filter-panel {
    background: #fff;
    border: 1px solid #e2e6ec;
    border-radius: 12px;
    padding: 22px 20px;
}

.filter-title {
    margin: 0 0 4px;
    font-size: 19px;
}

.filter-note {
    margin: 0 0 20px;
    font-size: 12px;
    color: #8a929c;
    line-height: 1.6;
}

.filter-group {
    margin-bottom: 22px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group-title {
    margin: 0 0 12px;
    font-size: 14px;
    color: #333;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 7px 14px;
    border: 1px solid #d5dbe3;
    border-radius: 999px;
    background: #fff;
    color: #444;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.2;
}

.filter-chip:hover {
    border-color: #90caf9;
    background: #f0f7ff;
}

.filter-chip.is-active {
    border-color: #1565c0;
    color: #1565c0;
    font-weight: bold;
}

.filter-search,
.filter-select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

/* ------------------------------
   資料一覧パネル
------------------------------ */

.file-panel {
    background: #fff;
    border: 1px solid #e2e6ec;
    border-radius: 12px;
    padding: 22px 24px;
    min-width: 0;
}

.file-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.file-panel-title {
    margin: 0 0 6px;
    font-size: 20px;
}

.file-panel-lead {
    margin: 0;
    font-size: 13px;
    color: #77808b;
    line-height: 1.6;
}

.file-count {
    flex-shrink: 0;
    font-size: 13px;
    color: #8a929c;
    white-space: nowrap;
}

/* 資料テーブル */

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    padding: 16px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #eceff3;
}

.file-table thead th {
    padding-top: 0;
    font-size: 13px;
    font-weight: bold;
    color: #8a929c;
    border-bottom: 1px solid #e2e6ec;
    white-space: nowrap;
}

.file-table .th-dl,
.file-table .cell-dl {
    text-align: center;
    white-space: nowrap;
}

.cell-doc {
    min-width: 220px;
}

.doc-name {
    font-weight: bold;
    font-size: 15px;
    color: #1f2933;
    overflow-wrap: anywhere;
}

.doc-desc {
    margin-top: 6px;
    font-size: 13px;
    color: #77808b;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* カテゴリバッジ */

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fff5d6;
    color: #a06800;
    border: 1px solid #f2dea0;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}


/* 種類列の折り返し緩和 */
.file-table td[data-label="種類"] {
    white-space: nowrap;
}
.file-table td[data-label="更新日"],
.file-table td[data-label="バージョン"] {
    white-space: nowrap;
}

/* ハッシュ値 */

.hash-value {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #444;
    word-break: break-all;
    max-width: 260px;
    line-height: 1.5;
}

.hash-algo {
    margin-top: 2px;
    font-size: 11px;
    color: #9aa2ac;
    letter-spacing: 0.03em;
}

.hash-empty {
    color: #c2c8d0;
}

/* DLボタン */

.dl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 8px 16px;
    border-radius: 8px;
    background: #1565c0;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
}

.dl-button:hover {
    background: #0d4a94;
    text-decoration: none;
}

.file-empty {
    padding: 40px 16px;
    text-align: center;
    color: #8a929c;
}

/* ------------------------------
   レスポンシブ
------------------------------ */

@media (max-width: 960px) {

    .partner-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .partner-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 14px 20px;
    }

    .brand-title {
        font-size: 18px;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .file-panel {
        padding: 18px 16px;
    }

    .file-panel-head {
        flex-direction: column;
    }

    .file-table,
    .file-table thead,
    .file-table tbody,
    .file-table tr,
    .file-table th,
    .file-table td {
        display: block;
    }

    .file-table thead {
        display: none;
    }

    .file-table tr {
        margin-bottom: 16px;
        border: 1px solid #e2e6ec;
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
    }

    .file-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        border-bottom: 1px solid #f0f2f5;
        padding: 12px 14px;
    }

    .file-table td:last-child {
        border-bottom: none;
    }

    .file-table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 12px;
        font-weight: bold;
        color: #8a929c;
    }

    .cell-doc {
        flex-direction: column;
    }

    .cell-doc::before {
        margin-bottom: 4px;
    }

    .file-table .cell-dl {
        justify-content: flex-end;
    }

    .hash-value {
        max-width: 100%;
        text-align: right;
    }
}

/* ------------------------------
   登録情報変更（profile.php）
------------------------------ */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 24px;
}

.profile-grid .form-row input,
.profile-grid .form-row textarea {
    max-width: none;
}

.profile-grid-full {
    grid-column: 1 / -1;
}

.profile-grid-full textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
}

.profile-actions {
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e6ec;
}

@media (max-width: 768px) {

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        flex-direction: row;
    }
}

/* セクション見出し（profile等のフォーム内区切り） */

.form-section-title {
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1565c0;
    font-size: 18px;
}

.edit-form .form-section-title {
    margin-top: 0;
}

.edit-form .form-section-title ~ .form-section-title,
.form-buttons + .form-section-title {
    margin-top: 32px;
}

.form-section-title-spaced {
    margin-top: 32px;
}