/* リセットとベース */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #1a2b3c;
    background-color: #f7f9fc;
    letter-spacing: 0.3px;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ヘッダーとナビゲーション */
.main-nav {
    background-color: #1a2b47;
    color: white;
    padding: 14px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.logo a {
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 24px;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
}

/* フッター */
.main-footer {
    background-color: #1a2b47;
    color: rgba(255,255,255,0.85);
    padding: 40px 0;
    margin-top: 70px;
    text-align: center;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

/* ボタン */
.btn {
    display: inline-block;
    background-color: #3672dc;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(54, 114, 220, 0.25);
    letter-spacing: 0.5px;
}

.btn:hover {
    background-color: #2a61c5;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(42, 97, 197, 0.3);
}

.btn-secondary {
    background-color: #6c7a89;
    box-shadow: 0 2px 6px rgba(108, 122, 137, 0.25);
}

.btn-secondary:hover {
    background-color: #5a6676;
    box-shadow: 0 4px 10px rgba(90, 102, 118, 0.3);
}

.btn-accent {
    background-color: #27ae60;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.25);
}

.btn-accent:hover {
    background-color: #229955;
    box-shadow: 0 4px 10px rgba(34, 153, 85, 0.3);
}

.btn-danger {
    background-color: #e74c3c;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.25);
}

.btn-danger:hover {
    background-color: #d44333;
    box-shadow: 0 4px 10px rgba(212, 67, 51, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #34495e;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3672dc;
    box-shadow: 0 0 0 3px rgba(54, 114, 220, 0.1);
}

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

.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 36px;
}

.required {
    color: #e74c3c;
    margin-left: 3px;
}

/* メッセージボックス */
.success-message {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid #27ae60;
    font-weight: 500;
}

.error-box {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid #e74c3c;
    font-weight: 500;
}

.error-box ul {
    margin-left: 24px;
    margin-top: 8px;
}

/* ページヘッダー */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e1e8ed;
}

.page-header h1 {
    font-size: 28px;
    color: #1a2b47;
    font-weight: 600;
}

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

/* データがない場合の表示 */
.no-data {
    text-align: center;
    padding: 50px 24px;
    background-color: #ffffff;
    border-radius: 8px;
    margin: 24px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.no-data p {
    margin-bottom: 18px;
    color: #6c7a89;
    font-size: 1.05rem;
}

/* ダッシュボード */
.dashboard {
    padding: 24px 0;
}

.dashboard h1 {
    text-align: center;
    margin-bottom: 36px;
    color: #1a2b47;
    font-weight: 600;
    font-size: 32px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.dashboard-card {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(225, 232, 237, 0.7);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
    color: #3672dc;
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 600;
}

.dashboard-card p {
    color: #6c7a89;
    margin-bottom: 18px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.stats-card {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(225, 232, 237, 0.7);
}

.stats-card h4 {
    color: #6c7a89;
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 500;
}

.stats-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a2b47;
}

/* テーブル */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    border: 1px solid rgba(225, 232, 237, 0.7);
}

.admin-table,
.articles-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    color: #34495e;
}

.admin-table th,
.admin-table td,
.articles-table th,
.articles-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.admin-table th,
.articles-table th {
    background-color: #f7f9fc;
    font-weight: 600;
    color: #34495e;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.admin-table tr:hover,
.articles-table tr:hover {
    background-color: rgba(54, 114, 220, 0.03);
}

.admin-table .title-cell,
.articles-table .title-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.admin-table .notes-cell,
.articles-table .notes-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 最近の納品記事 */
.recent-articles {
    margin-top: 48px;
}

.recent-articles h2 {
    margin-bottom: 24px;
    font-size: 24px;
    color: #1a2b47;
    font-weight: 600;
}

.recent-articles .articles-table {
    table-layout: fixed;
}

.recent-articles .articles-table th,
.recent-articles .articles-table td {
    padding: 16px;
    vertical-align: middle;
}

.recent-articles .articles-table th:nth-child(1),
.recent-articles .articles-table td:nth-child(1) {
    width: 15%; /* 納品日 */
}

.recent-articles .articles-table th:nth-child(2),
.recent-articles .articles-table td:nth-child(2) {
    width: 35%; /* タイトル */
}

.recent-articles .articles-table th:nth-child(3),
.recent-articles .articles-table td:nth-child(3) {
    width: 15%; /* 著者 */
}

.recent-articles .articles-table th:nth-child(4),
.recent-articles .articles-table td:nth-child(4) {
    width: 20%; /* 納品先 */
}

.recent-articles .articles-table th:nth-child(5),
.recent-articles .articles-table td:nth-child(5) {
    width: 15%; /* 文字数 */
    text-align: right;
}

.recent-articles .view-all {
    text-align: center;
    margin-top: 24px;
}

.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
}

.action-buttons .btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 36px 0;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    color: #34495e;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.pagination-btn:hover {
    background-color: #f7f9fc;
    border-color: #bdc3c7;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
}

.pagination-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    color: #34495e;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.pagination-number:hover {
    background-color: #f7f9fc;
    border-color: #bdc3c7;
}

.pagination-number.active {
    background-color: #3672dc;
    color: white;
    border-color: #3672dc;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #6c7a89;
}

/* 検索 */
.search-container {
    margin-bottom: 24px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.clear-search {
    color: #3672dc;
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 4px;
}

.clear-search:hover {
    text-decoration: underline;
}

/* タブナビゲーション */
.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 36px;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 2px;
}

.tab-button {
    padding: 12px 20px;
    text-decoration: none;
    color: #6c7a89;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    border-radius: 6px 6px 0 0;
    transition: all 0.3s;
}

.tab-button.active {
    color: #3672dc;
    background-color: rgba(54, 114, 220, 0.05);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #3672dc;
    border-radius: 5px 5px 0 0;
}

/* 管理セクション */
.admin-section {
    margin-bottom: 48px;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 22px;
    color: #1a2b47;
}

.admin-form-section {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 36px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(225, 232, 237, 0.7);
}

.admin-form-section h3 {
    margin-bottom: 24px;
    font-size: 20px;
    color: #1a2b47;
    font-weight: 600;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 12px;
}

.admin-list-section {
    margin-bottom: 36px;
}

.admin-list-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #1a2b47;
    font-weight: 600;
}

/* 売上データ */
.sales-summary {
    margin-bottom: 36px;
}

.chart-container {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    height: 400px;
    border: 1px solid rgba(225, 232, 237, 0.7);
}

.pie-chart-container {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    height: 400px;
    border: 1px solid rgba(225, 232, 237, 0.7);
    position: relative;
}

.chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 10px;
}

.chart-tab {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: #6c7a89;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.chart-tab.active {
    background-color: #3672dc;
    color: white;
}

.chart-view-type {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.chart-type-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: #6c7a89;
    font-weight: 500;
    transition: all 0.3s;
    background-color: #f7f9fc;
    border: 1px solid #e1e8ed;
    font-size: 0.95rem;
}

.chart-type-btn.active {
    background-color: #3672dc;
    color: white;
    border-color: #3672dc;
}

.chart-view {
    width: 100%;
    height: 300px;
}

.pie-chart-view {
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pie-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.month-destination-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.toggle-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: #6c7a89;
    font-weight: 500;
    transition: all 0.3s;
    background-color: #f7f9fc;
    border: 1px solid #e1e8ed;
    font-size: 0.95rem;
}

.toggle-btn.active {
    background-color: #3672dc;
    color: white;
    border-color: #3672dc;
}

.year-filter {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.year-select {
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    background-color: white;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.yearly-articles-list {
    margin-top: 36px;
}

.yearly-articles-list h3 {
    margin-bottom: 16px;
    font-size: 18px;
    color: #34495e;
}

.loading-text {
    text-align: center;
    padding: 30px;
    color: #6c7a89;
    font-style: italic;
}

/* フォームカード */
.form-card {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(225, 232, 237, 0.7);
}

/* ログイン */
.login-container {
    max-width: 460px;
    margin: 60px auto;
    padding: 0 24px;
}

.login-card {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid rgba(225, 232, 237, 0.7);
}

.login-card h2 {
    color: #1a2b47;
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 600;
}

.login-card p {
    color: #6c7a89;
    margin-bottom: 24px;
}

.login-form {
    text-align: left;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .dashboard-cards,
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .main-nav .container {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-links li {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .admin-table .title-cell {
        max-width: 150px;
    }
    
    .chart-tabs,
    .chart-view-type {
        flex-wrap: wrap;
    }
    
    .tab-navigation {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        text-align: center;
    }
    
    .login-card {
        padding: 30px 20px;
    }
} 

/* テーブルカラム幅の調整 */
.admin-table th,
.articles-table th {
    white-space: nowrap;
}

.admin-table th:nth-child(1),
.articles-table th:nth-child(1) {
    width: 10%;  /* 納品日 - 少し狭く調整 */
}

.admin-table th:nth-child(2),
.articles-table th:nth-child(2) {
    width: 25%;  /* タイトル */
}

.admin-table th:nth-child(3),
.articles-table th:nth-child(3) {
    width: 12%;  /* 著者 */
}

.admin-table th:nth-child(4),
.articles-table th:nth-child(4) {
    width: 40%;  /* 納品URL - 最も広く */
}

.admin-table th:nth-child(5),
.articles-table th:nth-child(5) {
    width: 9%;  /* 文字数 */
}

.admin-table th:nth-child(6),
.articles-table th:nth-child(6) {
    width: 4%;  /* アクション */
}

/* アクション関連のスタイル調整 */
.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
}

.action-buttons .btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* URLセルのスタイル調整 */
.admin-table td:nth-child(4),
.articles-table td:nth-child(4) {
    word-break: break-all;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .admin-table td:nth-child(4),
    .articles-table td:nth-child(4) {
        max-width: 150px;
    }
}