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

body {
    font-family: 'Microsoft JhengHei', '微軟正黑體', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    min-height: 100vh;
}

.page {
    display: none;
    min-height: 100vh;
    background-color: #ffffff;
}

.page.active {
    display: block;
}

/* Header 樣式 */
.header {
    display: flex;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
    margin-right: 30px;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
}

.logo-en {
    font-size: 12px;
    color: #666;
    letter-spacing: 1px;
}

.main-title {
    font-size: 36px;
    font-weight: bold;
    color: #000;
    font-family: serif;
    flex: 1;
}

.header-link {
    margin-left: auto;
}

.header-link a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.header-link a:hover {
    color: #333;
}

/* Content Area */
.content-area {
    padding: 40px;
    background-color: #ffffff;
}

.instruction {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Category Section */
.category-section {
    margin-top: 20px;
}

.category-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.category-btn {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 200px;
}

.category-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

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

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.back-btn {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-btn:hover {
    background-color: #f5f5f5;
    border-color: #0078d4;
    color: #0078d4;
    transform: translateX(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #666;
}

.search-box-frontend {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 15px;
    flex: 1;
    max-width: 400px;
}

.search-box-frontend .search-input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 0;
    margin: 0;
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.page-btn {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #0078d4;
    color: #0078d4;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Table */
.table-container {
    overflow-x: auto;
    background-color: #ffffff;
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    font-size: 14px;
}

.data-table thead {
    background-color: #1976d2;
}

.data-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    color: #ffffff;
    border-bottom: 2px solid #1565c0;
    white-space: nowrap;
    font-family: 'Microsoft JhengHei', '微軟正黑體', Arial, sans-serif;
}

.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e8e8e8;
    color: #333;
}

.data-table tbody tr {
    background-color: #fafafa;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

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

/* 增強表格樣式 - 帶顏色主題 */
.enhanced-table tbody tr {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.enhanced-table tbody tr.theme-blue {
    background: linear-gradient(90deg, #e3f2fd 0%, #ffffff 5%);
    border-left-color: #2196f3;
}

.enhanced-table tbody tr.theme-blue:hover {
    background: linear-gradient(90deg, #bbdefb 0%, #f5f5f5 5%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.enhanced-table tbody tr.theme-green {
    background: linear-gradient(90deg, #e8f5e9 0%, #ffffff 5%);
    border-left-color: #4caf50;
}

.enhanced-table tbody tr.theme-green:hover {
    background: linear-gradient(90deg, #c8e6c9 0%, #f5f5f5 5%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.enhanced-table tbody tr.theme-purple {
    background: linear-gradient(90deg, #f3e5f5 0%, #ffffff 5%);
    border-left-color: #9c27b0;
}

.enhanced-table tbody tr.theme-purple:hover {
    background: linear-gradient(90deg, #e1bee7 0%, #f5f5f5 5%);
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.2);
}

.enhanced-table tbody tr.theme-orange {
    background: linear-gradient(90deg, #fff3e0 0%, #ffffff 5%);
    border-left-color: #ff9800;
}

.enhanced-table tbody tr.theme-orange:hover {
    background: linear-gradient(90deg, #ffe0b2 0%, #f5f5f5 5%);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.enhanced-table tbody tr.theme-canceled {
    background: linear-gradient(90deg, #ffebee 0%, #ffffff 5%);
    border-left-color: #f44336;
    opacity: 0.8;
}

.enhanced-table tbody tr.theme-canceled:hover {
    background: linear-gradient(90deg, #ffcdd2 0%, #f5f5f5 5%);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

/* 表格欄位樣式 */
.enhanced-table thead {
    background: #1976d2;
    color: #ffffff;
}

.enhanced-table thead th {
    padding: 14px 10px;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #1565c0;
    white-space: nowrap;
    position: relative;
    font-family: 'Microsoft JhengHei', '微軟正黑體', Arial, sans-serif;
    color: #ffffff;
}

.enhanced-table thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.enhanced-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
}

.license-number-cell {
    font-weight: 600;
    color: #1976d2;
}

.product-name-cell {
    font-weight: 500;
    color: #333;
    max-width: 300px;
    word-break: break-word;
}

.qsd-cell {
    font-weight: 600;
    color: #7b1fa2;
    text-align: center;
}

.file-download-cell {
    text-align: center;
}

.file-link-icon {
    font-size: 20px;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.file-link-icon:hover {
    transform: scale(1.2);
}

.file-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffc107;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-download-btn:hover {
    background: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.file-download-btn .file-icon {
    font-size: 20px;
    display: block;
}

.file-download-cell {
    text-align: center;
}

.date-expired {
    color: #d32f2f !important;
    font-weight: 600;
    background: #ffebee;
    padding: 2px 6px;
    border-radius: 4px;
}

.date-warning {
    color: #f57c00 !important;
    font-weight: 600;
    background: #fff3e0;
    padding: 2px 6px;
    border-radius: 4px;
    position: relative;
}

.date-warning::after {
    content: '⚠️';
    margin-left: 4px;
    font-size: 14px;
}

.text-red {
    color: #c62828;
    font-weight: 500;
}

.file-link {
    color: #2196F3;
    text-decoration: none;
    font-size: 12px;
}

.file-link:hover {
    text-decoration: underline;
}

/* 紅色文字樣式 */
.text-red {
    color: #d32f2f;
}

/* 後台管理樣式 */
.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-size: 14px;
    color: #666;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

.admin-container {
    display: flex;
    min-height: calc(100vh - 80px);
    background-color: #ffffff;
}

.admin-sidebar {
    width: 200px;
    background-color: #f8f8f8;
    border-right: 1px solid #e0e0e0;
    padding: 20px 0;
}

.admin-nav {
    display: flex;
    flex-direction: column;
}

.nav-btn {
    background-color: transparent;
    border: none;
    padding: 15px 20px;
    text-align: left;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-btn:hover {
    background-color: #f0f0f0;
}

.nav-btn.active {
    background-color: #ffffff;
    border-left-color: #333;
    font-weight: bold;
}

.admin-content {
    flex: 1;
    padding: 30px;
    overflow-x: auto;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.add-btn {
    background-color: #333;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-btn:hover {
    background-color: #555;
}

.admin-controls {
    margin-bottom: 20px;
}

.admin-table .action-buttons {
    white-space: nowrap;
}

.edit-btn,
.delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
    transition: background-color 0.3s ease;
}

.edit-btn {
    background-color: #2196F3;
    color: #ffffff;
}

.edit-btn:hover {
    background-color: #1976D2;
}

.delete-btn {
    background-color: #f44336;
    color: #ffffff;
}

.delete-btn:hover {
    background-color: #d32f2f;
}

/* 模態框樣式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.close {
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #333;
}

.modal form {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

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

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

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    height: 40px;
    box-sizing: border-box;
}

.form-group input[type="date"] {
    cursor: pointer;
    background-color: #fff;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    padding: 4px;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

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

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

.file-link-selector {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.file-select {
    flex: 1;
}

.link-btn {
    background-color: #2196F3;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.link-btn:hover {
    background-color: #1976D2;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    position: sticky;
    bottom: 0;
    background-color: #ffffff;
}

.cancel-btn {
    background-color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cancel-btn:hover {
    background-color: #c82333;
    border-color: #c82333;
}

.save-btn {
    background-color: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.save-btn:hover {
    background-color: #0056b3;
}

.save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 檔案管理網格 */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.file-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.file-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.file-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.file-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-card-actions {
    display: flex;
    gap: 5px;
}

.file-card-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-card-btn:hover {
    color: #333;
}

.file-card-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.file-card-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    min-height: 40px;
}

.file-card-link {
    display: inline-block;
    color: #2196F3;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
}

.file-card-link:hover {
    text-decoration: underline;
}

/* Azure 登入按鈕樣式 */
.azure-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #8c8c8c;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.azure-login-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.azure-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* 登入頁面樣式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    padding: 20px;
}

.login-box {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.login-header .logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    margin-right: 0;
}

.login-header .logo-img {
    margin: 0 auto 8px auto;
}

.login-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-top: 15px;
}

.login-form {
    margin-top: 30px;
}

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

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

.login-form .form-group input[type="text"],
.login-form .form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #666;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: #333;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    background-color: #555;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Microsoft 登入按鈕樣式 */
.microsoft-login-btn {
    width: 100%;
    padding: 14px 24px;
    background-color: #ffffff;
    color: #333;
    border: 2px solid #8c8c8c;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.microsoft-login-btn:hover {
    background-color: #f5f5f5;
    border-color: #0078d4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.microsoft-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.microsoft-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.microsoft-login-btn svg {
    flex-shrink: 0;
}

.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #ffebee;
    border-radius: 4px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }
    
    .main-title {
        font-size: 28px;
        margin-top: 10px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .category-btn {
        width: 100%;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        max-width: 100%;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 4px;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .nav-btn {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-btn.active {
        border-left: none;
        border-bottom-color: #333;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .users-card-container {
        grid-template-columns: 1fr;
    }
}

/* 用戶管理卡片式設計 */
.section-subtitle {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
    font-weight: normal;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 20px;
}

.search-box .search-input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 0;
    margin: 0;
}

.users-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.user-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #0078d4;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.user-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 14px;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-body {
    flex: 1;
    margin-bottom: 15px;
}

.user-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.detail-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
}

.user-card-footer {
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.delete-btn-card {
    background: #ff5252;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
}

.delete-btn-card:hover {
    background: #d32f2f;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.info-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #bbdefb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.info-card-header h3 {
    font-size: 18px;
    color: #1976d2;
    margin: 0;
}

.info-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.info-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* 前台卡片式設計 */
.license-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.license-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.license-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #0078d4;
}

.license-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.license-number {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.card-icon {
    font-size: 20px;
}

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

.license-number strong {
    color: #333;
    font-size: 16px;
    word-break: break-all;
}

.status-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 10px;
}

.badge-canceled {
    background: #ffebee;
    color: #c62828;
}

.license-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-row {
    display: flex;
    gap: 15px;
}

.card-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.card-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.field-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.field-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.field-value {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

.field-value.text-red {
    color: #c62828;
    font-weight: 500;
}

.field-value.date-expired {
    color: #d32f2f;
    font-weight: 500;
}

.field-value .file-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

.field-value .file-link:hover {
    text-decoration: underline;
}

.card-canceled {
    opacity: 0.85;
    border-color: #ffcdd2;
}

.empty-state-frontend {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.empty-icon-frontend {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-frontend h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.empty-state-frontend p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .license-card-container {
        grid-template-columns: 1fr;
    }
    
    .card-row-2col {
        grid-template-columns: 1fr;
    }
    
    .search-box-frontend {
        max-width: 100%;
    }
    
    /* 分頁控制響應式 */
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 10px;
    }
    
    .page-btn {
        flex: 1;
        min-width: 80px;
        max-width: 120px;
        padding: 10px 12px;
        font-size: 14px;
        text-align: center;
        justify-content: center;
    }
    
    .page-info {
        flex: 1;
        min-width: 120px;
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 控制區域響應式 */
    .controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .back-btn {
        flex: 0 0 auto;
        min-width: 100px;
    }
    
    .search-box-frontend {
        flex: 1;
        min-width: 200px;
    }
}

/* 超小螢幕（手機） */
@media (max-width: 480px) {
    .pagination-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .page-btn {
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .page-info {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        order: -1; /* 將頁碼資訊放在最上面 */
    }
    
    .controls {
        flex-direction: column;
    }
    
    .back-btn {
        width: 100%;
    }
    
    .search-box-frontend {
        width: 100%;
        max-width: 100%;
    }
    
    /* 後台分頁響應式 */
    .pagination {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 15px 10px !important;
    }
    
    .pagination button {
        width: 100% !important;
        max-width: 200px;
        margin: 0 !important;
        padding: 10px 20px !important;
    }
    
    .pagination span {
        width: 100%;
        text-align: center;
        margin: 0 !important;
        padding: 8px;
        order: -1; /* 將頁碼資訊放在最上面 */
    }
}

