/* =============================================
   在庫管理システム - メインスタイルシート
   モダンで洗練されたUIデザイン
   ============================================= */

:root {
    /* カラーパレット */
    /* キーカラー: #41383B（ダークブラウン/グレー） */
    --primary: #41383B;
    --primary-dark: #2d2528;
    --primary-light: #5a4f53;
    /* サブカラー1: #B09060（ゴールド/ベージュ） */
    --secondary: #B09060;
    --secondary-dark: #8f7149;
    --secondary-light: #d4b888;
    /* サブカラー2: #878F93（グレー） */
    --accent: #878F93;
    --accent-dark: #6b7276;
    --accent-light: #a8b0b5;
    /* バランスの取れたカラー */
    --success: #4a9b5c;
    --success-light: #d4edda;
    --warning: #d4a574;
    --warning-light: #fff3cd;
    --danger: #c85a5a;
    --danger-light: #f8d7da;
    --info: #6b8fa8;
    --info-light: #d1ecf1;
    
    /* グレースケール */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* その他 */
    --white: #ffffff;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.2s ease-in-out;
}

/* ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* =============================================
   ログインページ（在庫管理システム固有）
   ============================================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-title {
    text-align: center;
    color: var(--primary);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

.maintenance-notice {
    margin-bottom: 16px;
    align-items: center;
    gap: 10px;
}

.maintenance-notice-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(185, 28, 28, 0.12);
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.maintenance-notice-content {
    flex: 1;
    min-width: 0;
}

.maintenance-notice-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.maintenance-notice-text {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.5;
    word-break: keep-all;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65, 56, 59, 0.1);
}

.login-form {
    margin-top: 20px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-800);
    font-size: 14px;
}

.login-form .form-group input[type="text"],
.login-form .form-group input[type="password"],
.login-form .form-group input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65, 56, 59, 0.1);
}

.login-form .btn-block {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    font-size: 16px;
}

.login-forgot-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.login-forgot-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.login-forgot-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =============================================
   レイアウト（左サイドバー）
   ============================================= */

.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--primary);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.sidebar-logo:hover {
    color: var(--white);
    opacity: 0.9;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav a {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 10px 20px;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-nav a.active {
    background-color: var(--primary-dark);
    color: var(--white);
}

.sidebar-nav-group {
    margin-bottom: 16px;
    padding: 0 24px 0 28px;
}

.sidebar-nav-group:last-child {
    margin-bottom: 0;
}

.sidebar-nav-group--admin {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 16px;
    margin-top: 4px;
}

.sidebar-nav-group-title {
    display: block;
    padding: 8px 0 4px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.sidebar-user-name {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.sidebar-logout {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
}

.sidebar-logout:hover {
    background-color: rgba(255, 255, 255, 0.25);
    color: var(--white);
}

.content-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    flex: 1;
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
    box-sizing: border-box;
}

.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-500);
    font-size: 13px;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

/* =============================================
   カード
   ============================================= */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: 24px;
}

.card:last-child {
    margin-bottom: 0;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* =============================================
   統計カード
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(65, 56, 59, 0.1) 0%, rgba(65, 56, 59, 0.2) 100%);
    color: var(--primary);
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(74, 155, 92, 0.1) 0%, rgba(74, 155, 92, 0.2) 100%);
    color: var(--success);
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.1) 0%, rgba(212, 165, 116, 0.2) 100%);
    color: var(--warning);
}

.stat-icon.info {
    background: linear-gradient(135deg, rgba(107, 143, 168, 0.1) 0%, rgba(107, 143, 168, 0.2) 100%);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* 在庫管理システム用の統計カードスタイル */
.stat-card-label {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-card-value.primary {
    color: var(--primary);
}

.stat-card-value.success {
    color: var(--success);
}

.stat-card-value.warning {
    color: var(--warning);
}

.stat-card-value.error {
    color: var(--danger);
}

.stat-card-subtext {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.action-grid > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.action-grid > .card .card-header {
    flex-shrink: 0;
    height: 2.8em;
    min-height: 2.8em;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.action-grid > .card .card-body {
    flex-shrink: 0;
}

.action-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
}

.action-card-value {
    font-size: 32px;
    font-weight: 600;
    margin: 16px 0;
    line-height: 1.2;
}

.action-card-value.warning {
    color: var(--warning);
}

.action-card-value.info {
    color: var(--info);
}

.action-card-value.error {
    color: var(--danger);
}

.action-card-button {
    margin-top: 16px;
}

/* =============================================
   ボタン
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(65, 56, 59, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(65, 56, 59, 0.4);
    color: var(--white);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(176, 144, 96, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(176, 144, 96, 0.4);
    color: var(--white);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #3d7a4d 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(74, 155, 92, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 155, 92, 0.4);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #a84848 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(200, 90, 90, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(200, 90, 90, 0.4);
    color: var(--white);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #b8905a 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(212, 165, 116, 0.4);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--border-radius-sm);
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* セット商品管理ページ（CSV・一括操作） */
.set-items-manage .set-items-list-search {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.set-items-manage .set-items-list-search__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 14px;
}

.set-items-manage .set-items-list-search__field {
    flex: 1 1 260px;
    min-width: min(100%, 200px);
    max-width: 420px;
}

.set-items-manage .set-items-list-search__field .form-label {
    margin-bottom: 6px;
}

.set-items-manage .set-items-list-search__submit,
.set-items-manage .set-items-list-search__clear {
    height: 46px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.set-items-manage .set-items-list-search__meta {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--gray-600, #6b7280);
}

.set-items-manage .set-items-csv-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px 28px;
    align-items: end;
}

.set-items-manage .set-items-csv-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 16px;
    align-items: end;
    margin: 0;
    min-width: 0;
}

.set-items-manage .set-items-csv-form__file {
    min-width: 0;
}

.set-items-manage .set-items-csv-form__file .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.set-items-manage .set-items-csv-form__btn {
    flex-shrink: 0;
    height: 46px;
    padding-left: 20px;
    padding-right: 20px;
}

.set-items-manage .set-items-csv-export {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 6px;
    align-self: end;
}

.set-items-manage .set-items-csv-export__btn {
    height: 46px;
    padding-left: 20px;
    padding-right: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

.set-items-manage .set-items-csv-hint {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px 16px;
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--border-radius-sm, 8px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.set-items-manage .set-items-csv-hint__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600, #6b7280);
    letter-spacing: 0.02em;
}

.set-items-manage .set-items-csv-hint__code {
    font-size: 13px;
    line-height: 1.5;
    color: var(--gray-800, #1f2937);
    word-break: break-all;
    font-family: ui-monospace, monospace;
    background: var(--white, #fff);
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid var(--gray-200, #e5e7eb);
}

/* 一括ツールバー */
.set-items-manage .set-items-bulk {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0 28px;
    align-items: end;
    margin-bottom: 20px;
    padding: 22px 24px;
    background: var(--white, #fff);
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: 0 1px 2px rgba(65, 56, 59, 0.06);
}

.set-items-manage .set-items-bulk__selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-right: 24px;
    border-right: 1px solid var(--gray-200, #e5e7eb);
}

.set-items-manage .set-items-bulk__chip {
    flex-shrink: 0;
}

.set-items-manage .set-items-bulk__category {
    min-width: 0;
    padding: 0 8px;
}

.set-items-manage .set-items-bulk__category-label {
    display: block;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700, #374151);
}

.set-items-manage .set-items-bulk__category-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
}

.set-items-manage .set-items-bulk__category-input {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 100%;
    height: 46px;
    box-sizing: border-box;
}

.set-items-manage .set-items-bulk__btn-apply {
    flex: 0 0 auto;
    height: 46px;
    padding-left: 20px;
    padding-right: 20px;
}

.set-items-manage .set-items-bulk__danger {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-left: 24px;
    border-left: 1px solid var(--gray-200, #e5e7eb);
    flex-shrink: 0;
}

.set-items-manage .set-items-bulk__btn-remove {
    height: 46px;
    padding-left: 18px;
    padding-right: 18px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(200, 90, 90, 0.22);
}

.set-items-manage .set-items-bulk__btn-remove:hover {
    box-shadow: 0 2px 8px rgba(200, 90, 90, 0.28);
}

.set-items-manage .set-items-bulk__note {
    grid-column: 1 / -1;
    margin: 20px 0 0;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--gray-600, #6b7280);
    background: var(--gray-50, #f9fafb);
    border-radius: 6px;
    border: 1px solid var(--gray-100, #f3f4f6);
}

@media (max-width: 960px) {
    .set-items-manage .set-items-csv-panel {
        grid-template-columns: 1fr;
    }

    .set-items-manage .set-items-csv-form {
        grid-template-columns: 1fr;
    }

    .set-items-manage .set-items-csv-form__btn {
        justify-self: start;
    }

    .set-items-manage .set-items-csv-export__btn {
        width: 100%;
        justify-content: center;
    }

    .set-items-manage .set-items-bulk {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .set-items-manage .set-items-bulk__selection {
        padding-right: 0;
        border-right: none;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--gray-200, #e5e7eb);
    }

    .set-items-manage .set-items-bulk__category {
        padding: 0;
    }

    .set-items-manage .set-items-bulk__danger {
        padding-left: 0;
        border-left: none;
        padding-top: 4px;
    }

    .set-items-manage .set-items-bulk__btn-remove {
        width: 100%;
        justify-content: center;
    }

    .set-items-manage .set-items-bulk__btn-apply {
        flex: 1 1 auto;
        min-width: 140px;
    }
}

/* =============================================
   フォーム
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
}

.form-label .required {
    color: var(--danger);
    margin-left: 4px;
}

.form-control,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--white);
    color: var(--gray-800);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(65, 56, 59, 0.1);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(200, 90, 90, 0.1);
}

.invalid-feedback {
    color: var(--danger);
    font-size: 13px;
    margin-top: 6px;
}

.form-text {
    color: var(--gray-500);
    font-size: 13px;
    margin-top: 6px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

textarea.form-control,
.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* チェックボックス・ラジオボタン */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

/* ファイルアップロード */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    background: var(--gray-50);
    transition: var(--transition);
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(65, 56, 59, 0.05);
}

.file-upload.dragover {
    border-color: var(--primary);
    background: rgba(65, 56, 59, 0.1);
}

.file-upload-icon {
    font-size: 48px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.file-upload-text {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.file-upload-hint {
    font-size: 13px;
    color: var(--gray-500);
}

/* =============================================
   テーブル
   ============================================= */
.table-responsive,
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(odd) {
    background: var(--gray-50);
}

.table-striped tbody tr:nth-child(odd):hover {
    background: var(--gray-100);
}

/* テーブルアクション */
.table-actions {
    display: flex;
    gap: 4px;
}

/* =============================================
   アラート
   ============================================= */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-success {
    background: var(--success-light);
    color: #2d5a3a;
    border: 1px solid #b8d4c1;
}

.alert-success .alert-icon {
    color: var(--success);
}

.alert-danger {
    background: var(--danger-light);
    color: #8a3a3a;
    border: 1px solid #f1c2c2;
}

.alert-danger .alert-icon {
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: #8a6a4a;
    border: 1px solid #ffe6cc;
}

.alert-warning .alert-icon {
    color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: #4a5f6f;
    border: 1px solid #b8d4e1;
}

.alert-info .alert-icon {
    color: var(--info);
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-error .alert-icon {
    color: var(--danger);
}

/* =============================================
   バッジ
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-primary {
    background: rgba(65, 56, 59, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(74, 155, 92, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(212, 165, 116, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(200, 90, 90, 0.1);
    color: var(--danger);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-info {
    background: rgba(107, 143, 168, 0.15);
    color: var(--info);
}

/* =============================================
   モーダル
   ============================================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: var(--transition);
}

.modal-backdrop.show .modal {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =============================================
   ページネーション
   ============================================= */
.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.page-link:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.page-item.disabled .page-link {
    background: var(--gray-50);
    color: var(--gray-400);
    cursor: not-allowed;
}

/* =============================================
   ローディング
   ============================================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 14px;
    color: var(--gray-600);
}

/* =============================================
   検索・フィルター
   ============================================= */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input-wrapper .form-control {
    padding-left: 44px;
}

.search-input-wrapper i,
.search-input-wrapper .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 1;
    pointer-events: none;
    line-height: 1;
    font-size: 16px;
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =============================================
   ツールチップ
   ============================================= */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--gray-800);
    color: var(--white);
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    margin-top: 8px;
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]:hover {
    z-index: 9998;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* =============================================
   空の状態
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-state-icon {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 24px;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================
   レスポンシブ
   ============================================= */
@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0;
    }
    
    .sidebar-logo {
        padding: 12px 16px;
        border-bottom: none;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0 8px 8px;
        order: 3;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .sidebar-nav-group {
        flex: 1 1 100%;
        margin-bottom: 8px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .sidebar-nav-group--admin {
        padding-top: 12px;
        margin-top: 4px;
    }
    
    .sidebar-nav-group-title {
        padding: 6px 0 2px;
        font-size: 10px;
    }
    
    .sidebar-nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .sidebar-footer {
        margin-left: auto;
        border-top: none;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .sidebar-user-name {
        margin-bottom: 0;
    }
    
    .content-wrap {
        margin-left: 0;
        margin-top: 0;
    }
    
    .main-container {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .table th,
    .table td {
        padding: 10px 12px;
    }
}

/* =============================================
   アニメーション
   ============================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

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

.text-muted {
    color: var(--gray-500);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
