/* ===========================
   リセット & 基本設定
=========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===========================
   ログイン画面
=========================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    border: 1px solid #e0e0e0;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    color: #1f2937;
}

/* ===========================
   ヘッダー
=========================== */
.header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 30px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-logo {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-size: 14px;
    color: #6b7280;
}

.logout-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #dc2626;
}

/* ===========================
   サイドバー & メインレイアウト
=========================== */
.layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px 0;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: block;
    padding: 12px 24px;
    color: #4b5563;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: #f5f5f5;
    color: #2563eb;
    text-decoration: none;
}

.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1200px;
    background-color: #fafafa;
}

/* ===========================
   ダッシュボード
=========================== */
.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1f2937;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.card-value {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.card-value.plan {
    color: #2563eb;
}

.card-value.limit {
    color: #059669;
}

.card-note {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-label.required::after {
    content: '*';
    color: #ef4444;
    margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background-color: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #2563eb;
}

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

.form-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* ===========================
   ボタン
=========================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #059669;
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* ===========================
   テーブル
=========================== */
.table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #fafafa;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e0e0e0;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}

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

.data-table tr:hover {
    background: #fafafa;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions a,
.table-actions button {
    padding: 6px 12px;
    font-size: 13px;
}

/* ===========================
   画像アップロード
=========================== */
.image-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: white;
    transition: all 0.2s;
}

.image-upload-area:hover {
    border-color: #2563eb;
    background: #f9fafb;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-remove-btn:hover {
    background: rgba(239, 68, 68, 0.9);
}

/* ===========================
   アラート・メッセージ
=========================== */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===========================
   ステータスバッジ
=========================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-published {
    background: #d1fae5;
    color: #065f46;
}

.badge-draft {
    background: #f3f4f6;
    color: #374151;
}

/* ===========================
   空状態
=========================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
    margin-bottom: 20px;
}

/* ===========================
   レスポンシブ
=========================== */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .header {
        padding: 0 20px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   パスワードリセット
=========================== */
.forgot-password-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.forgot-password-link a {
    font-size: 13px;
    color: #2563eb;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

.password-reset-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.back-to-login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.back-to-login-link a {
    font-size: 13px;
    color: #6b7280;
}

.back-to-login-link a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* ===========================
   フォームセクション
=========================== */
.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

/* ===========================
   削除済み物件用スタイル
=========================== */
.deleted-property-badge {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.backup-info-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.backup-info-box p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

