/* Base Styles */
:root {
    --primary-color: #4CAF50;    /* 主要顏色 */
    --primary-light: #81C784;    /* 淺綠色 */
    --secondary-color: #FFE0B2;  /* 次要顏色 */
    --tertiary-color: #90CAF9;   /* 第三顏色 */
    --text-color: #333;
    --border-color: #E0E0E0;
    --success-color: #43A047;    /* 成功顏色 */
    --warning-color: #FB8C00;    /* 警告顏色 */
    --danger-color: #E53935;     /* 危險顏色 */
    --offline-color: #757575;    /* 灰色顏色 */
    --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-tab {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    background: transparent;
    position: relative;
}

.nav-tab i {
    font-size: 18px;
}

.nav-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-tab.active {
    background: var(--primary-color);
    color: white;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

/* Withdraw Page */
.withdraw-container {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.withdraw-container h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.withdraw-container .form-group {
    margin-bottom: 25px;
}

.withdraw-container label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 500;
}

.withdraw-container select,
.withdraw-container input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.withdraw-container select:focus,
.withdraw-container input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.device-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
}

.amount-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.qr-button, .password-button, .direct-withdraw-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-button {
    background-color: var(--warning-color);
    color: white;
}

.qr-button:hover {
    background-color: #f39c12;
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

.password-button {
    background-color: var(--tertiary-color);
    color: #1565C0;
}

.password-button:hover {
    background-color: #64B5F6;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

.direct-withdraw-button {
    background-color: var(--danger-color);
    color: white;
}

.direct-withdraw-button:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

/* QR Code Display */
.qr-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
}

/* Navigation */
header {
    background-color: white;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

/* Forms */
form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

/* Records */
.records-container {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.records-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.records-tabs .tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.records-tabs .tab-button:hover {
    opacity: 1;
    color: var(--primary-color);
}

.records-tabs .tab-button.active {
    opacity: 1;
    color: var(--primary-color);
}

.records-tabs .tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.records-content {
    display: none;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.records-content.active {
    display: block;
}

.records-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.records-table th {
    background-color: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

.records-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.status-badge {
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.status-completed {
    background-color: var(--success-color);
    color: white;
}

.status-pending {
    background-color: var(--warning-color);
    color: white;
}

.status-failed {
    background-color: var(--danger-color);
    color: white;
}

/* Admin Interface */
.admin-container {
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-container h2 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.admin-tabs button {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.3s ease;
    position: relative;
}

.admin-tabs button:hover {
    opacity: 1;
    color: var(--primary-color);
}

.admin-tabs button.active {
    opacity: 1;
    color: var(--primary-color);
}

.admin-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* Device Management */
.devices-container {
    background-color: var(--tertiary-color);
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
}

/* 重置按鈕樣式 */
.reset-btn {
    background-color: #90CAF9;
    color: #1565C0;
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.reset-btn:hover {
    background-color: #42A5F5;
    color: white;
}

/* 補充鈔票和重置操作類型的樣式 */
.operation-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    background-color: #f0f0f0;
}

.operation-reset {
    background-color: #90CAF9;
    color: #1565C0;
}

.operation-refill {
    background-color: var(--primary-light);
    color: white;
}

.admin-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.admin-form .form-group {
    margin-bottom: 20px;
}

.admin-form input,
.admin-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.admin-form input:focus,
.admin-form select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(144, 238, 144, 0.2);
}

.admin-button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-button:hover {
    background-color: #7bc47b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 238, 144, 0.3);
}

.admin-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.device-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.device-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.device-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.edit-btn {
    background-color: var(--tertiary-color);
    color: #1565C0;
}

.edit-btn:hover {
    background-color: #64B5F6;
    color: white;
}

.delete-btn {
    background-color: #FFCDD2;
    color: #C62828;
}

.delete-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

.refill-btn {
    background-color: var(--primary-light);
    color: white;
}

.refill-btn:hover {
    background-color: var(--primary-color);
}

/* 表單輸入樣式 */
.input-with-icon i {
    width: 16px;
    text-align: center;
}

.device-info p span i {
    width: 16px;
    text-align: center;
    margin-right: 8px;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.device-header h4 {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
}

.device-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-online {
    background-color: var(--success-color);
}

.status-offline {
    background-color: var(--offline-color);
}

.status-error {
    background-color: var(--danger-color);
}

.device-info {
    margin-top: 20px;
    font-size: 14px;
}

.device-info p {
    margin: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

.device-info p:last-child {
    border-bottom: none;
}

.device-info p span:first-child {
    color: var(--text-color);
    opacity: 0.7;
}

.device-info p span:last-child {
    font-weight: 500;
}

.device-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.update-cash-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.update-cash-btn:hover {
    background-color: #7bc47b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 238, 144, 0.3);
}

.update-cash-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Tabs */
.tabs {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    color: var(--secondary-color);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-right: 1rem;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Device Cards */
.device-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.device-status {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
}

.device-status span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.device-status .online {
    background-color: var(--success-color);
}

.device-status .offline {
    background-color: var(--danger-color);
}

.device-status .unknown {
    background-color: var(--warning-color);
}

/* User Management */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.user-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.user-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.user-info {
    flex: 1;
}

.user-info p {
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
}

.user-info p:last-child {
    border-bottom: none;
}

.user-label {
    font-weight: bold;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 3px;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.user-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Search Input */
#user-search {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
    font-size: 1rem;
}

/* Form Container */
.form-container {
    margin-bottom: 2rem;
}

.form-container h2 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Status Indicators */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
}

.status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status.failed {
    background-color: #f8d7da;
    color: #721c24;
}

.status.cancelled {
    background-color: #e9ecef;
    color: #495057;
}

/* Records Filter Controls */
.records-filter-container {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.records-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.records-filter-item {
    flex: 1;
    min-width: 150px;
}

.records-filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-color);
}

.records-filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
}

.records-filter-button {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.records-filter-button:hover {
    background-color: #7bc47b;
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

.records-sort-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.records-sort-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background-color: white;
}

/* Sortable Table Headers */
.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 20px !important;
    user-select: none;
}

.sortable-header:hover {
    background-color: #e9ecef;
}

.sortable-header::after {
    content: '↕';
    position: absolute;
    right: 8px;
    color: #adb5bd;
    font-size: 14px;
}

.sortable-header.sort-asc::after {
    content: '↑';
    color: var(--primary-color);
}

.sortable-header.sort-desc::after {
    content: '↓';
    color: var(--primary-color);
}

/* Cancel Transaction Button */
.cancel-transaction-btn {
    width: 24px;
    height: 24px;
    background-color: transparent;
    color: #6c757d;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cancel-transaction-btn:hover {
    background-color: #f8d7da;
    color: #dc3545;
}

.cancel-transaction-btn:active {
    transform: scale(0.95);
}

.status-badge-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 計時器顏色狀態 */
.countdown-container {
    display: flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.timer-normal {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.timer-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #e0a800;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.timer-critical {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.timer-expired {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* 脈動動畫效果 - 用於最後一分鐘的緊急提示 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-animation {
    animation: pulse 1s infinite;
}

/* 倒計時器樣式 */
.countdown-timer {
    font-family: 'Roboto Mono', monospace, 'Microsoft JhengHei';
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 5px;
    min-width: 48px;
    text-align: center;
}

/* 確認中狀態 */
.status-verifying {
    background-color: #6c757d;
    color: white;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* 過渡效果 */
.countdown-container, .status-badge {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
}

/* Improved Filter Container */
.records-filter-container {
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.records-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.records-filter-item {
    flex: 1;
    min-width: 150px;
}

.records-filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: #495057;
}

.records-filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 13px;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.records-filter-select:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

.records-filter-button {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.records-filter-button:hover {
    background-color: #3d8b40;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.records-filter-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-container h1 i {
    color: var(--primary-color);
}

.login-form .form-group {
    margin-bottom: 25px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.input-with-icon input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-with-icon input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(144, 238, 144, 0.2);
}

.input-with-icon input:focus + i {
    opacity: 1;
    color: var(--primary-color);
}

.login-button {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-button:hover {
    background-color: #7bc47b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 238, 144, 0.3);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.login-button i {
    font-size: 18px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: auto;
}

/* Transaction Query */
.transactions-container {
    background-color: #F0F8FF;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-container {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-item {
    flex: 1;
    min-width: 200px;
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.filter-button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-button:hover {
    background-color: #7bc47b;
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

.transaction-table-container {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table thead th {
    background-color: #f5f5f5;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.transactions-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.no-data {
    text-align: center;
    padding: 30px;
    color: #888;
    font-style: italic;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.pagination-button {
    padding: 8px 15px;
    background-color: #f5f5f5;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-button:hover {
    background-color: #e0e0e0;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-info {
    font-size: 14px;
    color: var(--text-color);
}

/* Status Indicators for User Management */
.device-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 5px;
    vertical-align: middle;
}

.device-status-dot.online {
    background-color: var(--success-color);
}

.device-status-dot.offline {
    background-color: var(--offline-color);
}

.device-status-dot.error {
    background-color: var(--danger-color);
}

/* Text color utility classes */
.text-success {
    color: var(--success-color);
}

.text-secondary {
    color: var(--offline-color);
}

.text-danger {
    color: var(--danger-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .nav-tabs, .admin-tabs {
        flex-wrap: wrap;
    }

    .nav-tab, .admin-tabs button {
        flex: 1;
        padding: 10px;
        font-size: 14px;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-item {
        width: 100%;
    }

    .device-grid, .user-grid {
        grid-template-columns: 1fr;
    }

    form {
        padding: 1rem;
    }

    .tab-button {
        padding: 0.75rem 1rem;
    }

    th, td {
        padding: 0.75rem;
    }

    .login-container {
        margin: 20px auto;
        padding: 20px;
    }

    .records-table, .transactions-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* 容量條樣式 */
.capacity-container {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.capacity-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.capacity-value {
    font-weight: 600;
}

.capacity-bar {
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 5px;
}

.capacity-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.capacity-status {
    display: flex;
    justify-content: flex-end;
    font-size: 12px;
    margin-top: 5px;
}

.status-low, .status-medium, .status-high {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-low {
    color: var(--danger-color);
}

.status-medium {
    color: var(--warning-color);
}

.status-high {
    color: var(--success-color);
}

/* 禁用選項樣式 */
.disabled-option {
    color: #999;
    background-color: #f5f5f5;
    font-style: italic;
}

/* 設備狀態樣式 */
#device-select {
    color: var(--text-color);
}

/* 設備名稱與序號顯示樣式 */
.device-id-display {
    font-weight: 500;
}

/* QR碼和密碼顯示的增強樣式 */
.qrcode-display {
    margin: 1rem auto;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.qr-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.qr-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.qr-action-btn:hover {
    background-color: #388e3c;
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

/* 密碼容器和顯示樣式 */
.password-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
}

.password-display {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.password-digits {
    font-family: 'Courier New', monospace;
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 4px;
    color: #28a745;
    background: #e9ecef;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    display: inline-block;
    min-width: 200px;
}

.password-info {
    margin: 10px 0;
    color: #666;
    font-size: 14px;
}

.password-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.password-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.password-action-btn:hover {
    background-color: #388e3c;
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

/* 設備信息顯示格式樣式 - 用於 deviceName(deviceSerial) 格式 */
.device-info-format {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

.device-name {
    margin-right: 4px;
}

.device-serial {
    font-size: 0.9em;
    color: #666;
    opacity: 0.9;
}

/* 標籤容器 */
.label-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* 標籤樣式 */
.label-container label {
    margin-bottom: 0;
}

/* 加減按鈕容器 */
.amount-controls {
    display: flex;
    gap: 5px;
}

/* 加減按鈕樣式 */
.amount-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.amount-btn:hover {
    background-color: #3d8b40;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 移動端優化 */
@media (max-width: 768px) {
    .amount-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* 交易記錄中設備信息的顯示樣式 */
.transaction-device-info {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.transaction-device-name {
    font-weight: 500;
}

.transaction-device-serial {
    font-size: 0.85em;
    color: #666;
    opacity: 0.8;
}
