:root {
    --bg-dark: #0f172a;          /* Slate 900 */
    --bg-card: #1e293b;          /* Slate 800 */
    --bg-input: #0f172a;         /* Slate 900 for Contrast */
    --bg-hover: rgba(51, 65, 85, 0.4); /* Slate 700 with opacity */
    --bg-primary: #1e293b;
    --primary-color: #3b82f6;
    --danger-color: #ef4444;
    --text-primary: #f8fafc;     /* Slate 50 */
    --text-secondary: #b6c2d2;   /* Higher-contrast supporting text */
    --border-color: #334155;     /* Slate 700 */
    --border-light: rgba(51, 65, 85, 0.5);
    --accent: #3b82f6;           /* Blue 500 */
    --accent-hover: #2563eb;     /* Blue 600 */
    --danger: #ef4444;           /* Red 500 */
    --danger-hover: #dc2626;     /* Red 600 */
    
    /* Box Shapes (Minimalist Sharp Edge) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    /* 모바일 가로 스크롤 방지는 내부 컨테이너에서 담당 */
}

/* Sidebar Navigation */
.nav-bar {
    width: 250px;
    background-color: rgba(14, 14, 19, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    padding: 24px 0 0 0;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.nav-links {
    list-style: none;
    display: flex !important;
    flex-direction: column !important;
}

.nav-links li {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links li:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-links li.active {
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    border-right: 3px solid var(--accent);
}

.nav-links li i {
    width: 20px;
    height: 20px;
}

/* Main Content Area */
.content-area {
    flex-grow: 1;
    margin-left: 250px;
    padding: 40px;
    max-width: 1400px;
}

.header {
    margin-bottom: 32px;
}

.header h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.header p {
    color: var(--text-secondary);
}

/* Tab Switching */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Forms */
.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 24px;
}

.form-card h3 {
    margin-bottom: 20px;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label,
.ip-group-wrap label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .half {
    flex: 1;
}

.form-row .full {
    flex: 1;
    width: 100%;
}

input[type="text"],
input[type="tel"],
input[type="time"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(129, 236, 255, 0.2);
    background-color: rgba(37, 37, 45, 0.6);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

textarea {
    resize: vertical;
}

.info-box {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-box strong {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-text {
    background: transparent;
    color: var(--accent);
    padding: 0;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-icon,
.btn-remove {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.mt-6 {
    margin-top: 24px;
}

/* Grid Forms (Work Register) */
.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Dynamic Rows */
.dynamic-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.dynamic-row-inner {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.dynamic-row input {
    flex: 1;
}

.ip-group-wrap {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.ip-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ip-input-row {
    display: flex;
    gap: 8px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .grid-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .nav-bar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .logo {
        padding: 0 0 16px 0;
    }

    .nav-links {
        display: flex;
        width: 100%;
        overflow-x: auto;
        gap: 8px;
    }

    .nav-links li {
        padding: 12px 16px;
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
        border-radius: var(--radius-md);
    }

    .nav-links li.active {
        border-bottom: 3px solid var(--accent);
        border-right: none;
    }

    .content-area {
        margin-left: 0;
        padding: 20px;
    }

    .dynamic-row-inner {
        flex-wrap: wrap;
    }

    .dynamic-row input {
        width: 100%;
        min-width: 100%;
    }
}

/* PDF Print Styles (Hidden initially) */
#pdf-report-container {
    background: white;
    color: black;
    width: 210mm;
    /* A4 width */
    font-family: 'Pretendard', sans-serif;
    position: absolute;
    left: -9999px;
    top: 0;
}

.pdf-wrapper {
    padding: 15px 30px;
    background-color: white;
    color: #111;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    border-bottom: 2px solid #222;
    padding-bottom: 12px;
}

.pdf-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 0;
    color: #000;
}

.pdf-meta {
    font-size: 14px;
    color: #555;
}

.pdf-section {
    margin-bottom: 30px;
}

.pdf-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111;
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #222;
}

.pdf-table th,
.pdf-table td {
    border: 1px solid #ccc;
    padding: 10px 12px;
    text-align: left;
    color: #222;
}

.pdf-table th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #111;
}

.pdf-table-striped tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.pdf-notes-box {
    border: 1px solid #ccc;
    padding: 15px;
    min-height: 100px;
    font-size: 14px;
    white-space: pre-wrap;
    color: #222;
}

.pdf-footer {
    margin-top: 50px;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.pdf-signatures {
    display: flex;
    justify-content: flex-end;
    gap: 40px;
    margin-top: 30px;
}

.pdf-signatures div {
    border-top: 1px solid #000;
    padding-top: 10px;
    width: 150px;
    text-align: center;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: rgba(18, 18, 25, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    padding: 25px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 45px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(129, 236, 255, 0.1);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* --- CRM Dashboard Styles --- */
#crm-dashboard.active {
    display: flex !important;
}

.crm-dashboard-grid {
    width: 100%;
}

.crm-panel {
    position: relative;
}

.crm-log-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-log-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.crm-log-item.warning {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
    /* very light red tint */
}

.crm-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.crm-log-store {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.05rem;
}

.crm-log-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
}

.crm-log-badge {
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-hover);
    color: var(--text-primary);
}

.crm-log-badge.type {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.crm-log-badge.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.crm-log-badge.status-done {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.crm-log-content {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
}

.crm-log-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* --- Mobile Header Base (Hidden on Desktop) --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
}

/* --- Mobile Responsive (max-width: 768px) --- */
/* Dashboard Grid & Cards */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 105px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info h4 {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.stat-sub-info p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-sub-info strong {
    font-size: 1.15em;
    margin-left: 5px;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.dashboard-panel {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-content {
    padding: 20px;
    flex: 1;
}

.schedule-split {
    display: flex;
    flex: 1;
}

.schedule-col {
    flex: 1;
    padding: 20px;
    border-right: 1px solid var(--border-color);
}

.schedule-col:last-child {
    border-right: none;
}

.schedule-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.schedule-col-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1em;
}

.schedule-list,
.game-request-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-item,
.request-item {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    word-break: break-all;
}

.schedule-item.done .text-content,
.request-item.done .text-content {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* =========================================
   전체 일정 달력 (Calendar Grid) Styles
========================================= */
.calendar-wrapper-inner {
    min-width: 700px;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(90px, auto);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    flex: 1;
    overflow-y: auto;
    min-width: 700px;
}

.calendar-grid-header {
    min-width: 700px;
    /* Force horizontal scroll on small devices */
}

.calendar-cell {
    background: var(--bg-card);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar-cell:hover {
    background: var(--bg-hover);
}

.calendar-cell.other-month {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
}

.calendar-cell.today {
    background: rgba(59, 130, 246, 0.1);
}

.calendar-cell .date-num {
    font-weight: bold;
    font-size: 1.05em;
    margin-bottom: 5px;
}

.calendar-cell:nth-child(7n+1) .date-num {
    color: #ef4444;
    /* 일요일 */
}

.calendar-cell:nth-child(7n) .date-num {
    color: #3b82f6;
    /* 토요일 */
}

.calendar-schedule-item {
    font-size: 0.75em;
    background: #3b82f6;
    color: white;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.calendar-schedule-item.done {
    background: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.6;
}

.calendar-schedule-item i.del-btn {
    width: 12px;
    height: 12px;
    cursor: pointer;
    color: #fca5a5;
    margin-left: 5px;
}

.calendar-schedule-item i.del-btn:hover {
    color: white;
}

/* 연속 일정 둥근 띠 Notion 스타일 */
.calendar-schedule-item.range-start {
    border-top-right-radius: 0px !important;
    border-bottom-right-radius: 0px !important;
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
    margin-right: -9px; /* 셀 경계선과의 간격 최소화 */
}

.calendar-schedule-item.range-middle {
    border-radius: 0px !important;
    margin-left: -9px;
    margin-right: -9px;
}

.calendar-schedule-item.range-end {
    border-top-left-radius: 0px !important;
    border-bottom-left-radius: 0px !important;
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
    margin-left: -9px;
}

/* 캘린더 검색창을 위한 부드러운 다크 모드 스타일링 */
#calendarSearchInput {
    max-width: 250px;
    padding: 8px 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    transition: all 0.25s ease;
    font-size: 0.85rem;
}
#calendarSearchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 10px rgba(59, 130, 246, 0.25);
    outline: none;
}

@media (max-width: 768px) {
    /* 모바일 달력 주간 뷰 최적화 (가로 분할 제거, 세로 1줄 리스트) */
    .calendar-wrapper-inner { min-width: 0 !important; width: 100% !important; }
    .calendar-grid-header { display: none !important; }
    .calendar-grid { 
        grid-template-columns: 1fr !important; 
        min-width: 0 !important; 
        display: flex !important; 
        flex-direction: column !important; 
    }

    .mobile-header {
        display: flex;
    }

    .nav-bar {
        position: fixed !important;
        left: 0;
        top: 0;
        width: 250px !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        /* 명시적 top 고정 (플렉스 영향 방지) */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        z-index: 1001;
        /* 모바일 헤더(1000)보다 높게 하여 메뉴가 덮도록 설정 */
    }

    .nav-bar.show-sidebar {
        transform: translateX(0);
    }

    /* 사이드바 켰을 때 바탕을 어둡게 막아주는 오버레이 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .content-area {
        margin-left: 0 !important;
        padding: 80px 15px 20px 15px !important;
        /* 모바일 헤더용 여백 확보 */
        width: 100%;
        max-width: 100vw;
    }

    .form-row,
    .flex-row {
        flex-direction: column;
        gap: 15px;
    }

    /* 탭 최상단 제목 및 우측 버튼/검색창 구역의 세로 압축 파괴 방어 */
    .content-area .header {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .content-area .header>div:last-child {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 필터 영역 모바일 레이아웃 최적화 (2단 분할 Grid) */
    .customer-filter-row {
        flex-direction: row !important;
        /* 위 기본 form-row 규칙 차단 */
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px !important;
    }

    .customer-filter-row .form-group:first-child {
        grid-column: 1 / -1;
        /* 검색창 풀 너비 */
    }

    .customer-filter-row .form-group:last-child {
        grid-column: 1 / -1;
        /* 장비임대 체크박스 풀 너비 */
    }

    .dashboard-stats-grid,
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }

    .schedule-split {
        grid-template-columns: 1fr !important;
    }

    .schedule-col {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .schedule-col:last-child {
        border-bottom: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .crm-dashboard-grid {
        flex-direction: column;
    }

    .crm-sidebar {
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: auto;
    }

    .crm-content {
        flex: 1;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 800px;
    }

    /* 표 안의 내용물(글자)이 가로 공간 부족으로 세로로 늘어지는 것을 강제 방지 (버그 픽스) */
    table th,
    table td {
        white-space: nowrap !important;
    }
}
/* Fix date picker calendar icon color in dark mode */
input[type='date']::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }

/* Quill Editor Dark Theme Overrides */
.ql-toolbar.ql-snow {
    background: var(--bg-hover);
    border-color: var(--border-color) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ql-container.ql-snow {
    border-color: var(--border-color) !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-family: inherit;
    font-size: 0.95em;
}
.ql-editor {
    color: var(--text-primary);
}
.ql-editor.ql-blank::before {
    color: var(--text-secondary);
    font-style: italic;
}
.ql-snow .ql-stroke {
    stroke: var(--text-secondary);
}
.ql-snow .ql-fill {
    fill: var(--text-secondary);
}
.ql-snow .ql-picker {
    color: var(--text-secondary);
}
.ql-snow .ql-picker-options {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}
.ql-snow .ql-tooltip {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.ql-snow .ql-tooltip input[type=text] {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button:focus .ql-stroke,
.ql-snow .ql-toolbar button:focus .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,
.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,
.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,
.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,
.ql-snow.ql-toolbar button:hover .ql-stroke-miter,
.ql-snow .ql-toolbar button:hover .ql-stroke-miter,
.ql-snow.ql-toolbar button:focus .ql-stroke-miter,
.ql-snow .ql-toolbar button:focus .ql-stroke-miter,
.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,
.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,
.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,
.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,
.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,
.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter {
    stroke: var(--accent);
}
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button:focus .ql-fill,
.ql-snow .ql-toolbar button:focus .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill,
.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,
.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,
.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,
.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,
.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,
.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,
.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill {
    fill: var(--accent);
}
.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button:focus,
.ql-snow .ql-toolbar button:focus,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active,
.ql-snow.ql-toolbar .ql-picker-label:hover,
.ql-snow .ql-toolbar .ql-picker-label:hover,
.ql-snow.ql-toolbar .ql-picker-label.ql-active,
.ql-snow .ql-toolbar .ql-picker-label.ql-active,
.ql-snow.ql-toolbar .ql-picker-item:hover,
.ql-snow .ql-toolbar .ql-picker-item:hover,
.ql-snow.ql-toolbar .ql-picker-item.ql-selected,
.ql-snow .ql-toolbar .ql-picker-item.ql-selected {
    color: var(--accent);
}


/* --- Notion-style Block Editor Custom Styles --- */

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Memo Sidebar Items */
.memo-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.memo-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
.memo-item.active {
    background: rgba(139, 92, 246, 0.15); /* Purple tint */
    border-color: #8b5cf6;
}
.memo-item-title {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.memo-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75em;
    color: var(--text-secondary);
}
.memo-item-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
}
.memo-item-badge.category-업무 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.memo-item-badge.category-회의 { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.memo-item-badge.category-아이디어 { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.memo-item-badge.category-개인 { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.memo-item-badge.category-기타 { background: rgba(156, 163, 175, 0.2); color: #d1d5db; }

/* Editor WorkSpace & Blocks */
.editor-block-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}
.editor-block-wrapper:hover {
    background: rgba(255, 255, 255, 0.02);
}
.editor-block-wrapper.drag-over {
    border-top: 2px solid #8b5cf6;
}

/* Block Actions Sidebar (Drag handle & Plus Button) */
.block-actions-sidebar {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
    user-select: none;
    margin-top: 4px;
    flex-shrink: 0;
}
.editor-block-wrapper:hover .block-actions-sidebar {
    opacity: 1;
}
.block-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    transition: background 0.15s;
}
.block-drag-handle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.block-drag-handle:active {
    cursor: grabbing;
}
.block-plus-btn {
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    transition: background 0.15s;
}
.block-plus-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Editable Block Content Base */
.block-content {
    flex: 1;
    min-height: 24px;
    outline: none;
    word-break: break-word;
    white-space: pre-wrap; /* [Vibe Dev Team 개선] 개행 문자 \n 및 연속 공백이 정상적으로 화면에 렌더링되도록 보장 */
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95em;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
}
.block-content[placeholder]:empty::before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
    cursor: text;
}

/* Heading Block Styles */
.block-content.heading-1 {
    font-size: 1.8em;
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 4px;
    color: #f8fafc;
}
.block-content.heading-2 {
    font-size: 1.45em;
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 3px;
    color: #e2e8f0;
}
.block-content.heading-3 {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 2px;
    color: #cbd5e1;
}

/* List Block Style */
.block-content.list-item {
    display: list-item;
    list-style-type: disc;
    margin-left: 20px;
}

/* Code Block Style */
.block-content.code-block-wrapper {
    background: #0f0f15;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.85em;
    padding: 0;
    overflow: hidden;
}
.code-block-header {
    background: #181824;
    padding: 6px 12px;
    font-size: 0.8em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.code-block-textarea {
    width: 100%;
    min-height: 80px;
    background: transparent;
    border: none;
    color: #a78bfa;
    font-family: inherit;
    font-size: inherit;
    padding: 12px;
    resize: vertical;
    outline: none;
}
.code-block-preview {
    padding: 12px;
    display: none;
    white-space: pre-wrap;
    background: #0f0f15;
    overflow-x: auto;
}

/* Math (LaTeX) Block Style */
.block-content.math-block-wrapper {
    background: rgba(139, 92, 246, 0.03);
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-sm);
    padding: 0;
    overflow: hidden;
}
.math-block-header {
    background: rgba(139, 92, 246, 0.08);
    padding: 6px 12px;
    font-size: 0.8em;
    color: #c084fc;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.math-block-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #e9d5ff;
    padding: 10px 12px;
    font-family: monospace;
    font-size: 0.9em;
    outline: none;
    resize: none;
    height: 44px;
}
.math-block-render {
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    font-size: 1.15em;
    color: #cbd5e1;
    background: rgba(0,0,0,0.1);
}

/* Table Block Style */
.block-content.table-block-wrapper {
    padding: 5px 0;
}
.editor-table {
    border-collapse: collapse;
    width: 100%;
    margin: 4px 0;
}
.editor-table th, .editor-table td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: 0.9em;
    outline: none;
    color: var(--text-primary);
}
.editor-table th {
    background: rgba(255,255,255,0.03);
    font-weight: 600;
}
.table-block-actions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

/* Image Block Style */
.block-content.image-block-wrapper {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.01);
    padding: 0;
    overflow: hidden;
}
.image-block-upload-zone {
    padding: 20px;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85em;
    transition: background 0.15s;
}
.image-block-upload-zone:hover {
    background: rgba(255,255,255,0.03);
}
.image-block-preview {
    display: none;
    position: relative;
    width: 100%;
    background: #000;
    text-align: center;
}
.image-block-preview img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    vertical-align: middle;
}
.image-block-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    border-radius: 4px;
}

/* Slash Popup active item */
.slash-item.active {
    background: rgba(139, 92, 246, 0.2) !important;
    border-left: 3px solid #8b5cf6;
}

/* Todo Block Styles */
.block-content.todo-block-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 2px 4px;
}
.todo-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
    margin-top: 3px;
    background: transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.todo-checkbox:checked {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}
.todo-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}
.todo-text {
    flex: 1;
    min-height: 24px;
    outline: none;
    word-break: break-word;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 1em;
}
.todo-checkbox:checked + .todo-text {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Memo List Item Delete Button */
.memo-item {
    position: relative;
    padding-right: 36px !important; /* space for delete btn */
}
.memo-item-delete {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}
.memo-item:hover .memo-item-delete {
    opacity: 0.5;
}
.memo-item-delete:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

/* --- Notion-style Personal Memo Image Block Styles --- */
.image-block-wrapper {
    margin: 12px 0;
    width: 100%;
}
.image-block-container {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.image-block-container:hover {
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}
.image-block-container img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.image-block-container button {
    opacity: 0 !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    transform: scale(0.95);
}
.image-block-container:hover button {
    opacity: 0.95 !important;
    transform: scale(1);
}

/* --- Dynamic Category Manager Styles --- */
.popup-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.popup-category-item button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, transform 0.15s;
    padding: 2px;
}
.popup-category-item button:hover {
    color: #ef4444 !important;
    transform: scale(1.1);
}

/* Memo Badges & Categories Dynamic styling */
.memo-item-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.memo-item-badge.category-업무 {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.memo-item-badge.category-회의 {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.memo-item-badge.category-아이디어 {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.memo-item-badge.category-개인 {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.memo-item-badge.category-기타 {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.25);
}

/* --- Game Center Modal Mobile Responsive Styles --- */
@media (max-width: 1024px) {
    #gameCenterModal .card {
        width: 95% !important;
        height: 95vh !important;
        max-height: 95vh !important;
    }
    .gc-tab-content {
        flex-direction: column !important;
        overflow-y: auto !important;
    }
    .gc-form-side {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding: 20px !important;
        flex-shrink: 0 !important;
        overflow-y: visible !important;
    }
    .gc-list-side {
        width: 100% !important;
        padding: 20px !important;
        overflow-y: visible !important;
    }
}

@media (max-width: 768px) {
    #gameCenterModal .card {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }
    .game-center-tabs {
        padding: 4px 8px !important;
    }
    .gc-tab-btn {
        padding: 8px 12px !important;
        font-size: 0.85em !important;
    }
    .request-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 12px !important;
    }
    .request-item > div {
        width: 100% !important;
        text-align: left !important;
    }
    .request-item .text-content {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
    
    /* 포레요청 리스트 모바일 대응 */
    #foreRequestListArea > div:first-child {
        display: none !important; /* 헤더 숨기기 */
    }
    #foreRequestListArea {
        padding: 0 !important;
    }
    .request-item[style*="display:flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    .request-item[style*="display:flex"] > div {
        width: 100% !important;
        text-align: left !important;
        padding-left: 0 !important;
    }
}

/* --- Personal Memo Modal Responsive Styling (NetSup CS Vibe Dev Team) --- */
@media (max-width: 768px) {
    /* 모달 윈도우 크기를 화면 전체에 밀착 */
    #personalMemoModal .modal-content {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    /* 2단 레이아웃을 1단 레이아웃으로 변경 */
    #personalMemoModal .modal-content > div:nth-child(2) {
        position: relative;
        width: 100%;
        height: 100%;
    }

    /* 사이드바 목록을 화면 전체 너비로 */
    #personalMemoModal .memo-sidebar {
        width: 100% !important;
        border-right: none !important;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
        transition: transform 0.25s ease-in-out;
    }

    /* 에디터 영역을 화면 전체 너비로 */
    #personalMemoModal #memoEditorArea {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        z-index: 20;
        transition: transform 0.25s ease-in-out;
    }

    /* mobile-hidden 클래스가 붙었을 때 처리 */
    #personalMemoModal .memo-sidebar.mobile-hidden {
        transform: translateX(-100%);
        pointer-events: none;
    }

    #personalMemoModal #memoEditorArea.mobile-hidden {
        transform: translateX(100%);
        pointer-events: none;
    }

    /* 모바일 전용 뒤로가기 버튼 활성화 */
    #personalMemoModal .memo-mobile-back-btn {
        display: inline-flex !important;
        margin-right: 8px;
    }

    /* 모바일 환경에서 Notion 에디터의 패딩 조절 */
    #personalMemoModal #activeMemoEditor .custom-scrollbar {
        padding: 15px 15px !important;
    }

    /* 모바일 제목 폰트 조율 */
    #personalMemoModal #memoTitleInput {
        font-size: 1.6em !important;
        margin-bottom: 12px !important;
    }

    /* 풋터 영역 미세 조절 */
    #personalMemoModal #activeMemoEditor > div:last-child {
        padding: 10px 15px !important;
        font-size: 0.72em !important;
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* --- CRM Premium Consultation Dashboard Styles --- */
mark.search-highlight {
    background: rgba(16, 185, 129, 0.35) !important;
    color: #34d399 !important;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 3px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.7);
}

.crm-timeline-container {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
    margin: 15px 0 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crm-timeline-card {
    background: rgba(30, 30, 42, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.crm-timeline-card::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    border: 3px solid #1a1a24;
    transition: all 0.25s ease;
}

.crm-timeline-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
}

.crm-timeline-card:hover::before {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.crm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.crm-card-body {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-primary);
}

.crm-card-section {
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.15);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-color);
}

.crm-card-section.inquiry {
    border-left-color: #3b82f6;
}

.crm-card-section.action {
    border-left-color: #10b981;
}

.crm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* CRM Category Badges */
.crm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1;
    gap: 4px;
    border: 1px solid transparent;
}

.crm-badge-일반문의 {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
}
.crm-badge-긴급장애, .crm-badge-긴급문의 {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
}
.crm-badge-방문요청 {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.25);
}
.crm-badge-불만 {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
}
.crm-badge-기타 {
    background: rgba(107, 114, 128, 0.12);
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.25);
}

/* CRM Quick Templates */
.crm-quick-templates-wrapper {
    margin-bottom: 12px;
}
.crm-quick-templates-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}
.crm-quick-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.btn-quick-template {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.82em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-quick-template:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-1px);
}
.btn-quick-template:active {
    transform: translateY(0);
}

/* Mobile Assistant Floating Bar */
.crm-mobile-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 36, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 2100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
.crm-toolbar-btn {
    flex: 1;
    margin: 0 6px;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.crm-toolbar-btn-action {
    background: #10b981;
    color: #fff;
}
.crm-toolbar-btn-newline {
    background: #3b82f6;
    color: #fff;
}
.crm-toolbar-btn-close {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Search Highlights */
.search-highlight-match {
    background: rgba(245, 158, 11, 0.35) !important;
    color: #fbbf24 !important;
    font-weight: bold;
    border-radius: 2px;
    padding: 0 2px;
}

/* Image preview container within CRM Card */
.crm-image-preview-container {
    margin-top: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
    max-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.crm-image-preview-container img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.crm-image-preview-container img:hover {
    transform: scale(1.02);
}

/* =========================================
   자원/컨디션 H/W 모니터링 모달 Styles (Vibe Dev Team)
   ========================================= */

.resource-modal-content {
    max-width: 900px !important;
    width: 95% !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.resource-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.resource-summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.resource-summary-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.resource-card-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.resource-card-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8rem;
    max-height: 120px;
    overflow-y: auto;
}

.resource-card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.resource-card-item:last-child {
    border-bottom: none;
}

.resource-card-item .item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.resource-card-item .item-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: bold;
}

.resource-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.resource-sync-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.resource-legend {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.online { background: #10b981; }
.legend-dot.offline { background: #6b7280; }
.legend-dot.warning { background: #f59e0b; }
.legend-dot.error { background: #ef4444; }

/* 장애 좌석 테이블 관련 스타일 */
#resource-condition-table th, 
#resource-condition-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

#resource-condition-table tbody tr {
    transition: background 0.15s ease;
}

#resource-condition-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
}

.badge-offline {
    background: rgba(156, 163, 175, 0.15);
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
}

.resource-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    border-radius: var(--radius-md);
}

.resource-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: resource-spin 1s ease-in-out infinite;
}

@keyframes resource-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
    .resource-summary-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .resource-summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }
    .resource-meta-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .resource-legend {
        justify-content: space-between;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite !important;
}

/* --- Game Installation Request Item Custom Layout (NetSup Vibe Dev Team) --- */
.request-item-main-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.request-item-store {
    font-weight: bold;
    color: var(--accent);
    min-width: 130px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.request-item-game {
    font-size: 0.75rem;
    color: #e0e7ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.request-item-badge {
    font-size: 0.75rem;
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    flex-shrink: 0;
    margin-left: auto !important;
}

.request-item-second-row {
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .request-item-main-row {
        flex-wrap: nowrap !important;
        gap: 6px !important;
    }
    
    .request-item-store {
        min-width: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }
    
    .request-item-game {
        width: auto !important;
        flex: 1 !important;
        white-space: normal !important;
        word-break: break-all !important;
        overflow: visible !important;
        text-overflow: clip !important;
        font-size: 0.75rem !important;
        margin-top: 0 !important;
    }
    
    .request-item-badge {
        margin-left: auto !important;
        font-size: 0.75rem !important;
    }
}

/* --- UNIFIED BOARD STYLE --- */
/* --- UNIFIED BOARD STYLE (목록형 개편) --- */
.board-feed-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.board-feed-card {
    background: rgba(30, 34, 53, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

.board-feed-card:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: #8b5cf6;
}

.board-feed-card.status-pending {
    border-left: 3px solid #f59e0b;
}

.board-feed-card.status-progress {
    border-left: 3px solid #3b82f6;
}

.board-feed-card.status-completed {
    border-left: 3px solid #10b981;
    opacity: 0.8;
}

.board-feed-card.type-notice {
    border-left: 3px solid #ef4444;
}

.board-feed-card.type-free {
    border-left: 3px solid #8b5cf6;
}

.board-card-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.board-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.board-card-meta-info {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .board-feed-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 14px;
    }
    .board-card-main-info {
        width: 100%;
    }
    .board-card-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    .board-card-meta-info {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 6px;
        gap: 8px;
        flex-wrap: wrap;
    }
}

.board-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.board-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.board-badge.notice { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.board-badge.task { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.board-badge.free { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }

.board-badge.pending { background: rgba(245, 158, 11, 0.15); color: #fde047; }
.board-badge.progress { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.board-badge.completed { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

/* Filter Buttons */
.btn-filter {
    transition: all 0.2s ease;
}
.btn-filter.active {
    background: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
    color: white !important;
}

/* Task Matrix Grid */
.task-matrix-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    font-size: 0.8rem;
}

.task-matrix-item.read {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.05);
}

.task-matrix-item.completed {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}

.task-matrix-status {
    font-size: 0.75rem;
    font-weight: 600;
}
.task-matrix-status.unread { color: var(--text-secondary); }
.task-matrix-status.read { color: #60a5fa; }
.task-matrix-status.completed { color: #34d399; }

/* Unified Board & Portal Styles */
.unified-board-sub-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.unified-board-sub-tabs::-webkit-scrollbar {
    display: none; /* Safari & Chrome */
}

.btn-sub-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-sub-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-sub-tab.active {
    background: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.unified-sub-content {
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Layouts */
.unified-board-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: start;
}

.unified-board-sidebar {
    background: #1e2235;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.unified-board-sidebar h4 {
    margin: 0;
    font-size: 0.95em;
    color: #a78bfa;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.unified-board-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Category manager list popup rows */
.category-edit-row {
    transition: background 0.15s ease;
}
.category-edit-row:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

@media (max-width: 768px) {
    .unified-board-container {
        grid-template-columns: 1fr;
    }
}

/* [Vibe Dev Team] 브라우저 기본값 및 라이브러리 간섭 차단 - 모든 다크인풋 창 흰색 배경 이탈 방지 */
.text-input, 
input[type="text"], 
input[type="number"], 
input[type="password"], 
input[type="email"], 
textarea,
select {
    background-color: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

/* 포커스 시 스타일 */
.text-input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    background-color: rgba(37, 37, 45, 0.8) !important;
    border-color: var(--accent) !important;
}

/* Shared interaction and layout quality layer */
:where(button, a, input, select, textarea, [role="button"]):focus-visible {
    outline: 3px solid #93c5fd !important;
    outline-offset: 3px;
}

button:disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none !important;
}

.btn,
.nav-links li[role="button"] {
    min-height: 44px;
}

.nav-bar {
    overflow-y: auto;
    scrollbar-width: thin;
}

.content-area {
    width: calc(100% - 250px);
    max-width: none;
}

.stat-card[role="button"]:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.24);
}

/* Login */
.login-page {
    padding: 24px;
    background:
        radial-gradient(circle at 50% 15%, rgba(59, 130, 246, 0.18), transparent 34rem),
        var(--bg-dark) !important;
}

.login-card {
    max-width: 440px !important;
    padding: 48px 40px !important;
    border-color: #40526b;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.5);
}

.login-mark {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 20px !important;
}

.login-eyebrow {
    margin-bottom: 8px;
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.login-card h1 {
    margin-bottom: 12px;
    font-size: 1.75rem;
    line-height: 1.25;
}

.login-description {
    margin-bottom: 30px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.login-card #btn-google-login {
    min-height: 52px;
    border-radius: var(--radius-sm);
}

.auth-status-panel {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid #475569;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.78);
    text-align: left;
}

.auth-status-panel[hidden] {
    display: none;
}

.auth-status-panel[data-tone="warning"] {
    border-color: #b45309;
    background: rgba(180, 83, 9, 0.12);
}

.auth-status-panel[data-tone="danger"] {
    border-color: #b91c1c;
    background: rgba(185, 28, 28, 0.12);
}

.auth-status-panel h2 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.auth-status-panel p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.55;
}

.auth-status-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.auth-status-actions .btn {
    min-height: 44px;
    padding: 8px 10px;
    white-space: normal;
}

.login-help {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

@media (max-width: 768px) {
    .content-area {
        width: 100%;
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    #dashboard-view > .header > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #dashboard-view > .header > div:last-child .btn {
        width: 100%;
        min-width: 0;
    }

    #dashboard-view > .card > div {
        align-items: stretch !important;
        flex-direction: column;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .stat-card {
        min-width: 0;
        min-height: 124px;
        padding: 16px !important;
    }

    .stat-card span {
        white-space: normal !important;
        line-height: 1.35;
    }

    .dashboard-panel .panel-header {
        align-items: flex-start !important;
        flex-wrap: wrap;
        gap: 10px !important;
    }

    .dashboard-panel .panel-header > div,
    .dashboard-panel .panel-header > button {
        min-height: 44px;
    }

    #dashboard-recent-works-tbody td[colspan] {
        position: sticky;
        left: 0;
        padding-left: 12px !important;
        text-align: left !important;
    }

    .schedule-split {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .login-page {
        padding: 20px;
    }

    .login-card {
        padding: 38px 24px !important;
    }

    .auth-status-actions {
        grid-template-columns: 1fr;
    }
}

.dashboard-actions .btn {
    color: var(--text-primary);
    font-weight: 700;
    gap: 7px;
}

.dashboard-actions .btn:nth-child(1) { background: rgba(37,99,235,.16); border-color: rgba(96,165,250,.45); }
.dashboard-actions .btn:nth-child(2) { background: rgba(124,58,237,.16); border-color: rgba(167,139,250,.45); }
.dashboard-actions .btn:nth-child(3) { background: rgba(5,150,105,.16); border-color: rgba(52,211,153,.45); }
.dashboard-actions .btn:nth-child(4) { background: rgba(219,39,119,.14); border-color: rgba(244,114,182,.42); }
.dashboard-actions .btn:nth-child(5) { background: rgba(217,119,6,.15); border-color: rgba(251,191,36,.42); }
.dashboard-actions .btn:hover { filter: brightness(1.2); color: #fff; }

.dashboard-group-dialog {
    width: min(1100px, calc(100% - 24px));
    max-width: none;
    max-height: calc(100dvh - 24px);
    padding: 18px;
    overflow: hidden;
}

.dashboard-group-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.dashboard-group-tabs .btn.active {
    color: white;
    border-color: #8b5cf6;
    background: #8b5cf6;
}

.dashboard-group-card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-hover);
}

.dashboard-group-card h4 {
    margin: 0 0 8px;
}

.dashboard-group-card p {
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.dashboard-group-card .btn {
    width: 100%;
    min-height: 44px;
}

.dashboard-group-body {
    min-height: 260px;
    max-height: calc(100dvh - 170px);
    overflow: auto;
}

.dashboard-group-docked-content {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 520px;
    max-height: calc(100dvh - 180px) !important;
    margin: 0 !important;
}

.dashboard-group-docked-content > .modal-header {
    display: none !important;
}

.dashboard-group-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .dashboard-actions { gap: 10px !important; }
    .dashboard-actions .btn { min-height: 46px; padding: 10px 12px !important; }
    .dashboard-group-dialog { width: calc(100% - 12px); padding: 12px; }
    .dashboard-group-body { max-height: calc(100dvh - 155px); }
    .dashboard-group-docked-content { min-height: 480px; max-height: none !important; }
}

/* Dashboard communication focus: operational summaries live in their dedicated screens. */
.dashboard-triple-grid {
    grid-template-columns: minmax(0, 1fr) !important;
}

.dashboard-triple-grid > .dashboard-panel:nth-child(1),
.dashboard-triple-grid > .dashboard-panel:nth-child(2) {
    display: none !important;
}

/* Mobile containment: keep legacy inline layouts inside viewport. */
@media (max-width: 1024px) {
    #crm-dashboard > .form-card > div,
    #crm-dashboard > .form-card > div > div:first-child {
        flex-wrap: wrap !important;
    }

    #crm-dashboard > .form-card > div > div:first-child > div {
        flex: 1 1 180px !important;
        max-width: none !important;
        min-width: 0 !important;
    }
}

@media (max-width: 768px) {
    html,
    body,
    .app-container,
    .content-area,
    .tab-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .content-area,
    .tab-content,
    .card,
    .form-card,
    .dashboard-panel,
    .grid-form,
    .form-group,
    .modal-content {
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .tab-content {
        margin-top: 58px;
    }

    .unified-board-sub-tabs {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        white-space: normal !important;
        overflow: visible !important;
    }

    .unified-board-sub-tabs .btn-sub-tab {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }

    #inv-master-modal .modal-content {
        width: calc(100% - 20px) !important;
        max-width: none !important;
        height: calc(100dvh - 20px) !important;
        max-height: none !important;
        padding: 0 !important;
    }

    #inv-master-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 12px !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    #inv-master-content > div {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: none !important;
        overflow: visible !important;
    }

    #inv-master-content > div:first-child > div:first-child {
        display: grid !important;
        grid-template-columns: 45px minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    #inv-master-content > div:first-child > div:first-child > div:last-child {
        grid-column: 1 / -1;
        width: 100%;
    }

    #inv-stockin button,
    #inv-stockout button,
    #inv-dashboard button,
    #inv-master-modal button,
    #inv-supplier-modal button {
        min-width: 44px;
        min-height: 44px;
    }

    #gameCenterModal > .card {
        width: calc(100% - 20px) !important;
        max-width: none !important;
        height: calc(100dvh - 20px) !important;
        max-height: none !important;
    }

    #gameCenterModal > .card > div:first-child {
        padding: 12px 14px !important;
    }

    #gameCenterModal > .card > div:first-child h3 {
        min-width: 0;
        font-size: 1rem !important;
    }

    #gameCenterModal .gc-tab-content.active-tab {
        padding: 14px !important;
        width: 100% !important;
        min-width: 0 !important;
        flex-direction: column !important;
        overflow-y: auto !important;
    }

    #gameCenterModal .gc-tab-content.active-tab > div:first-child {
        align-items: stretch !important;
        flex-direction: column;
        gap: 12px;
    }

    #gameCenterModal .gc-tab-content.active-tab > div:first-child h4 {
        width: 100%;
        white-space: normal;
        word-break: keep-all;
    }

    #gameCenterModal .gc-tab-content.active-tab > div:first-child > div {
        width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: stretch !important;
    }

    #gameCenterModal .gc-tab-content.active-tab > div:first-child button {
        width: 100% !important;
    }

    #gameCenterModal > .card > div:nth-child(2) {
        scrollbar-width: none;
    }


    #gameCenterModal .gc-tab-content.active-tab input {
        width: 100% !important;
        min-width: 0 !important;
    }

    #gameCenterModal .gc-form-side,
    #gameCenterModal .gc-list-side {
        width: 100% !important;
        min-width: 0 !important;
        padding: 14px !important;
    }

    .dashboard-panel {
        width: 100% !important;
        max-width: 100% !important;
    }

    #unified-sub-board > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        height: auto !important;
        overflow: visible !important;
    }

    #unified-sub-board > div > div {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    #unified-sub-board > div > div:last-child > div:first-child {
        flex-wrap: wrap !important;
    }

    #unified-sub-memo > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        height: auto !important;
        overflow: visible !important;
    }

    #unified-sub-memo .memo-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 360px;
        border-right: 0 !important;
    }

    #unified-memoEditorArea {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 360px;
    }

    #customer-select-modal .modal-content > div:nth-child(2) {
        flex-wrap: wrap !important;
    }

    #customerSelectSearch {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px;
        font-size: 16px !important;
    }

    #directReceiverInput,
    .tab-content input:not([type="checkbox"]):not([type="radio"]),
    .tab-content select,
    .tab-content textarea {
        min-height: 44px;
        font-size: 16px !important;
    }

    .tab-content input[type="checkbox"],
    .tab-content input[type="radio"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        flex: 0 0 20px;
    }

    .tab-content > *,
    .card > *,
    .form-card > * {
        min-width: 0;
        max-width: 100%;
    }

    .tab-content [style*="min-width"] {
        min-width: 0 !important;
    }

    .tab-content [style*="display: flex"],
    .header,
    .panel-header {
        flex-wrap: wrap !important;
    }

    #message-send > div:nth-child(2) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #message-send > div:nth-child(2) > .card {
        width: 100% !important;
        max-width: none !important;
        flex: none !important;
    }

    #message-send .form-group > div[style*="display: flex"] {
        flex-direction: column;
        align-items: stretch !important;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
        box-sizing: border-box;
    }

    .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 72px 14px 14px !important;
    }

    .modal-content {
        width: calc(100% - 20px) !important;
        padding: 14px !important;
    }

    .modal-footer {
        flex-wrap: wrap !important;
    }

    .modal-footer .btn {
        flex: 1 1 120px;
        min-height: 44px;
        white-space: normal;
    }

    #crm-dashboard > .form-card > div,
    #crm-dashboard > .form-card > div > div:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        gap: 12px !important;
    }

    #crm-dashboard > .form-card > div > div:first-child > div {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    #crm-dashboard > .form-card div[style*="width: 1px"] {
        display: none !important;
    }

    #crm-dashboard > .form-card button,
    #crm-dashboard > .form-card select,
    #crm-dashboard > .form-card input {
        width: 100% !important;
    }

    #crm-dashboard > .form-card div[style*="gap: 4px"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    #crm-dashboard > .form-card div[style*="gap: 4px"] > span {
        display: none;
    }

    .dashboard-stats-grid,
    #dashboard-view > .header > div:last-child {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .stat-card {
        min-height: auto;
    }

    .header h2 {
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}





