:root {
    --bg: #f6f8fb;
    --card: #fff;
    --muted: #6b7280;
    --brand: #0d6efd;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    margin: 0;
    padding: 20px;
    color: #0f172a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 0;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.search {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 500px;
}

.search input {
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search button {
    padding: 12px 20px;
    border-radius: var(--radius);
    border: 0;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.search button:hover {
    background: #0b5ed7;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.guest-card .name {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
    color: #1e293b;
}

.guest-card .meta {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.mono {
    font-family: ui-monospace, monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 13px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.service .title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
    color: #1e293b;
}

.service .meta {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 12px;
}

.progress {
    background: #eef2ff;
    border-radius: 999px;
    height: 16px;
    overflow: hidden;
    margin-top: 8px;
}

.progress .bar {
    background: linear-gradient(90deg, var(--brand), #3b82f6);
    height: 100%;
    text-align: center;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    font-weight: 600;
    transition: width 0.3s ease;
}

.timeline {
    position: relative;
    padding-left: 24px;
    margin-top: 16px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding: 16px 0;
}

.timeline .dot {
    position: absolute;
    left: -6px;
    top: 22px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brand);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
    z-index: 2;
}

.timeline .content {
    background: var(--card);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline .content:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.left .svc {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 4px;
}

.left .therapist {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 4px;
}

.right {
    text-align: right;
    flex-shrink: 0;
}

.right .time {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.right .center {
    font-size: 13px;
    color: var(--muted);
}

.notice {
    padding: 16px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    margin: 16px 0;
}

.notice.warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.hero {
    text-align: center;
    padding: 40px 24px;
    background: #fff;
    border-radius: var(--radius);
    color: var(--muted);
    border: 1px solid var(--border);
    margin: 40px 0;
}

.hero h2 {
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 600;
}

/* Package table styles */
.pkg-card {
    margin-bottom: 20px;
}

.pkg-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

.pkg-table th {
    background: #f8fafc;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    color: #374151;
}

.pkg-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: #4b5563;
}

.pkg-table tr:hover {
    background: #f9fafb;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 12px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .search {
        flex-direction: column;
        max-width: none;
    }
    
    .search input {
        min-width: 0;
    }
    
    .search button {
        width: 100%;
    }
    
    .row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .right {
        text-align: left;
        width: 100%;
    }
    
    .timeline {
        padding-left: 20px;
    }
    
    .timeline .dot {
        left: -5px;
        top: 20px;
        width: 12px;
        height: 12px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .pkg-table {
        font-size: 13px;
    }
    
    .pkg-table th,
    .pkg-table td {
        padding: 8px;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 480px) {
        .pkg-table {
            display: block;
            overflow-x: auto;
        }
        
        .card {
            padding: 16px;
        }
        
        .timeline .content {
            padding: 12px;
        }
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    
    .guest-card .name {
        font-size: 16px;
    }
    
    .service .title {
        font-size: 15px;
    }
    
    .left .svc {
        font-size: 15px;
    }
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item {
    animation: fadeIn 0.3s ease-out;
}

.card {
    animation: fadeIn 0.4s ease-out;
}

/* Popup Styles Newly Added */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.popup-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.popup-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #374151;
    background: #f3f4f6;
    border-radius: 50%;
}

.popup-body {
    padding: 24px;
}

.popup-body ul {
    margin: 8px 0 16px 0;
    padding-left: 20px;
}

.popup-body li {
    margin-bottom: 4px;
    color: #4b5563;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-submit {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.btn-submit:hover {
    background: #2563eb;
}

.btn-cancel {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #4b5563;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== MODERN POPUP STYLES 20 Nov 2025 ===== */
.modern-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modern-popup-container {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s ease-out;
}

.modern-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.header-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content {
    flex: 1;
}

.popup-title {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.popup-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.modern-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    color: white;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modern-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Patient Info Card */
.patient-info-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    margin: 20px 24px;
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #bae6fd;
}

.patient-avatar {
    background: white;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.patient-details {
    flex: 1;
}

.patient-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #0c4a6e;
}

.patient-id {
    margin: 0;
    font-size: 12px;
    color: #0369a1;
    font-family: 'Courier New', monospace;
}

/* Alert Card */
.alert-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    margin: 0 24px 20px 24px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #fcd34d;
    display: flex;
    gap: 12px;
}

.alert-icon {
    color: #d97706;
    flex-shrink: 0;
}

.alert-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.service-name {
    font-size: 12px;
    color: #78350f;
    font-weight: 500;
    flex: 1;
    margin-right: 8px;
}

.service-balance {
    font-size: 11px;
    color: #ea580c;
    font-weight: 600;
    background: rgba(251, 191, 36, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Form Section */
.form-section {
    padding: 0 24px 24px 24px;
}

.form-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modern-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.label-text {
    font-weight: 500;
}

.required-mark {
    color: #ef4444;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.modern-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    color: #1e293b;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
}

.modern-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-select:hover {
    border-color: #cbd5e1;
}

.select-arrow {
    position: absolute;
    right: 16px;
    color: #64748b;
    pointer-events: none;
}

/* Form Actions */
.modern-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel-modern {
    flex: 1;
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-modern:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-submit-modern {
    flex: 2;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-submit-modern:active {
    transform: translateY(0);
}

.btn-submit-modern.loading {
    pointer-events: none;
}

.btn-text, .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar Styling */
.modern-popup-container::-webkit-scrollbar {
    width: 6px;
}

.modern-popup-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modern-popup-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modern-popup-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 640px) {
    .modern-popup-overlay {
        padding: 16px;
    }
    
    .modern-popup-header {
        padding: 20px;
    }
    
    .patient-info-card,
    .alert-card {
        margin: 16px 20px;
    }
    
    .form-section {
        padding: 0 20px 20px 20px;
    }
    
    .modern-form-actions {
        flex-direction: column;
    }
}