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

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #0A3D62 0%, #1A5276 100%);
    padding: 20px;
}

.login-form {
    background-color: #fff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1A5276;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #0A3D62 0%, #1A5276 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 82, 118, 0.4);
}

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

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

.btn-success {
    background-color: #52c41a;
    color: #fff;
}

.btn-success:hover {
    background-color: #73d13d;
}

.btn-danger {
    background-color: #ff4d4f;
    color: #fff;
}

.btn-danger:hover {
    background-color: #ff7875;
}

.btn-warning {
    background-color: #faad14;
    color: #fff;
}

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

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

.error-message {
    margin-top: 16px;
    padding: 10px 14px;
    background-color: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    color: #cf1322;
    font-size: 14px;
    text-align: center;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.success-message {
    margin-top: 16px;
    padding: 10px 14px;
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
    color: #389e0d;
    font-size: 14px;
    text-align: center;
}

.admin-container {
    height: 100vh;
    width: 100vw;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar {
    width: 100%;
    background-color: #001529;
    color: #fff;
    flex-shrink: 0;
    height: auto;
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid #002140;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.sidebar-nav {
    display: flex;
    align-items: center;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 22px;
    text-align: center;
    white-space: nowrap;
}

.sidebar-nav a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a.active {
    color: #fff;
    background-color: #1A5276;
}

.user-name-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    text-align: center;
    white-space: nowrap;
    margin-left: auto;
}

.sidebar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    padding-right: 16px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.top-nav {
    background-color: #fff;
    padding: 0 16px;
    height: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    flex-shrink: 0;
}

.top-nav h1 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-container {
    display: flex;
    gap: 16px;
    padding: 16px;
    flex-wrap: wrap;
}

.stat-card {
    background-color: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 600;
    color: #1A5276;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.activity-section {
    padding: 0 16px 16px;
}

.activity-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.activity-list {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    padding: 12px;
}

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

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

.activity-time {
    color: #999;
    font-size: 14px;
}

.content-section {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.search-bar {
    background-color: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    margin-bottom: 16px;
}

.search-bar form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.data-table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #333;
}

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

.pagination {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.action-bar {
    padding: 12px 16px;
    background-color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.action-bar .btn {
    width: auto;
}

.search-box {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.search-box input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.user-info {
    font-size: 14px;
    display: none;
}

.table-container {
    flex: 1;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    overflow: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.schedule-table th,
.schedule-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.schedule-table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.schedule-table tr:hover {
    background-color: #f5f5f5;
}

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

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

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

.modal-content .btn {
    margin-top: 10px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

.status-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.active {
    background-color: #f6ffed;
    color: #52c41a;
}

.status-tag.inactive {
    background-color: #fff1f0;
    color: #ff4d4f;
}

@media (max-width: 1024px) {
    .sidebar-nav ul {
        flex-wrap: wrap;
        overflow-x: visible;
    }
    
    .sidebar-nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .stats-container {
        gap: 12px;
        padding: 12px;
    }
    
    .stat-card {
        min-width: 120px;
        padding: 12px;
    }
    
    .stat-number {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar-header {
        padding: 10px 12px;
    }
    
    .sidebar-header h2 {
        font-size: 14px;
    }
    
    .sidebar-nav ul {
        justify-content: flex-start;
    }
    
    .sidebar-nav a {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .top-nav {
        height: 44px;
        min-height: 44px;
        padding: 0 12px;
    }
    
    .top-nav h1 {
        font-size: 14px;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .stat-card {
        min-width: 100%;
        padding: 12px;
    }
    
    .content-section {
        padding: 10px;
    }
    
    .action-bar {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .search-box {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .search-box input {
        flex: 1;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .data-table th,
    .data-table td,
    .schedule-table th,
    .schedule-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .login-form {
        padding: 30px 20px;
        max-width: 100%;
        margin: 10px;
    }
    
    .login-form h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .modal-content {
        width: 95%;
        padding: 16px;
        max-height: 90vh;
    }
    
    .avatar-preview {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .sidebar-nav a {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .top-nav h1 {
        font-size: 13px;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td,
    .schedule-table th,
    .schedule-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-bar .btn {
        width: 100%;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input,
    .search-box .btn {
        width: 100%;
    }
}

.form-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    max-width: 800px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

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

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 14px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .admin-container {
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: #001529;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .sidebar-header {
        padding: 8px 12px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: none;
    }
    
    .sidebar-header h2 {
        font-size: 16px;
        margin: 0;
        flex: 1;
        text-align: center;
    }
    
    .sidebar-nav {
        display: none;
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        background-color: #001529;
        border-top: 1px solid #002140;
        max-height: calc(100vh - 50px);
        overflow-y: auto;
    }
    
    .sidebar-nav.active {
        display: block;
    }
    
    .sidebar-nav ul {
        flex-direction: column;
        flex-wrap: nowrap;
    }
    
    .sidebar-nav li {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .sidebar-nav a {
        padding: 14px 16px;
        font-size: 16px;
        text-align: left;
        border-radius: 0;
    }
    
    .sidebar-nav a.active {
        background-color: #1A5276;
    }
    
    .sidebar-right {
        flex-direction: column;
        padding: 10px 16px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .sidebar-right button,
    .sidebar-right a {
        font-size: 14px !important;
        padding: 8px 0 !important;
        text-align: left !important;
    }
    
    .user-name-display {
        font-size: 14px;
        padding: 8px 0;
        margin-left: 0;
        text-align: left;
    }
}

.menu-toggle {
    display: none;
}

@media (max-width: 480px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 8px;
        cursor: pointer;
    }
    
    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background-color: #fff;
        border-radius: 1px;
    }
    
    .main-content {
        margin-top: 50px;
        height: calc(100vh - 50px);
        height: calc(100dvh - 50px);
        overflow-y: auto;
    }
    
    .top-nav {
        height: 44px;
        min-height: 44px;
        padding: 0 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }
    
    .top-nav h1 {
        font-size: 16px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .content-section {
        padding: 10px;
    }
    
    .search-bar {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .search-bar input {
        font-size: 14px;
        padding: 10px 12px;
        height: 44px;
    }
    
    .action-bar {
        padding: 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .action-bar .btn {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px;
        font-size: 14px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
        border-radius: 8px;
        margin-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table,
    .schedule-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td,
    .schedule-table th,
    .schedule-table td {
        padding: 10px 8px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .data-table th {
        font-size: 12px;
        font-weight: 600;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 14px;
        border-radius: 6px;
        min-height: 36px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 30px;
    }
    
    .form-container {
        padding: 16px;
        border-radius: 12px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 8px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 15px;
        padding: 12px;
        height: 44px;
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    .form-group textarea {
        height: auto;
        min-height: 80px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions .btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        height: 48px;
    }
    
    .stat-card {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
    
    .stat-number {
        font-size: 28px;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 14px;
        color: #666;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 100%;
        padding: 20px;
        border-radius: 12px;
        max-height: 90vh;
    }
    
    .login-container {
        padding: 20px;
    }
    
    .login-form {
        padding: 30px 20px;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    }
    
    .login-form h2 {
        font-size: 22px;
        margin-bottom: 24px;
    }
    
    .status-tag {
        padding: 4px 10px;
        font-size: 12px;
        border-radius: 20px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pagination .btn {
        min-width: 36px;
        height: 36px;
        padding: 0;
        font-size: 13px;
    }
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
}

.file-info {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
}

.checkbox-item input {
    width: auto;
}

.checkbox-item.selected {
    background-color: #e6f7ff;
    border: 1px solid #1890ff;
}

.tab-container {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 16px;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.tab-item:hover {
    color: #1A5276;
}

.tab-item.active {
    color: #1A5276;
    border-bottom-color: #1A5276;
    font-weight: 600;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #f0f0f0;
    border-top-color: #1A5276;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}
