* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f0f7ff;
    color: #071936;
    overflow-x: hidden;
}

.ap-page-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto 48px auto;
    padding: 0 12px;
}

.ap-hero-header {
    background: linear-gradient(95deg, #005bb5 0%, #0284c7 55%, #0ea5e9 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.22);
    margin-bottom: 18px;
}

.ap-hero-title {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.ap-hero-sub {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
}

/* ২টি ট্যাব: Hospital Schedule (Default) ও Chamber Schedule */
.ap-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.ap-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 14px;
    border-radius: 15px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    color: #071936;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(7, 25, 54, 0.05);
}

.ap-mode-btn.active {
    background: linear-gradient(95deg, #005bb5 0%, #0284c7 100%);
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.28);
}

.ap-mode-btn.mode-chamber.active {
    background: linear-gradient(95deg, #047857 0%, #059669 100%);
    border-color: #059669;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.28);
}

/* মেইন গ্রিড */
.ap-main-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .ap-main-grid {
        grid-template-columns: 1fr;
    }
}

.ap-panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(7, 25, 54, 0.07);
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.ap-panel-title {
    margin: 0 0 14px 0;
    font-size: 17px;
    font-weight: 800;
    color: #071936;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ap-schedule-card {
    position: relative;
    width: 100%;
    text-align: left;
    font-family: inherit;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ap-schedule-card:hover:not(.is-disabled) {
    border-color: #38bdf8;
    background: #f8fbff;
    transform: translateY(-1px);
}

.ap-schedule-card.is-chamber:hover:not(.is-disabled) {
    border-color: #34d399;
    background: #f3fdf8;
}

.ap-schedule-card.is-selected {
    border-color: #0284c7;
    background: #e8f4ff;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.18);
}

.ap-schedule-card.is-chamber.is-selected {
    border-color: #059669;
    background: #dcfce7;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.18);
}

.ap-schedule-card.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8fafc;
}

.ap-sch-img {
    width: 82px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
    flex-shrink: 0;
}

.ap-sch-body {
    min-width: 0;
}

.ap-sch-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 4px;
}

.ap-sch-name {
    margin: 0;
    font-size: 15.5px;
    font-weight: 800;
    color: #071936;
    line-height: 1.25;
}

.ap-selected-pill {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: #0284c7;
    color: #ffffff;
}

.ap-schedule-card.is-selected .ap-selected-pill {
    display: inline-flex;
}

.ap-schedule-card.is-chamber.is-selected .ap-selected-pill {
    background: #059669;
}

.ap-sch-meta {
    font-size: 12px;
    color: #334155;
    font-weight: 600;
    line-height: 1.45;
}

.ap-sch-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.ap-sch-time {
    font-size: 12px;
    font-weight: 800;
    color: #0b2e66;
    background: #e0f2fe;
    padding: 4px 9px;
    border-radius: 8px;
    white-space: nowrap;
}

.ap-badge-avail {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: #d1fae5;
    color: #15803d;
    white-space: nowrap;
}

.ap-badge-unavail {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    white-space: nowrap;
}

@media (max-width: 580px) {
    .ap-hero-title {
        font-size: 19px;
    }
    .ap-mode-btn {
        font-size: 12.5px;
        padding: 11px 10px;
        gap: 6px;
    }
    .ap-schedule-card {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
    }
    .ap-sch-img {
        width: 68px;
        height: 54px;
    }
    .ap-sch-name {
        font-size: 14px;
    }
    .ap-sch-right {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px dashed #cbd5e1;
    }
}

/* তারিখ সিলেক্টর */
.ap-dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 9px;
    margin-bottom: 16px;
}

.ap-date-chip {
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    border-radius: 13px;
    padding: 9px 7px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    color: #071936;
    transition: all 0.18s ease;
}

.ap-date-chip:hover {
    border-color: #0284c7;
    background: #f0f9ff;
}

.ap-date-chip.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(2, 132, 199, 0.25);
}

.ap-date-chip.chamber-active.active {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 5px 14px rgba(5, 150, 105, 0.25);
}

.ap-chip-day {
    display: block;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.85;
}

.ap-chip-date {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    margin-top: 2px;
}

.ap-chip-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    margin-top: 3px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(2, 132, 199, 0.12);
    color: #0369a1;
}

.ap-date-chip.active .ap-chip-tag {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.ap-empty-dates {
    padding: 13px 14px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.ap-empty-dates.is-warn {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.ap-summary-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}

.ap-summary-box.has-selection {
    background: #f0f9ff;
    border-color: #7dd3fc;
}

.ap-field-group {
    margin-bottom: 13px;
}

.ap-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #071936;
}

.ap-input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    font-family: inherit;
    font-size: 14px;
    color: #071936;
    background: #ffffff;
}

.ap-input:focus {
    outline: none;
    border-color: #0284c7;
}

.ap-submit-btn {
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(95deg, #005bb5 0%, #0284c7 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.28);
    transition: transform 0.18s ease;
}

.ap-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ap-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.ap-alert {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    display: none;
    line-height: 1.5;
}

.ap-alert.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* =========================================================================
   বড় ও পরিচ্ছন্ন পপআপ নোটিফিকেশন (স্ক্রিনশট ফ্রেন্ডলি কনফার্মেশন কার্ড)
   ========================================================================= */
.ap-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 25, 54, 0.68);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(24px + env(safe-area-inset-bottom, 0px)) 14px;
    z-index: 9999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ap-modal-backdrop.is-open {
    display: flex;
}

.ap-modal-card {
    width: 100%;
    max-width: 680px;
    margin: auto;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(7, 25, 54, 0.35);
    border: 2px solid #bae6fd;
    animation: apModalPop 0.24s ease-out;
}

@keyframes apModalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ap-modal-top {
    background: linear-gradient(95deg, #047857 0%, #059669 55%, #10b981 100%);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ap-modal-top-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ap-modal-check-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.ap-modal-title {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
}

.ap-modal-sub {
    margin: 3px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
}

.ap-modal-close-x {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ap-modal-body {
    padding: 22px 24px;
}

.ap-slip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    background: #f8fbff;
    border: 1.5px solid #dbeafe;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 18px;
}

.ap-slip-item-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    margin-bottom: 3px;
}

.ap-slip-item-val {
    font-size: 15px;
    font-weight: 800;
    color: #071936;
    word-break: break-word;
}

.ap-guidance-box {
    background: #fffbeb;
    border: 1.5px solid #fcd34d;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.ap-screenshot-banner-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.ap-screenshot-banner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 22px;
    border-radius: 999px;
    background: linear-gradient(95deg, #dc2626 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25);
}

.ap-guidance-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 800;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-guidance-list {
    margin: 0;
    padding-left: 18px;
    color: #78350f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
}

.ap-guidance-list li {
    margin-bottom: 6px;
}

.ap-guidance-list li:last-child {
    margin-bottom: 0;
}

.ap-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.ap-modal-btn-secondary {
    padding: 12px 20px;
    border-radius: 999px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #071936;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.ap-modal-btn-primary {
    padding: 12px 24px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(95deg, #005bb5 0%, #0284c7 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 600px) {
    .ap-modal-backdrop {
        padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(20px + env(safe-area-inset-bottom, 0px)) 10px;
    }
    .ap-modal-card {
        border-radius: 18px;
    }
    .ap-modal-top {
        padding: 14px 16px;
        gap: 10px;
    }
    .ap-modal-top-left {
        gap: 10px;
    }
    .ap-modal-check-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .ap-modal-title {
        font-size: 17px;
    }
    .ap-modal-sub {
        font-size: 12px;
    }
    .ap-modal-body {
        padding: 14px 16px;
    }
    .ap-screenshot-banner {
        font-size: 13.5px;
        padding: 7px 16px;
    }
    .ap-slip-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 13px;
    }
    .ap-modal-actions {
        flex-direction: column-reverse;
    }
    .ap-modal-btn-secondary,
    .ap-modal-btn-primary {
        width: 100%;
    }
}