.header {
    background: var(--white);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 60px;
    width: 100%;
}

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--min-tap-size, 48px);
    height: var(--min-tap-size, 48px);
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    margin-left: auto;
    padding: 0;
    font-size: 1.3rem;
}

.mobile-menu-toggle:hover {
    background-color: var(--light-color);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* ハンバーガーメニューの線アニメーション */
.mobile-menu-toggle .hamburger-lines {
    position: relative;
    width: 22px;
    height: 16px;
}

.mobile-menu-toggle .hamburger-lines span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    left: 0;
    transition: transform 0.3s ease, top 0.3s ease, opacity 0.2s ease;
}

.mobile-menu-toggle .hamburger-lines span:nth-child(1) {
    top: 0;
}

.mobile-menu-toggle .hamburger-lines span:nth-child(2) {
    top: 7px;
}

.mobile-menu-toggle .hamburger-lines span:nth-child(3) {
    top: 14px;
}

/* ハンバーガー → X アニメーション */
.mobile-menu-toggle.active .hamburger-lines span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
}

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

.mobile-menu-toggle.active .hamburger-lines span:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
}

.mobile-menu {
    display: block;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    visibility: hidden;
    transition: all 0.3s ease;
    position: absolute;
    top: 100%;
    right: 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
}

.mobile-menu.show {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.header-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: var(--border-radius);
    transition: background-color 0.15s ease;
}

.header-link:active {
    background-color: rgba(0, 0, 0, 0.04);
}

.header-link:hover {
    color: inherit;
    text-decoration: none;
}

.header-left i {
    color: var(--primary-color);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.header-left h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.2;
}

.header-right {
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.role-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.parent {
    background-color: var(--primary-color);
    color: var(--white);
}

.role-badge.child {
    background-color: var(--success-color);
    color: var(--white);
}

.logout-btn {
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--border-radius);
}

.logout-btn:hover {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.logout-text {
    display: none;
}

.main-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    min-height: 60px;
    width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.8rem 0.5rem;
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
    flex: 1;
    text-align: center;
    min-width: 0;
}

.nav-item:hover {
    color: var(--primary-color);
    background-color: rgba(23, 162, 184, 0.05);
}

.nav-item:active {
    transform: scale(0.97);
}

.nav-item.active {
    color: var(--primary-color);
    background-color: rgba(23, 162, 184, 0.1);
    font-weight: 600;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

.badge {
    background-color: var(--danger-color);
    color: var(--white);
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.nav-icon-container {
    position: relative;
    display: inline-block;
}

.nav-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: var(--white);
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.nav-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.page-header {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-color);
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.page-header h1 i {
    color: var(--primary-color);
    background: rgba(23, 162, 184, 0.1);
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.header-badge {
    background-color: var(--danger-color);
    color: var(--white);
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.breadcrumb {
    margin-bottom: 1.5rem;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--dark-color);
    font-weight: 500;
}

.breadcrumb-item i {
    margin-right: 0.25rem;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-color);
    font-size: 0.8rem;
    opacity: 0.7;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark-color);
    text-decoration: none;
    padding: 0.75rem 0;
    min-height: var(--min-tap-size, 48px);
}

.mobile-menu-link:hover {
    color: var(--primary-color);
}

/* ========================================
   レスポンシブ: モバイルフォントサイズ
   ======================================== */

@media (max-width: 768px) {
    .page-header {
        padding: 1rem 1.25rem;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .page-header h1 i {
        font-size: 1rem;
        width: 1.8rem;
        height: 1.8rem;
    }

    .nav-item {
        font-size: 0.75rem;
    }

    .nav-item i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.2rem;
    }

    .page-header h1 i {
        font-size: 0.9rem;
        width: 1.6rem;
        height: 1.6rem;
    }

    .header-left h1 {
        font-size: 1rem;
    }

    .nav-item {
        font-size: 0.7rem;
        padding: 0.6rem 0.3rem;
    }

    .breadcrumb-list {
        font-size: 0.8rem;
    }
}

@media (max-width: 320px) {
    .page-header h1 {
        font-size: 1.1rem;
    }

    .header-left h1 {
        font-size: 0.9rem;
    }

    .nav-item {
        font-size: 0.65rem;
    }
}

/* ========================================
   ページ遷移アニメーション
   ======================================== */

@keyframes slideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-25px); }
}

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

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-25px); }
    to { opacity: 1; transform: translateX(0); }
}

.main-content.leaving-right {
    animation: slideOutLeft 0.15s ease-out forwards;
}

.main-content.leaving-left {
    animation: slideOutRight 0.15s ease-out forwards;
}

.main-content.entering-right {
    animation: slideInRight 0.2s ease-out;
}

.main-content.entering-left {
    animation: slideInLeft 0.2s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.98); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.main-content.fade-out {
    animation: fadeOut 0.15s ease-out forwards;
}

.main-content.fade-in {
    animation: fadeIn 0.2s ease-out;
}
