/* ================================
   K1 SPORTS - Design System
   ================================ */
:root {
    --k1-black: #111111;
    --k1-dark: #1A1A1A;
    --k1-gray-900: #212121;
    --k1-gray-800: #2D2D2D;
    --k1-gray-700: #3D3D3D;
    --k1-gray-600: #555555;
    --k1-gray-500: #777777;
    --k1-gray-400: #999999;
    --k1-gray-300: #BBBBBB;
    --k1-gray-200: #E0E0E0;
    --k1-gray-100: #F0F0F0;
    --k1-white: #FFFFFF;

    --k1-accent: #1E56A0;
    --k1-accent-light: #3A7BD5;
    --k1-accent-dark: #163D72;
    --k1-blue: #3B82F6;
    --k1-purple: #8B5CF6;
    --k1-orange: #F59E0B;
    --k1-red: #EF4444;
    --k1-pink: #EC4899;
    --k1-cyan: #06B6D4;
    --k1-green: #10B981;
    --k1-teal: #14B8A6;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px rgba(30,86,160,0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--k1-black);
    color: var(--k1-white);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ================================
   Login Page
   ================================ */
.login-page {
    background: var(--k1-black);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(30,86,160,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(59,130,246,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--k1-dark);
    border: 1px solid var(--k1-gray-800);
    border-radius: var(--radius-xl);
    padding: 44px 36px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(30,86,160,0.3);
}

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--k1-white);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--k1-gray-500);
    font-size: 13px;
}

/* Tab Selector */
.tab-selector {
    display: flex;
    background: var(--k1-gray-900);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 28px;
    border: 1px solid var(--k1-gray-800);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--k1-gray-500);
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--k1-gray-800);
    color: var(--k1-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tab-btn i { margin-right: 6px; }

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--k1-gray-400);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label i {
    margin-right: 5px;
    color: var(--k1-accent);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: var(--k1-gray-900);
    border: 1px solid var(--k1-gray-700);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    color: var(--k1-white);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.form-group input::placeholder {
    color: var(--k1-gray-600);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--k1-accent);
    box-shadow: 0 0 0 3px rgba(30,86,160,0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--k1-accent);
    color: var(--k1-white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: var(--k1-accent-light);
    box-shadow: 0 4px 20px rgba(30,86,160,0.35);
    transform: translateY(-1px);
}

.btn-admin {
    background: var(--k1-white);
    color: var(--k1-black);
}

.btn-admin:hover {
    background: var(--k1-gray-200);
    box-shadow: 0 4px 20px rgba(255,255,255,0.15);
}

.error-message {
    background: rgba(239,68,68,0.1);
    color: var(--k1-red);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 12px;
    border: 1px solid rgba(239,68,68,0.2);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-footer p {
    color: var(--k1-gray-600);
    font-size: 12px;
}

.login-footer .social-link {
    color: var(--k1-gray-500);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.login-footer .social-link:hover {
    color: var(--k1-accent);
}

/* ================================
   Privacy Policy Modal
   ================================ */
.privacy-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.privacy-modal-overlay.hidden {
    display: none !important;
}
.privacy-modal {
    background: var(--k1-dark);
    border: 1px solid var(--k1-gray-700);
    border-radius: 16px;
    width: 640px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.privacy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--k1-gray-700);
    flex-shrink: 0;
}
.privacy-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--k1-white);
    display: flex;
    align-items: center;
    gap: 10px;
}
.privacy-modal-header h2 i {
    color: var(--k1-accent-light);
}
.privacy-modal-close {
    background: none;
    border: none;
    color: var(--k1-gray-400);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.privacy-modal-close:hover {
    background: var(--k1-gray-800);
    color: var(--k1-white);
}
.privacy-modal-body {
    padding: 24px;
    overflow-y: auto;
    color: var(--k1-gray-300);
    font-size: 13px;
    line-height: 1.8;
}
.privacy-modal-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--k1-white);
    margin-bottom: 12px;
}
.privacy-modal-body h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--k1-accent-light);
    margin: 24px 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--k1-accent);
}
.privacy-modal-body p {
    margin-bottom: 10px;
}
.privacy-modal-body ul {
    margin: 8px 0 12px 20px;
    padding: 0;
}
.privacy-modal-body ul li {
    margin-bottom: 6px;
    position: relative;
}
.privacy-modal-body ul li::marker {
    color: var(--k1-accent-light);
}
.privacy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 16px;
    font-size: 12.5px;
}
.privacy-table th,
.privacy-table td {
    padding: 10px 14px;
    border: 1px solid var(--k1-gray-700);
    text-align: left;
}
.privacy-table th {
    background: var(--k1-gray-900);
    color: var(--k1-gray-200);
    font-weight: 600;
    font-size: 12px;
}
.privacy-table td {
    color: var(--k1-gray-300);
}
.privacy-link {
    color: var(--k1-gray-500);
    font-size: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    transition: color 0.2s;
}
.privacy-link:hover {
    color: var(--k1-accent-light);
}

/* ================================
   Dashboard Layout
   ================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--k1-dark);
    border-right: 1px solid var(--k1-gray-800);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--k1-gray-800);
    margin-bottom: 12px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-logo img {
    width: 44px;
    height: auto;
    border-radius: 50%;
}

.sidebar-logo span {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
}

.sidebar-header .user-info {
    padding: 12px 14px;
    background: var(--k1-gray-900);
    border-radius: var(--radius-sm);
    border: 1px solid var(--k1-gray-800);
}

.sidebar-header .user-info .name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.sidebar-header .user-info .badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--k1-accent);
    color: var(--k1-white);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-header .user-info .badge-admin {
    background: var(--k1-accent);
}

.sidebar-nav {
    padding: 4px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--k1-gray-500);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--k1-white);
    background: rgba(255,255,255,0.04);
    border-left-color: var(--k1-accent);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.sidebar-nav a.active i {
    color: var(--k1-accent);
}

.sidebar-bottom {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--k1-gray-800);
}

.sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--k1-gray-500);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.sidebar-bottom a:hover { color: var(--k1-accent); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 28px 32px;
    min-height: 100vh;
    background: var(--k1-black);
    /* flex 아이템 기본 min-width:auto가 칸반 보드 폭만큼 본문을 늘려
       보드 내부 가로 스크롤(배경 드래그 팬)이 죽는 것을 방지 */
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-header h1 i {
    color: var(--k1-accent);
    margin-right: 10px;
}

/* Student Profile in Header */
.student-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--k1-gray-900);
    border: 1px solid var(--k1-gray-800);
    border-radius: 20px;
}

.student-profile-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--k1-white);
}

.student-profile-branch {
    font-size: 12px;
    color: var(--k1-gray-400);
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--k1-dark);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--k1-gray-800);
    overflow: hidden;
    max-width: 100%;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--k1-white);
}

.card-title i {
    color: var(--k1-accent);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--k1-dark);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    border: 1px solid var(--k1-gray-800);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.2s;
}

.stat-card:hover {
    border-color: var(--k1-gray-700);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.stat-card.purple::before { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }
.stat-card.blue::before { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.stat-card.green::before { background: linear-gradient(90deg, #10B981, #34D399); }
.stat-card.orange::before { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.stat-card.pink::before { background: linear-gradient(90deg, #EC4899, #F472B6); }
.stat-card.cyan::before { background: linear-gradient(90deg, #06B6D4, #22D3EE); }
.stat-card.red::before { background: linear-gradient(90deg, #EF4444, #F87171); }
.stat-card.teal::before { background: linear-gradient(90deg, #14B8A6, #2DD4BF); }

.stat-card .stat-icon { font-size: 22px; margin-bottom: 6px; }
.stat-card .stat-label {
    font-size: 11px;
    color: var(--k1-gray-500);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-card .stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--k1-white);
}
.stat-card .stat-score {
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
}

.stat-score.excellent { background: rgba(16,185,129,0.15); color: #34D399; }
.stat-score.good { background: rgba(59,130,246,0.15); color: #60A5FA; }
.stat-score.average { background: rgba(245,158,11,0.15); color: #FBBF24; }
.stat-score.poor { background: rgba(239,68,68,0.15); color: #F87171; }

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* Percentile */
.percentile-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.percentile-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.percentile-label {
    width: 95px;
    font-size: 12px;
    font-weight: 700;
    color: var(--k1-gray-400);
    flex-shrink: 0;
}

.percentile-bar-wrap { flex: 1; min-width: 0; }

.percentile-bar-bg {
    height: 26px;
    background: var(--k1-gray-900);
    border-radius: 13px;
    overflow: hidden;
    border: 1px solid var(--k1-gray-800);
}

.percentile-bar-fill {
    height: 100%;
    border-radius: 13px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 60px;
    position: relative;
}

.percentile-bar-fill span {
    font-size: 11px;
    font-weight: 800;
    color: var(--k1-white);
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.percentile-badge {
    width: 58px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    color: var(--k1-white);
}

/* ================================
   Admin Styles
   ================================ */
.upload-zone {
    border: 2px dashed var(--k1-gray-700);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--k1-gray-900);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--k1-accent);
    background: rgba(30,86,160,0.06);
}

.upload-zone i {
    font-size: 44px;
    color: var(--k1-accent);
    margin-bottom: 14px;
}

.upload-zone h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--k1-white);
}

.upload-zone p {
    color: var(--k1-gray-500);
    font-size: 13px;
}

/* Table */
.data-table-wrap { overflow-x: auto; margin-top: 16px; }

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

.data-table thead {
    background: var(--k1-gray-900);
}

.data-table th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--k1-gray-400);
    border-bottom: 1px solid var(--k1-gray-800);
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--k1-gray-900);
    white-space: nowrap;
    color: var(--k1-gray-300);
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.data-table .rank-1 { color: #FBBF24; font-weight: 800; }
.data-table .rank-2 { color: #94A3B8; font-weight: 700; }
.data-table .rank-3 { color: #CD7F32; font-weight: 700; }

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}

.btn-indigo { background: var(--k1-accent); color: var(--k1-white); }
.btn-indigo:hover { background: var(--k1-accent-light); box-shadow: var(--shadow-glow); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--k1-gray-700);
    color: var(--k1-gray-400);
}
.btn-outline:hover {
    border-color: var(--k1-accent);
    color: var(--k1-accent);
}

.btn-danger { background: rgba(239,68,68,0.15); color: #F87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-success { background: var(--k1-green); color: var(--k1-black); }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* Selects */
.select-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.select-wrap select,
.select-wrap input[type="text"],
.select-wrap input[type="month"] {
    padding: 10px 14px;
    background: var(--k1-gray-900);
    border: 1px solid var(--k1-gray-700);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--k1-white);
    outline: none;
}

.select-wrap select:focus,
.select-wrap input:focus {
    border-color: var(--k1-accent);
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.badge-male { background: rgba(59,130,246,0.15); color: #60A5FA; }
.badge-female { background: rgba(236,72,153,0.15); color: #F472B6; }

/* Month Tag */
.month-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(0,201,167,0.1);
    color: var(--k1-accent);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Alert */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16,185,129,0.1);
    color: #34D399;
    border: 1px solid rgba(16,185,129,0.2);
}

.alert-error {
    background: rgba(239,68,68,0.1);
    color: #F87171;
    border: 1px solid rgba(239,68,68,0.2);
}

.alert-info {
    background: rgba(59,130,246,0.1);
    color: #60A5FA;
    border: 1px solid rgba(59,130,246,0.2);
}

/* Loading */
.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--k1-gray-800);
    border-top-color: var(--k1-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    width: 42px;
    height: 42px;
    background: var(--k1-dark);
    border: 1px solid var(--k1-gray-800);
    color: var(--k1-white);
    border-radius: var(--radius-sm);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ================================
   Trend Charts
   ================================ */
.trend-chart-item {
    background: var(--k1-gray-900);
    border: 1px solid var(--k1-gray-800);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    overflow: hidden;
    max-width: 100%;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }

    .grid-2 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .page-header h1 { font-size: 18px; }
    .student-profile { padding: 4px 10px; gap: 6px; }
    .student-profile-name { font-size: 13px; }
    .student-profile-branch { font-size: 11px; }
    .student-profile .badge { font-size: 10px; padding: 2px 7px; }
    .login-card { padding: 32px 24px; }
    .percentile-item { flex-direction: row; align-items: center; gap: 10px; }
    .percentile-label { width: 70px; font-size: 11px; }
    .percentile-badge { width: 52px; font-size: 12px; }
    .percentile-bar-bg { height: 24px; }
    .percentile-bar-fill { min-width: 55px; padding-right: 6px; }
    .percentile-bar-fill span { font-size: 10px; }
    .card { padding: 12px; overflow: hidden; max-width: 100%; }
    .main-content { margin-left: 0; padding: 60px 8px 20px; }
    .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .trend-chart-item { padding: 10px; }
    #trendChartsArea { max-width: 100%; overflow: hidden; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 14px 10px; }
    .stat-card .stat-value { font-size: 17px; }
    .stat-card .stat-label { font-size: 10px; }
}

/* ================================
   근태관리 추가 스타일
   ================================ */
.clock-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 10px 0 4px;
}
.clock-time {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}
.clock-date { color: var(--k1-gray-400); font-size: 14px; margin-top: -10px; }
.clock-btns { display: flex; gap: 12px; width: 100%; max-width: 380px; }
.clock-btns .btn { flex: 1; justify-content: center; padding: 16px; font-size: 15px; }
.btn-clock-in { background: var(--k1-accent); color: var(--k1-white); }
.btn-clock-in:hover { background: var(--k1-accent-light); box-shadow: var(--shadow-glow); }
.btn-clock-out { background: var(--k1-gray-800); color: var(--k1-white); border: 1px solid var(--k1-gray-700); }
.btn-clock-out:hover { border-color: var(--k1-accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.clock-status { font-size: 13px; color: var(--k1-gray-400); }
.clock-status b { color: var(--k1-green); }

.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 700;
}
.status-normal     { background: rgba(16,185,129,0.15); color: #34D399; }
.status-late       { background: rgba(245,158,11,0.15); color: #FBBF24; }
.status-early_leave{ background: rgba(245,158,11,0.15); color: #FBBF24; }
.status-absent     { background: rgba(239,68,68,0.15);  color: #F87171; }
.status-leave      { background: rgba(139,92,246,0.15); color: #A78BFA; }
.status-half_am, .status-half_pm { background: rgba(6,182,212,0.15); color: #22D3EE; }
.status-holiday    { background: rgba(119,119,119,0.2); color: #BBBBBB; }
.status-pending    { background: rgba(245,158,11,0.15); color: #FBBF24; }
.status-approved   { background: rgba(16,185,129,0.15); color: #34D399; }
.status-rejected   { background: rgba(239,68,68,0.15);  color: #F87171; }
.status-cancelled  { background: rgba(119,119,119,0.2); color: #BBBBBB; }

/* 일정 캘린더 */
.cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-head {
    text-align: center; font-size: 11px; font-weight: 700;
    color: var(--k1-gray-500); padding: 6px 0; text-transform: uppercase;
}
.cal-cell {
    min-height: 86px; background: var(--k1-gray-900);
    border: 1px solid var(--k1-gray-800); border-radius: 8px;
    padding: 6px; font-size: 11px; overflow: hidden;
}
.cal-cell.other { opacity: 0.3; }
.cal-cell.today { border-color: var(--k1-accent); box-shadow: 0 0 0 1px var(--k1-accent); }
.cal-cell .d { font-weight: 700; color: var(--k1-gray-400); margin-bottom: 3px; }
.cal-cell.sun .d { color: #F87171; }
.cal-cell.sat .d { color: #60A5FA; }
.cal-item {
    display: block; padding: 2px 5px; margin-bottom: 2px; border-radius: 5px;
    background: var(--k1-gray-800); color: var(--k1-gray-300);
    font-size: 10px; line-height: 1.4; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.cal-item.me { background: rgba(30,86,160,0.35); color: #9CC4F5; font-weight: 700; }
/* 타임트리 스타일 일정 바 */
.cal-item.tt { color: #fff; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.cal-item.tt.me { outline: 2px solid rgba(255,255,255,0.85); outline-offset: -2px; }
/* 이름 라벨(칩) 일정 표기 — 상담 카드 라벨과 동일한 톤 */
.cal-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-item.nchip {
    display: inline-block; width: auto; margin: 0;
    padding: 1px 7px; border-radius: 10px;
    font-size: 10px; font-weight: 700; line-height: 1.6;
    color: #fff;
}
.cal-item.nchip.me { outline: 1px solid rgba(255,255,255,0.7); }
/* 연차 칩 (승인 = 진한 회색 / 신청중 = 점선·흐림) */
.cal-item.nchip.leave { background: rgba(148,163,184,0.28); color: #E2E8F0; }
.cal-item.nchip.leave i { font-size: 9px; opacity: 0.8; margin-right: 1px; }
.cal-item.nchip.leave.pending {
    background: repeating-linear-gradient(45deg, rgba(148,163,184,0.10), rgba(148,163,184,0.10) 5px, rgba(148,163,184,0.22) 5px, rgba(148,163,184,0.22) 10px);
    color: var(--k1-gray-400); border: 1px dashed var(--k1-gray-500); font-style: italic;
}
.cal-cell.editable { cursor: pointer; transition: border-color 0.15s; }
.cal-cell.editable:hover { border-color: var(--k1-accent); }
/* 월간 일정 등록 날짜 그리드 */
.smm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.smm-day { position: relative; cursor: pointer; }
.smm-day input { position: absolute; opacity: 0; }
.smm-day span {
    display: flex; flex-direction: column; align-items: center; padding: 7px 0 5px;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700); border-radius: 8px;
    font-size: 13px; font-weight: 700; color: var(--k1-gray-200); line-height: 1.2;
}
.smm-day span small { font-size: 9px; font-weight: 400; color: var(--k1-gray-500); }
.smm-day.sun span { color: #F87171; }
.smm-day.sat span { color: #60A5FA; }
.smm-day input:checked + span {
    background: rgba(239,68,68,0.18); border-color: var(--k1-red); color: var(--k1-red);
    text-decoration: line-through;
}
/* 알림 종 */
.noti-bell {
    position: fixed; top: 14px; right: 16px; z-index: 1200;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-800);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--k1-gray-300); font-size: 17px;
}
.noti-bell:hover { color: var(--k1-white); border-color: var(--k1-accent); }
.noti-badge {
    position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px;
    background: var(--k1-red); color: #fff; border-radius: 9px; font-size: 11px;
    font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.noti-panel {
    position: fixed; top: 62px; right: 16px; z-index: 1200; width: 320px; max-width: calc(100vw - 32px);
    max-height: 70vh; overflow-y: auto; background: var(--k1-gray-900);
    border: 1px solid var(--k1-gray-700); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
.noti-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--k1-gray-800); font-weight: 800; font-size: 14px; }
.noti-item { padding: 10px 14px; border-bottom: 1px solid var(--k1-gray-800); cursor: pointer; }
.noti-item:hover { background: var(--k1-gray-800); }
.noti-item.unread { border-left: 3px solid var(--k1-accent); }
.noti-item .nt-title { font-size: 13px; font-weight: 700; color: var(--k1-gray-100); }
.noti-item .nt-body { font-size: 12px; color: var(--k1-gray-400); margin-top: 2px; }
.noti-item .nt-time { font-size: 11px; color: var(--k1-gray-600); margin-top: 2px; }

/* 전역 검색 */
.gs-btn {
    position: fixed; top: 14px; right: 66px; z-index: 1200;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-800);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--k1-gray-300); font-size: 16px;
}
.gs-btn:hover { color: var(--k1-white); border-color: var(--k1-accent); }
.gs-panel {
    position: fixed; top: 62px; right: 16px; z-index: 1200; width: 440px; max-width: calc(100vw - 32px);
    max-height: 78vh; display: flex; flex-direction: column; background: var(--k1-gray-900);
    border: 1px solid var(--k1-gray-700); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); overflow: hidden;
}
.gs-input-wrap { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--k1-gray-800); }
.gs-input-wrap > i { color: var(--k1-gray-500); font-size: 14px; }
.gs-input-wrap input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--k1-gray-100); font-size: 14px; font-family: inherit;
}
.gs-close { background: none; border: none; color: var(--k1-gray-500); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }
.gs-close:hover { color: var(--k1-white); }
.gs-results { overflow-y: auto; }
.gs-empty { padding: 22px 16px; text-align: center; color: var(--k1-gray-500); font-size: 13px; }
.gs-group { padding: 4px 0 6px; }
.gs-group-head { padding: 8px 14px 4px; font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--k1-gray-500); text-transform: uppercase; }
.gs-group-head .gs-cnt { color: var(--k1-gray-600); margin-left: 2px; }
.gs-item { padding: 8px 14px; cursor: pointer; border-left: 3px solid transparent; }
.gs-item:hover { background: var(--k1-gray-800); border-left-color: var(--k1-accent); }
.gs-item .gs-t { font-size: 13px; font-weight: 700; color: var(--k1-gray-100); }
.gs-item .gs-t .gs-sub { font-size: 12px; font-weight: 500; color: var(--k1-gray-400); margin-left: 4px; }
.gs-item .gs-meta { font-size: 11px; color: var(--k1-gray-500); margin-top: 2px; }
.gs-item .gs-snip { font-size: 11px; color: var(--k1-gray-400); margin-top: 3px; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gs-results mark { background: rgba(30,86,160,0.55); color: #fff; border-radius: 2px; padding: 0 1px; }

/* 행사·회의 멘션 선택 */
.ev-mentions { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow-y: auto; }
.ev-mentions label {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 14px;
    border: 1px solid var(--k1-gray-700); font-size: 12px; cursor: pointer; color: var(--k1-gray-300);
}
.ev-mentions label.on { background: var(--k1-accent); border-color: var(--k1-accent); color: #fff; }
.ev-mentions input { display: none; }
/* 캘린더 이벤트/공휴일 바 */
.cal-ev { display: block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev.holiday { background: rgba(239,68,68,0.22); color: #FCA5A5; cursor: default; }
.cal-ev.event { background: rgba(245,158,11,0.22); color: #FBBF24; }
.cal-ev.meeting { background: rgba(139,92,246,0.22); color: #C4B5FD; }
.cal-cell.holiday .d { color: #F87171; }

/* 이슈 댓글 */
.cmt { padding: 8px 0; border-bottom: 1px solid var(--k1-gray-800); }
.cmt-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--k1-gray-400); }
.cmt-head b { color: var(--k1-gray-200); }
.cmt-time { color: var(--k1-gray-600); font-size: 11px; }
.cmt-head .attach-del { margin-left: auto; }
.cmt-body { font-size: 13px; color: var(--k1-gray-100); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.cmt-reply { margin-left: 22px; border-left: 2px solid var(--k1-gray-700); padding-left: 10px; }
.cmt-reply-btn { border: none; background: transparent; color: var(--k1-accent-light); font-size: 11px; cursor: pointer; padding: 0; }
.cmt-replying { font-size: 12px; color: var(--k1-accent-light); display: inline-flex; align-items: center; gap: 4px; }
.cmt-replying button { border: none; background: transparent; color: var(--k1-gray-500); cursor: pointer; }
/* 이슈 설명 표 렌더 (doc-body 재사용 + 보강) */
.doc-body table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.doc-body th, .doc-body td { border: 1px solid var(--k1-gray-700); padding: 6px 9px; font-size: 13px; text-align: left; }
.doc-body th { background: var(--k1-gray-800); font-weight: 700; }
.doc-body ul.task-list { list-style: none; padding-left: 4px; }
/* @멘션 자동완성 드롭다운 */
.mention-suggest {
    position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 50;
    min-width: 160px; max-height: 200px; overflow-y: auto;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700);
    border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.mention-suggest .ms-item { padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--k1-gray-200); }
.mention-suggest .ms-item.active, .mention-suggest .ms-item:hover { background: var(--k1-accent); color: #fff; }
/* 댓글 본문 @멘션 강조 (클릭 → 프로필) */
.cmt-body .mention-tag { color: var(--k1-accent-light); font-weight: 700; cursor: pointer; }
.cmt-body .mention-tag:hover { text-decoration: underline; }
/* 시·분 분리 시간 선택 (10분 단위) */
.time2 { display: inline-flex; align-items: center; gap: 4px; }
.time2 select {
    padding: 12px 8px; background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700);
    border-radius: var(--radius-sm); color: var(--k1-white); font-size: 14px; font-family: inherit; cursor: pointer;
}
.form-group .time2, .form-group .time2 { width: 100%; }
.form-group .time2 select { flex: 1; }
/* 이름 → 프로필 연결 */
.person-link { cursor: pointer; }
.person-link:hover { text-decoration: underline; color: var(--k1-accent-light); }
/* 프로필 카드 아바타 */
.cc-avatar {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 800; color: #fff;
}

/* 대시보드 */
.dash-list-item { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--k1-gray-800); font-size: 13px; cursor: pointer; }
.dash-list-item:last-child { border-bottom: none; }
.dash-list-item:hover { background: var(--k1-gray-900); }
.dash-list-item .di-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--k1-gray-100); }
.dash-list-item .di-meta { font-size: 11px; color: var(--k1-gray-500); white-space: nowrap; }
.dash-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dash-branch {
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-800);
    border-radius: 12px; padding: 12px 14px;
}
.dash-branch-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; font-weight: 800; color: var(--k1-gray-300); margin-bottom: 10px;
}
.dash-branch-head .cnt {
    background: var(--k1-gray-800); border-radius: 10px; padding: 1px 8px;
    font-size: 11px; color: var(--k1-gray-400);
}
.dash-person { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dash-person .nchip { font-size: 12px; padding: 2px 10px; }
.dash-time { font-size: 11px; color: var(--k1-gray-500); }

/* 직원 관리 직급/지점 선택 */
.pos-sel {
    padding: 4px 8px; background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700);
    border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 700; outline: none;
    color: var(--k1-gray-200);
}
.pos-sel option { background: var(--k1-gray-900); color: var(--k1-gray-200); }
.sch-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.sch-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 16px; border: 1px solid var(--k1-gray-700);
    background: transparent; color: var(--k1-gray-300); font-family: inherit;
    font-size: 12px; font-weight: 700; cursor: pointer;
}
.sch-chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sch-chip.off { opacity: 0.35; }
.sch-chip.off .dot { background: var(--k1-gray-600) !important; }
.sch-chip.branch.active { background: var(--k1-accent); border-color: var(--k1-accent); color: #fff; }

/* 범용 모달 */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none !important; }
/* 프로필(연락처) 모달은 다른 모달(문서·이슈 뷰어) 위에 뜨도록 최상위 */
#contactModal { z-index: 1100; }
/* 첨부 미리보기 뷰어: 문서·이슈 모달 위에 뜨도록 */
#attachViewModal { z-index: 1120; }
.modal-box {
    background: var(--k1-dark); border: 1px solid var(--k1-gray-700);
    border-radius: 16px; width: 460px; max-width: 95vw; max-height: 88vh;
    display: flex; flex-direction: column; box-shadow: var(--shadow-xl);
}
.modal-box-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--k1-gray-800);
}
.modal-box-header h3 { font-size: 16px; font-weight: 700; }
.modal-box-header h3 i { color: var(--k1-accent); margin-right: 8px; }
.modal-box-body { padding: 22px; overflow-y: auto; }
.modal-close-btn {
    background: none; border: none; color: var(--k1-gray-400);
    font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.modal-close-btn:hover { background: var(--k1-gray-800); color: var(--k1-white); }

.req-row { font-size: 12.5px; }
.req-actions { display: flex; gap: 6px; }

.mobile-tabbar { display: none; }
@media (max-width: 768px) {
    .cal-cell { min-height: 64px; padding: 4px; }
    .cal-item { font-size: 9px; padding: 1px 3px; }
    .clock-time { font-size: 32px; }
}

/* ================================
   케이원비즈 - 칸반 / 문서 / 상담
   ================================ */
.kanban-wrap {
    display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
    align-items: stretch; cursor: grab;
    height: calc(100vh - 190px); min-height: 360px;   /* JS가 실제 위치 기준으로 재계산 */
}
.kanban-wrap.panning { cursor: grabbing; user-select: none; }
.kanban-col {
    min-width: 230px; width: 230px; flex-shrink: 0;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-800);
    border-radius: 12px; padding: 10px;
    display: flex; flex-direction: column;
}
/* 컬럼 내부 스크롤: 컬럼이 보드 높이를 채우고 초과분은 휠로 확인 → 가로 스크롤바는 항상 하단 */
.kanban-col-body {
    overflow-y: auto; overscroll-behavior: contain;
    flex: 1 1 auto; min-height: 0;
    margin: 0 -4px; padding: 0 4px;
}
.kanban-col-body::-webkit-scrollbar { width: 6px; }
.kanban-col-body::-webkit-scrollbar-thumb { background: var(--k1-gray-700); border-radius: 3px; }
.kanban-col-body::-webkit-scrollbar-track { background: transparent; }
.kanban-col.dragover { border-color: var(--k1-accent); background: rgba(30,86,160,0.08); }
.kanban-col-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; font-weight: 800; color: var(--k1-gray-300);
    padding: 2px 6px 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.kanban-col-head .cnt {
    background: var(--k1-gray-800); border-radius: 10px; padding: 1px 8px;
    font-size: 11px; color: var(--k1-gray-400);
}
.kanban-card {
    background: var(--k1-dark); border: 1px solid var(--k1-gray-800);
    border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
    transition: border-color 0.15s, transform 0.1s; font-size: 13px;
}
.kanban-card:hover { border-color: var(--k1-accent); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card .kc-title { font-weight: 600; line-height: 1.45; margin: 4px 0; word-break: break-all; }
.kanban-card .kc-meta {
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    font-size: 11px; color: var(--k1-gray-500);
}
.chip {
    display: inline-block; padding: 1px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 700;
}
.chip-epic { background: rgba(139,92,246,0.18); color: #A78BFA; }
.chip-task { background: rgba(59,130,246,0.18); color: #60A5FA; }
.chip-subtask { background: rgba(119,119,119,0.25); color: #BBB; }
.chip-branch-연수점 { background: rgba(59,130,246,0.18); color: #60A5FA; }
.chip-branch-서구점 { background: rgba(239,68,68,0.18); color: #F87171; }
.chip-branch-계양점 { background: rgba(245,158,11,0.18); color: #FBBF24; }
.chip-gray { background: var(--k1-gray-800); color: var(--k1-gray-400); }
#consultBranchTabs { margin-bottom: 12px; }
#consultBranchTabs button[data-branch="서구점"].active { background: #EF4444; border-color: #EF4444; }
#consultBranchTabs button[data-branch="연수점"].active { background: #3B82F6; border-color: #3B82F6; }
#consultBranchTabs button[data-branch="계양점"].active { background: #F59E0B; border-color: #F59E0B; }

.filter-bar {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="search"] {
    padding: 9px 12px; background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700);
    border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--k1-white); outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--k1-accent); }

.view-toggle { display: flex; background: var(--k1-gray-900); border: 1px solid var(--k1-gray-800); border-radius: 8px; padding: 2px; }
.view-toggle button {
    border: none; background: transparent; color: var(--k1-gray-500); padding: 7px 14px;
    border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.view-toggle button.active { background: var(--k1-gray-800); color: var(--k1-accent); }

/* 문서 */
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-tabs button {
    padding: 8px 16px; border-radius: 20px; border: 1px solid var(--k1-gray-700);
    background: transparent; color: var(--k1-gray-400); font-family: inherit;
    font-size: 13px; font-weight: 700; cursor: pointer;
}
.doc-tabs button.active { background: var(--k1-accent); border-color: var(--k1-accent); color: #fff; }
.doc-row { cursor: pointer; }
.doc-body {
    color: var(--k1-gray-200); font-size: 14px; line-height: 1.8; word-break: break-word;
}
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 { color: var(--k1-white); margin: 18px 0 8px; }
.doc-body p { margin-bottom: 8px; }
.doc-body ul, .doc-body ol { margin: 8px 0 12px 22px; }
.doc-body table { border-collapse: collapse; margin: 10px 0; max-width: 100%; }
.doc-body th, .doc-body td { border: 1px solid var(--k1-gray-700); padding: 7px 10px; font-size: 13px; }
.doc-body th { background: var(--k1-gray-900); }
.doc-body a { color: var(--k1-accent-light); }
.doc-body img { max-width: 100%; border-radius: 8px; }
.doc-editor {
    min-height: 320px; background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700);
    border-radius: 8px; padding: 16px; outline: none; color: var(--k1-white);
    font-size: 14px; line-height: 1.8; overflow-y: auto; max-height: 50vh;
}
.doc-editor:focus { border-color: var(--k1-accent); }
.editor-toolbar { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.editor-toolbar button {
    width: 34px; height: 32px; border-radius: 6px; border: 1px solid var(--k1-gray-700);
    background: var(--k1-gray-900); color: var(--k1-gray-300); cursor: pointer; font-size: 13px;
}
.editor-toolbar button:hover { border-color: var(--k1-accent); color: var(--k1-accent); }
/* 색상 글자 버튼: 인라인 색 유지(hover에도 색 안 바뀜) */
.editor-toolbar button.tb-color { font-weight: 800; }
.editor-toolbar button.tb-color:hover { color: inherit; border-color: var(--k1-accent); }
.editor-toolbar .tb-sep { width: 1px; align-self: stretch; background: var(--k1-gray-700); margin: 2px 4px; }

.modal-box.wide { width: 760px; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; }
.pagination button {
    padding: 6px 12px; border-radius: 6px; border: 1px solid var(--k1-gray-700);
    background: transparent; color: var(--k1-gray-400); cursor: pointer; font-family: inherit; font-size: 12px;
}
.pagination button:disabled { opacity: 0.35; cursor: default; }
.pagination span { font-size: 12px; color: var(--k1-gray-500); }

/* 첨부파일 (NAS) */
.attach-drop {
    border: 1px dashed var(--k1-gray-600); border-radius: 8px; padding: 14px;
    text-align: center; color: var(--k1-gray-500); font-size: 12px; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.attach-drop:hover, .attach-drop.dragover { border-color: var(--k1-accent); color: var(--k1-accent); background: rgba(30,86,160,0.06); }
.attach-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 6px;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-800); border-radius: 8px; font-size: 13px;
}
.attach-item a { color: var(--k1-accent-light); text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item a:hover { text-decoration: underline; }
.attach-meta { font-size: 11px; color: var(--k1-gray-500); white-space: nowrap; }
.attach-del { border: none; background: transparent; color: var(--k1-gray-500); cursor: pointer; padding: 2px 4px; }
.attach-del:hover { color: var(--k1-red); }
.attach-note { font-size: 12px; color: var(--k1-gray-500); padding: 8px 2px; }
/* 미리보기 썸네일 (이미지·PDF) */
.attach-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.attach-thumb {
    position: relative; border: 1px solid var(--k1-gray-800); border-radius: 10px; overflow: hidden;
    background: var(--k1-gray-900); cursor: zoom-in; height: 150px;
    transition: border-color 0.15s;
}
.attach-thumb:hover { border-color: var(--k1-accent); }
.attach-thumb img, .attach-thumb iframe {
    width: 100%; height: 112px; object-fit: cover; border: none; display: block; background: #fff;
}
.attach-thumb-cover { position: absolute; inset: 0 0 38px 0; }   /* iframe 클릭 가로채기 */
.attach-thumb-cap {
    position: absolute; left: 0; right: 0; bottom: 0; height: 38px;
    display: flex; align-items: center; gap: 4px; padding: 0 8px;
    background: var(--k1-gray-900); border-top: 1px solid var(--k1-gray-800);
}
.attach-thumb-cap span {
    flex: 1; min-width: 0; font-size: 11px; color: var(--k1-gray-300);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 자세히보기 */
.av-img { max-width: 100%; max-height: 72vh; border-radius: 8px; }
.av-frame { width: 100%; height: 72vh; border: none; border-radius: 8px; background: #fff; }

/* 회의록 조직 칩 필터 */
.org-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.org-chips button {
    padding: 6px 12px; border-radius: 16px; border: 1px solid var(--k1-gray-700);
    background: transparent; color: var(--k1-gray-400); font-family: inherit;
    font-size: 12px; font-weight: 700; cursor: pointer;
}
.org-chips button.active { background: var(--k1-accent); border-color: var(--k1-accent); color: #fff; }
.org-chips .org-cnt { opacity: 0.65; font-weight: 400; margin-left: 2px; }
/* 문서 검색 강조 */
mark { background: rgba(245,158,11,0.35); color: #FDE68A; border-radius: 3px; padding: 0 2px; }
/* PWA 설치 안내 바 */
.pwa-bar {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    z-index: 9999; width: calc(100% - 24px); max-width: 440px;
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700);
    border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
    animation: pwaUp 0.3s ease;
}
@keyframes pwaUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.pwa-bar .pwa-ico { width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; }
.pwa-bar .pwa-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pwa-bar .pwa-txt b { font-size: 14px; color: var(--k1-white); }
.pwa-bar .pwa-txt span { font-size: 12px; color: var(--k1-gray-400); }
.pwa-bar .pwa-btn {
    flex-shrink: 0; border: none; background: var(--k1-accent); color: #fff;
    font-family: inherit; font-weight: 700; font-size: 13px; padding: 9px 16px;
    border-radius: 9px; cursor: pointer;
}
.pwa-bar .pwa-close {
    flex-shrink: 0; border: none; background: transparent; color: var(--k1-gray-500);
    font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px;
}
/* 사람 멘션 → 연락처 */
.doc-person {
    display: inline-block; padding: 0 7px; border-radius: 10px; cursor: pointer;
    background: rgba(30,86,160,0.25); color: #9CC4F5; font-weight: 700; font-size: 0.92em;
}
.doc-person:hover { background: rgba(30,86,160,0.45); }
/* 문서 간 링크 */
.doc-xlink { color: var(--k1-accent-light); text-decoration: underline; }

/* @멘션 칩 (문서 본문·에디터 공용) */
.mention {
    display: inline-block; padding: 0 7px; border-radius: 10px;
    background: rgba(30,86,160,0.25); color: #9CC4F5; font-weight: 700; font-size: 0.92em;
    white-space: nowrap;
}
.doc-body .mention, .doc-editor .mention { cursor: pointer; }
.doc-body .mention:hover { background: rgba(30,86,160,0.45); }
/* @멘션 자동완성 팝업 (에디터) */
.mention-picker {
    position: absolute; z-index: 9999; min-width: 200px; max-height: 240px; overflow-y: auto;
    background: var(--k1-gray-900); border: 1px solid var(--k1-gray-700);
    border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.mention-picker .mp-item { padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--k1-gray-200); }
.mention-picker .mp-item.active, .mention-picker .mp-item:hover { background: var(--k1-accent); color: #fff; }
/* 대시보드 미읽음 멘션 강조 */
.dash-list-item.unread .di-title { font-weight: 800; }
.dash-list-item.unread::before { content: '●'; color: var(--k1-accent-light); font-size: 9px; }

@media (max-width: 768px) {
    .kanban-col { min-width: 200px; width: 200px; }
    .modal-box.wide { width: 95vw; }
}
