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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f3f3f3;
    color: #1a1a1a;
    height: 100vh;
    overflow: hidden;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #009688;
    border-radius: 8px;
    margin-bottom: 12px;
}

.logo-icon.small {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    margin-bottom: 0;
}

.logo-text {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.logo-icon.small .logo-text {
    font-size: 12px;
}

.logo-img {
    height: 32px;
    width: auto;
    margin-right: 10px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 300;
    color: #1a1a1a;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #009688;
    box-shadow: 0 0 0 2px rgba(0,150,136,0.15);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-bar {
    background: #f8f9fa;
    color: #333;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 48px;
    flex-shrink: 0;
    z-index: 100;
    border-bottom: 1px solid #e0e0e0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.app-title {
    font-size: 16px;
    font-weight: 600;
}

.top-bar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    justify-content: flex-end;
}

.view-switcher {
    display: flex;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.view-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.view-btn.active {
    background: #009688;
    color: #fff;
    font-weight: 600;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-label {
    font-size: 16px;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.user-info {
    font-size: 13px;
    color: #555;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 220px;
    background: #2d2d2d;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 12px;
}

.sidebar-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 8px;
    padding: 0 4px;
}

.user-list {
    list-style: none;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #c0c0d0;
    transition: all 0.15s;
}

.user-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.user-item.active {
    background: rgba(0,150,136,0.25);
    color: #fff;
}

.user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-dot.all {
    background: #aaa;
}

.user-dot.Taiwan {
    background: #4caf50;
}

.user-dot.MainlandChina {
    background: #f44336;
}

.user-dot.Malaysia {
    background: #2196f3;
}

.content {
    flex: 1;
    overflow: auto;
    background: #fff;
}

.calendar-container {
    height: 100%;
}

.calendar-grid {
    height: 100%;
    position: relative;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:hover {
    background: #e8e8e8;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background: #009688;
    border-color: #009688;
    color: #fff;
}

.btn-primary:hover {
    background: #00796b;
    border-color: #00796b;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #80cbc4;
    border-color: #80cbc4;
}

/* Day view */
.day-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: auto;
}

.day-header {
    display: grid;
    grid-template-columns: 60px 1fr;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f8f8;
}

.day-header-cell {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: center;
}

.day-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.day-hour-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    border-bottom: 1px solid #f0f0f0;
    height: 48px;
}

.day-hour-label {
    padding: 2px 8px;
    font-size: 11px;
    color: #999;
    text-align: right;
    border-right: 1px solid #e0e0e0;
}

.day-hour-content {
    position: relative;
}

/* Week view */
.week-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid #e0e0e0;
    background: #f8f8f8;
    position: sticky;
    top: 0;
    z-index: 10;
}

.week-header-cell {
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-align: center;
    border-right: 1px solid #f0f0f0;
}

.week-header-cell.today {
    color: #ff9800;
}

.week-header-cell .day-num {
    display: block;
    font-size: 18px;
    font-weight: 400;
}

.week-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.week-hour-row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid #f0f0f0;
    height: 40px;
}

.week-hour-label {
    padding: 2px 8px;
    font-size: 11px;
    color: #999;
    text-align: right;
    border-right: 1px solid #e0e0e0;
}

.week-day-cell {
    border-right: 1px solid #f0f0f0;
    position: relative;
}

.week-day-cell.today {
    background: #fff8e1;
}

/* Month view */
.month-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 2px solid #e0e0e0;
    background: #f8f8f8;
}

.month-header-cell {
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: center;
}

.month-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.month-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    border-bottom: 1px solid #f0f0f0;
}

.month-day-cell {
    border-right: 1px solid #f0f0f0;
    padding: 4px;
    min-height: 80px;
    cursor: pointer;
    transition: background 0.15s;
    overflow: hidden;
}

.month-day-cell:hover {
    background: #f5f9ff;
}

.month-day-cell.other-month {
    background: #fafafa;
}

.month-day-cell.today {
    background: #fff8e1;
}

.month-day-num {
    font-size: 14px;
    color: #333;
    font-weight: 400;
}

.month-day-cell.today .month-day-num {
    background: #ff9800;
    color: #fff;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.month-day-cell.other-month .month-day-num {
    color: #bbb;
}

.month-schedule-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin: 1px;
}

.month-schedule-more {
    font-size: 10px;
    color: #009688;
    cursor: pointer;
}

/* Schedule blocks */
.schedule-block {
    position: absolute;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    z-index: 5;
    transition: opacity 0.15s;
    min-height: 20px;
    border-left: 3px solid;
}

.schedule-block:hover {
    opacity: 0.85;
}

.schedule-block .sched-time {
    font-size: 10px;
    opacity: 0.8;
}

.schedule-block .sched-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-block.location-Taiwan {
    background: #d4edda;
    color: #155724;
}

.schedule-block.location-MainlandChina {
    background: #ffd6d6;
    color: #7a1a1a;
}

.schedule-block.location-Malaysia {
    background: #cce5ff;
    color: #004085;
}

.day-grid-wrapper {
    position: relative;
}

.day-schedule-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.day-schedule-layer .schedule-block {
    pointer-events: auto;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 400;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
}

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

.modal-content form {
    padding: 20px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: #ececec;
    color: #888;
    cursor: not-allowed;
}

.radio-label input:disabled + span,
.radio-label input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #009688;
    box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}

.radio-group {
    display: flex;
    gap: 16px;
    padding: 4px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Detail modal */
.detail-content {
    padding: 20px;
}

.detail-field {
    margin-bottom: 12px;
}

.detail-field .detail-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
}

.detail-field .detail-value {
    font-size: 15px;
    color: #333;
    margin-top: 2px;
}

/* Chips */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: #f5f5f5;
}

.chip .chip-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chip-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}

.chip-delete:hover {
    color: #dc3545;
}

.chip-username {
    cursor: pointer;
}

.chip-username:hover {
    text-decoration: underline;
}

.chip-reset-pwd {
    background: none;
    border: none;
    cursor: pointer;
    color: #009688;
    font-size: 11px;
    padding: 0 4px;
    line-height: 1;
}

.chip-reset-pwd:hover {
    color: #00796b;
    text-decoration: underline;
}

.chip-filter {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
    vertical-align: middle;
}

.chip-filter .radio-label {
    font-size: 12px;
}

.chip.holiday-chip.Taiwan { border-color: #4caf50; background: #d4edda; color: #155724; }
.chip.holiday-chip.MainlandChina { border-color: #f44336; background: #ffd6d6; color: #7a1a1a; }
.chip.holiday-chip.Malaysia { border-color: #2196f3; background: #cce5ff; color: #004085; }

/* Holiday banners (day view) */
.holiday-banner {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 0;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 10px;
    z-index: 6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 18px;
    line-height: 16px;
    pointer-events: none;
}

.holiday-banner.Taiwan { background: #d4edda; border: 1px solid #4caf50; color: #155724; }
.holiday-banner.MainlandChina { background: #ffd6d6; border: 1px solid #f44336; color: #7a1a1a; }
.holiday-banner.Malaysia { background: #cce5ff; border: 1px solid #2196f3; color: #004085; }

/* Holiday tags (week view header) */
.holiday-tag {
    font-size: 9px;
    padding: 0 3px;
    border-radius: 2px;
    display: block;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.holiday-tag.Taiwan { background: #d4edda; color: #155724; }
.holiday-tag.MainlandChina { background: #ffd6d6; color: #7a1a1a; }
.holiday-tag.Malaysia { background: #cce5ff; color: #004085; }

/* Holiday bar (month view) */
.holiday-bar {
    font-size: 9px;
    padding: 0 4px;
    border-radius: 2px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 16px;
}

.holiday-bar.Taiwan { background: #d4edda; color: #155724; }
.holiday-bar.MainlandChina { background: #ffd6d6; color: #7a1a1a; }
.holiday-bar.Malaysia { background: #cce5ff; color: #004085; }

/* User admin */
.user-admin-section {
    padding: 20px;
}

.user-admin-section h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #333;
}

.existing-users {
    max-height: 200px;
    overflow-y: auto;
}

.existing-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.existing-user-item .user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-user-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
}

.delete-user-btn:hover {
    text-decoration: underline;
}

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 16px 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Weekend highlighting */
.weekend .week-day-cell,
.weekend.week-day-cell {
    background: #fafafa;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .sidebar {
        width: 180px;
    }
    .top-bar-center {
        gap: 8px;
    }
}

/* User list filter highlight */
.user-list-filter {
    font-size: 11px;
    color: #aaa;
    padding: 2px 8px;
}

/* Support hours modal table */
.support-hours-section {
    margin-bottom: 8px;
}

.support-hours-section:first-child h3 {
    margin-top: 0 !important;
}

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

.support-hours-table th,
.support-hours-table td {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.support-hours-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #555;
}

.support-hours-table tbody tr:hover {
    background: #fafafa;
}

.hours-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.hours-cell:hover {
    color: #009688;
    text-decoration: underline;
}

/* Admin badge in chip */
.admin-chip {
    border-color: #ff9800 !important;
}

.admin-badge {
    display: inline-block;
    font-size: 10px;
    color: #ff9800;
    font-weight: 600;
    margin-left: 2px;
}
