* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #eef4f7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M45 20c-6 0-10 4-14 4s-7-4-12-4c-6 0-10 5-10 12 0 10 4 18 7 25 2 5 3 9 6 9 4 0 4-8 6-13 1-3 2-4 4-4s3 1 4 4c2 5 2 13 6 13 3 0 4-4 6-9 3-7 7-15 7-25 0-7-4-12-10-12z' fill='none' stroke='%23000000' stroke-width='1.5' stroke-opacity='0.18'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-attachment: fixed;
    color: #1a2e38;
    margin: 0;
    padding: 0;
    font-weight: 500;
    font-size: 16px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 28px;
}

/* TOPBAR */
.topbar {
    background: linear-gradient(135deg, #0f5f72 0%, #1D7A8C 60%, #2aa3ba 100%);
    color: #fff;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar .actions a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    margin-left: 4px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}
.topbar .actions a:hover { background: rgba(255,255,255,0.2); }

/* CARDS */
.card {
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M45 20c-6 0-10 4-14 4s-7-4-12-4c-6 0-10 5-10 12 0 10 4 18 7 25 2 5 3 9 6 9 4 0 4-8 6-13 1-3 2-4 4-4s3 1 4 4c2 5 2 13 6 13 3 0 4-4 6-9 3-7 7-15 7-25 0-7-4-12-10-12z' fill='none' stroke='%23000000' stroke-width='1.5' stroke-opacity='0.12'/%3E%3C/svg%3E");
    background-repeat: repeat;
    border-radius: 14px;
    padding: 18px 22px 30px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(29,122,140,0.09);
    border: 1.5px solid #d0e8ed;
}

.card-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 14px;
    color: #0f5f72;
}

/* LABELS */
label {
    display: block;
    font-size: 16px;
    color: #1a4a58;
    margin-bottom: 5px;
    margin-top: 13px;
    font-weight: 700;
}

/* INPUTS */
input[type=text], input[type=password], input[type=number],
input[type=tel], textarea, select {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #b0d4dd;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    background: #f5fafb;
    color: #1a2e38;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1D7A8C;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(29,122,140,0.13);
}
textarea { min-height: 65px; resize: vertical; }

/* BUTTONS */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, #1D7A8C, #2aa3ba);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    width: 100%;
    letter-spacing: 0.2px;
    box-shadow: 0 3px 8px rgba(29,122,140,0.28);
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(29,122,140,0.35); }
.btn:active { transform: translateY(0); }

.btn-secondary {
    background: #fff;
    color: #1D7A8C;
    border: 2px solid #1D7A8C;
    font-weight: 700;
    box-shadow: none;
}
.btn-secondary:hover { background: #edf7f8; }

.btn-outline-small {
    display: inline-block;
    padding: 6px 13px;
    border: 1.5px solid #1D7A8C;
    color: #1D7A8C;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    background: #fff;
    transition: background 0.12s;
}
.btn-outline-small:hover { background: #edf7f8; }

/* LAYOUT */
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* PATIENT LIST */
.patient-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 16px;
    border: 1.5px solid #d0e8ed;
    border-radius: 12px;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.1s;
}
.patient-item:hover {
    border-color: #1D7A8C;
    box-shadow: 0 3px 10px rgba(29,122,140,0.12);
    transform: translateX(2px);
}

.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f5f72, #2aa3ba);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(29,122,140,0.25);
}

.patient-item .info { flex: 1; }
.patient-item .name { font-weight: 800; font-size: 17px; }
.patient-item .meta { font-size: 16px; color: #5a8a95; margin-top: 2px; font-weight: 500; }

/* CHECKLIST */
.checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #1a2e38;
    padding: 9px 2px;
    border-bottom: 1px solid #edf4f6;
    margin: 0;
    cursor: pointer;
}
.checklist label:last-child { border-bottom: none; }
.checklist input[type=checkbox] { width: 18px; height: 18px; accent-color: #1D7A8C; flex-shrink: 0; }
.checklist .price { margin-left: auto; color: #1D7A8C; font-size: 16px; font-weight: 700; }

/* SUMMARY ROWS */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #edf4f6;
}
.summary-row:last-child { border-bottom: none; }
.summary-row.total {
    border-top: 2px solid #d0e8ed;
    border-bottom: none;
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 800;
    font-size: 18px;
    color: #1D7A8C;
}
.summary-row.balance-due { color: #c62828; font-weight: 700; }
.summary-row.balance-clear { color: #2e7d32; font-weight: 700; }

/* BADGES */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
}
.badge-danger { background: #fdecea; color: #c62828; }
.badge-success { background: #e8f5e9; color: #2e7d32; }

/* ALERTS */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    border-left: 4px solid;
}
.alert-error { background: #fdecea; color: #c62828; border-color: #c62828; }
.alert-success { background: #e8f5e9; color: #1b5e20; border-color: #2e7d32; }
.alert-info { background: #e3f2fd; color: #0d47a1; border-color: #1565c0; }
.alert-warning { background: #fff8e1; color: #e65100; border-color: #ff9800; }

/* LEDGER SUMMARY CARDS */
.summary-cards {
    display: flex;
    gap: 10px;
    background: linear-gradient(135deg, #0f5f72, #2aa3ba);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(29,122,140,0.28);
}
.summary-cards .item { flex: 1; text-align: center; color: #fff; }
.summary-cards .item .label { font-size: 16px; opacity: 0.85; font-weight: 600; }
.summary-cards .item .value { font-size: 18px; font-weight: 800; margin-top: 4px; }

/* IMAGES */
.thumb-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid #d0e8ed; }
.thumb-wrap { position: relative; }
.thumb-tag {
    position: absolute; bottom: 2px; left: 2px;
    background: rgba(0,0,0,0.6); color: #fff;
    font-size: 9px; padding: 1px 4px; border-radius: 4px;
}

.empty-state {
    text-align: center; color: #8aabba;
    padding: 50px 10px; font-size: 16px; font-weight: 600;
}

/* NO PRINT */
@media print { .no-print { display: none !important; } }

/* HAMBURGER MENU - default: chhupa hua (desktop par nazar nahi aata) */
.hamburger-btn { display: none; }
.nav-close-btn { display: none; }
.nav-overlay { display: none; }

/* MOBILE */
@media (max-width: 768px) {
    .container { padding: 10px 12px; }
    .topbar { padding: 12px 14px; }
    .row { flex-wrap: wrap; }

    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        font-size: 26px;
        color: #fff;
        cursor: pointer;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }
    .nav-overlay.open { opacity: 1; pointer-events: auto; }

    .topbar .actions {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        width: 250px;
        background: #1D7A8C;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 60px 0 20px;
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }
    .topbar .actions.open { transform: translateX(0); }
    .topbar .actions a {
        margin: 0;
        padding: 14px 20px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        text-align: left;
        display: block;
        width: 100%;
    }

    

    .nav-close-btn {
        display: block;
        position: absolute;
        top: 14px;
        right: 18px;
        font-size: 22px;
        color: #fff;
        cursor: pointer;
    }
}


@media (max-width: 768px) {
    .treatment-btn .btn-outline-small{
        flex-basis: calc(50% - 16px) !important;
    }
    .treatment-btn form{
        flex-basis: calc(50% - 16px) !important;
    }
}