@charset "utf-8";
/*=================================================================================
  共通UIコンポーネント スタイル
  common-ui.css
-----------------------------------------------------------------------------------
  js/common-ui.js が動的に生成する以下要素のためのスタイル定義。

    .cui-backdrop       モーダル用の半透明背景 + センタリング
    .cui-modal          モーダル本体カード
    .cui-toast          自動消滅トースト
    #cui-overlay        全画面オーバーレイ (処理中)
    .cui-btn            汎用ボタン (primary / danger / cancel)

  カラーパレット:
    primary  #4a4a82    (設定タブと同色 / メインアクション)
    success  #2d8659    (緑系 / 完了通知)
    error    #c0392b    (赤系 / エラー)
    info     #5b8ab8    (青系 / 情報)
    warn     #d68910    (黄系 / 警告)

  2026.05.01 v1.004.0000 新設
-----------------------------------------------------------------------------------
  Copyright 2017-2026 (c) Biz+ Allrights Reserved.
=================================================================================*/

/*-----------------------------------------------------------------------
  ルートコンテナ (動的生成: <div id="cui-root">)
  -- 全要素を内包する。z-indexは多階層 (オーバーレイ > モーダル > トースト)。
-----------------------------------------------------------------------*/
#cui-root {
    font-family: 'Noto Sans JP', sans-serif;
}

/*=======================================================================
  モーダル共通: 背景 (backdrop) + カード本体
=======================================================================*/

/*--- 半透明の背景 + センタリング ---*/
.cui-backdrop {
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
.cui-backdrop.cui-show {
    opacity: 1;
}

/*--- モーダルカード ---*/
.cui-modal {
    box-sizing: border-box;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.25);
    min-width: 22rem;
    max-width: 32rem;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.15s ease-out;
}
.cui-backdrop.cui-show .cui-modal {
    transform: scale(1);
}

/*--- ヘッダ (アイコン + タイトル) ---*/
.cui-modal-head {
    box-sizing: border-box;
    padding: 1rem 1.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 0.0625rem solid #eee;
}
.cui-modal-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.cui-modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
}

/*--- ヘッダのアイコン色 (typeで変化) ---*/
.cui-modal-info    .cui-modal-icon { color: #5b8ab8; }
.cui-modal-error   .cui-modal-icon { color: #c0392b; }
.cui-modal-warn    .cui-modal-icon { color: #d68910; }
.cui-modal-confirm .cui-modal-icon { color: #4a4a82; }

/*--- ボディ (メッセージ) ---*/
.cui-modal-body {
    box-sizing: border-box;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    word-break: break-all;
}

/*--- フッタ (ボタン群) ---*/
.cui-modal-foot {
    box-sizing: border-box;
    padding: 0.5rem 1.25rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/*=======================================================================
  ボタン
=======================================================================*/
.cui-btn {
    box-sizing: border-box;
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
    border: 0.0625rem solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    min-width: 5rem;
    text-align: center;
}
.cui-btn:focus {
    outline: 0.125rem solid rgba(74, 74, 130, 0.4);
    outline-offset: 0.0625rem;
}

/*--- primary (紫) ---*/
.cui-btn-primary {
    background-color: #4a4a82;
    border-color: #4a4a82;
    color: #fff;
}
.cui-btn-primary:hover {
    background-color: #3c3c6b;
    border-color: #3c3c6b;
}

/*--- danger (赤) ---*/
.cui-btn-danger {
    background-color: #c0392b;
    border-color: #c0392b;
    color: #fff;
}
.cui-btn-danger:hover {
    background-color: #a32d22;
    border-color: #a32d22;
}

/*--- cancel (グレー枠) ---*/
.cui-btn-cancel {
    background-color: #fff;
    border-color: #ccc;
    color: #555;
}
.cui-btn-cancel:hover {
    background-color: #f4f4f4;
    border-color: #aaa;
    color: #333;
}

/*=======================================================================
  トースト (画面右下)
=======================================================================*/

/*--- スタック領域 ---*/
#cui-toast-area {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    z-index: 10001;
    pointer-events: none;   /* 子のトーストのみクリック有効 */
}

/*--- トースト本体 ---*/
.cui-toast {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 16rem;
    max-width: 24rem;
    padding: 0.75rem 1rem;
    background-color: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 0.875rem rgba(0, 0, 0, 0.18);
    border-left: 0.25rem solid #888;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    cursor: pointer;
    pointer-events: auto;   /* スタック領域は無効、本体は有効 */
    opacity: 0;
    transform: translateX(0.5rem);
    transition: opacity 0.2s, transform 0.2s;
}
.cui-toast.cui-show {
    opacity: 1;
    transform: translateX(0);
}

/*--- トースト アイコン ---*/
.cui-toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.cui-toast-msg {
    flex: 1;
    word-break: break-all;
}

/*--- type別 色 ---*/
.cui-toast-success {
    border-left-color: #2d8659;
}
.cui-toast-success .cui-toast-icon {
    color: #2d8659;
}
.cui-toast-error {
    border-left-color: #c0392b;
}
.cui-toast-error .cui-toast-icon {
    color: #c0392b;
}
.cui-toast-info {
    border-left-color: #5b8ab8;
}
.cui-toast-info .cui-toast-icon {
    color: #5b8ab8;
}

/*=======================================================================
  オーバーレイ (処理中)
=======================================================================*/
#cui-overlay {
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
#cui-overlay.cui-show {
    opacity: 1;
}

.cui-overlay-box {
    box-sizing: border-box;
    background-color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.cui-overlay-spinner {
    font-size: 1.75rem;
    color: #4a4a82;
}
.cui-overlay-msg {
    font-size: 0.95rem;
    color: #444;
}
