/* ========== 全局變數與基礎樣式 ========== */
:root {
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --medical-gradient: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    background-color: #f3f4f6;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1f2937;
}

/* ========== 滾動條美化 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== 卡片樣式 ========== */
.custom-card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    background: white;
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.card-header {
    background: white;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
}

/* ========== 快捷功能按鈕 (POS Grid) ========== */
.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.pos-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    color: #4b5563;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    aspect-ratio: 1/0.85;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pos-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: #6366f1;
    color: #4f46e5;
}

.pos-btn i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #9ca3af;
    transition: color 0.3s;
}

.pos-btn:hover i {
    color: #4f46e5;
}

.pos-btn span {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

.pos-btn-highlight {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.pos-btn-highlight:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
    color: white;
}

.pos-btn-highlight i {
    color: rgba(255, 255, 255, 0.9);
}

.pos-btn-highlight:hover i {
    color: white;
}

/* Feature Button - Medical Support */
.pos-btn-medical {
    background: var(--medical-gradient);
    color: white !important;
    border: none;
}

.pos-btn-medical:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.4);
    color: white;
}

.pos-btn-medical i {
    color: rgba(255, 255, 255, 0.95);
}

.pos-btn-medical:hover i {
    color: white;
}


/* ========== 公告列表樣式 ========== */
.announcement-list {
    padding: 0;
    margin: 0;
}

.announcement-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
    cursor: pointer;
    position: relative;
}

.announcement-item:hover {
    background-color: #f9fafb;
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-item.pinned {
    background-color: #fffbeb;
}

.announcement-item.pinned:hover {
    background-color: #fef3c7;
}

.announcement-item.pinned::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #f59e0b;
}

/* ========== 聯單紀錄樣式 ========== */
.record-list {
    max-height: 600px;
    overflow-y: auto;
}

.record-card {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-card:hover {
    background: white;
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.record-info-left {
    display: flex;
    flex-direction: column;
}

.record-number {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 700;
    color: #2563eb;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.record-meta {
    font-size: 0.8rem;
    color: #64748b;
}

.record-info-right {
    text-align: right;
}

.record-amount {
    font-weight: 700;
    color: #059669;
    font-size: 1.1rem;
}

.record-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ========== 提醒訊息 (Alerts) ========== */
.alert-autohide {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== 舊版相容性 (保留以防萬一) ========== */
.scroll-container {
    height: calc(100vh - 280px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 1rem;
}
