/* ==========================================================================
   Design System & Theme Variables (v6)
   ========================================================================== */
:root {
    /* Fonts */
    --font-heading: 'Prompt', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', 'Prompt', -apple-system, sans-serif;

    /* Light Mode Palette (Default) */
    --bg-app: #ffffff;                    /* White background */
    --bg-surface: #f4f7f6;                /* Very soft gray/mint-gray for cards */
    --bg-surface-hover: #eef2f1;
    --primary: #1E5631;                   /* Primary Dark Green */
    --primary-rgb: 30, 86, 49;
    --primary-hover: #153c22;
    --primary-light: #e8efe9;             /* Soft green accent */
    --primary-accent: #d0e1d4;
    --text-main: #2d3748;                 /* Charcoal */
    --text-muted: #718096;
    --text-on-primary: #ffffff;
    --border: #e2e8f0;
    
    /* Semantic Colors */
    --success: #388E3C;                   /* Success Green */
    --success-bg: #e8f5e9;
    --warning: #f57c00;
    --warning-bg: #fff3e0;
    --danger: #D32F2F;                    /* Contraindication Red */
    --danger-bg: #ffebee;
    --info: #1976D2;                      /* Info Blue */
    --info-bg: #e3f2fd;
    --neutral: #757575;                   /* Neutral Gray */
    --neutral-bg: #eeeeee;

    /* Shadows & Border Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.08);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-app: #121413;
    --bg-surface: #1c201d;                /* Soft dark slate green */
    --bg-surface-hover: #222a25;
    --primary: #52b788;                   /* Brighter green for contrast */
    --primary-rgb: 82, 183, 136;
    --primary-hover: #74c69d;
    --primary-light: #182b20;
    --primary-accent: #2c4236;
    --text-main: #f3f4f6;
    --text-muted: #a0aec0;
    --border: #2c3530;
    
    /* Semantic Colors */
    --success: #81c784;
    --success-bg: #1c3322;
    --warning: #ffb74d;
    --warning-bg: #3d2d1e;
    --danger: #ef5350;
    --danger-bg: #3e1b1b;
    --info: #64b5f6;
    --info-bg: #152b3c;
    --neutral: #bdbdbd;
    --neutral-bg: #2d2d2d;

    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Global Resets & Layout
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.app-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Header */
.app-header {
    padding: 16px 0;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo.logo-failed {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.logo.logo-failed div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.logo h1 {
    font-size: 18px;
    line-height: 1.2;
    color: var(--text-main);
}

.logo .sub-title {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guideline-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.app-main {
    flex-grow: 1;
}

/* ==========================================================================
   Buttons & General Components
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-on-primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.15);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

.btn-outline.danger-border {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-outline.danger-border:hover {
    background-color: var(--danger-bg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-text:hover {
    text-decoration: underline;
}

.icon-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Card */
.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: all var(--transition-normal);
}

/* Screen Transitions */
.screen-section {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   SCREEN A: Authentication
   ========================================================================== */
.auth-card {
    max-width: 440px;
    margin: 40px auto;
}

.auth-toggle {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-toggle button {
    margin-left: 4px;
}

.auth-error {
    color: var(--danger);
    background-color: var(--danger-bg);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    border-left: 3px solid var(--danger);
}

/* ==========================================================================
   SCREEN B: Personal Health Profile
   ========================================================================== */
.form-header {
    margin-bottom: 24px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 16px;
}

.form-header h2 {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-header p {
    font-size: 13px;
    color: var(--text-muted);
}

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

.group-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.group-label .required {
    color: var(--danger);
}

.group-label .sub-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

/* Inputs */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
}

.input-with-icon input, .form-select {
    width: 100%;
    padding: 11px 12px 11px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    background-color: var(--bg-app);
    color: var(--text-main);
    transition: border-color var(--transition-fast);
}

.form-select {
    padding-left: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.input-with-icon input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.input-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Radio/Checkbox Grid */
.radio-card-grid, .checkbox-card-stack {
    display: grid;
    gap: 14px;
}

.radio-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.radio-card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 576px) {
    .radio-card-grid.cols-2 {
        grid-template-columns: 1fr;
    }
}

.radio-card, .checkbox-card {
    position: relative;
    cursor: pointer;
}

.radio-card input, .checkbox-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content, .checkbox-card-content {
    background-color: var(--bg-app);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-fast);
}

.radio-card:hover .radio-card-content,
.checkbox-card:hover .checkbox-card-content {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.radio-card input:checked + .radio-card-content,
.checkbox-card input:checked + .checkbox-card-content {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

/* Highlight checked cards */
.checkbox-card.selected-card .checkbox-card-content {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.radio-icon, .checkbox-icon {
    font-size: 20px;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.radio-card input:checked + .radio-card-content .radio-icon,
.checkbox-card input:checked + .checkbox-card-content .checkbox-icon,
.checkbox-card.selected-card .checkbox-icon {
    background-color: var(--primary);
    color: var(--text-on-primary);
}

.radio-details, .checkbox-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.radio-title, .checkbox-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.radio-desc, .checkbox-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Conditional animations */
.conditional-group {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-bottom: 0;
    transition: max-height 0.35s ease, opacity 0.35s ease, margin-bottom 0.35s ease;
}

.conditional-group.show {
    max-height: 120px;
    opacity: 1;
    margin-bottom: 24px;
}

.toggle-card {
    background-color: var(--bg-app);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.flex-column-mobile {
    display: flex;
}

@media (max-width: 576px) {
    .flex-column-mobile {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

.toggle-info {
    display: flex;
    flex-direction: column;
}

.toggle-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-title i {
    color: var(--primary);
}

.toggle-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Slider */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border);
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ==========================================================================
   SCREEN C, D, E Hub & Dashboard Navigation
   ========================================================================== */
.profile-banner-card {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background-color: var(--bg-surface);
    border-left: 5px solid var(--primary);
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-avatar {
    font-size: 38px;
    color: var(--primary);
}

.profile-info h3 {
    font-size: 15px;
    color: var(--text-main);
}

.profile-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.banner-buttons {
    display: flex;
    gap: 10px;
}

@media (max-width: 576px) {
    .profile-banner-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .banner-buttons {
        width: 100%;
        justify-content: space-between;
    }
}

/* Tabs Navigation */
.tab-navigation-container {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-nav-btn {
    background: none;
    border: none;
    padding: 12px 18px;
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-nav-btn:hover {
    color: var(--primary);
}

.tab-nav-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-nav-btn.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px 3px 0 0;
}

.sub-screen-container {
    display: none;
}

.sub-screen-container.active {
    display: block;
}

/* ==========================================================================
   SUB-SCREEN C: Smart Vaccine Analysis
   ========================================================================== */
.vaccine-analysis-section {
    margin-bottom: 36px;
}

.section-badge-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.section-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.success-indicator { background-color: var(--success); }
.info-indicator { background-color: var(--info); }
.danger-indicator { background-color: var(--danger); }

.section-badge-title h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.section-desc-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.vaccine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}

/* Vaccine Cards in Screen C */
.vaccine-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.vaccine-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.card-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
}

.badge-routine { background-color: var(--success-bg); color: var(--success); }
.badge-risk { background-color: var(--info-bg); color: var(--info); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); }

.recommend-box {
    background-color: var(--bg-app);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
}

.recommend-box.high-dose-alert {
    border-left-color: var(--warning);
    background-color: var(--warning-bg);
}

.recommend-box.danger-alert {
    border-left-color: var(--danger);
    background-color: var(--danger-bg);
    color: var(--danger);
    font-weight: 500;
}

.recommend-text {
    font-weight: 550;
    color: var(--text-main);
}

.recommend-box.danger-alert .recommend-text {
    color: var(--danger);
}

.desc-box {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.desc-item {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.desc-item i {
    margin-top: 3px;
    color: var(--primary);
}

.desc-item.contra-item i {
    color: var(--danger);
}

/* Contraindicated Vaccine Card Special Class */
.vaccine-card.contraindicated-card {
    border-color: var(--danger);
}

.vaccine-card.contraindicated-card:hover {
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.08);
}

/* ==========================================================================
   SUB-SCREEN D: Personal Vaccine Logbook
   ========================================================================== */
.upcoming-alerts-container {
    margin-bottom: 24px;
}

.alert-banner {
    background-color: var(--warning-bg);
    border: 1px solid rgba(245, 124, 0, 0.15);
    border-left: 5px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 14px;
}

.alert-icon-side {
    font-size: 20px;
    color: var(--warning);
    display: flex;
    align-items: center;
}

.alert-content-side {
    flex-grow: 1;
}

.alert-content-side h5 {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.alert-list {
    list-style: none;
    width: 100%;
}

.alert-list li {
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-app);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    border-left: 3px solid var(--warning);
    box-shadow: var(--shadow-sm);
}

.alert-list li::before {
    content: none;
}

.alert-due-badge {
    background-color: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    margin-left: auto;
}

/* Stats Overview */
.logbook-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 576px) {
    .logbook-stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 18px;
    border-radius: var(--radius-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.completed-box .stat-num { color: var(--success); }
.in-progress-box .stat-num { color: var(--info); }
.not-started-box .stat-num { color: var(--neutral); }

/* Active States for Badges */
.completed-box.active {
    border: 2px solid var(--success);
    background-color: var(--success-bg);
}

.in-progress-box.active {
    border: 2px solid var(--info);
    background-color: var(--info-bg);
}

.not-started-box.active {
    border: 2px solid var(--neutral);
    background-color: var(--neutral-bg);
}

/* Drill-down View */
.drilldown-details-card {
    background-color: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
    animation: slideDown var(--transition-normal) forwards;
}

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

.drilldown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.drilldown-header h5 {
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.drilldown-list {
    display: grid;
    gap: 12px;
}

.drilldown-row {
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: border-color var(--transition-fast);
}

.drilldown-row:hover {
    border-color: var(--primary);
}

.drilldown-left {
    display: flex;
    flex-direction: column;
}

.drilldown-name-th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

.drilldown-name-en {
    font-size: 11px;
    color: var(--text-muted);
}

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

.progress-pill {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 600;
}

.progress-pill.pill-not-started {
    background-color: var(--neutral-bg);
    color: var(--text-muted);
}

.progress-pill.pill-completed {
    background-color: var(--success-bg);
    color: var(--success);
}

@media (max-width: 576px) {
    .drilldown-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .drilldown-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Log Table */
.logbook-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.logbook-actions-row h4 {
    font-size: 14px;
    color: var(--text-main);
}

.logbook-table-container {
    background-color: var(--bg-app);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.logbook-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.logbook-table th, .logbook-table td {
    padding: 14px 16px;
    border-bottom: 1.5px solid var(--border);
}

.logbook-table th {
    background-color: var(--bg-surface);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-main);
}

.logbook-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
}

.logbook-table tr:last-child td {
    border-bottom: none;
}

.empty-log-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-log-state i {
    font-size: 32px;
    margin-bottom: 12px;
}

.empty-log-state p {
    font-size: 13px;
    font-weight: 550;
    color: var(--text-main);
    margin-bottom: 4px;
}

.empty-log-state .sub-text {
    font-size: 11px;
}

.delete-log-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: transform var(--transition-fast);
}

.delete-log-btn:hover {
    transform: scale(1.1);
}

/* Responsive Table */
@media (max-width: 768px) {
    .logbook-table-container {
        border: none;
    }
    .logbook-table, .logbook-table thead, .logbook-table tbody, .logbook-table th, .logbook-table td, .logbook-table tr {
        display: block;
    }
    .logbook-table thead {
        display: none;
    }
    .logbook-table td {
        border-bottom: 1px solid var(--border);
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    .logbook-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--text-main);
    }
    .logbook-table tr {
        border: 1.5px solid var(--border);
        border-radius: var(--radius-md);
        margin-bottom: 14px;
        background-color: var(--bg-surface);
    }
}

/* ==========================================================================
   SUB-SCREEN E: Vaccine Promotions & Contact
   ========================================================================== */
.promo-section-title {
    margin-bottom: 20px;
}

.promo-section-title h3 {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.promo-section-title p {
    font-size: 12px;
    color: var(--text-muted);
}

.promo-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.promo-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.promo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.promo-card-badge {
    display: inline-block;
    background-color: #D32F2F;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 6px;
    margin-bottom: 4px;
    width: fit-content;
}

.promo-card-header {
    padding: 20px 20px 12px 20px;
    border-bottom: 1px dashed var(--border);
}

.promo-card-header h4 {
    font-size: 13.5px;
    color: var(--text-main);
    line-height: 1.3;
}

.promo-card-sub {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.promo-card-body {
    padding: 16px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.promo-card-body p {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 16px;
}

.promo-price-tag {
    margin-top: auto;
    font-family: var(--font-heading);
    color: var(--primary);
}

.price-value {
    font-size: 26px;
    font-weight: 700;
}

.price-currency {
    font-size: 14px;
    font-weight: 600;
    margin-left: 2px;
}

.promo-card-footer {
    padding: 0 20px 20px 20px;
}

/* Contact panel */
.contact-panel {
    background-color: var(--bg-surface);
    border-left: 5px solid var(--primary);
    padding: 24px;
}

.contact-header {
    margin-bottom: 20px;
}

.contact-header h4 {
    font-size: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-header h4 i {
    color: var(--primary);
}

.contact-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.contact-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--bg-app);
    border: 1.5px solid var(--border);
    padding: 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.contact-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.contact-icon {
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface);
}

.tel-btn .contact-icon { color: var(--primary); }
.line-btn .contact-icon { color: #06C755; } /* Official LINE Green */
.web-btn .contact-icon { color: var(--info); }

.contact-details {
    display: flex;
    flex-direction: column;
}

.contact-title {
    font-size: 11px;
    color: var(--text-muted);
}

.contact-val {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
}

/* ==========================================================================
   MODAL DIALOG (v6)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: 1000;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-app);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    overflow: hidden;
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1.5px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 15px;
    color: var(--text-main);
}

.modal-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1.5px solid var(--border);
    background-color: var(--bg-surface);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================================
   Footer App Info
   ========================================================================== */
.app-footer-info {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.app-footer-info p {
    font-size: 10px;
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto 6px auto;
}

/* Utility */
.danger-text { color: var(--danger) !important; }
.text-danger { color: var(--danger); }
.success-text { color: var(--success); }
.info-text { color: var(--info); }
.active-none { border-style: dashed; }

@keyframes pulse-highlight {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 86, 49, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(30, 86, 49, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(30, 86, 49, 0);
    }
}

.highlight-pulse {
    animation: pulse-highlight 1.5s infinite;
    border-color: var(--primary) !important;
}

/* Screen E Promotions Styling */
.promo-notes-banner {
    background-color: var(--primary-light);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.promo-note-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main);
    font-weight: 550;
}

.promo-note-item i {
    color: var(--primary);
    margin-top: 3px;
    font-size: 14px;
}

.promo-price-tag-group {
    display: flex;
    flex-direction: column;
    margin-top: auto;
}

.price-original {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: 2px;
}

.promo-disclaimer {
    margin: 20px 0 28px 0;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}


