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

body {
    background-color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.iphone-simulator {
    width: 390px;
    height: 844px;
    background-color: #f8fafc;
    border-radius: 50px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    position: relative;
    border: 12px solid #0f172a;
    display: flex;
    flex-direction: column;
}

/* Simulate the dynamic island/notch area */
.iphone-simulator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background-color: #0f172a;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 10;
}

/* On actual smartphones, remove the simulator frame and go full screen */
@media (max-width: 480px) {
    body {
        background-color: #ffffff;
    }
    .iphone-simulator {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .iphone-simulator::before {
        display: none;
    }
}

.app-header {
    background-color: #ffffff;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.app-header h1 {
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subtitle {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

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

.logout-btn {
    background-color: transparent;
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    background-color: #f8fafc;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* スムーズスクロール対応 */
}

.progress-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    animation: slideUpFade 0.8s ease-out forwards;
}

.progress-container {
    width: 100%;
    max-width: 280px;
    position: relative;
    background: #ffffff;
    border-radius: 50%;
    padding: 20px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01);
}

.circular-chart {
    display: block;
    width: 100%;
    height: auto;
}

.circle-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 2;
}

.circle {
    fill: none;
    stroke: url(#progress-gradient);
    stroke-width: 2.5; 
    stroke-linecap: round;
}

.percentage-value {
    fill: #0f172a;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

.percentage-label {
    fill: #64748b;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.status-card {
    background: white;
    width: 100%;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    text-align: center;
}

.status-card h2 {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.level-title {
    font-size: 20px;
    font-weight: 700;
    color: #0284c7;
    margin-bottom: 8px;
}

.level-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

@keyframes slideUpFade {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* --- Login Screen Styles --- */
.login-body {
    background-color: #f1f5f9;
}

.login-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 32px 32px;
    background-color: #ffffff;
    justify-content: center;
}

.login-brand {
    text-align: center;
    margin-bottom: 48px;
    animation: slideUpFade 0.6s ease-out forwards;
}

.brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0284c7, #059669);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.3);
}

.login-brand h1 {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-brand p {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideUpFade 0.8s ease-out forwards;
}

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

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.input-group input {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 15px;
    color: #0f172a;
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #0284c7;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-top: -4px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    cursor: pointer;
}

.forgot-password {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
}

.login-button {
    margin-top: 12px;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.login-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px -1px rgba(2, 132, 199, 0.2);
}

.demo-notice {
    margin-top: auto;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    padding-top: 32px;
    animation: slideUpFade 1s ease-out forwards;
}

/* --- Tabs UI Styles --- */
.tabs-container {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1; /* Allow it to grow */
}

.tab-buttons {
    display: flex;
    background-color: #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    width: 100%;
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-content {
    display: none; /* Hidden by default */
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.tab-content.active {
    display: block; /* Show if active */
    animation: slideUpFade 0.3s ease-out forwards;
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: #cbd5e1;
    color: #475569;
    transition: all 0.2s ease;
}

/* Red accent when active on uncompleted tab */
.tab-btn.active #uncompleted-badge, .badge-red {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Green accent when active on completed tab */
.tab-btn.active #completed-badge, .badge-green {
    background-color: #d1fae5;
    color: #10b981;
}

.training-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.training-item {
    padding: 14px 16px;
    background-color: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.complete-btn {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
    transition: transform 0.1s ease, background-color 0.1s ease;
    white-space: nowrap;
    margin-left: 12px;
}

.complete-btn:active {
    transform: scale(0.92);
}

.complete-btn:disabled {
    background-color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.training-item:active {
    transform: scale(0.98);
}

/* --- Modal Styles --- */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    width: 85%;
    max-width: 320px;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    font-size: 16px;
    color: #0f172a;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-content p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
}

.date-picker {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: #0f172a;
    margin-bottom: 24px;
    background-color: #f8fafc;
}

.date-picker:focus {
    outline: none;
    border-color: #0284c7;
    background-color: #ffffff;
}

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

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.1s ease, filter 0.1s ease;
}

.modal-btn:active {
    transform: scale(0.95);
    filter: brightness(0.9);
}

.cancel-btn {
    background-color: #f1f5f9;
    color: #475569;
}

.submit-btn {
    background-color: #10b981;
    color: white;
}

.uncompleted-item {
    border-left-color: #ef4444; /* Red accent */
}

.completed-item {
    border-left-color: #10b981; /* Green accent */
    opacity: 0.8; /* Make completed items slightly faded */
}

.item-id {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.5px;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* --- Admin Button --- */
.admin-btn {
    background-color: #0284c7;
    color: white;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
}

/* --- Admin Screen --- */
.admin-body {
    background-color: #f1f5f9;
    display: block;
    min-height: 100vh;
    align-items: unset;
}

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

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

.admin-header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.admin-header-left h1 span {
    color: #0284c7;
    font-size: 14px;
    font-weight: 600;
    margin-left: 8px;
    background: #e0f2fe;
    padding: 2px 8px;
    border-radius: 6px;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #475569;
}

.admin-header-right a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
}

.admin-logout {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.admin-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-filters select {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
    cursor: pointer;
    min-width: 160px;
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.summary-card .label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-card .value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
}

.admin-table-wrap {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.staff-table th {
    background: #f8fafc;
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.staff-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

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

.staff-table tr:hover td {
    background: #f8fafc;
}

.level-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e0f2fe;
    color: #0284c7;
}

.progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, #0284c7, #059669);
}

.progress-pct {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    min-width: 36px;
    text-align: right;
}

.admin-empty {
    text-align: center;
    padding: 48px;
    color: #94a3b8;
    font-size: 14px;
}
