/* ============================================
   JFMRA Admin System - Stylesheet
   ============================================ */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #1a202c;
    --sidebar-width: 250px;
    --sidebar-collapsed: 0px;
    --header-height: 56px;
}

/* --- Base --- */
body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f7fafc;
    color: #2d3748;
    font-size: 14px;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-light);
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-brand small {
    font-size: 0.7rem;
    opacity: 0.7;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav .nav-section {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    font-weight: 700;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-left-color: #63b3ed;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: #fff;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-bar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.top-bar .page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.content-wrapper {
    padding: 1.5rem;
}

/* --- Mobile --- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .main-content {
        margin-left: 0;
    }
}

/* --- Cards --- */
.stat-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* --- Tables --- */
.table-wrapper {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.table-wrapper .table {
    margin-bottom: 0;
}

.table thead th {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
    font-size: 0.8rem;
    color: #4a5568;
    white-space: nowrap;
    padding: 0.75rem;
}

.table tbody td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
    font-size: 0.85rem;
    border-color: #edf2f7;
}

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

/* --- Forms --- */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4a5568;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(44, 82, 130, 0.15);
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* --- Badges --- */
.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
}

.badge-active {
    background-color: #c6f6d5;
    color: #22543d;
}

.badge-inactive {
    background-color: #fed7d7;
    color: #822727;
}

.badge-paid {
    background-color: #c6f6d5;
    color: #22543d;
}

.badge-unpaid {
    background-color: #fefcbf;
    color: #744210;
}

/* --- Pagination --- */
.pagination .page-link {
    color: var(--primary);
    border-color: #e2e8f0;
    font-size: 0.85rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* --- Flash Messages --- */
.alert-dismissible {
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

/* --- Login Page --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-card .card-header {
    background: transparent;
    text-align: center;
    padding: 2rem 2rem 0.5rem;
    border: none;
}

.login-card .card-body {
    padding: 1.5rem 2rem 2rem;
}

/* --- Import --- */
.import-preview {
    max-height: 400px;
    overflow: auto;
}

.import-preview table {
    font-size: 0.8rem;
}

.column-mapping select {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* --- Mail --- */
.progress-wrapper {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.send-log {
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.8rem;
    font-family: monospace;
    background: #1a202c;
    color: #a0aec0;
    padding: 1rem;
    border-radius: 0.375rem;
}

.send-log .success {
    color: #68d391;
}

.send-log .error {
    color: #fc8181;
}

/* --- Utilities --- */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.w-180 {
    width: 180px;
}

/* --- Wizard --- */
.wizard-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #a0aec0;
}

.wizard-step.active {
    color: var(--primary);
    font-weight: 700;
}

.wizard-step.completed {
    color: #38a169;
}

.wizard-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    background: #e2e8f0;
    color: #718096;
}

.wizard-step.active .step-number {
    background: var(--primary);
    color: #fff;
}

.wizard-step.completed .step-number {
    background: #38a169;
    color: #fff;
}

.wizard-step-divider {
    width: 40px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.75rem;
}

/* --- Print --- */
@media print {
    .sidebar,
    .top-bar,
    .sidebar-toggle,
    .btn,
    .pagination {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}
