:root {
    --primary-color: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow-y: hidden;
    overflow-x: auto;
    min-width: 1200px;
}

.container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    z-index: 101;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.menu {
    list-style: none;
    flex: 1;
}

.menu li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.menu li:hover,
.menu li.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.menu li .material-symbols-outlined {
    font-size: 1.25rem;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.info {
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
}

.info .role {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 64px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: background-color 0.2s;
}

.icon-btn .material-symbols-outlined {
    font-size: 1.2rem;
}

.icon-btn:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

/* Dashboard Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-change {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
}

.stat-change.up {
    background-color: #dcfce7;
    color: #166534;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 4px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.action-item.urgent {
    border-left-color: var(--danger-color);
}

.action-content {
    flex: 1;
}

.action-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.action-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-outline:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    height: 40px;
}

/* Timeline for Classes */
.timeline-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    height: 100%;
    position: relative;
}

.time-axis {
    width: 50px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding-top: 56px;
    /* Match header height */
    border-top: 1px solid transparent;
    /* Match day-column border width for alignment */
    height: fit-content;
}

.time-label {
    height: 60px;
    /* 1 hour = 60px */
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    padding-right: 0.5rem;
    position: relative;
    /* Remove top adjustment */
}

.time-label span {
    position: absolute;
    top: 0;
    right: 0.5rem;
    transform: translateY(-50%);
    background: var(--surface-color);
    /* Optional: background to cover line if needed, or transparent */
}

.day-column {
    min-width: 150px;
    flex: 1;
    background-color: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    height: fit-content;
}

.day-header {
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    z-index: 10;
    height: 56px;
    flex-shrink: 0;
}

.time-slots {
    flex: none;
    position: relative;
    /* Grid lines for timeline */
    background-image: linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    background-size: 100% 60px;
    /* 60px = 1 hour */
    /* Ensure exact height matching labels (12 hours = 720px) */
    height: 720px;
    overflow: hidden;
    cursor: pointer;
}

.class-card {
    position: absolute;
    /* Now absolute for precise timing */
    width: 96%;
    left: 2%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: grab;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s, box-shadow 0.1s;
    overflow: hidden;
    z-index: 5;
    user-select: none;
    min-height: 40px;
}

.action-list .class-card {
    position: relative !important;
    flex-shrink: 0;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 6;
}

.class-card:active {
    cursor: grabbing;
}

/* Resize Handles - Only visible in Edit Mode */
.timeline-container:not(.edit-mode) .resize-handle-top,
.timeline-container:not(.edit-mode) .resize-handle-bottom {
    display: none;
}

.timeline-container:not(.edit-mode) .class-card {
    cursor: pointer;
    /* Indicate clickable for details */
}

.timeline-container.edit-mode .class-card {
    cursor: grab;
}

/* Resizer handles for class card */
.resize-handle-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
    z-index: 10;
}

.resize-handle-top:hover {
    background: rgba(0, 0, 0, 0.1);
}

.resize-handle-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
    z-index: 10;
}

.resize-handle-bottom:hover {
    background: rgba(0, 0, 0, 0.1);
}


/* Member List */
.member-table {
    width: 100%;
    border-collapse: collapse;
}

.member-table th,
.member-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag.risk {
    background-color: #fee2e2;
    color: #991b1b;
}

.tag.target {
    background-color: #fef3c7;
    color: #92400e;
}

.tag.normal {
    background-color: #e0e7ff;
    color: #3730a3;
}

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

.modal {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.member-form-modal .modal-footer {
    padding: 1rem 1.75rem 1.5rem;
    margin-top: 0;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 2000;
    min-width: 150px;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.context-menu-item:hover {
    background-color: var(--bg-color);
}

.context-menu-item.danger {
    color: var(--danger-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label,
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.form-control.search {
    width: 100%;
}


/* Refactored Styles from JS */

/* Modal Layouts */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    flex: 1;
    padding-right: 0.5rem;
}

.modal-col-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-col-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-left: 1px solid #eee;
    padding-left: 1rem;
}

.modal-section-title {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.modal-section-title.mt-4 {
    margin-top: 1rem;
}

/* Form Elements */
.form-row-flex {
    display: flex;
    gap: 1rem;
}

.form-row-flex.mt-2 {
    margin-top: 0.5rem;
}

.input-time-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-time {
    width: 60px;
}

.input-time-colon {
    margin: 0 2px;
}

/* Member Management */
.member-search-container {
    position: relative;
}

.member-search-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.member-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.member-search-item {
    padding: 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.member-search-item:hover {
    background: #f1f5f9;
}

.member-list-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 300px;
}

.member-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
}

.member-list-empty {
    text-align: center;
    color: #999;
    padding: 2rem;
}

/* Schedule Slots */
.schedule-slot {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    position: relative;
}

.slot-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #94a3b8;
}

/* Components from Render.js */
.class-card.selected {
    box-shadow: 0 0 0 3px #2563eb !important;
    z-index: 100 !important;
    border-color: #2563eb !important;
}

.paste-ghost {
    pointer-events: none;
    opacity: 0.6;
    z-index: 1000;
    border: 2px dashed #000;
}

.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
}

/* Switch Component */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(14px);
}

/* Popup Search Results */
.popup-search-results {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.5rem;
}

.popup-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.popup-search-item:hover {
    background-color: #f8fafc;
}

/* Remaining Refactored Styles */

/* General Utilities */
.divider-horizontal {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-muted-small {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 36px;
}

/* Card Styles */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.card-header-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.card-header-right {
    display: flex;
    gap: 0.5rem;
}

.edit-mode-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.edit-mode-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.card-content-wrapper {
    pointer-events: none;
    overflow: hidden;
    height: 100%;
}

/* Icons */
.material-symbols-outlined.pin-icon {
    font-size: 20px !important;
    cursor: pointer;
}

.risk-icon {
    font-size: 12px;
}

.card-icons-container {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 2px;
    z-index: 20;
}

/* Ghost Element */
.paste-ghost-content {
    font-size: 0.8em;
}

.paste-ghost-name {
    display: block;
}

/* Class Details Modal */
.class-title-header {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.class-title-time {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.8em;
}

.class-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.class-details-min-text {
    color: #999;
}

.class-details-tickets {
    color: #666;
}

/* Forms */
.search-input-wrapper {
    position: relative;
}

.search-input-field {
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-form-scrollable {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    max-height: 70vh;
    overflow-y: auto;
}

/* Member Info */
.member-info-name {
    font-weight: 500;
}

.member-info-phone {
    font-size: 0.8rem;
    color: #64748b;
}

/* Modal Refactoring Styles */
.modal-lg {
    max-width: 970px;
    width: 90% !important;
}

.modal-sm {
    max-width: 500px;
    width: 90% !important;
}

.fieldset-styled {
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 8px;
}

.legend-styled {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0 0.5rem;
}

.ticket-label {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.width-full {
    width: 100%;
}

.dashed-btn {
    width: 100%;
    border-style: dashed;
    margin-top: 0.5rem;
}

/* Class Card Content */
.card-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 4px;
    min-height: 40px;
    position: relative;
    top: 4px;
}

.card-title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.card-bottom-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.2;
}

.card-time {
    font-weight: 500;
}

.card-stats {
    font-weight: 600;
}

/* Legacy styles for backward compatibility */
.card-info {
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Week Navigation */
.week-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    margin-left: 1rem;
}

.week-range-display {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    min-width: 160px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.btn-today {
    padding: 0.35rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.25rem;
}

.btn-today:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.btn-today:active {
    transform: translateY(0);
}

/* --- NEW CARD SCHEDULE STYLES --- */

.schedule-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.schedule-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.card-delete-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.card-delete-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.card-time-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
    user-select: none;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    transition: all 0.2s;
}

.dropdown-trigger:hover {
    opacity: 0.8;
}

/* Hidden menu template in the DOM */
.dropdown-menu-template {
    display: none;
}

/* Global Portal for Dropdowns */
#dropdown-portal {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 9999;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    animation: fadeIn 0.1s ease-out;
}

#dropdown-portal.show {
    display: block;
}

.dropdown-option {
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    cursor: pointer;
    text-align: center;
    color: var(--text-color);
    font-size: 0.95rem;
}

.dropdown-option:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.dropdown-option.selected {
    background-color: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
}

/* Context Specific Dropdown Styles */
.member-form-dropdown {
    width: 100%;
}

.member-form-dropdown .dropdown-trigger {
    width: 100%;
    height: 38px;
    padding: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 400;
    justify-content: space-between;
}

.member-form-dropdown .dropdown-trigger:hover {
    border-color: var(--primary-color);
    opacity: 1;
}

.day-dropdown {
    width: 42px;
    height: 42px;
}

.day-dropdown .dropdown-trigger {
    width: 100%;
    height: 100%;
    background: #e0e7ff;
    border-radius: 10px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
}

.day-dropdown .dropdown-menu {
    min-width: 50px;
}

.time-min-dropdown {
    display: inline-block;
}

.time-min-dropdown .dropdown-trigger {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 32px;
}

.large-time-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.time-unit {
    display: flex;
    align-items: baseline;
}

.time-num-lg {
    border: none;
    font-size: 1.4rem;
    font-weight: 700;
    width: 40px;
    text-align: right;
    color: #1e293b;
    background: transparent;
}

.time-num-lg:focus {
    outline: none;
    color: var(--primary-color);
}

.time-colon {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 1px;
    color: #1e293b;
}

.time-dash {
    font-size: 1.2rem;
    font-weight: 400;
    color: #94a3b8;
    margin: 0 0.25rem;
}

/* Info Row */
.card-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pill-input-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pill-input-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    white-space: nowrap;
    margin: 0;
}

.pill-input-group input {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    width: 100px;
    color: #334155;
    transition: all 0.2s;
}

.pill-input-group input:focus {
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px #e0e7ff;
}

/* Coach Dropdown in Schedule Card */
.coach-dropdown {
    min-width: 100px;
}

.coach-dropdown .dropdown-trigger {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    color: #334155;
    transition: all 0.2s;
    min-width: 80px;
    justify-content: space-between;
}

.coach-dropdown .dropdown-trigger:hover {
    background: #e2e8f0;
}

.coach-dropdown .dropdown-trigger::after {
    content: '▼';
    font-size: 0.6rem;
    color: #64748b;
    margin-left: 0.5rem;
}

.coach-dropdown .dropdown-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill-toggle-group {
    margin-left: auto;
    /* Push to right */
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 110px;
}

.pill-toggle-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    margin: 0;
}

.badge-date {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.badge-date:hover {
    background: #dbeafe;
    box-shadow: 0 0 0 2px #bfdbfe;
}

/* Ticket Chip Checkboxes */
.ticket-checkbox-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ticket-check-item {
    position: relative;
}

.ticket-check-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ticket-check-item span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.ticket-check-item:hover span {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.ticket-check-item input:checked+span {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* === Loading Bar Component === */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Loading Container - spinner directly on overlay */
.modal-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.modal-loading-container .loading-spinner {
    width: 50px;
    height: 50px;
}

/* Page Loading Container - for page transitions */
.page-loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    gap: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* === Progress Bar for Inline Loading === */

.progress-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    z-index: 1000;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #818cf8, var(--primary-color));
    background-size: 200% 100%;
    animation: progressShimmer 1.5s ease-in-out infinite;
    width: 0;
    transition: width 0.3s ease;
}

.progress-bar.indeterminate {
    width: 100%;
    animation: progressIndeterminate 0.5s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes progressIndeterminate {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Timeline Loading Bar (below header) */
.timeline-loading-bar {
    position: relative;
    top: auto;
    margin: 0;
    height: 3px;
    flex-shrink: 0;
}

/* Global Loading Bar (below top-bar) */
.global-loading-bar {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 100;
}

/* Skeleton Text Animation */
.skeleton-text {
    display: inline-block;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* === Skeleton Loader for Cards === */

.skeleton-card {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* === Content Loading State === */

.content-loading {
    position: relative;
    min-height: 200px;
}

.content-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.content-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 11;
}

/* === Sync Status Indicator === */

.sync-indicator {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sync-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.sync-indicator.syncing {
    color: var(--primary-color);
}

.sync-indicator.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

.sync-indicator.success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.sync-indicator.error {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* === Timeline Loading Skeleton === */

.timeline-skeleton {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.day-column-skeleton {
    flex: 1;
    min-width: 150px;
}

.day-header-skeleton {
    height: 56px;
    background: #f1f5f9;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 1rem;
}

.class-card-skeleton {
    height: 80px;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
}

/* === Optimistic UI Feedback === */

.card-saving {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.card-saving::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.card-error {
    border: 2px solid var(--danger-color) !important;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* === Member Management Page === */

.member-page-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.member-filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.filter-dot.risk {
    background-color: #ef4444;
}

.filter-dot.target {
    background-color: #f59e0b;
}

.filter-tab.active .filter-dot {
    background-color: white;
}

.member-search-box {
    position: relative;
    min-width: 280px;
}

.member-search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

.member-search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.member-search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Member Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.member-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.member-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
}

.member-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.member-avatar.risk,
.member-avatar.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.member-avatar.target,
.member-avatar.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.member-avatar.normal {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.member-avatar.green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.member-avatar.gray {
    background: linear-gradient(135deg, #64748b, #475569);
}

.member-basic-info {
    flex: 1;
    min-width: 0;
}

.member-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.member-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.member-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.member-card-body {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.member-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.member-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.stat-value.warning {
    color: var(--danger-color);
}

.d-day {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.25rem;
    background: var(--bg-color);
    color: var(--text-muted);
}

.d-day.expired {
    background: #fee2e2;
    color: #991b1b;
}

.d-day.today {
    background: #fef3c7;
    color: #92400e;
}

.d-day.soon {
    background: #fef3c7;
    color: #92400e;
}

.member-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.member-list-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.member-list-empty-state p {
    margin-top: 1rem;
}

/* === Member Detail Modal === */

.member-detail-modal {
    max-width: 900px;
}

.member-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.member-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.member-avatar-lg.risk {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.member-avatar-lg.target {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.member-avatar-lg.normal {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.member-detail-name {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.member-detail-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.member-detail-grid {
    max-height: 60vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-color);
}

.section-title .material-symbols-outlined {
    font-size: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-value {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Ticket Card */
.ticket-card {
    background: linear-gradient(135deg, #f8fafc, #e0e7ff);
    border-radius: var(--radius);
    padding: 1rem;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.ticket-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.ticket-count small {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.ticket-expiry {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ticket-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.ticket-progress {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ticket-progress.warning {
    background: var(--warning-color);
}

.ticket-progress.danger {
    background: var(--danger-color);
}

.ticket-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.ticket-actions .btn {
    flex: 1 1 auto;
    white-space: nowrap;
    min-width: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Hold Status */
.ticket-card.on-hold {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid var(--warning-color);
}

.hold-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--warning-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

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

/* Transfer Modal */
.member-search-item.selected,
.transfer-member-item.selected {
    background: var(--primary-light);
    border-left: 3px solid var(--primary-color);
}

.transfer-member-item:hover {
    background: #f8fafc;
}

.transfer-member-item:last-child {
    border-bottom: none;
}

/* Enrolled Classes */
.enrolled-classes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.enrolled-class-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

.class-color-bar {
    width: 4px;
    height: 36px;
    border-radius: 2px;
}

.enrolled-class-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.enrolled-class-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.enrolled-class-schedule {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.no-classes {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Memo Box */
.memo-box {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 60px;
}

.memo-box.empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Timeline */
.timeline-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.timeline-header .section-title {
    margin: 0;
    padding: 0;
    border: none;
}

.timeline-list {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
    padding-right: 0.5rem;
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-left: 2px solid var(--border-color);
    margin-left: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -5px;
    top: 1rem;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.timeline-content {
    flex: 1;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.timeline-type {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.timeline-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.no-timeline {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Contact Options */
.contact-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Consultation Modal */
.consultation-modal-overlay {
    z-index: 1001;
}

.consultation-modal-overlay .modal {
    z-index: 1002;
}

.contact-modal-overlay {
    z-index: 1001;
}

.contact-modal-overlay .modal {
    z-index: 1002;
}

/* Form Control for Select */
select.form-control {
    width: 100%;
    padding: 0.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    cursor: pointer;
}

textarea.form-control {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

/* === Settings Page === */

.settings-page {
    display: flex;
    gap: 1.5rem;
    height: 100%;
}

.settings-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.settings-nav-item:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.settings-nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

.settings-nav-item .material-symbols-outlined {
    font-size: 20px;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

.settings-card {
    display: flex;
    flex-direction: column;
}

.settings-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-card-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.settings-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.settings-card-body {
    padding: 1.5rem;
    flex: 1;
}

.settings-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.settings-preview .material-symbols-outlined {
    font-size: 18px;
}

/* Field Settings List */
.field-settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.field-setting-item.enabled {
    background: white;
    border-color: var(--border-color);
}

.field-setting-item.disabled {
    opacity: 0.6;
}

.field-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.field-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.field-badge {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-weight: 500;
}

.field-badge.required {
    background: #fee2e2;
    color: #991b1b;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:disabled+.slider {
    background-color: var(--primary-color);
    opacity: 0.6;
    cursor: not-allowed;
}

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

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.setting-section-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.setting-label {
    font-weight: 500;
    font-size: 0.95rem;
}

.setting-description {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Radio Card Group */
.radio-card-group {
    display: flex;
    gap: 0.75rem;
}

.radio-card {
    flex: 1;
    position: relative;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card:hover {
    border-color: var(--primary-color);
}

.radio-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.radio-card-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.radio-card-example {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

.radio-check {
    margin-left: auto;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s;
}

.radio-card.selected .radio-check {
    opacity: 1;
}

/* Phone Test Box */
.phone-test-box {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.phone-test-input {
    flex: 1;
}

.phone-test-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-value {
    font-family: monospace;
    font-weight: 500;
    color: var(--primary-color);
}

/* Coming Soon Placeholder */
.coming-soon-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.coming-soon-placeholder .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* === Member Form Modal === */

.member-form-modal {
    max-width: 800px;
}

.member-form {
    padding: 1.5rem 1.75rem;
    max-height: 65vh;
    overflow-y: auto;
}

.member-form .form-group {
    margin-bottom: 0;
}

.member-form .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.member-form .form-control {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.member-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.member-form .form-control::placeholder {
    color: #a0aec0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1rem;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.required-mark {
    color: var(--danger-color);
    margin-left: 0.25rem;
}

/* Gender Toggle */
.gender-toggle {
    display: flex;
    gap: 0.5rem;
}

.gender-option {
    flex: 1;
    position: relative;
}

.gender-option input {
    position: absolute;
    opacity: 0;
}

.gender-option span {
    display: block;
    padding: 0.65rem 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    background: white;
}

.gender-option input:checked+span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.gender-option:hover span {
    border-color: var(--primary-color);
}

/* Member Header Actions */
.member-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Danger Button Styles */
.btn-outline.danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-outline.danger:hover {
    background: var(--danger-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
}

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

/* Confirm Modal Overlay */
.confirm-modal-overlay {
    z-index: 1001;
}

.confirm-modal-overlay .modal {
    z-index: 1002;
}

/* Responsive Settings */
@media (max-width: 768px) {
    .settings-page {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
    }

    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .settings-nav-item {
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .radio-card-group {
        flex-direction: column;
    }

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

    .form-grid .form-group.full-width {
        grid-column: auto;
    }

    .member-header {
        flex-direction: column;
        gap: 1rem;
    }

    .member-header-actions {
        width: 100%;
        flex-direction: column;
    }

    .member-search-box {
        width: 100%;
        min-width: auto;
    }

    .member-header-actions .btn {
        width: 100%;
    }
}

/* Checkbox Label Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-text {
    user-select: none;
}

.form-hint {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Text color utilities */
.text-success {
    color: var(--success-color);
    font-weight: 500;
}

.text-muted {
    color: var(--text-muted);
}

/* Birth input with age display */
.birth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.birth-input-wrapper .form-control {
    flex: 1;
    padding-right: 6rem;
}

.age-display {
    position: absolute;
    right: 0.75rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    background: var(--primary-light);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}

/* SMS Consent Toggle Switch */
.sms-consent-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.sms-consent-group .toggle-switch-label {
    flex-shrink: 0;
}

.toggle-switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

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

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-color);
}

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

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
}

.toggle-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.toggle-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Attendance Buttons */
.attendance-member-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attendance-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.attendance-member-item:hover {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.attendance-member-item .member-info {
    cursor: pointer;
    flex: 1;
}

.attendance-member-item .member-info-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.attendance-member-item .member-name {
    font-weight: 600;
    color: var(--text-color);
}

.attendance-member-item .member-info-bottom {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
}

.attendance-buttons {
    display: flex;
    gap: 0.5rem;
}

.attendance-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.attendance-btn:hover {
    background: #f1f5f9;
}

.attendance-btn.present:hover,
.attendance-btn.present.active {
    background-color: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

.attendance-btn.absent:hover,
.attendance-btn.absent.active {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.attendance-btn .material-symbols-outlined {
    font-size: 20px;
}

/* === SmartRule Styles === */

/* SmartRule Tags */
.smart-rule-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.smart-rule-tag.smart-rule-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.smart-rule-tag.smart-rule-orange {
    background-color: #fef3c7;
    color: #92400e;
}

.smart-rule-tag.smart-rule-green {
    background-color: #dcfce7;
    color: #166534;
}

.smart-rule-tag.smart-rule-gray {
    background-color: #f1f5f9;
    color: #475569;
}

/* SmartRule Flag */
.smart-rule-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    cursor: help;
}

.smart-rule-flag .flag-icon {
    font-size: 1rem;
}

.smart-rule-flag.red .flag-icon {
    color: #ef4444;
}

.smart-rule-flag.orange .flag-icon {
    color: #f59e0b;
}

.smart-rule-flag.green .flag-icon {
    color: #22c55e;
}

.smart-rule-flag.gray .flag-icon {
    color: #64748b;
}

/* SmartRule Tooltip */
.smart-rule-tooltip {
    position: relative;
}

.smart-rule-tooltip .tooltip-content {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}

.smart-rule-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* SmartRule Settings Card */
.smart-rule-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.smart-rule-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.smart-rule-card.disabled {
    opacity: 0.5;
}

.smart-rule-card .rule-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.smart-rule-card .rule-color-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.smart-rule-card .rule-color-badge.red {
    background: #ef4444;
}

.smart-rule-card .rule-color-badge.orange {
    background: #f59e0b;
}

.smart-rule-card .rule-color-badge.green {
    background: #22c55e;
}

.smart-rule-card .rule-color-badge.gray {
    background: #64748b;
}

.smart-rule-card .rule-name {
    font-weight: 600;
    color: var(--text-color);
}

.smart-rule-card .rule-conditions {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.smart-rule-card .rule-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* SmartRule Edit Modal */
.smart-rule-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.smart-rule-edit-form .color-selector {
    display: flex;
    gap: 0.5rem;
    padding-left: 4px;
}

.smart-rule-edit-form .color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-rule-edit-form .color-option:hover {
    transform: scale(1.1);
}

.smart-rule-edit-form .color-option.selected {
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px var(--surface-color), 0 0 0 4px var(--primary-color);
}

.smart-rule-edit-form .color-option.red {
    background: #ef4444;
}

.smart-rule-edit-form .color-option.orange {
    background: #f59e0b;
}

.smart-rule-edit-form .color-option.green {
    background: #22c55e;
}

.smart-rule-edit-form .color-option.gray {
    background: #64748b;
}

/* Condition Builder */
.condition-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.condition-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--bg-color);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.condition-item select,
.condition-item input {
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
}

.condition-item select {
    flex: 1;
    min-width: 100px;
}

.condition-item input[type="number"] {
    width: 70px;
}

.condition-item .remove-condition-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--danger-color);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.condition-item .remove-condition-btn:hover {
    background: #fee2e2;
}

.add-condition-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

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

/* Logic Toggle */
.logic-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.logic-toggle label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.logic-toggle-btn {
    display: flex;
    gap: 0;
}

.logic-toggle-btn button {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logic-toggle-btn button:first-child {
    border-radius: 6px 0 0 6px;
}

.logic-toggle-btn button:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.logic-toggle-btn button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Member List with SmartRule Highlight */
.member-list-item.has-rules {
    border-left: 3px solid var(--warning-color);
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), transparent);
}

.member-list-item .rule-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

/* Filter tabs for SmartRule */
.smart-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.smart-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.smart-filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.smart-filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.smart-filter-tab .filter-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.smart-filter-tab .filter-count {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Add Rule Button */
.add-rule-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 0.5rem;
}

.add-rule-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ========================= */
/* Sales Analysis Page Styles */
/* ========================= */

.sales-analysis-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem;
}

.sales-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.sales-row-3col {
    grid-template-columns: repeat(3, 1fr);
}

.sales-card {
    padding: 1.5rem;
}

.sales-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hero Card - Monthly Revenue */
.sales-hero-card {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: white;
}

.sales-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.sales-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.sales-hero-value {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.sales-big-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.sales-change {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.sales-change.positive {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.sales-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.sales-sublabel {
    font-size: 0.8rem;
    opacity: 0.7;
}

.sales-yoy {
    text-align: right;
}

.sales-yoy-label {
    font-size: 0.8rem;
    opacity: 0.7;
    display: block;
}

.sales-yoy-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.sales-yoy-value.positive {
    color: #86efac;
}

.sales-chart-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
}

.sales-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sales-chart-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.sales-chart-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.current {
    background: #fff;
}

.legend-dot.lastyear {
    background: rgba(255, 255, 255, 0.5);
}

.sales-chart-wrapper {
    height: 200px;
}

/* Breakdown Card */
.sales-breakdown-card {
    display: flex;
    flex-direction: column;
}

.breakdown-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.breakdown-item.total {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
}

.breakdown-label {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.breakdown-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.breakdown-value.danger {
    color: var(--danger-color);
}

.breakdown-sub-items {
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.breakdown-sub-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.breakdown-sub-label {
    color: var(--text-muted);
    font-family: monospace;
}

.breakdown-sub-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.change-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.change-badge.positive {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.change-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.breakdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0;
}

.breakdown-secondary .breakdown-item {
    padding: 0.5rem 0;
}

.breakdown-margin {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: auto;
}

.margin-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.margin-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.margin-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.margin-change.positive {
    color: var(--success-color);
}

/* Class Analysis Card */
.sales-class-card {
    display: flex;
    flex-direction: column;
    max-height: 450px;
}

.sales-class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sales-class-filters {
    display: flex;
    gap: 0.5rem;
}

.sales-class-filters select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

.class-analysis-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.class-analysis-item {
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.class-analysis-item:hover {
    box-shadow: var(--shadow);
}

.class-analysis-item.status-up {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.3);
}

.class-analysis-item.status-down {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
}

.class-analysis-item.status-stable {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
}

.class-analysis-item.status-normal-up {
    background: rgba(34, 197, 94, 0.03);
    border-color: rgba(34, 197, 94, 0.2);
}

.class-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.class-status-icon {
    font-size: 1.1rem;
}

.class-name {
    font-weight: 600;
    font-size: 1rem;
}

.class-schedule {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

.class-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.class-revenue-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.class-revenue {
    font-size: 1.1rem;
    font-weight: 600;
}

.class-vs {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.class-change {
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: auto;
}

.class-change.positive {
    color: var(--success-color);
}

.class-change.negative {
    color: var(--danger-color);
}

.class-range-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.range-label {
    color: var(--text-muted);
}

.range-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    position: relative;
    display: flex;
    align-items: center;
}

.range-fill {
    position: absolute;
    height: 12px;
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    top: -3px;
}

.range-min,
.range-max {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.class-instructor {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.instructor-name {
    color: var(--text-color);
    font-weight: 500;
}

.class-insight {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(79, 70, 229, 0.05);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.insight-icon {
    flex-shrink: 0;
}

.insight-text {
    color: var(--text-muted);
    line-height: 1.4;
}

/* Member Segments Card */
.sales-member-card {
    display: flex;
    flex-direction: column;
}

.member-segments {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.member-segment {
    padding: 1rem;
    border-radius: 10px;
}

.member-segment.new {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.member-segment.renewal {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.member-segment.vip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.segment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.segment-icon {
    font-size: 1.1rem;
}

.segment-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.segment-percent {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.segment-change {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 600;
}

.segment-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.segment-amount {
    font-size: 1.35rem;
    font-weight: 700;
}

.segment-details {
    display: flex;
    gap: 1rem;
}

.segment-detail {
    font-size: 0.8rem;
}

.detail-label {
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.detail-value {
    font-weight: 500;
}

.segment-change.positive {
    color: var(--success-color);
}

.segment-change.negative {
    color: var(--danger-color);
}

/* Daily Goal Card */
.sales-daily-card {
    display: flex;
    flex-direction: column;
}

.daily-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.daily-progress-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.daily-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.time-icon {
    font-size: 1rem;
}

.time-value {
    font-weight: 600;
}

.time-progress {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.daily-numbers {
    display: flex;
    gap: 1.5rem;
}

.daily-number {
    display: flex;
    flex-direction: column;
}

.number-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.number-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.number-value.warning {
    color: var(--warning-color);
}

.daily-progress-bar {
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #6366f1);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-label {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.daily-suggestions {
    background: rgba(79, 70, 229, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.suggestions-title {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.suggestions-list {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.suggestions-list li {
    padding: 0.25rem 0;
}

.suggestions-list li::before {
    content: '•';
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.daily-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.history-items {
    display: flex;
    gap: 0.75rem;
}

.history-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--bg-color);
}

.history-item.achieved {
    background: rgba(34, 197, 94, 0.1);
}

.history-item.missed {
    background: rgba(239, 68, 68, 0.1);
}

.history-day {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.history-status {
    font-size: 0.9rem;
}

/* Mini Cards */
.sales-mini-card {
    padding: 1.25rem;
}

.sales-mini-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.composition-chart {
    height: 120px;
    margin-bottom: 0.75rem;
}

.composition-legend {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.comp-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.comp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.comp-dot.membership {
    background: #4f46e5;
}

.comp-dot.pt {
    background: #22c55e;
}

.comp-dot.products {
    background: #f59e0b;
}

.liability-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.liability-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.liability-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.liability-value {
    font-weight: 600;
}

.liability-value.warning {
    color: var(--warning-color);
}

.key-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.key-metric {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 50px;
}

.metric-value {
    font-weight: 600;
    font-size: 1rem;
}

.metric-change {
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: auto;
}

.metric-change.positive {
    color: var(--success-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .sales-row {
        grid-template-columns: 1fr;
    }

    .sales-row-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sales-row-3col {
        grid-template-columns: 1fr;
    }

    .sales-big-number {
        font-size: 2rem;
    }

    .daily-numbers {
        flex-wrap: wrap;
    }
}

/* === Ticket Management Styles === */

.ticket-manage-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticket-manage-card {
    display: flex;
    align-items: stretch;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.ticket-manage-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.ticket-manage-card.inactive {
    opacity: 0.6;
    background: #f8fafc;
}

.ticket-color-bar {
    width: 6px;
    flex-shrink: 0;
}

.ticket-info {
    flex: 1;
    padding: 1rem;
    cursor: pointer;
}

.ticket-name-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.ticket-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.ticket-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-type-badge.count {
    background: #e0e7ff;
    color: #4f46e5;
}

.ticket-type-badge.unlimited {
    background: #fef3c7;
    color: #92400e;
}

.ticket-type-badge.period {
    background: #dcfce7;
    color: #166534;
}

.ticket-details {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ticket-divider {
    color: #cbd5e1;
}

.ticket-price {
    font-weight: 600;
    color: var(--text-color);
}

.ticket-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.ticket-manage-card .ticket-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-left: 1px solid var(--border-color);
    background: #fafafa;
}

/* Ticket Type Select in Modal */
.ticket-type-select {
    display: flex;
    gap: 0.75rem;
}

.ticket-type-select .radio-card {
    flex: 1;
}

.ticket-type-select .radio-card-content {
    text-align: center;
}

.ticket-type-select .radio-card-example {
    font-size: 0.7rem;
}

/* Ticket Color Selector */
.ticket-color-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-left: 4px;
}

.ticket-color-selector .color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}

.ticket-color-selector .color-option:hover {
    transform: scale(1.1);
}

.ticket-color-selector .color-option.selected {
    border-color: #1e293b;
    box-shadow: 0 0 0 2px white, 0 0 0 4px currentColor;
}

/* === Assign Ticket Modal (Member Detail) === */

.assign-ticket-modal {
    width: 520px;
}

.ticket-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.ticket-option-card {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    min-height: 120px;
    overflow: hidden;
}

.ticket-option-card:hover {
    border-color: var(--primary-color);
    background: #faf5ff;
}

.ticket-option-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.ticket-option-color {
    width: 8px;
    flex-shrink: 0;
}

.ticket-option-content {
    flex: 1;
    padding: 1rem;
}

.ticket-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.ticket-option-name {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ticket-option-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.ticket-option-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ticket-option-detail {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ticket-option-detail .material-symbols-outlined {
    font-size: 1rem;
}

.ticket-option-desc {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Add Ticket Button in Member Detail */
.add-ticket-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

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

.add-ticket-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* No Ticket State */
.no-ticket-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.no-ticket-state .material-symbols-outlined {
    font-size: 3rem;
    color: #cbd5e1;
    display: block;
    margin-bottom: 0.75rem;
}

.no-ticket-state p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Ticket Policy Modal */
.excluded-class-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: #f8fafc;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.excluded-class-chip:hover {
    border-color: var(--primary-color);
    background: #faf5ff;
}

.excluded-class-chip.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.policy-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
}

/* =========================================
   Refactored Inline Styles (2024-12-06)
   ========================================= */

/* Utilities */
.icon-md {
    font-size: 18px;
}

.icon-sm {
    font-size: 16px;
}

.mr-1 {
    margin-right: 4px;
}

.full-width {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-white {
    color: white;
}

.bg-danger {
    background: var(--danger-color);
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.align-center {
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.p-v-1 {
    padding: 1rem 0;
}

/* Empty States */
.empty-state-container {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.empty-state-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 0.5rem;
}

/* Modals */
.modal-w-500 {
    width: 500px !important;
    max-width: 90%;
}

.modal-w-480 {
    width: 480px !important;
    max-width: 90%;
}

.modal-w-360 {
    width: 360px !important;
    max-width: 90%;
}

.modal-scroll-body {
    max-height: 60vh;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Staff List */
.staff-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.staff-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.staff-name-row {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.staff-role-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.staff-phone-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.staff-meta-row {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

.icon-btn-padding {
    padding: 0.4rem 0.75rem;
}

.role-option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
}

.color-item-check {
    color: white;
    font-size: 16px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Ticket Policy Modal (Refactored) */
.policy-modal-lg {
    max-width: 800px;
}

.policy-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: 0.5rem;
}

.policy-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.policy-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.policy-icon-primary {
    color: var(--primary-color);
}

.policy-icon-warning {
    color: var(--warning-color);
}

.policy-control-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.policy-switch {
    transform: scale(0.9);
}

.policy-text-sm {
    font-size: 0.9rem;
}

.policy-label-row {
    margin-bottom: 0.75rem;
}

.policy-label-title {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.policy-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.policy-input-wrapper-sm {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.policy-input-mini {
    width: 70px;
    padding: 0.4rem;
}

.policy-input-micro {
    width: 60px;
    padding: 0.4rem;
}

.policy-text-xs {
    font-size: 0.8rem;
}

.policy-hint-text {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.excluded-classes-list-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: 160px;
    overflow-y: auto;
}

.policy-chip-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.policy-empty-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.policy-modal-footer {
    padding-top: 0.75rem;
}

.policy-columns-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.policy-form-group-compact {
    margin-bottom: 0;
}

/* Utilities (Added for Member Register Refactoring) */
.mb-6 {
    margin-bottom: 1.5rem;
}

.icon-xs {
    font-size: 14px;
}

.icon-xl {
    font-size: 48px;
}

.align-middle {
    vertical-align: middle;
}

.mr-auto {
    margin-right: auto;
}

.input-disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.text-danger {
    color: var(--danger-color);
}

.my-3 {
    margin: 1rem 0;
}

.text-sm {
    font-size: 0.85rem;
}

.p-4 {
    padding: 2rem;
}

.d-none {
    display: none;
}

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

.staff-phone-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

/* Transfer Modal Refactoring */
.transfer-count-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.input-icon-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.input-icon-absolute {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 20px;
}

.input-with-icon {
    padding-left: 2.5rem;
    width: 100%;
}

.search-results-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.transfer-member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
}

.transfer-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.transfer-empty-state {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.loading-min-h {
    min-height: 200px;
}

/* Dashboard & Message Popup Refactoring */
.schedule-list-scroll {
    max-height: 300px;
    overflow-y: auto;
}

.waiting-text {
    color: #d97706;
    font-weight: bold;
}

.chart-container-sm {
    height: 150px;
    margin-top: 1rem;
}

.grid-col-full {
    grid-column: 1 / -1;
}

.message-popup {
    position: fixed;
    bottom: 0;
    right: 24px;
    width: 500px;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    font-family: 'Google Sans', Roboto, sans-serif;
    transition: all 0.2s ease;
}

.popup-header {
    background: #404040;
    color: white;
    padding: 8px 8px 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
}

.popup-header-icon {
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.popup-header-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.popup-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.popup-field-row {
    display: flex;
    align-items: flex-start;
    padding: 8px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.popup-label {
    color: #5f6368;
    font-size: 14px;
    min-width: 40px;
    padding-top: 4px;
}

.recipients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    max-height: 72px;
    overflow-y: auto;
}

.recipient-chip {
    background: #e8eaed;
    padding: 4px 4px 4px 8px;
    border-radius: 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    color: #3c4043;
    cursor: default;
}

.recipient-avatar-xs {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a73e8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 6px;
}

.recipient-remove {
    cursor: pointer;
    margin-left: 4px;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
}

.recipient-remove:hover {
    background: #d3d3d3;
}

.popup-input-bare {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #202124;
    padding-top: 6px;
}

.popup-textarea {
    flex: 1;
    min-height: 200px;
    border: none;
    outline: none;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #202124;
    resize: none;
    font-family: inherit;
}

/* Channel Selection */
.popup-channel-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.channel-checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.channel-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.channel-checkbox-item:hover {
    background: #f1f3f4;
}

.channel-checkbox-item input[type="checkbox"] {
    display: none;
}

.channel-checkbox-item input[type="checkbox"]:checked+.channel-icon {
    opacity: 1;
    transform: scale(1.05);
}

.channel-checkbox-item input[type="checkbox"]:not(:checked)+.channel-icon {
    opacity: 0.4;
}

.channel-checkbox-item input[type="checkbox"]:checked~.channel-label {
    font-weight: 600;
    color: var(--text-color);
}

.channel-checkbox-item input[type="checkbox"]:not(:checked)~.channel-label {
    color: var(--text-muted);
}

.channel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s;
}

.channel-icon.kakao {
    background: #fee500;
    color: #3c1e1e;
}

.channel-icon.sms {
    background: #22c55e;
    color: white;
}

.channel-icon.app {
    background: #3b82f6;
    color: white;
}

.channel-icon .material-symbols-outlined {
    font-size: 20px;
}

.channel-label {
    font-size: 0.9rem;
    transition: all 0.2s;
}

.popup-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
}

.popup-send-btn {
    background: #0b57d0;
    color: white;
    border: none;
    border-radius: 18px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.popup-send-btn:hover {
    background: #0842a0;
}

.popup-tool-icon {
    font-size: 22px;
    color: #5f6368;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.popup-tool-icon:hover {
    background: #f1f3f4;
}

.popup-separator {
    width: 1px;
    height: 20px;
    background: #dadce0;
    margin: 0 8px;
}

/* Fix for Staff Management Styles */
.align-items-center {
    align-items: center;
}

.staff-role-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.staff-role-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    /* Default border, overridden by inline style for logic */
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
    background: white;
}

.staff-color-palette {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.staff-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.staff-color-option:hover {
    transform: scale(1.1);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-danger-outline:hover {
    background: var(--danger-color);
    color: white;
}

/* === Message Template Management === */

.template-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.template-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.template-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.template-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-default {
    background: var(--primary-light);
    color: var(--primary-color);
}

.template-actions {
    display: flex;
    gap: 0.25rem;
}

.template-smart-rule {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.template-card-body {
    padding: 1.25rem 1.5rem;
}

.template-subject {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.template-content {
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.template-card-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

/* Utility classes for template modal */
.icon-xl {
    font-size: 48px;
}

.text-danger {
    color: var(--danger-color);
}

.my-3 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Template Rule Selection */
.template-rule-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.template-rule-select .radio-card {
    cursor: pointer;
}

.template-rule-select .radio-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.template-rule-select .radio-card.disabled:hover {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.template-rule-select .radio-card.disabled .radio-card-title {
    color: var(--text-muted);
}

.template-rule-select .radio-card-content {
    gap: 0.5rem;
}

.rule-color-dot {
    flex-shrink: 0;
}