@import url(../css/_reset.css);
* {
    box-sizing: border-box;
    margin: 0;
    left: 0;
}
:root
{
    --brandColor: #41aadb;
    --brandColor2: #1f4099;
    --brandColor3: #1e293b;
    --borderColor: #DDDDDD;
    --headerColor: #1f4099;
    --tableColor : #d2d9e4;
    --btnColor: #2563eb;
} 

.inner {
    padding: 0 20px;
}

@media (max-width: 360px) {
    .inner {
        padding: 0 12px;
    }
}

/* === LAYOUT === */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 210px;
    background: #1e293b;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    z-index: 100;
}

.sidebar-logo {
    text-align: center;
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #334155;
    line-height: 1.3;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    /* padding: 12px 0; */
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 16px;
    position: relative;
}
.sidebar-menu li a img {
    width: 20px;
    height: 20px;
    object-fit: cover;
}
.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: #334155;
    color: #fff;
}
.sidebar-menu li a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background-color: #FFA909;
}
.sidebar-menu li a .icon {
    width: 18px;
    text-align: center;
    font-style: normal;
}

.main-content {
    margin-left: 210px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

.topbar {
    background: #fff;
    padding: 14px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-timer {
    font-size: 13px;
    color: #64748b;
}

.session-timer .time {
    font-weight: 600;
    color: #f59e0b;
}

.page-content {
    padding: 24px;
    flex: 1;
}

/* === FORM === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control[readonly] {
    background: #f8fafc;
    color: #64748b;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
}

.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    resize: vertical;
    min-height: 140px;
    font-family: 'Consolas', 'Courier New', monospace;
}

.form-control-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}



/* === BUTTON === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}
.btn-border {
    border: 1px solid var(--btnColor);
    background: #fff;
    color: var(--btnColor);
}
.btn-border:hover {
    background: #eff4fa;
}
.btn-block {
    width: 100%;
    padding: 10px 0;
}

/* === CARD === */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.card-body {
    padding: 20px;
}

.table-wrapper {
    width: 100%;
}

.table-wrapper table {
    width: 100%;
    table-layout: fixed;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

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

tbody tr:hover {
    background: #f8fafc;
}

/* === BADGE === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-active {
    background: #dcfce7;
    color: #16a34a;
}

.badge-inactive {
    background: #fee2e2;
    color: #dc2626;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

/* === TOGGLE === */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: #2563eb;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* === MODAL === */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 520px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #475569;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* === TOOLBAR === */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    width: 200px;
    font-family: inherit;
}

.search-input:focus {
    border-color: #2563eb;
}

/* === PAGE TITLE === */
.page-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

/* === USER MAIN === */
.user-main-wrapper {

    background: #f1f5f9;
}
header { 
    position: fixed; 
    top: 0; 
    left: 0;  
    z-index: 9999;
    width: 100%; 
} 
.user-header {
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}

.user-content {
    padding-bottom: 30px;
}

.insurer-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(750px, 1fr));
    gap: 20px 25px;
}

.insurer-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.insurer-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.insurer-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* === STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    justify-content: space-between;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--borderColor);
}
.stat-card .right {
    text-align: right;
    margin-top: 25px;

}
.stat-label {
    color: #64748b;
    font-weight: 500;
    margin-bottom: 8px;
}

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

.stat-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* === ALERT === */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.alert-info {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-family: inherit;
}

.page-btn:hover:not(.disabled),
.page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #94a3b8;
}

/* === CODE === */
code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #e11d48;
}

/* === SIDEBAR FOOTER (공통) === */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #334155;
}

/* === UTILITY === */
.w-auto { width: auto; }

/* === RESPONSIVE (user pages only) === */

/* ── 햄버거 버튼 ── */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 14px;
    z-index: 160;
    background: #1e293b;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}
.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* ── 사이드바 오버레이 ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
}
.sidebar-overlay.show {
    display: block;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }

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

    .topbar {
        padding: 10px 14px 10px 62px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .topbar-right {
        gap: 8px;
    }

    .session-timer {
        font-size: 12px;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* 테이블 가로 스크롤 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrapper table {
        table-layout: auto;
        min-width: 500px;
    }

    /* 툴바 세로 정렬 */
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .toolbar-left,
    .toolbar-right {
        flex-wrap: wrap;
        gap: 6px;
    }

    .search-input {
        width: 160px;
    }

    /* 모달 */
    .modal {
        width: 95vw !important;
        max-width: 95vw !important;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 10px 12px 10px 58px;
    }

    .session-timer {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: 12px;
    }

    .page-title {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-body {
        padding: 14px;
    }

    .search-input {
        width: 130px;
    }

    .login-card {
        width: 90vw;
        padding: 32px 24px;
    }
}
