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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

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

.login-header h1 {
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

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

.existing-schedule-item {
    transition: all 0.2s;
}

.existing-schedule-item:hover {
    background: #f0f0f0 !important;
}

.login-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.login-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
    color: white;
    position: fixed;
    height: 100%;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #4a5568;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu li.active a {
    background: #667eea;
    color: white;
}

.sidebar-menu li.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.sidebar-overlay.show {
    display: block;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 20px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.top-bar-left h1 {
    font-size: 24px;
    color: #2d3748;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: #666;
    text-align: right;
}

.user-info #userName {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.user-email {
    font-size: 12px;
    color: #999;
}

.user-role {
    font-size: 12px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.calendar-header h2 {
    flex: 1;
    text-align: center;
    color: #2d3748;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 10px;
}

.weekday {
    text-align: center;
    padding: 10px;
    font-weight: 600;
    color: #666;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-day-row {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.calendar-day-row:hover {
    background: #f7fafc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calendar-day-row.today {
    background: #e6f7ff;
    border-color: #1890ff;
}

.day-info {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e2e8f0;
    margin-right: 15px;
}

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

.day-number {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    display: inline-block;
}

.day-weekday {
    display: inline-block;
    font-size: 13px;
    color: #666;
    margin-left: 12px;
    padding: 2px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.day-schedules {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.schedule-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    font-size: 15px;
}

.schedule-user-name {
    font-weight: 600;
    font-size: 16px;
}

.schedule-shift-name {
    font-size: 14px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.schedule-remark {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 5px;
}

.schedule-empty {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

.day-schedule {
    margin-top: 5px;
    font-size: 10px;
    color: #666;
}

.schedule-tag {
    display: flex;
    flex-direction: column;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 10px;
    color: white;
    margin-bottom: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-user {
    font-weight: 600;
    font-size: 9px;
}

.schedule-shift {
    font-size: 8px;
    opacity: 0.9;
}

.schedule-list {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.legend-item {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10002;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.data-table tr:hover {
    background: #f7fafc;
}

.data-table.small {
    font-size: 14px;
}

.data-table.small th,
.data-table.small td {
    padding: 8px;
}

.profile-container {
    display: grid;
    gap: 20px;
}

.profile-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.profile-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #2d3748;
}

.settings-container {
    display: grid;
    gap: 20px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.settings-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #2d3748;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stats-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stats-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #2d3748;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.shift-bar {
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.shift-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 10px;
    }
    
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
    }
    
    .sidebar-menu li {
        flex: 1;
        min-width: 100px;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .user-info {
        align-items: flex-start;
        text-align: left;
    }
    
    .calendar-container {
        padding: 10px;
    }
    
    .calendar-header {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .calendar-header h2 {
        font-size: 18px;
    }
    
    .calendar-grid {
        gap: 8px;
    }
    
    .calendar-day-row {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .day-info {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        margin-right: 0;
        margin-bottom: 10px;
        padding-bottom: 10px;
        width: 100%;
        justify-content: flex-start;
    }
    
    .day-date {
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 10px;
    }
    
    .day-number {
        font-size: 24px;
    }
    
    .day-weekday {
        display: inline;
        margin-top: 0;
    }
    
    .day-schedules {
        width: 100%;
    }
    
    .schedule-item {
        padding: 8px 12px;
        font-size: 14px;
        flex: 1;
        min-width: 200px;
        justify-content: center;
    }
    
    .schedule-user-name {
        font-size: 15px;
    }
    
    .schedule-shift-name {
        font-size: 13px;
    }
    
    .legend {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .legend-item {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .filter-bar {
        flex-wrap: wrap;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
        max-width: none;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
    }
}

@media (max-width: 480px) {
    .sidebar-header h2 {
        font-size: 16px;
    }
    
    .sidebar-menu li a {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .top-bar-left h1 {
        font-size: 20px;
    }
    
    .calendar-header h2 {
        font-size: 16px;
    }
    
    .calendar-day-row {
        padding: 10px;
    }
    
    .day-number {
        font-size: 22px;
    }
    
    .day-weekday {
        font-size: 13px;
    }
    
    .schedule-item {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 100%;
        justify-content: flex-start;
    }
    
    .schedule-user-name {
        font-size: 14px;
    }
    
    .schedule-shift-name {
        font-size: 12px;
    }
}

.back-to-top,
.scroll-to-bottom {
    position: fixed;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.back-to-top {
    bottom: 100px;
}

.scroll-to-bottom {
    bottom: 30px;
}

.back-to-top:hover,
.scroll-to-bottom:hover {
    background-color: #764ba2;
    transform: translateY(-5px);
}

.back-to-top.show,
.scroll-to-bottom.show {
    opacity: 1;
    visibility: visible;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.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: 24px;
}

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

input:checked + .slider {
    background-color: #667eea;
}

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

@media (max-width: 768px) {
    .back-to-top,
    .scroll-to-bottom {
        width: 45px;
        height: 45px;
        font-size: 20px;
        right: 20px;
    }
    
    .back-to-top {
        bottom: 90px;
    }
    
    .scroll-to-bottom {
        bottom: 20px;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 250px;
        height: 100vh;
        z-index: 10000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-header {
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .sidebar-header h2 {
        margin: 0;
    }
    
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
        background-color: #667eea;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 24px;
        cursor: pointer;
        z-index: 10001;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 60px;
    }
    
    .sidebar-menu {
        display: block;
    }
    
    .sidebar-menu li {
        flex: none;
        min-width: auto;
    }
    
    .sidebar-menu li a {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .top-bar {
        padding: 10px 15px;
    }
    
    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 9998;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-bottom-bar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #a0aec0;
        text-decoration: none;
        font-size: 11px;
        padding: 5px 0;
        transition: all 0.3s;
    }
    
    .mobile-bottom-bar a:hover,
    .mobile-bottom-bar a.active {
        color: #667eea;
    }
    
    .mobile-bottom-bar a.active {
        font-weight: 600;
    }
    
    .mobile-bottom-bar i {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .main-content {
        padding-bottom: 70px;
    }
}
