/* KTPWPプラグイン管理画面専用CSS */

/* H1タイトルのスタイル統一 */
.ktp-admin-wrap h1 {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    color: #23282d !important;
    font-size: 23px !important;
    font-weight: 400 !important;
    padding: 9px 0 4px !important;
    line-height: 1.3 !important;
}

/* H1タイトルのアイコン */
.ktp-admin-wrap h1 .dashicons {
    margin-right: 10px !important;
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
}

/* サブメニューのアイコン表示 */
#adminmenu .wp-submenu a[href*="ktp-settings"]::before {
    content: "\f469"; /* WordPress標準アイコン: admin-settings */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

#adminmenu .wp-submenu a[href*="ktp-mail-settings"]::before {
    content: "\f465"; /* WordPress標準アイコン: email */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

#adminmenu .wp-submenu a[href*="ktp-design-settings"]::before {
    content: "\f540"; /* WordPress標準アイコン: art */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

#adminmenu .wp-submenu a[href*="ktp-staff"]::before {
    content: "\f110"; /* WordPress標準アイコン: groups */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

#adminmenu .wp-submenu a[href*="ktp-license"]::before {
    content: "\f160"; /* WordPress標準アイコン: lock */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

#adminmenu .wp-submenu a[href*="ktpwp-dummy-data"]::before {
    content: "\f161"; /* WordPress標準アイコン: database */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

#adminmenu .wp-submenu a[href*="ktp-data-tools"]::before {
    content: "\f155"; /* WordPress標準アイコン: star-filled */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    color: #ffd700; /* 金色の星 */
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.6);
    transform: scale(1.1);
}

#adminmenu .wp-submenu a[href*="ktp-developer-settings"]::before {
    content: "\f107"; /* WordPress標準アイコン: admin-tools */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}


/* メインコンテナのスタイル統一 - 最高優先度 */
.wp-admin .ktp-admin-wrap .ktp-settings-container {
    background: #fff !important;
    border: 1px solid #ccd0d4 !important;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04) !important;
    padding: 20px !important;
    margin-top: 20px !important;
    border-radius: 3px !important;
}

/* セクションスタイル */
.ktp-admin-wrap .ktp-settings-section {
    margin-bottom: 30px !important;
}

.ktp-admin-wrap .ktp-settings-section h2 {
    padding-bottom: 10px !important;
    border-bottom: 1px solid #eee !important;
    margin-top: 0 !important;
}

/* テストメールフォーム */
.ktp-admin-wrap .ktp-test-mail-form {
    background: #f9f9f9 !important;
    padding: 15px !important;
    border-radius: 3px !important;
    border: 1px solid #e5e5e5 !important;
    margin-top: 20px !important;
}

/* ライセンス情報ボックス */
.ktp-admin-wrap .ktp-license-info {
    margin-top: 30px !important;
    background: #f9f9f9 !important;
    padding: 15px !important;
    border-radius: 3px !important;
    border: 1px solid #e5e5e5 !important;
}

/* ボタンエリア */
.ktp-admin-wrap .ktp-submit-button {
    margin-top: 20px !important;
}

/* フォーム要素のz-index調整 */
.ktp-admin-wrap form {
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

.ktp-admin-wrap .form-table {
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

/* ライセンス設定ページの特別な調整 */
.ktp-admin-wrap .ktp-settings-container {
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

.ktp-admin-wrap .ktp-settings-section {
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

/* タブナビゲーションの優先度を最高に */
.ktp-admin-wrap .nav-tab-wrapper {
    position: relative !important;
    z-index: 100 !important;
    pointer-events: auto !important;
    overflow: visible !important;
}

/* タブナビゲーション内のすべての要素をクリック可能に */
.ktp-admin-wrap .nav-tab-wrapper * {
    pointer-events: auto !important;
}

/* ライセンスステータス */
.ktp-admin-wrap .ktp-license-status {
    margin-top: 8px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
}

/* ライセンスステータスのアイコン */
.ktp-admin-wrap .ktp-license-status.active {
    color: #46b450 !important;
}

/* ライセンスステータスのアイコン */
.ktp-admin-wrap .ktp-license-status.inactive {
    color: #dc3232 !important;
}

/* ライセンスステータスのアイコン */
.ktp-admin-wrap .ktp-license-status .dashicons {
    margin-right: 5px !important;
}

/* 印刷ボタンエリア */
.ktp-admin-wrap .printer {
    margin-top: 30px !important;
    padding: 15px 20px !important;
    background-color: #f9f9f9 !important;
    border-radius: 4px !important;
    border-left: 4px solid #0073aa !important;
}

.ktp-admin-wrap .printer h3 {
    margin-top: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.ktp-admin-wrap .printer button {
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
}

/* 画像アップロードフィールドスタイル */
.ktp-admin-wrap .ktp-image-upload-field {
    position: relative !important;
}

.ktp-admin-wrap .ktp-image-preview {
    margin-bottom: 10px !important;
}

.ktp-admin-wrap .ktp-image-preview img {
    max-width: 300px !important;
    max-height: 200px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    display: block !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.ktp-admin-wrap .ktp-upload-image {
    margin-right: 10px !important;
}

.ktp-admin-wrap .ktp-remove-image {
    color: #a00 !important;
    border-color: #a00 !important;
}

.ktp-admin-wrap .ktp-remove-image:hover {
    color: #fff !important;
    background-color: #a00 !important;
}

/* デザイン設定フィールド */
.ktp-admin-wrap input[type="color"] {
    width: 100px !important;
    height: 40px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

.ktp-admin-wrap input[type="color"]:hover {
    border-color: #0073aa !important;
}

/* カスタムCSSエリア */
.ktp-admin-wrap #custom_css {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 10px !important;
    background-color: #f9f9f9 !important;
}

.ktp-admin-wrap #custom_css:focus {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 1px #0073aa !important;
    background-color: #fff !important;
}

/* アイコン専用ボタンの統一スタイル */
.ktp-admin-wrap .controller button[style*="padding: 0px 3px"] {
    padding: 0px 3px !important;
    font-size: 12px !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 28px !important;
    height: 28px !important;
}

.ktp-admin-wrap .controller button[style*="padding: 0px 3px"]:hover {
    background: #f0f0f0 !important;
    border-color: #0073aa !important;
}

.ktp-admin-wrap .controller button[style*="padding: 0px 3px"] .material-symbols-outlined {
    font-size: 16px !important;
    line-height: 1 !important;
}

/* 印刷時のスタイル */
@media print {
    #adminmenumain,
    #wpadminbar,
    #wpfooter,
    .wrap .nav-tab-wrapper,
    .ktp-submit-button,
    .ktp-test-mail-form,
    .printer,
    .update-nag,
    .notice {
        display: none !important;
    }
    
    .wrap {
        margin: 0 !important;
    }
    
    .ktp-settings-container {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body {
        background: white !important;
    }
}

/* ドラッグ&ドロップ関連のスタイル */
.dragging {
    opacity: 0.8;
    background-color: #f0f8ff !important;
    border: 2px dashed #0073aa !important;
}

.sort-success {
    background-color: #d4edda !important;
    transition: background-color 0.3s ease;
}

.drag-handle {
    cursor: move;
    color: #666;
    padding: 2px 4px;
    border-radius: 3px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    display: inline-block;
    margin-right: 5px;
}

.drag-handle:hover {
    background-color: #e5e5e5;
    color: #333;
}

/* ドラッグ中のテーブル行のスタイル */
.cost-items-table tbody tr.ui-sortable-helper {
    background-color: #f0f8ff !important;
    border: 2px dashed #0073aa !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ドラッグプレースホルダーのスタイル */
.cost-items-table tbody tr.ui-sortable-placeholder {
    visibility: visible !important;
    background-color: #f8f9fa !important;
    border: 2px dashed #dee2e6 !important;
    height: 40px;
}

/* 納期フィールドのスタイル */
.delivery-dates-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
    flex-wrap: wrap;
}

.date-field {
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-field label {
    white-space: nowrap;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

.delivery-date-input {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.delivery-date-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.2);
}

.delivery-date-input:hover {
    border-color: #007cba;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .delivery-dates-container {
        margin-left: 10px;
        gap: 10px;
    }
    
    .date-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .date-field label {
        font-size: 11px;
    }
    
    .delivery-date-input {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* 受注書の金額表示スタイル */
.invoice-item-amount,
.cost-item-amount {
    display: inline-block;
    min-width: 80px;
    text-align: left;
    font-weight: bold;
    color: #333;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    user-select: none;
    cursor: default;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.invoice-item-amount:hover,
.cost-item-amount:hover {
    background-color: #e9ecef;
}

/* 金額が0の場合のスタイル */
.invoice-item-amount[data-amount="0"],
.cost-item-amount[data-amount="0"] {
    color: #6c757d;
    font-weight: normal;
}

/* 金額表示の左寄せ */
.invoice-item-amount,
.cost-item-amount {
    text-align: left !important;
}
