/* ==========================================
   管理画面スタイル - メグリ
   ========================================== */

/* ==========================================
   基本設定
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #e8f5f3 0%, #f0f8ff 100%);
    min-height: 100vh;
    color: #333;
}

/* ==========================================
   ログイン画面
   ========================================== */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #95e1d3 0%, #87ceeb 100%);
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 50px 40px;
    max-width: 450px;
    width: 100%;
    text-align: center;
}

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #95e1d3, #87ceeb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.login-icon i {
    font-size: 36px;
    color: white;
}

.login-container h1 {
    font-size: 28px;
    color: #2c5f5d;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 40px;
}

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

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

.login-form input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

.login-form input:focus {
    outline: none;
    border-color: #95e1d3;
    box-shadow: 0 0 0 3px rgba(149, 225, 211, 0.1);
}

.error-message {
    background: #ffe5e5;
    color: #d32f2f;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #95e1d3, #87ceeb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Noto Sans JP', sans-serif;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 225, 211, 0.4);
}

/* ==========================================
   管理画面メイン
   ========================================== */
.admin-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ヘッダー */
.admin-header {
    background: linear-gradient(135deg, #2c5f5d, #3d7c78);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    font-size: 32px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-view-stats {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-view-stats:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-logout {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* メインコンテンツ */
.admin-main {
    flex: 1;
    padding: 40px 20px;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* サマリーセクション */
.summary-section {
    margin-bottom: 40px;
}

.summary-section h2 {
    font-size: 22px;
    color: #2c5f5d;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.last-updated {
    margin-top: 20px;
    padding: 16px 24px;
    background: #f8f9fa;
    border-left: 4px solid #95e1d3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

.last-updated i {
    color: #95e1d3;
    font-size: 16px;
}

.last-updated span:last-child {
    font-weight: 600;
    color: #2c5f5d;
}

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

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.summary-card.balance .card-icon {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #f57c00;
}

.summary-card.income .card-icon {
    background: linear-gradient(135deg, #95e1d3, #a8e6cf);
    color: #2c5f5d;
}

.summary-card.expense .card-icon {
    background: linear-gradient(135deg, #ffb3ba, #ffcccb);
    color: #d32f2f;
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c5f5d;
}

/* フォームセクション */
.form-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.form-section h2 {
    font-size: 22px;
    color: #2c5f5d;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-block {
    margin-bottom: 40px;
}

.form-block:last-of-type {
    margin-bottom: 0;
}

.form-block h3 {
    font-size: 20px;
    color: #2c5f5d;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid #95e1d3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-subsection {
    margin-bottom: 32px;
}

.subsection-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.income-title {
    color: #2c5f5d;
}

.expense-title {
    color: #d32f2f;
}

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

. form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.label-note {
    color: #999;
    font-weight: 400;
    font-size: 13px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: #95e1d3;
    box-shadow: 0 0 0 3px rgba(149, 225, 211, 0.1);
}

.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
    resize: vertical;
    min-height: 80px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #95e1d3;
    box-shadow: 0 0 0 3px rgba(149, 225, 211, 0.1);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* ボタンアクション */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Noto Sans JP', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #95e1d3, #87ceeb);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 225, 211, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

/* 成功メッセージ */
.success-message {
    position: fixed;
    top: 100px;
    right: 30px;
    background: linear-gradient(135deg, #95e1d3, #a8e6cf);
    color: white;
    padding: 18px 24px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    animation: slideInRight 0.5s ease, fadeOut 0.5s ease 2.5s forwards;
    z-index: 1000;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* フッター */
.admin-footer {
    background: #2c5f5d;
    color: white;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #95e1d3;
}

/* ==========================================
   レスポンシブ対応
   ========================================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-right {
        flex-direction: column;
        width: 100%;
    }

    .btn-view-stats,
    .btn-logout {
        width: 100%;
        justify-content: center;
    }

    .form-section {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .success-message {
        right: 15px;
        left: 15px;
        top: 80px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 40px 24px;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .card-value {
        font-size: 24px;
    }
}
