/* =====================================================================
   Softit MIS - Design System
   Bootstrap 5.3 위에 얹는 커스텀 테마 (indigo primary, soft surfaces)
   ===================================================================== */
:root {
    --mis-primary: #4f46e5;
    --mis-primary-rgb: 79, 70, 229;
    --mis-primary-soft: #eef2ff;
    --mis-bg: #f4f6fb;
    --mis-surface: #ffffff;
    --mis-border: #e8ebf3;
    --mis-text: #1e293b;
    --mis-muted: #64748b;
    --mis-sidebar-bg: #0f172a;
    --mis-sidebar-bg2: #1e1b4b;
    --mis-sidebar-text: #cbd5e1;
    --mis-sidebar-width: 264px;
    --mis-sidebar-collapsed: 78px;
    --mis-header-height: 66px;
    --mis-radius: 14px;
    --mis-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --mis-shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);

    --bs-primary: var(--mis-primary);
    --bs-primary-rgb: var(--mis-primary-rgb);
    --bs-link-color: var(--mis-primary);
    --bs-link-color-rgb: var(--mis-primary-rgb);
    --bs-body-font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--mis-text);
    --bs-body-bg: var(--mis-bg);
    --bs-border-color: var(--mis-border);
    --bs-border-radius: 10px;
}

body {
    font-size: .925rem;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------- Buttons */
.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: .5rem 1rem;
}

.btn-sm {
    border-radius: 8px;
    padding: .3rem .7rem;
}

.btn-primary {
    --bs-btn-bg: var(--mis-primary);
    --bs-btn-border-color: var(--mis-primary);
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #3730a3;
    --bs-btn-disabled-bg: #a5b4fc;
    --bs-btn-disabled-border-color: #a5b4fc;
    box-shadow: 0 4px 12px rgba(var(--mis-primary-rgb), .25);
}

.btn-outline-primary {
    --bs-btn-color: var(--mis-primary);
    --bs-btn-border-color: #c7d2fe;
    --bs-btn-hover-bg: var(--mis-primary);
    --bs-btn-hover-border-color: var(--mis-primary);
    --bs-btn-active-bg: #4338ca;
}

.btn-light {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--mis-border);
    --bs-btn-hover-bg: #f8fafc;
    --bs-btn-hover-border-color: #d5dbe7;
    color: var(--mis-text);
}

.btn-excel {
    --bs-btn-color: #15803d;
    --bs-btn-bg: #f0fdf4;
    --bs-btn-border-color: #bbf7d0;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #16a34a;
    --bs-btn-hover-border-color: #16a34a;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------------------------------------------------------- Forms */
.form-control, .form-select {
    border-radius: 10px;
    border-color: #dfe3ec;
    padding: .55rem .85rem;
}

.form-control-sm, .form-select-sm {
    border-radius: 8px;
    padding: .3rem .6rem;
}

/* 위 padding 단축 속성이 Bootstrap 의 오른쪽 여백(화살표 자리)을 덮어써 글자와 화살표가 겹치므로 되돌린다 */
.form-select { padding-right: 2.25rem; }
.form-select-sm { padding-right: 2rem; }
/* 페이지 상단 버튼 영역(연도·월 선택)은 flex 안에서 줄어들어 글자가 잘리므로 내용 너비로 */
.page-actions .form-select { width: auto; flex-shrink: 0; }

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 .2rem rgba(var(--mis-primary-rgb), .15);
}

.form-check-input:checked {
    background-color: var(--mis-primary);
    border-color: var(--mis-primary);
}

.form-label {
    font-weight: 600;
    font-size: .82rem;
    color: #475569;
    margin-bottom: .35rem;
}

.form-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-section-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--mis-primary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 1.25rem 0 .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.form-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--mis-border);
}

/* ---------------------------------------------------------- Layout */
.app {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--mis-sidebar-width);
    background: linear-gradient(180deg, var(--mis-sidebar-bg) 0%, var(--mis-sidebar-bg2) 100%);
    color: var(--mis-sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .2s ease, transform .2s ease;
}

.sidebar-brand {
    height: var(--mis-header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* 로고: 어두운 배경(사이드바·로그인)은 logo-white.png, 밝은 배경(진위 확인)은 logo-navy.png */
.brand-logo {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-sub {
    font-size: .7rem;
    font-weight: 500;
    color: #94a3b8;
    display: block;
    line-height: 1;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem .75rem;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .15);
    border-radius: 4px;
}

.nav-section-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: #64748b;
    padding: .75rem .75rem .35rem;
    text-transform: uppercase;
}

.sidebar .nav-item-link, .sidebar .nav-group-toggle {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .62rem .8rem;
    border-radius: 10px;
    color: var(--mis-sidebar-text);
    text-decoration: none;
    font-weight: 500;
    background: none;
    border: 0;
    white-space: nowrap;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}

.sidebar .nav-item-link i, .sidebar .nav-group-toggle > i:first-child {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-item-link:hover, .sidebar .nav-group-toggle:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar .nav-item-link.active {
    background: linear-gradient(90deg, rgba(129, 140, 248, .28), rgba(129, 140, 248, .08));
    color: #fff;
    box-shadow: inset 3px 0 0 #818cf8;
}

.nav-group-toggle .chevron {
    margin-left: auto;
    font-size: .75rem;
    transition: transform .2s;
}

.nav-group-toggle[aria-expanded="true"] .chevron {
    transform: rotate(90deg);
}

.nav-sub {
    padding-left: 1.15rem;
    position: relative;
}

.nav-sub::before {
    content: "";
    position: absolute;
    left: 1.55rem;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: rgba(255, 255, 255, .08);
}

.nav-sub .nav-item-link {
    font-size: .88rem;
    padding: .5rem .8rem .5rem 1.1rem;
}

.nav-sub .nav-item-link i {
    font-size: .95rem;
}

.sidebar-footer {
    padding: .9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: .75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
}

.app-main {
    margin-left: var(--mis-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s ease;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--mis-header-height);
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--mis-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
}

.app-header .breadcrumb {
    margin: 0;
    font-size: .8rem;
}

.app-header .header-title {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.header-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--mis-border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 1.1rem;
}

.header-icon-btn:hover {
    background: #f8fafc;
    color: var(--mis-primary);
}

.header-icon-btn .dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .6rem .3rem .3rem;
    border-radius: 14px;
    border: 1px solid var(--mis-border);
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.user-chip:hover {
    background: #f8fafc;
}

.user-chip .user-meta {
    line-height: 1.15;
    text-align: left;
}

.user-chip .user-meta small {
    color: var(--mis-muted);
    font-size: .72rem;
}

.app-content {
    flex: 1;
    padding: 1.75rem;
    max-width: 1680px;
    width: 100%;
}

/* collapsed sidebar (desktop) */
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar {
        width: var(--mis-sidebar-collapsed);
    }

    body.sidebar-collapsed .app-main {
        margin-left: var(--mis-sidebar-collapsed);
    }

    body.sidebar-collapsed .sidebar .brand-text,
    body.sidebar-collapsed .sidebar .nav-item-link span,
    body.sidebar-collapsed .sidebar .nav-group-toggle span,
    body.sidebar-collapsed .sidebar .chevron,
    body.sidebar-collapsed .sidebar .nav-section-label,
    body.sidebar-collapsed .sidebar-footer {
        display: none;
    }

    body.sidebar-collapsed .sidebar .nav-sub {
        padding-left: 0;
    }

    body.sidebar-collapsed .sidebar .nav-sub::before {
        display: none;
    }

    body.sidebar-collapsed .sidebar .nav-item-link,
    body.sidebar-collapsed .sidebar .nav-group-toggle {
        justify-content: center;
        padding: .62rem;
    }
}

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

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--mis-shadow-lg);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

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

    .app-content {
        padding: 1rem;
    }

    .user-chip .user-meta {
        display: none;
    }
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    z-index: 1035;
}

/* ---------------------------------------------------------- Page header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -.03em;
}

.page-header p {
    color: var(--mis-muted);
    margin: .25rem 0 0;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ---------------------------------------------------------- Cards */
.card {
    border: 1px solid var(--mis-border);
    border-radius: var(--mis-radius);
    box-shadow: var(--mis-shadow);
    background: var(--mis-surface);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--mis-border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.card-header:first-child {
    border-radius: var(--mis-radius) var(--mis-radius) 0 0;
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.search-card .card-body {
    padding: 1rem 1.25rem;
}

.icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.icon-box.sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1rem;
}

.stat-card {
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-label {
    color: var(--mis-muted);
    font-size: .8rem;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.2;
}

.stat-card .stat-value small {
    font-size: .85rem;
    font-weight: 600;
    color: var(--mis-muted);
    margin-left: 2px;
}

/* soft colors */
.bg-soft-primary { background: #eef2ff; color: #4f46e5; }
.bg-soft-success { background: #ecfdf5; color: #059669; }
.bg-soft-warning { background: #fffbeb; color: #d97706; }
.bg-soft-danger { background: #fef2f2; color: #dc2626; }
.bg-soft-info { background: #ecfeff; color: #0891b2; }
.bg-soft-secondary { background: #f1f5f9; color: #475569; }
.bg-soft-pink { background: #fdf2f8; color: #db2777; }
.bg-soft-violet { background: #f5f3ff; color: #7c3aed; }

.badge {
    font-weight: 600;
    padding: .38em .7em;
    border-radius: 999px;
}

.badge-soft-primary { background: #eef2ff; color: #4338ca; }
.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; }
.badge-soft-info { background: #cffafe; color: #0e7490; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }

/* ---------------------------------------------------------- Tables */
.table-modern {
    margin: 0;
    --bs-table-hover-bg: #f8faff;
}

.table-modern thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--mis-border);
    padding: .75rem 1rem;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: .8rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table-modern tbody tr:last-child td {
    border-bottom: 0;
}

.table-responsive {
    border-radius: 0 0 var(--mis-radius) var(--mis-radius);
}

.cell-main {
    font-weight: 600;
}

.cell-sub {
    font-size: .78rem;
    color: var(--mis-muted);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    flex-shrink: 0;
}

.avatar.sm {
    width: 30px;
    height: 30px;
    font-size: .78rem;
}

.avatar.lg {
    width: 72px;
    height: 72px;
    font-size: 1.6rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--mis-muted);
}

.empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: .5rem;
    color: #cbd5e1;
}

/* ---------------------------------------------------------- Reorder (drag & number) */
.drag-handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 1.1rem;
    padding: .25rem;
    border-radius: 6px;
}

.drag-handle:hover {
    color: var(--mis-primary);
    background: var(--mis-primary-soft);
}

.drag-handle:active {
    cursor: grabbing;
}

.order-input {
    width: 62px;
    text-align: center;
    font-weight: 600;
    padding: .25rem .35rem !important;
}

.sortable-ghost {
    opacity: .5;
    background: var(--mis-primary-soft) !important;
}

.sortable-chosen {
    box-shadow: var(--mis-shadow-lg);
}

.reorder-hint {
    font-size: .78rem;
    color: var(--mis-muted);
}

/* tree */
.tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-list .tree-list {
    margin-left: 2.25rem;
    padding-left: .75rem;
    border-left: 2px dashed #e2e8f0;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border: 1px solid var(--mis-border);
    border-radius: 12px;
    background: #fff;
    margin-bottom: .5rem;
    transition: box-shadow .15s, border-color .15s;
}

.tree-row:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(79, 70, 229, .08);
}

.tree-row.inactive {
    background: #f8fafc;
    opacity: .7;
}

.tree-row .tree-name {
    font-weight: 600;
}

.tree-row .tree-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* ---------------------------------------------------------- Pagination */
.pagination {
    --bs-pagination-border-radius: 10px;
    --bs-pagination-active-bg: var(--mis-primary);
    --bs-pagination-active-border-color: var(--mis-primary);
    --bs-pagination-color: #475569;
    gap: .25rem;
}

.pagination .page-link {
    border-radius: 9px !important;
    min-width: 36px;
    text-align: center;
    border-color: var(--mis-border);
}

/* ---------------------------------------------------------- Tabs */
.nav-tabs-modern {
    border-bottom: 1px solid var(--mis-border);
    gap: .25rem;
}

.nav-tabs-modern .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--mis-muted);
    font-weight: 600;
    padding: .75rem 1rem;
}

.nav-tabs-modern .nav-link.active {
    color: var(--mis-primary);
    border-bottom-color: var(--mis-primary);
    background: transparent;
}

/* ---------------------------------------------------------- Modal */
.modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: var(--mis-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--mis-border);
    padding: 1.1rem 1.4rem;
}

.modal-title {
    font-weight: 700;
}

.modal-body {
    padding: 1.4rem;
}

.modal-footer {
    border-top: 1px solid var(--mis-border);
    padding: .9rem 1.4rem;
}

/* ---------------------------------------------------------- Toast */
.toast-container {
    z-index: 1090;
}

.toast {
    border: 0;
    border-radius: 14px;
    box-shadow: var(--mis-shadow-lg);
    min-width: 300px;
}

.toast .toast-body {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .9rem 1rem;
    font-weight: 500;
}

.toast .toast-body i {
    font-size: 1.2rem;
}

/* ---------------------------------------------------------- Dashboard */
.widget-card {
    height: 100%;
}

.widget-card .card-header .widget-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mis-primary-soft);
    color: var(--mis-primary);
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px dashed #eef1f6;
}

.widget-list li:last-child {
    border-bottom: 0;
}

.birthday-banner {
    border-radius: var(--mis-radius);
    background: linear-gradient(120deg, #fdf2f8 0%, #eef2ff 60%, #ecfeff 100%);
    border: 1px solid #fbcfe8;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.birthday-banner .cake {
    font-size: 2rem;
}

.welcome-card {
    background: linear-gradient(120deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    border: 0;
    overflow: hidden;
    position: relative;
}

.welcome-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    right: -60px;
    top: -120px;
}

.leave-ring {
    --p: 0;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: conic-gradient(var(--mis-primary) calc(var(--p) * 1%), #e0e7ff 0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.leave-ring > div {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.leave-ring strong {
    font-size: 1.4rem;
}

.widget-sort-list .list-group-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    border-radius: 10px !important;
    margin-bottom: .4rem;
    border: 1px solid var(--mis-border);
}

/* ---------------------------------------------------------- Calendar (FullCalendar) */
.fc {
    --fc-border-color: #eef1f6;
    --fc-today-bg-color: #eef2ff;
    --fc-button-bg-color: #fff;
    --fc-button-border-color: var(--mis-border);
    --fc-button-text-color: #334155;
    --fc-button-hover-bg-color: #f8fafc;
    --fc-button-hover-border-color: #d5dbe7;
    --fc-button-active-bg-color: var(--mis-primary);
    --fc-button-active-border-color: var(--mis-primary);
    --fc-event-border-color: transparent;
}

.fc .fc-button {
    border-radius: 10px;
    font-weight: 600;
    font-size: .85rem;
    box-shadow: none !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    color: #fff;
}

.fc .fc-toolbar-title {
    font-size: 1.3rem;
    font-weight: 800;
}

.fc .fc-col-header-cell-cushion {
    font-weight: 700;
    color: #64748b;
    font-size: .8rem;
    padding: .6rem 0;
}

.fc .fc-daygrid-day-number {
    font-weight: 600;
    font-size: .85rem;
    color: #334155;
}

.fc .fc-day-sun .fc-daygrid-day-number,
.fc .fc-day-sun .fc-col-header-cell-cushion,
.fc .fc-day-holiday .fc-daygrid-day-number {
    color: #dc2626;
}

.fc .fc-day-sat .fc-daygrid-day-number,
.fc .fc-day-sat .fc-col-header-cell-cushion {
    color: #2563eb;
}

.fc .fc-holiday-bg {
    background: rgba(239, 68, 68, .07);
    opacity: 1;
}

.fc .fc-holiday-label {
    background: transparent !important;
    border: 0 !important;
}

.fc .fc-holiday-label .fc-event-title {
    color: #dc2626;
    font-weight: 700;
    font-size: .75rem;
}

.fc .fc-holiday-label .fc-daygrid-event-dot {
    display: none;
}

.fc .fc-leave {
    border-radius: 6px;
    padding: 1px 4px;
    font-weight: 600;
    font-size: .76rem;
}

.fc .fc-leave-pending {
    border-radius: 6px;
    padding: 1px 4px;
    font-weight: 600;
    font-size: .76rem;
    opacity: .6;
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .25) 0 6px, transparent 6px 12px);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

/* ---------------------------------------------------------- Login */
.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

.login-hero {
    background: radial-gradient(circle at 20% 20%, rgba(129, 140, 248, .35), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(124, 58, 237, .35), transparent 40%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #fff;
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-hero h2 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.25;
}

.login-feature {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    margin-bottom: 1.1rem;
    color: #cbd5e1;
}

.login-feature i {
    font-size: 1.2rem;
    color: #a5b4fc;
    background: rgba(255, 255, 255, .08);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}

.login-box {
    width: 100%;
    max-width: 380px;
}

.login-box .form-control {
    padding: .75rem 1rem;
}

@media (max-width: 991.98px) {
    .login-wrap {
        grid-template-columns: 1fr;
    }

    .login-hero {
        display: none;
    }
}

/* ---------------------------------------------------------- Misc */
.text-muted-2 {
    color: var(--mis-muted) !important;
}

.fw-800 {
    font-weight: 800;
}

.min-w-0 {
    min-width: 0;
}

.calc-box {
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--mis-border);
    padding: .9rem 1rem;
}

.calc-box .calc-days {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mis-primary);
}

.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-page .code {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.permission-group {
    border: 1px solid var(--mis-border);
    border-radius: 12px;
    padding: .9rem 1rem;
    margin-bottom: .75rem;
}

.permission-group .group-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ===================================================================== 결재선 */
.approval-line { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.approval-step {
    display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.approval-step.is-waiting { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.approval-step.is-pending { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.approval-step.is-approved { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.approval-step.is-rejected { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.approval-arrow { color: #cbd5e1; font-size: .7rem; }
.approval-no {
    display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%;
    background: var(--bs-primary, #4f46e5); color: #fff; font-size: .68rem;
}
.line-editor { border: 1px dashed #cbd5e1; border-radius: .75rem; padding: .5rem; background: #f8fafc; }
.line-editor-item {
    display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; background: #fff;
    border: 1px solid #e2e8f0; border-radius: .6rem; margin-bottom: .4rem;
}
.line-editor-item:last-child { margin-bottom: 0; }
.line-editor-item .approval-no { width: 1.4rem; height: 1.4rem; font-size: .75rem; }
.line-editor-empty { text-align: center; color: #94a3b8; font-size: .85rem; padding: .75rem; }

/* ===================================================================== 알림 */
.notification-menu { width: 360px; max-width: 92vw; overflow: hidden; }
.notification-item {
    display: flex; align-items: flex-start; gap: .65rem; padding: .65rem 1rem; color: inherit;
    text-decoration: none; border-bottom: 1px solid #f1f5f9; background: #f5f7ff;
}
.notification-item:hover { background: #eef2ff; color: inherit; }
.notification-item.is-read { background: #fff; }
.notification-item.is-read:hover { background: #f8fafc; }
.notification-item.is-read .fw-semibold { font-weight: 500 !important; color: #475569; }
.notification-icon {
    display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .6rem; flex-shrink: 0;
}
.unread-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #4f46e5; margin-top: .4rem; flex-shrink: 0; }
.approval-step.is-skipped { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; text-decoration: line-through; }
.approval-step .delegated { font-weight: 500; font-size: .7rem; opacity: .85; }

/* ===================================================================== 게시판 */
.post-content { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; line-height: 1.7; }
.post-title { word-break: break-word; }
.board-title-cell { max-width: 520px; word-break: break-word; }
.board-comment { padding: .85rem 1rem; border-bottom: 1px solid #f1f5f9; }
.board-comment:last-child { border-bottom: 0; }
.comment-content { font-size: .9rem; }

/* ===================================================================== 주소록 */
.address-side .list-group-item { border-left: 0; border-right: 0; font-size: .9rem; }
.address-side .list-group-item.active { background: #eef2ff; color: #3730a3; border-color: rgba(0,0,0,.05); font-weight: 600; }
.address-side .list-group-item.active .badge { background: #e0e7ff; color: #3730a3; }
/* 검색창 + 검색 버튼(+ 지우기)은 한 줄 고정: 입력칸만 줄어들고 버튼은 줄바꿈되지 않는다 */
.address-tools { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.address-search { flex: 0 1 420px; min-width: 0; }
.address-search input[name="keyword"] { flex: 1 1 auto; min-width: 140px; width: auto; }
.address-search .btn { flex-shrink: 0; }
.address-tools > .btn-group, .address-tools > .address-sort { flex-shrink: 0; }
.address-sort select { width: auto; }
.address-bulk { background: #f8fafc; }
.address-company { border-bottom: 1px solid #eef2f7; }
.address-company:last-child { border-bottom: 0; }
.address-company-head { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; padding: .6rem 1rem; background: #fbfcfe; }
.address-company-head [data-bs-toggle="collapse"].collapsed i { transform: rotate(-90deg); }
.address-company-head [data-bs-toggle="collapse"] i { display: inline-block; transition: transform .15s; }
.address-loose .address-company-head { background: #f8fafc; }
.btn-star { border: 0; background: none; padding: 0; color: #cbd5e1; font-size: 1rem; line-height: 1; }
.btn-star:hover { color: #f59e0b; }
.btn-star.on { color: #f59e0b; }
.address-email { word-break: break-all; }
.address-memo { white-space: pre-wrap; word-break: break-word; }
.address-detail dt, .address-detail dd { margin-bottom: .45rem; }
.address-employee-list { max-height: 50vh; overflow-y: auto; }

/* ===================================================================== 캘린더(일정) */
.mis-cal { display: flex; min-height: calc(100vh - 122px); background: #fff; border: 1px solid var(--mis-border); border-radius: 14px; overflow: hidden; }
.mis-cal-side { width: 260px; flex-shrink: 0; border-right: 1px solid #eef1f6; padding: 1.1rem 1rem 1.25rem; display: flex; flex-direction: column; }
.mis-cal-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.mis-cal-brand h1 { font-size: 1.2rem; font-weight: 800; margin: 0; }
.mis-cal-new { width: 100%; border: 1px solid #222; border-radius: 10px; padding: .75rem; font-weight: 700; background: #fff; color: #111; }
.mis-cal-new:hover { background: #f8fafc; border-color: #000; }
.mis-cal-section { margin-top: 1.4rem; }
.mis-cal-section.mis-cal-company { margin-top: auto; padding-top: 1rem; border-top: 1px solid #e5e7eb; }
.mis-cal-section-head { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; font-weight: 700; color: #111; margin-bottom: .45rem; padding: 0 .3rem; }
.mis-cal-icon { color: #64748b; }
.mis-cal-icon:hover { color: #111; }
.mis-cal-list { list-style: none; padding: 0; margin: 0; }
.mis-cal-item { display: flex; align-items: center; gap: .35rem; padding: .3rem .3rem; border-radius: 8px; font-size: .86rem; }
.mis-cal-item:hover { background: #f8fafc; }
.mis-cal-check { display: flex; align-items: center; gap: .45rem; flex: 1; min-width: 0; margin: 0; cursor: pointer; }
.mis-cal-check .form-check-input { margin: 0; flex-shrink: 0; }
.mis-cal-check .form-check-input:checked, .mis-cal-check .form-check-input:indeterminate { background-color: #222; border-color: #222; }
.mis-cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mis-cal-more { visibility: hidden; }
.mis-cal-item:hover .mis-cal-more, .mis-cal-more.show, .mis-cal-more:focus-within { visibility: visible; }
.cal-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; vertical-align: middle; }
.cal-dot-holiday { background: #ef4444; }
.cal-dot-leave { background: repeating-linear-gradient(45deg, #94a3b8 0 3px, #cbd5e1 3px 6px); }
.mis-cal-add { margin: .4rem 0 0 1rem; border: 0; background: #f1f5f9; color: #334155; font-size: .82rem; padding: .3rem .65rem; border-radius: 6px; }
.mis-cal-add:hover { background: #e2e8f0; }
.mis-cal-setting { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.25rem; padding: 0 .3rem; font-size: .86rem; color: #334155; text-decoration: none; }
.mis-cal-setting:hover { color: #111; }
.mis-cal-main { flex: 1; min-width: 0; padding: 1.1rem 1.5rem 1.5rem; }
.mis-cal-heading { font-size: 1.2rem; font-weight: 800; margin: 0 0 1.4rem; }
.mis-cal-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.mis-cal-views { display: flex; gap: .4rem; }
.mis-pill { border: 1px solid #d4d4d8; background: #fff; color: #444; border-radius: 999px; padding: .3rem .85rem; font-size: .8rem; }
.mis-pill:hover { border-color: #888; }
.mis-pill.active { background: #333; border-color: #333; color: #fff; font-weight: 700; }
.mis-cal-nav { display: flex; align-items: center; gap: .6rem; }
.mis-round { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #e4e4e7; background: #fff; color: #777; display: inline-grid; place-items: center; }
.mis-round:hover { border-color: #999; color: #111; }
.mis-cal-period { font-size: 1.45rem; font-weight: 600; letter-spacing: .02em; min-width: 7ch; text-align: center; color: #222; }
.mis-cal-grid { border: 1px solid #e9ebf0; border-radius: 14px; overflow: hidden; }
/* 날짜·요일 이동 링크(navLinks)에 부트스트랩 밑줄이 붙지 않게 */
.mis-cal-skin .fc a.fc-col-header-cell-cushion, .mis-cal-skin .fc a.fc-daygrid-day-number, .mis-cal-skin .fc a.fc-list-day-text, .mis-cal-skin .fc a.fc-list-day-side-text { text-decoration: none; }
.mis-cal-skin .fc a.fc-col-header-cell-cushion:hover, .mis-cal-skin .fc a.fc-daygrid-day-number:hover { text-decoration: underline; }
.mis-cal-skin .fc { --fc-today-bg-color: transparent; --fc-border-color: #eceef2; --fc-now-indicator-color: #ef4444; }
.mis-cal-skin .fc .fc-scrollgrid { border: 0; }
.mis-cal-skin .fc .fc-col-header-cell-cushion { color: #333; font-weight: 500; font-size: .82rem; padding: .4rem 0; }
/* 날짜 숫자: 칸 오른쪽 위 */
.mis-cal-skin .fc .fc-daygrid-day-top { flex-direction: row; justify-content: flex-end; padding: .2rem .3rem 0 0; }
.mis-cal-skin .fc .fc-daygrid-day-number { font-weight: 500; color: #222; font-size: .86rem; min-width: 1.6rem; height: 1.6rem; line-height: 1.6rem; padding: 0 .3rem; text-align: center; border-radius: 999px; }
.mis-cal-skin .fc .fc-day-sat .fc-daygrid-day-number, .mis-cal-skin .fc .fc-day-sat .fc-col-header-cell-cushion { color: #222; }
.mis-cal-skin .fc .fc-day-sun .fc-daygrid-day-number, .mis-cal-skin .fc .fc-day-sun .fc-col-header-cell-cushion,
.mis-cal-skin .fc .fc-day-holiday .fc-daygrid-day-number, .mis-cal-skin .fc .fc-day-holiday .fc-col-header-cell-cushion { color: #e11d48; }
.mis-cal-skin .fc .fc-day-other .fc-daygrid-day-top { opacity: .35; }
.mis-cal-skin .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { background: #222; color: #fff; font-weight: 700; }
.mis-cal-skin .fc .fc-timegrid-col.fc-day-today { background: #fafafa; }
.mis-cal-skin .fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion { font-weight: 800; }
.mis-cal-skin .fc .fc-holiday-bg { background: transparent; }
.mis-cal-skin .fc .fc-schedule { border-radius: 5px; font-size: .76rem; font-weight: 400; padding: 0 3px; }
/* 일정·휴가·공휴일 글자는 보통 굵기(FullCalendar 기본은 제목 굵게) */
.mis-cal-skin .fc .fc-event-title, .mis-cal-skin .fc .fc-event-time,
.mis-cal-skin .fc .fc-leave, .mis-cal-skin .fc .fc-leave-pending,
.mis-cal-skin .fc .fc-holiday-label .fc-event-title, .mis-cal-skin .fc .fc-list-event-title { font-weight: 400; }
.mis-cal-skin .fc .fc-daygrid-dot-event.fc-schedule { background: transparent !important; }
.mis-cal-skin .fc .fc-more-link { font-size: .75rem; color: #475569; font-weight: 600; text-decoration: none; display: inline-block; margin: 1px 4px 0; padding: 0 .45rem; border-radius: 999px; background: #f1f5f9; }
.mis-cal-skin .fc .fc-more-link:hover { background: #e2e8f0; color: #1e293b; }
/* '+N개' 팝오버: 일정이 많아도 화면 밖으로 넘치지 않게 스크롤, 본문의 날짜 숫자 중복 숨김 */
.mis-cal-skin .fc .fc-more-popover { border-radius: 12px; border-color: #e2e8f0; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); overflow: hidden; min-width: 240px; }
.mis-cal-skin .fc .fc-more-popover .fc-popover-header { background: #f8fafc; padding: .55rem .75rem; font-weight: 700; font-size: .85rem; }
.mis-cal-skin .fc .fc-more-popover .fc-popover-body { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: .4rem .5rem; }
.mis-cal-skin .fc .fc-more-popover .fc-more-popover-misc { display: none; }
.mis-cal-skin .fc .fc-daygrid-day-events .fc-daygrid-event-harness + .fc-daygrid-event-harness { margin-top: 1px; }
.mis-cal-skin .fc .fc-list-empty { background: #fff; }
.mis-cal-skin .fc .fc-list-day-cushion { background: #f8fafc; }
.mis-cal-skin .fc-theme-standard .fc-list { border: 0; }
.cal-palette { display: flex; flex-wrap: wrap; gap: .5rem; }
.cal-swatch { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; cursor: pointer; border: 2px solid transparent; }
.cal-swatch i { visibility: hidden; }
.btn-check:checked + .cal-swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #222; }
.btn-check:checked + .cal-swatch i { visibility: visible; }
.cal-detail dd { margin-bottom: .5rem; }
.cal-memo { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.search-result .cell-sub { word-break: break-word; }
@media (max-width: 991.98px) {
    .mis-cal { flex-direction: column; }
    .mis-cal-side { width: auto; border-right: 0; border-bottom: 1px solid #eef1f6; }
    .mis-cal-section.mis-cal-company { margin-top: 1rem; }
    .mis-cal-toolbar { grid-template-columns: 1fr; justify-items: start; }
    .mis-cal-more { visibility: visible; }
}

/* ===================================================================== 경비관리 */
.cursor-pointer { cursor: pointer; }
.expense-original-ro { background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 10px; padding: .75rem 1rem; }
.expense-original-ro dt { font-weight: 600; color: var(--mis-muted); font-size: .8rem; }
.expense-receipt-thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; background: #f8fafc; }
.expense-receipt-pdf { width: 120px; height: 120px; border-radius: 8px; border: 1px solid #e5e7eb; display: inline-grid; place-items: center; color: #dc2626; font-size: 2.2rem; background: #fff5f5; }
.expense-limit-bar { height: 6px; }

/* =====================================================================
   증명서 발급 (진위 확인 단독 화면, 직인 미리보기)
   ===================================================================== */
.verify-wrap { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1rem; background: #f4f6fb; }
.verify-box { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; padding: 2rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.verify-card { border-width: 2px; }
.cert-seal-preview { display: inline-grid; place-items: center; width: 160px; height: 160px; border: 1px dashed #cbd5e1; border-radius: 10px;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.cert-seal-preview img { max-width: 140px; max-height: 140px; }
.cert-reason-row td { background: #fff7f7; border-top: 0; }
/* 발급 대장: 긴 소속·용도·제출처는 한 줄 말줄임(전체 값은 title 툴팁), 표는 nowrap + 가로 스크롤 */
.cert-cell-trunc { display: inline-block; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------------------------------------------------------------
   서비스 계정: ID·비밀번호 복사/보기 (secret-reveal.js)
   --------------------------------------------------------------- */
.btn-icon-xs { padding: .1rem .4rem; font-size: .75rem; line-height: 1.4; }
.secret-value { font-size: .85rem; letter-spacing: .02em; white-space: pre; user-select: all; }
.secret-id { user-select: all; }

/* 도움말 말풍선(ⓘ): 여러 줄 설명을 왼쪽 정렬로 */
.tooltip-help .tooltip-inner {
    max-width: 320px;
    text-align: left;
    white-space: pre-line;
    line-height: 1.6;
    padding: .5rem .75rem;
}

/* ---------------------------------------------------------- 공지 글쓰기 (2:1, 넓은 화면은 페이지 스크롤 없음) */
@media (min-width: 992px) {
    .notice-editor-row > [class*="col-"] { min-height: 0; height: 100%; }
    .notice-editor-main .card-body { min-height: 0; }
    .notice-editor-body { min-height: 0; resize: none; }
    .notice-editor-side { min-height: 0; }
    .notice-editor-options { overflow-y: auto; min-height: 0; }
}
.notice-editor-side { display: flex; flex-direction: column; }
.notice-editor-options { flex: 1 1 auto; }
.notice-opt-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--mis-text-muted, #6b7280);
    text-transform: none;
    margin-bottom: .75rem;
}

/* ---------------------------------------------------------- 사선 아이콘 (예: 삭제 불가 = trash + slash)
   Bootstrap Icons 에 trash-slash 가 없어 글리프 위에 사선을 그린다. 사용: <i class="bi icon-slash bi-trash"></i> */
.bi.icon-slash { position: relative; display: inline-block; }
.bi.icon-slash::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.3em;
    height: .11em;
    border-radius: .1em;
    background: currentColor;
    /* 사선 양옆을 버튼 배경색으로 띄워 글리프와 구분 */
    box-shadow: 0 .07em 0 var(--bs-btn-disabled-bg, var(--bs-body-bg, #fff)), 0 -.07em 0 var(--bs-btn-disabled-bg, var(--bs-body-bg, #fff));
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
}

/* ---------------------------------------------------------- 위젯 안내 줄(눌러서 처리하러 가는 경고성 항목) */
.widget-callout {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: .85rem;
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}
.widget-callout:hover, .widget-callout:focus-visible { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.widget-callout > .bi:first-child { font-size: 1.05rem; color: #d97706; }
.widget-callout .cell-sub { color: #a16207; }
