/* Dashboard – MSN-like layout */
/* General layout */
.main_wrapper {
    width: 100%;
    padding-top: 64px; /* space for sticky nav */
}

/* ========== Top Navigation ========== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 200;
    border-bottom: 1px solid #e6f0fa;
}

.topbar .inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: relative;
    box-sizing: border-box;
}

/* 左側: ロゴ + メイン機能ナビゲーション */
.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.topbar .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar .logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    transition: opacity 0.2s ease;
}

.topbar .logo a:hover {
    opacity: 0.8;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0078d4;
}

.logo-img {
    height: 45px;
    width: auto;
    vertical-align: middle;
}

/* メイン機能ナビゲーション */
.main-nav ul {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 1.3rem;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.main-nav a:hover {
    background: #f8f9fa;
    color: #0078d4;
    transform: translateY(-1px);
}

.main-nav a.active {
    background: #0078d4;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.25);
}

.main-nav a.active::before {
    display: none;
}

.main-nav a i {
    font-size: 1.4rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* 右側: ユーザーメニュー */
.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 12px;
    margin-left: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    font-size: 1.3rem;
    white-space: nowrap;
}

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

.user-info i {
    font-size: 1.2rem;
    opacity: 0.7;
}

.user-info .admin-badge {
    background: #ff9800;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-info .company-name,
.user-info .user-name {
    color: #333;
    font-size: 1.3rem;
}

.user-menu {
    display: flex;
    align-items: center;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
}

.logout-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.logout-btn i {
    font-size: 1.4rem;
}

/* ハンバーガーメニュー */
.hamburger-menu {
    display: none;
    flex-direction: column;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    justify-content: space-between;
    z-index: 1001;
    box-sizing: border-box;
}

.hamburger-menu span {
    width: 100%;
    height: 2px;
    background: #0078d4;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* モバイルナビゲーション */
.mobile-nav {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 64px);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 199;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
}

.mobile-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    color: #444;
    text-decoration: none;
    font-size: 1.4rem;
    transition: background 0.2s;
}

.mobile-nav a:hover {
    background: #f8f9fa;
    color: #0078d4;
}

.mobile-nav a.active {
    background: #0078d4;
    color: #ffffff;
}

.mobile-nav a i {
    font-size: 1.6rem;
    width: 24px;
    text-align: center;
}

.mobile-nav-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
    border-bottom: none;
}

.mobile-user-info {
    padding: 16px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-admin-badge,
.mobile-company-name,
.mobile-user-name {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #333;
    font-size: 1.3rem;
}

.mobile-admin-badge {
    background: #ff9800;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 8px;
}

.mobile-company-name {
    color: #555;
    font-weight: 500;
    margin-bottom: 8px;
}

.mobile-user-name {
    color: #666;
}

.mobile-user-info i {
    font-size: 1.4rem;
    opacity: 0.8;
}

.mobile-logout-btn {
    background: #f8f9fa !important;
    color: #dc3545 !important;
    font-weight: 600;
}

.mobile-logout-btn:hover {
    background: #fee !important;
    color: #c82333 !important;
}

/* レスポンシブ対応 */
@media screen and (max-width: 1024px) {
    .hamburger-menu {
        display: flex;
    }
    
    .main-nav {
        display: none;
    }
    
    .header-right {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
}

@media screen and (max-width: 768px) {
    .topbar .inner {
        padding: 0 16px;
        height: 56px;
    }
    
    .mobile-nav {
        top: 56px;
        max-height: calc(100vh - 56px);
    }
    
    .main_wrapper {
        padding-top: 56px;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .hamburger-menu {
        width: 44px;
        height: 44px;
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    .topbar .inner {
        padding: 0 12px;
        height: 52px;
    }
    
    .mobile-nav {
        top: 52px;
        max-height: calc(100vh - 52px);
    }
    
    .main_wrapper {
        padding-top: 52px;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .hamburger-menu {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .mobile-nav a {
        padding: 14px 20px;
        font-size: 1.3rem;
    }
    
    .mobile-user-info {
        padding: 14px 20px;
    }
}

/* ========== Content ========== */
#content {
    padding: 32px 16px;
}
.content_wrapper {
    max-width: 1280px;
    margin: 0 auto;
}

.news-container {
    display: flex;
    gap: 32px;
}
.news-main {
    flex: 3;
}
.sidebar {
    flex: 1;
}

/* Featured Article */
.featured {
    position: relative;
    margin-bottom: 32px;
    border-radius: 8px;
    overflow: hidden;
}
.featured img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}
.featured .feature-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(0deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.0) 100%);
    color: #fff;
}
.featured .feature-overlay h2 {
    font-size: 2.4rem;
    margin-bottom: 8px;
}
.featured .feature-overlay .meta {
    font-size: 1.2rem;
    opacity: 0.85;
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.1s ease;
}
.news-card:hover {
    transform: translateY(-3px);
}
.news-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}
.news-card .card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-card .title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #333;
}
.news-card .meta {
    font-size: 1.2rem;
    color: #777;
    margin-top: auto;
}

/* Sidebar */
.sidebar h3 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    font-weight: 700;
}
.trending-list {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.trending-list li + li {
    margin-top: 12px;
}
.trending-list a {
    color: #333;
    font-size: 1.4rem;
}
.trending-list a:hover {
    color: #0078d4;
}

/* Responsive */
@media screen and (max-width: 960px) {
    .news-container {
        flex-direction: column;
    }
    .sidebar {
        order: -1;
        margin-bottom: 32px;
    }
}

/* 3カラム横並びレイアウト */
.news-columns {
    display: flex;
    gap: 32px;
    width: 100%;
    min-width: 0;
}
.news-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 16px;
    max-height: 600px;
    overflow-y: auto;
}
.news-col h2 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}
.news-col h3 {
    font-size: 1.4rem;
}
.news-col h3 a {
    color: #333;
}
.news-col h4 {
    font-size: 1.0rem;
    font-weight: 400;
    color: #0078d4;
}
.news-col .date {
    font-size: 1.1rem;
    padding-top: 3px;
    color: #777;
}
.news-row {
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 0;
}
.news-row:last-child {
    border-bottom: none;
}
@media screen and (max-width: 960px) {
    .news-columns {
        flex-direction: column;
        gap: 24px;
    }
    .news-col {
        width: 100%;
        min-height: 450px;
    }
}

.yt-stats {
    display: flex;
    gap: 16px;
    margin-top: 4px;
    font-size: 1.1rem;
    color: #555;
    flex-wrap: wrap;
}
.yt-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.yt-stats i {
    color: #0078d4;
    font-size: 1.1rem;
}

.news-summary-row {
    display: flex;
    width: 100%;
    gap: 24px;
    margin-bottom: 32px;
}
.news-summary {
    width: 75%;
    max-height: 530px;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}
.news-summary-side {
    width: 25%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.news-summary h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    color: #0078d4;
}
.news-summary-content {
    font-size: 1.3rem;
    line-height: 1.4;
    color: #222;
    white-space: pre-line;
}
@media screen and (max-width: 960px) {
    .news-summary-row {
        flex-direction: column;
        gap: 16px;
    }
    .news-summary, .news-summary-side {
        width: 100%;
        max-width: 100%;
    }
}

.news-summary-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #00008b; /* 濃い青 */
    border-bottom: 0px solid #eee;
    padding-bottom: 0px;
}
.news-summary-content ul {
    list-style-type: '● ';
    padding: 0px;
    line-height: 1.4;
    margin: 0px 0px 5px 0px;
    margin-left: 10px;
}
.news-summary-content li {
    list-style-type: '● ';
    margin: 0px　0px 5px 0px;
    margin-left: 15px;
    padding: 0px 0px 5px 0px;
    line-height: 1.4;
}
.news-summary-content a {
    font-size: 1.1rem;
    color: #005fa3;
    text-decoration: none;
}

.summary-date {
    font-size: 1.0rem;
    color: #888;
}

.refresh-btn {
    background: #fff;
    color: #0078d4;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.refresh-btn:hover {
    background: #005fa3;
}
.refresh-btn i {
    font-size: 1.2rem;
}

.read-complete-btn {
    background: #0078d4;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    margin-left: auto;
}
.read-complete-btn:hover {
    background: #005fa3;
    color: #fff !important;
}
.read-complete-btn i {
    font-size: 1.2rem;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.calendar-title {
    font-weight: bold;
    font-size: 1.2rem;
}
.calendar-prev, .calendar-next {
    color: #0078d4;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.calendar-prev:hover, .calendar-next:hover {
    background: #e6f0fa;
}
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 8px;
}
.calendar-table th, .calendar-table td {
    width: 14.2%;
    height: 38px;
    text-align: center;
    padding: 4px 0;
    border: 1px solid #e0e0e0;
    font-size: 1.1rem;
}
.calendar-link {
    color: #0078d4;
    text-decoration: underline;
    font-weight: bold;
}
/* 表示中の日付のスタイル */
.calendar-current-date .calendar-link,
.calendar-current-date .calendar-empty {
    color: #d84315 !important; /* 赤い文字 */
    background-color: #ffd700 !important; /* 濃い黄色の背景 */
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: bold !important;
}

/* 今日の日付のセル背景色 */
.calendar-today {
    background-color: #fff5cc !important; /* もっと薄いオレンジ */
}
.calendar-empty {
    color: #333;
}
input[type="checkbox"][disabled] {
    accent-color: #0078d4;
    margin-right: 2px;
}

.calendar-table th {
    background: #e6f0fa;
    color: #222;
    font-weight: bold;
}
.calendar-table th.sun {
    color: #d84315;
}
.calendar-table th.sat {
    color: #00008b;
}

.logo-img {
    height: 60px;
    width: auto;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
    padding: 0;
}

/* メモ機能 */
.memo-section {
    border: 1px solid #dee2e6;
    margin-top: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
}

.memo-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.memo-tab {
    flex: 1;
    padding: 10px 12px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #6c757d;
    border-bottom: 2px solid transparent;
}

.memo-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.memo-tab.active {
    background: #fff;
    color: #0078d4;
    border-bottom-color: #0078d4;
    font-weight: 600;
}

.memo-tab i {
    margin-right: 4px;
    font-size: 1.0rem;
}

.memo-content {
    position: relative;
    height: 120px;
}

.memo-textarea {
    width: 100%;
    height: 120px;
    border: none;
    padding: 12px;
    font-size: 1.2rem;
    line-height: 1.4;
    resize: none;
    outline: none;
    background: #fff;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s;
    box-sizing: border-box;
}

.memo-textarea.active {
    opacity: 1;
    z-index: 1;
}

.memo-textarea:focus {
    box-shadow: inset 0 0 0 2px #0078d4;
}

.memo-textarea::placeholder {
    color: #adb5bd;
    font-style: italic;
}

@media screen and (max-width: 960px) {
    .memo-content {
        height: 100px;
    }
    
    .memo-textarea {
        height: 100px;
        font-size: 1.1rem;
        padding: 10px;
    }
    
    .memo-tab {
        padding: 8px 10px;
        font-size: 1.0rem;
    }
}

/* ========== ログイン画面スタイル ========== */
body#login {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

body#login .wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 30px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

body#login .wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0078d4, #00bcf2, #0078d4);
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

body#login .left_logo {
    text-align: center;
    padding: 20px;
    order: 1;
}

body#login .left_logo img {
    width: 120px;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

body#login .left_logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #0078d4, #00bcf2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body#login .left_logo p {
    font-size: 1.4rem;
    color: #666;
    margin: 0;
    font-weight: 400;
}

body#login .login_form {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    width: 100%;
    order: 2;
}

body#login .login_form h3 {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 30px 0;
    text-align: center;
    position: relative;
}

body#login .login_form h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #0078d4, #00bcf2);
    border-radius: 2px;
}

body#login .login_form dl {
    margin-bottom: 20px;
}

body#login .login_form dt {
    font-size: 1.3rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

body#login .login_form dd {
    margin: 0;
    position: relative;
}

body#login .login_form input[type="text"],
body#login .login_form input[type="password"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

body#login .login_form input[type="text"]:focus,
body#login .login_form input[type="password"]:focus {
    outline: none;
    border-color: #0078d4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
    transform: translateY(-2px);
}

body#login .pw_input {
    position: relative;
}

body#login .pw_input #buttonEye {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    cursor: pointer;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

body#login .pw_input #buttonEye:hover {
    color: #0078d4;
}

body#login .login_form p {
    margin: 25px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

body#login .login_form .checkbox {
    width: 18px;
    height: 18px;
    accent-color: #0078d4;
    cursor: pointer;
}

body#login .checkbox-p {
    font-size: 1.3rem;
    color: #666;
    cursor: pointer;
    user-select: none;
}

body#login .login_btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0078d4, #00bcf2);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body#login .login_btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

body#login .login_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.3);
}

body#login .login_btn:hover::before {
    left: 100%;
}

body#login .login_btn:active {
    transform: translateY(0);
}

body#login .attention {
    text-align: center;
    margin-top: 25px;
}

body#login .attention a {
    color: #0078d4;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

body#login .attention a:hover {
    color: #005fa3;
    text-decoration: underline;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    body#login .wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 30px 20px;
        margin: 20px;
        max-width: 500px;
    }
    
    body#login .left_logo {
        order: 1;
    }
    
    body#login .login_form {
        order: 2;
        padding: 25px 20px;
    }
    
    body#login .left_logo h1 {
        font-size: 1.8rem;
    }
    
    body#login .left_logo img {
        width: 100px;
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 480px) {
    body#login .wrapper {
        padding: 20px 15px;
        margin: 10px;
        border-radius: 15px;
    }
    
    body#login .login_form {
        padding: 20px 15px;
    }
    
    body#login .left_logo h1 {
        font-size: 1.6rem;
    }
    
    body#login .login_form h3 {
        font-size: 1.8rem;
    }
    
    body#login .login_form input[type="text"],
    body#login .login_form input[type="password"] {
        padding: 12px 16px;
        font-size: 1.3rem;
    }
    
    body#login .login_btn {
        padding: 14px;
        font-size: 1.4rem;
    }
}

/* バリデーションエラー用スタイル */
body#login .formError {
    background: #ff6b6b !important;
    border: 1px solid #ff5252 !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 1.2rem !important;
    margin-top: 5px !important;
}

body#login .formError .formErrorContent {
    background: none !important;
    color: #fff !important;
    border: none !important;
    text-shadow: none !important;
}

/* ========== Dashboard Specific Styles ========== */
/* シンプルな挨拶文表示 */
.greeting-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 12px 20px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#greeting-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    width: 100%;
    text-align: center;
    transition: opacity 0.5s ease-in-out;
}

/* 投稿フィルター機能のスタイル */
.post-filter-links {
    font-size: 14px;
}

.filter-link {
    color: #667eea;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.filter-link:hover {
    background-color: #f0f0f0;
}

.filter-link.active {
    background-color: #667eea;
    color: white;
}

.no-posts-message {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

.no-posts-message small {
    display: block;
    margin-top: 10px;
    color: #999;
}

/* ========== Memo List Specific Styles ========== */
.memo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.memo-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.memo-date {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.memo-content-wrapper {
    margin: 10px 0;
}

.memo-content {
    width: 100%;
    min-height: 100px;
    max-height: 200px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.5;
}

.memo-content:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0,120,212,0.2);
}

.memo-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.view-news-btn {
    background: #0078d4;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.view-news-btn:hover {
    background: #005a9e;
}

.calendar-container {
    margin: 20px 0;
    text-align: center;
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* ニュースコンテンツのスタイル */
.news-content h2 {
    font-size: 1.4em;
    color: #0078d4;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.news-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.news-content ul, .news-content ol {
    margin: 15px 0;
    padding-left: 20px;
}

.news-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.news-content a {
    color: #0078d4;
    text-decoration: none;
}

.news-content a:hover {
    text-decoration: underline;
}

.news-content blockquote {
    margin: 15px 0;
    padding: 10px 20px;
    border-left: 4px solid #0078d4;
    background-color: #f5f5f5;
}

.news-content code {
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

.news-content pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
}

.news-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 5px;
}

.news-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.news-content th, .news-content td {
    padding: 10px;
    border: 1px solid #ddd;
}

.news-content th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.date-range-form {
    margin: 20px 0;
    text-align: center;
}

.date-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.date-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.date-submit-btn {
    background: #0078d4;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

.date-submit-btn:hover {
    background: #005a9e;
}

/* ========== 企業情報管理画面スタイル ========== */
/* ページヘッダー */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e6f0fa;
}

.page-header h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: #0078d4;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h2::before {
    content: "\f1ad";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 2.0rem;
    color: #0078d4;
}

/* アラートメッセージ */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.3s ease-out;
}

.alert-success {
    background: #e8f5e8;
    border-left-color: #28a745;
    color: #155724;
}

.alert-success::before {
    content: "\f058";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #28a745;
    font-size: 1.6rem;
}

.alert-error {
    background: #f8e8e8;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-error::before {
    content: "\f06a";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #dc3545;
    font-size: 1.6rem;
}

/* 検索フォーム */
.search-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e6f0fa;
}

.search-controls {
    display: grid;
    grid-template-columns: 2fr 1.5fr auto;
    gap: 20px;
    align-items: end;
}

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

.search-group label {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

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

/* ボタンスタイル */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #0078d4, #005fa3);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #005fa3, #004578);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 120, 212, 0.3);
    color: #fff;
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3);
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 1.2rem;
}

/* フォームスタイル */
.form-horizontal {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e6f0fa;
}

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

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

.form-label .required {
    color: #dc3545;
    font-weight: 700;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1.4rem;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
    min-height: 48px;
}

.form-control select,
select.form-control {
    height: 48px !important;
    line-height: 1.5 !important;
    padding: 10px 16px !important;
    vertical-align: middle;
    font-size: 1.4rem !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    background: #f8f9fa !important;
    box-sizing: border-box !important;
}

/* 検索フォーム内のセレクトボックス専用スタイル */
.search-form select.form-control {
    height: 48px !important;
    line-height: 1.5 !important;
    padding: 12px 16px !important;
    font-size: 1.4rem !important;
    display: flex;
    align-items: center;
}

.form-control:focus {
    outline: none;
    border-color: #0078d4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-text {
    font-size: 1.2rem;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-start;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
}

/* テーブルコンテナ */
.table-container {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e6f0fa;
}

/* テーブルスタイル */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.3rem;
    margin: 0;
}

.table thead {
    background: linear-gradient(135deg, #0078d4, #005fa3);
    color: #fff;
}

.table thead th {
    padding: 16px 12px;
    font-weight: 600;
    text-align: left;
    border: none;
    font-size: 1.3rem;
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.table tbody td {
    padding: 16px 12px;
    vertical-align: middle;
    border: none;
}

.table .actions {
    text-align: center;
    white-space: nowrap;
    width: 160px;
}

.table .actions .btn {
    margin: 0 4px;
}

/* ステータスバッジ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}



.status-active {
    background: #d4edda;
    color: #155724;
}

.status-active::before {
    content: "\f058";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #28a745;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-inactive::before {
    content: "\f057";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #dc3545;
}

/* データなし表示 */
.no-data {
    text-align: center;
    padding: 48px 24px;
    color: #6c757d;
}

.no-data p {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.no-data p:first-child {
    font-size: 1.8rem;
    font-weight: 600;
    color: #495057;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .page-header h2 {
        font-size: 2.0rem;
    }
    
    .search-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .search-actions {
        justify-content: stretch;
    }
    
    .search-actions .btn {
        flex: 1;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 12px 8px;
        font-size: 1.2rem;
    }
}

@media screen and (max-width: 480px) {
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 1.3rem;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 1.1rem;
    }
    
    .form-horizontal {
        padding: 24px 20px;
    }
    
    .search-form {
        padding: 20px 16px;
    }
    
    .alert {
        padding: 12px 16px;
        font-size: 1.3rem;
    }
}

/* ========== セクション管理スタイル ========== */
.section-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e6f0fa;
    margin-top: 32px;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
}

.section-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h3 i {
    color: #0078d4;
    font-size: 1.6rem;
}

/* アイテムスタイル */
.character-item,
.dataset-item {
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.character-item:last-child,
.dataset-item:last-child {
    border-bottom: none;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s ease;
}

.item-header:hover {
    background: #e9ecef;
}

.item-header-simple {
    padding: 16px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.item-header h4,
.item-header-simple h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.item-content {
    padding: 24px;
    display: none;
}

.item-content.show {
    display: block;
}

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

.item-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* API Key表示 */
.api-key-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.api-key-display input {
    flex: 1;
    background: #f8f9fa;
    color: #6c757d;
    font-family: monospace;
    font-size: 1.2rem;
}

.form-control-static {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.dataset-info strong {
    color: #495057;
    font-size: 1rem;
}

.dataset-info .text-muted {
    font-size: 0.875rem;
    color: #6c757d !important;
}

/* base.cssのtextarea高さ設定を上書き */
.form-control textarea,
textarea.form-control {
    height: auto !important;
}

/* 行数に応じた高さ設定 */
textarea[rows="2"] {
    height: calc(1.5em * 2 + 20px) !important; /* 2行分 + padding */
}

textarea[rows="3"] {
    height: calc(1.5em * 3 + 20px) !important; /* 3行分 + padding */
}

textarea[rows="5"] {
    height: calc(1.5em * 5 + 20px) !important; /* 5行分 + padding */
}

/* ファイル管理スタイル */
.file-upload-area {
    margin: 10px 0;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: #ffffff;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.file-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* flexの子要素でテキストがはみ出ないように */
}

.file-info i {
    color: #6c757d;
    font-size: 1.2rem;
    flex-shrink: 0; /* アイコンのサイズを固定 */
}

.file-info strong {
    color: #495057;
    font-weight: 600;
    margin-right: 8px;
}

.file-info .text-muted {
    color: #6c757d !important;
    font-size: 0.875rem;
    white-space: nowrap;
}

.file-item .btn {
    flex-shrink: 0; /* ボタンのサイズを固定 */
    margin-left: 12px;
}

.no-files {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #17a2b8;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
}



/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .section-header h3 {
        font-size: 1.6rem;
    }
    
    .item-header {
        padding: 12px 16px;
    }
    
    .item-content {
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .api-key-display {
        flex-direction: column;
        align-items: stretch;
    }
}
