:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --input-border: #cbd5e1;
    --input-focus-ring: rgba(37, 99, 235, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Auth Pages */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    width: 100%;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.auth-title {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #1e293b;
}

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

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-size: 0.9rem;
        font-weight: 600;
        color: #475569;
    }

/* --- スタイリッシュなフォーム入力 --- */
.form-control,
input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    background-color: #fff;
    transition: all 0.2s ease-in-out;
    appearance: none;
    font-family: inherit;
}

    /* フォーカス時のスタイル */
    .form-control:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px var(--input-focus-ring);
    }

::placeholder {
    color: #94a3b8;
}

/* 日時入力のカスタマイズ (ブラウザのデフォルトアイコンを消してカスタムアイコンにする例) */
/* 注: 一部ブラウザでは完全な制御が難しい場合がありますが、モダンな見た目に調整します */
input[type="datetime-local"] {
    position: relative;
    color: var(--text-main);
}

    /* カレンダーアイコンの調整（簡易的） */
    input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        background: transparent;
        bottom: 0;
        color: transparent;
        cursor: pointer;
        height: auto;
        left: 0;
        position: absolute;
        right: 0;
        top: 0;
        width: auto;
    }

/* カスタムアイコンを背景として設定 */
input[type="datetime-local"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

/* Selectボックスの矢印カスタマイズ */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}
/* ---------------------------------- */

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

    .btn-primary:hover {
        background-color: var(--primary-hover);
        transform: translateY(-1px);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

    .btn-primary:disabled {
        background-color: #93c5fd;
        cursor: not-allowed;
        transform: none;
    }

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--input-border);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-secondary:hover {
        background-color: #f1f5f9;
        border-color: #94a3b8;
    }

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-danger:hover {
        background-color: var(--danger-hover);
    }

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #64748b;
}

    .auth-footer a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 500;
    }

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
}

.logo-area {
    padding: 0 24px 24px;
    font-size: 1.25rem;
    font-weight: 800;
    border-bottom: 1px solid #334155;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

    .nav-links li {
        margin-bottom: 4px;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        padding: 12px 24px;
        color: #94a3b8;
        text-decoration: none;
        font-size: 0.95rem;
        transition: all 0.2s;
        font-weight: 500;
    }

        .nav-links a:hover, .nav-links a.active {
            color: white;
            background-color: #334155;
            border-right: 4px solid var(--primary-color);
        }

        .nav-links a i {
            width: 24px;
            margin-right: 12px;
        }

.section-title {
    padding: 20px 24px 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #f1f5f9;
}

.top-bar {
    background-color: white;
    padding: 16px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .user-info .name {
        font-weight: 600;
        font-size: 0.95rem;
    }

.avatar {
    width: 40px;
    height: 40px;
    background-color: #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.content-wrapper {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.settings-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -1px rgb(0 0 0 / 0.03);
    border: 1px solid #e2e8f0;
}

    .card h3 {
        font-size: 1.1rem;
        margin-bottom: 20px;
        color: #1e293b;
        display: flex;
        align-items: center;
        gap: 10px;
        padding-bottom: 12px;
        border-bottom: 1px solid #f1f5f9;
    }

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

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

/* Chat Styles */
.chat-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.95rem;
    position: relative;
}

    .message.ai {
        background-color: #f1f5f9;
        align-self: flex-start;
        border-bottom-left-radius: 4px;
        color: #334155;
    }

    .message.user {
        background-color: var(--primary-color);
        color: white;
        align-self: flex-end;
        border-bottom-right-radius: 4px;
    }

.chat-input-area {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    background-color: #fff;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    position: relative;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close {
    color: #94a3b8;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

    .close:hover {
        color: #475569;
    }

/* MyPage Specific */
.user-info-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    text-align: center;
}

.avatar-large {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.info-text h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 700;
}

/* Notification List */
.notification-list .notif-item {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 16px;
    transition: background-color 0.2s;
}

    .notification-list .notif-item:hover {
        background-color: #f8fafc;
    }

.notif-item:last-child {
    border-bottom: none;
}

.notif-icon {
    width: 40px;
    height: 40px;
    background-color: #e0f2fe;
    color: #0284c7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Task Manager */
.task-cols {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.task-col {
    flex: 1;
    min-width: 320px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.col-header {
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #475569;
}

.task-count {
    background: #cbd5e1;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.8rem;
    color: #475569;
}

.task-card {
    background: white;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-left: 4px solid transparent;
    transition: all 0.2s;
    border: 1px solid transparent;
}

    .task-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        border-color: #e2e8f0;
    }

.priority-high {
    border-left-color: #ef4444;
}

.priority-medium {
    border-left-color: #f59e0b;
}

.priority-low {
    border-left-color: #10b981;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.task-actions button {
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 4px;
}

    .task-actions button:hover {
        color: var(--primary-color);
        border-color: var(--primary-color);
        background-color: #eff6ff;
    }

    .task-actions button.delete:hover {
        color: var(--danger-color);
        border-color: var(--danger-color);
        background-color: #fef2f2;
    }

/* Analytics */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

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

.kpi-box {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 12px 0;
}

.kpi-label {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

.period-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

    .period-btn:hover {
        background-color: #f1f5f9;
    }

    .period-btn.active {
        background: #eff6ff;
        color: var(--primary-color);
        border-color: var(--primary-color);
    }

/* Production */
.script-container {
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.script-step {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    padding: 20px;
}

    .script-step:last-child {
        border-bottom: none;
    }

.step-time {
    width: 90px;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    font-size: 0.95rem;
}

.step-content {
    flex: 1;
}

.step-title {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #334155;
    font-size: 1.05rem;
}

.point-list {
    margin-left: 20px;
    margin-bottom: 15px;
    line-height: 1.6;
}

    .point-list.good li {
        color: #059669;
    }

    .point-list.bad li {
        color: #dc2626;
    }

/* Strategy */
.kpi-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

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

.kpi-title {
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 8px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.heatmap-container {
    display: grid;
    grid-template-columns: 40px repeat(24, 1fr);
    gap: 4px;
    font-size: 0.7rem;
    overflow-x: auto;
    padding-bottom: 10px;
}

.heatmap-cell {
    aspect-ratio: 1;
    background-color: #f1f5f9;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
}

    .heatmap-cell:hover {
        transform: scale(1.2);
        z-index: 5;
        border: 1px solid #cbd5e1;
    }

        .heatmap-cell:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 120%;
            left: 50%;
            transform: translateX(-50%);
            background: #1e293b;
            color: white;
            padding: 6px 10px;
            border-radius: 6px;
            white-space: pre;
            z-index: 10;
            pointer-events: none;
            font-size: 0.75rem;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

.heatmap-header {
    text-align: center;
    color: #94a3b8;
    font-weight: 600;
}

.heatmap-label {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px 0;
    }

    .nav-links {
        display: flex;
        overflow-x: auto;
        padding: 0 10px;
    }

        .nav-links li {
            margin-right: 10px;
        }

    .section-title {
        display: none;
    }

    .top-bar {
        position: static;
        padding: 15px 20px;
    }

    .content-wrapper {
        padding: 20px;
    }
}

/* --- LP Page Styling --- */
.lp-body {
    background-color: #fff;
    flex-direction: column;
    overflow-y: auto;
}

.lp-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.lp-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.lp-hero {
    margin-top: 70px;
    padding: 100px 0;
    text-align: center;
    background: radial-gradient(circle at center, #eff6ff 0%, #fff 70%);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.lp-features {
    padding: 80px 0;
    background-color: #f8fafc;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

    .section-header h2 {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 16px;
        color: #1e293b;
    }

    .section-header p {
        color: #64748b;
        font-size: 1.1rem;
    }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.lp-feature-card {
    background: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

    .lp-feature-card:hover {
        transform: translateY(-8px);
    }

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.bg-blue {
    background: #e0f2fe;
    color: #0284c7;
}

.bg-purple {
    background: #f3e8ff;
    color: #9333ea;
}

.bg-green {
    background: #dcfce7;
    color: #16a34a;
}

.bg-orange {
    background: #ffedd5;
    color: #ea580c;
}

.lp-feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1e293b;
}

.lp-feature-card p {
    color: #64748b;
    line-height: 1.6;
}

.lp-footer {
    padding: 40px 0;
    text-align: center;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
