/* PetBook - Lightweight CSS */
:root {
    --primary-pink: #E91E63;
    --primary-purple: #9C27B0;
    --gradient-primary: linear-gradient(135deg, #E91E63, #9C27B0);
    --sidebar-bg: #1A1A2E;
    --sidebar-active-bg: linear-gradient(135deg, #E91E63, #9C27B0);
    --sidebar-text: #FFFFFF;
    --card-bg: #FFFFFF;
    --main-bg: #F5F5F5;
    --text-heading: #1A1A2E;
    --text-body: #424242;
    --accent-pink: #F48FB1;
    --accent-purple: #BA68C8;
    --border-color: #E0E0E0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--main-bg);
    color: var(--text-body);
    font-size: 14px;
}

.hidden { display: none !important; }

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.logo { text-align: center; margin-bottom: 30px; }
.logo i { font-size: 48px; color: var(--primary-pink); }
.logo h1 { font-size: 28px; margin-top: 10px; }
.logo p { color: var(--text-body); }
.logo-img { max-width: 200px; height: auto; }

.sidebar-header .logo-img { max-height: 40px; width: auto; object-fit: contain; display: block; margin: 0 auto; }
.sidebar.collapsed .sidebar-header .logo-img { max-height: 30px; padding: 4px 0; }

.receipt-logo { max-width: 140px; height: auto; display: block; margin: 0 auto 6px auto; }

/* Layout */
#main-app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-nav a span { display: none; }
.sidebar.collapsed .sidebar-header span { display: none; }

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header i { font-size: 24px; color: var(--primary-pink); }

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text);
}

.sidebar-footer { padding: 15px; border-top: 1px solid rgba(255,255,255,0.08); }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* Topbar */
.topbar {
    background: var(--card-bg);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title { flex: 1; font-size: 18px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 8px; color: var(--text-body); }

.header-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--sidebar-bg);
    padding: 6px 14px;
    border-radius: 20px;
    margin-left: auto;
}

/* Content */
.content-wrapper { padding: 25px; }

.content-page { animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 20px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.bg-blue { background: var(--gradient-primary); }
.bg-red { background: var(--danger); }
.bg-green { background: var(--success); }
.bg-orange { background: var(--warning); }
.bg-purple { background: var(--primary-purple); }
.bg-teal { background: var(--info); }

.stat-info h3 { font-size: 22px; margin-bottom: 4px; }
.stat-info p { color: var(--text-body); font-size: 13px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { font-weight: 600; background: var(--main-bg); font-size: 13px; text-transform: uppercase; color: var(--text-body); }
.table tbody tr:hover { background: var(--main-bg); }
.table-sm th, .table-sm td { padding: 8px 12px; font-size: 13px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--gradient-primary); color: white; }
.btn-primary:hover { background: var(--primary-purple); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-secondary { background: var(--border-color); color: var(--text-body); }
.btn-outline-primary { background: transparent; border: 1px solid var(--primary); color: var(--primary-pink); }
.btn-outline-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; background: transparent; color: var(--text-body); }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.2s;
}

.form-control:focus { outline: none; border-color: var(--primary-pink); }

/* POS */
.pos-type-selector { display: flex; gap: 10px; }
.pos-type-btn { flex: 1; padding: 15px; font-size: 16px; }

.pos-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.pos-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.pos-item:hover { border-color: var(--primary-pink); box-shadow: 0 4px 12px rgba(37,99,235,0.15); }
.pos-item h4 { font-size: 14px; margin-bottom: 6px; }
.pos-item .price { color: var(--primary-pink); font-weight: 600; }

.cart-items { max-height: 300px; overflow-y: auto; }
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-total { font-size: 18px; text-align: right; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-body { padding: 20px; }
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

/* Toast */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s;
    min-width: 250px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Utilities */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.w-50 { width: 50%; }
.row { display: flex; gap: 20px; }
.col-4 { flex: 0 0 33.333%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.666%; }

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.report-item {
    background: var(--main-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.report-item span { display: block; color: var(--text-body); margin-bottom: 8px; }
.report-item strong { font-size: 20px; }

.error-message { color: var(--danger); margin-top: 10px; font-size: 13px; }
.branches-info { text-align: center; margin-top: 15px; color: var(--text-body); }

/* Branch Selection */
.branch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.branch-card {
    background: var(--main-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.branch-card:hover {
    border-color: var(--primary-pink);
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(233,30,99,0.1);
}

.branch-card i {
    font-size: 24px;
    color: var(--primary-pink);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(156, 39, 176, 0.12);
    border-radius: 12px;
}

.branch-card-info h4 {
    margin-bottom: 4px;
    font-size: 16px;
}

.branch-card-info p {
    color: var(--text-body);
    font-size: 13px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .sidebar-nav a span { display: none; }
    .sidebar .sidebar-header span { display: none; }
    .sidebar-header .logo-img { max-height: 30px; }
    .main-content { margin-left: var(--sidebar-collapsed); }
    .row { flex-direction: column; }
    .col-4, .col-6, .col-8 { flex: 1; }
    .stats-grid { grid-template-columns: 1fr; }
    .report-grid { grid-template-columns: 1fr; }
}


.branch-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-body);
    font-size: 14px;
}


/* Medical Timeline */
.contact-medical-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.contact-medical-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.contact-medical-header i {
    font-size: 20px;
    color: var(--primary-pink);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(156, 39, 176, 0.12);
    border-radius: 10px;
}

.contact-medical-header h4 {
    font-size: 16px;
    margin: 0;
}

.contact-medical-header small {
    color: var(--text-body);
}

.pet-medical-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pet-medical-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--main-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.pet-medical-item:hover {
    background: var(--main-bg);
    border-color: var(--primary-pink);
}

.pet-medical-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pet-medical-info i {
    font-size: 18px;
    color: var(--primary-pink);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(156, 39, 176, 0.12);
    border-radius: 8px;
}

.pet-medical-meta {
    font-size: 13px;
    color: var(--text-body);
}

.pet-medical-meta span {
    margin-right: 12px;
}

.pet-info-banner {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pet-info-banner i {
    font-size: 32px;
    opacity: 0.9;
}

.pet-info-banner h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.pet-info-banner p {
    margin: 0;
    opacity: 0.9;
    font-size: 13px;
}

.medical-timeline {
    position: relative;
    padding-left: 28px;
}

.medical-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.medical-timeline-entry {
    position: relative;
    margin-bottom: 20px;
}

.medical-timeline-entry::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 18px;
    width: 12px;
    height: 12px;
    background: var(--gradient-primary);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

.medical-log-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}

.medical-log-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.medical-log-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-body);
}

.medical-log-branch {
    font-size: 12px;
    color: var(--text-body);
    background: var(--main-bg);
    padding: 3px 10px;
    border-radius: 6px;
}

.medical-log-vitals {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
}

.medical-log-vital {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-body);
}

.medical-log-vital i {
    color: var(--primary-pink);
}

.medical-log-vital strong {
    color: var(--text-body);
}

.medical-log-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.medical-log-section {
    background: var(--main-bg);
    border-radius: 8px;
    padding: 12px 14px;
}

.medical-log-section label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-body);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.medical-log-section p {
    margin: 0;
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.5;
}

.medical-log-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    justify-content: flex-end;
}

.no-medical-logs {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-body);
}

.no-medical-logs i {
    font-size: 48px;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.7);
}


/* Receipt Print */
.receipt-paper {
    background: var(--card-bg);
    padding: 20px;
    max-width: 360px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-heading);
}

.receipt-header {
    text-align: center;
    margin-bottom: 12px;
}

.receipt-header h2 {
    font-size: 20px;
    margin: 0 0 4px 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--primary-pink);
}

.receipt-header p {
    margin: 0;
    font-size: 12px;
    color: var(--text-body);
}

.receipt-divider {
    border-top: 1px dashed var(--border-color);
    margin: 10px 0;
}

.receipt-info p {
    margin: 3px 0;
    display: flex;
    justify-content: space-between;
}

.receipt-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.receipt-items th {
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0;
}

.receipt-items td {
    padding: 4px 0;
    vertical-align: top;
}

.receipt-items td:nth-child(2),
.receipt-items td:nth-child(3),
.receipt-items td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
    padding-left: 8px;
}

.receipt-total {
    text-align: right;
    font-size: 16px;
    padding: 8px 0;
}

.receipt-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-body);
}

.receipt-footer p {
    margin: 2px 0;
}

@media print {
    body * {
        visibility: hidden;
    }
    #receipt-modal, #receipt-modal * {
        visibility: visible;
    }
    #receipt-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    #receipt-modal .modal-header,
    #receipt-modal .modal-footer {
        display: none !important;
    }
    #receipt-modal .modal-body {
        padding: 0;
    }
    .receipt-paper {
        box-shadow: none;
        max-width: none;
        width: 80mm;
        margin: 0 auto;
    }
}


/* Contacts with Pets */
.contact-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.contact-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-card-info i {
    font-size: 20px;
    color: var(--primary-pink);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(156, 39, 176, 0.12);
    border-radius: 10px;
}

.contact-card-info h4 {
    margin: 0 0 2px 0;
    font-size: 16px;
}

.contact-card-info small {
    color: var(--text-body);
    font-size: 13px;
}

.contact-card-actions {
    display: flex;
    gap: 6px;
}

.pet-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pet-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--main-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 12px;
    transition: all .12s;
}

.pet-item:hover {
    border-color: rgba(233, 30, 99, 0.3);
    background: rgba(233, 30, 99, 0.03);
}

.pet-item-info {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.pet-item-info i {
    font-size: 12px;
    color: var(--primary-pink);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(156, 39, 176, 0.1);
    border-radius: 6px;
    flex-shrink: 0;
}

.pet-name {
    font-weight: 600;
    color: var(--text-heading);
    flex-shrink: 0;
}

.pet-sep {
    color: #cbd5e1;
    font-size: 10px;
    flex-shrink: 0;
}

.pet-meta {
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.pet-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 8px;
}

.add-pet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--primary-pink);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
}

.add-pet-btn:hover {
    border-color: var(--primary-pink);
    background: rgba(233, 30, 99, 0.08);
}


/* Cash Book */
.cash-session-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.cash-session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.cash-session-header h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: var(--text-body);
}

.cash-session-header p {
    margin: 0;
    color: var(--text-body);
    font-size: 13px;
}

.cash-session-status .badge-open {
    background: #dcfce7;
    color: #166534;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.cash-session-status .badge-closed {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.cash-session-balances {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.cash-balance-item {
    background: var(--main-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.cash-balance-item label {
    display: block;
    font-size: 12px;
    color: var(--text-body);
    margin-bottom: 6px;
}

.cash-balance-item strong {
    font-size: 18px;
    color: var(--text-body);
}

.cash-balance-item.cash-in strong {
    color: #10b981;
}

.cash-balance-item.cash-out strong {
    color: #ef4444;
}

.cash-balance-item.balance strong {
    color: var(--primary-pink);
}

.cash-session-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.badge-auto {
    background: rgba(156, 39, 176, 0.12);
    color: var(--primary-purple);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-manual {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

@media (max-width: 768px) {
    .cash-session-balances {
        grid-template-columns: repeat(2, 1fr);
    }
}


.badge-success {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-open {
    background: #dcfce7;
    color: #166534;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-closed {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}


/* Product thumbnail */
.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.product-thumb-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 20px;
}


/* Negative stock / allow minus styles */
.badge-info {
    background: rgba(156, 39, 176, 0.12);
    color: var(--primary-purple);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}


/* HRD / Employee Detail */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.detail-row {
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row strong {
    display: inline-block;
    min-width: 120px;
    color: #6b7280;
    font-weight: 500;
}

.catatan-box pre {
    font-size: 14px;
    line-height: 1.5;
}

/* Admin-only menu hidden by default */
.admin-only.hidden {
    display: none !important;
}

/* ============================================================================
   DASHBOARD REVENUE BREAKDOWN
   ============================================================================ */

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

.rev-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 4px solid;
    transition: transform 0.15s ease;
}

.rev-card:hover {
    transform: translateY(-2px);
}

.rev-klinik { border-left-color: #f43f5e; }
.rev-petshop { border-left-color: #3b82f6; }
.rev-petcare { border-left-color: #10b981; }

.rev-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.rev-klinik .rev-icon { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.rev-petshop .rev-icon { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.rev-petcare .rev-icon { background: linear-gradient(135deg, #10b981, #34d399); }

.rev-info h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 2px 0;
}

.rev-info .rev-count {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-bottom: 2px;
}

.rev-info p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    font-weight: 500;
}

/* ============================================================================
   DASHBOARD CALENDAR
   ============================================================================ */

.calendar-card-body {
    padding: 12px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.calendar-nav span {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-heading);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-grid .cal-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding: 6px 0;
    text-transform: uppercase;
}

.calendar-grid .cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-body);
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    min-height: 36px;
}

.calendar-grid .cal-day:hover {
    background: #f3f4f6;
}

.calendar-grid .cal-day.today {
    background: var(--gradient-primary);
    color: white;
}

.calendar-grid .cal-day.today:hover {
    opacity: 0.9;
}

.calendar-grid .cal-day.other-month {
    color: #d1d5db;
}

.calendar-grid .cal-day .cal-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.calendar-grid .cal-day .cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
}

.cal-klinik { background: #3b82f6; }
.cal-petshop { background: #10b981; }
.cal-petcare { background: #f59e0b; }
.cal-urgent { background: #ef4444; }

.calendar-legend {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    font-size: 11px;
    color: #6b7280;
    flex-wrap: wrap;
    justify-content: center;
}

.calendar-legend .cal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 3px;
    vertical-align: middle;
}

/* Calendar popup */
.calendar-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-popup {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.calendar-popup h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-heading);
}

.calendar-popup .popup-close {
    float: right;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #9ca3af;
}

.calendar-popup .popup-appointment {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.calendar-popup .popup-appointment:last-child {
    border-bottom: none;
}

.calendar-popup .popup-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.calendar-popup .popup-app-customer {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-heading);
}

.calendar-popup .popup-app-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.popup-type-klinik { background: #dbeafe; color: #1e40af; }
.popup-type-petshop { background: #d1fae5; color: #065f46; }
.popup-type-petcare { background: #fef3c7; color: #92400e; }
.popup-type-urgent { background: #fee2e2; color: #991b1b; }

.calendar-popup .popup-app-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Tagihan Table */
#tagihan-table .badge { font-size: 11px; padding: 2px 8px; border-radius: 12px; }

#pos-contact-search-wrap {
    position: relative;
}
#pos-contact-box {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .revenue-breakdown {
        grid-template-columns: 1fr;
    }
    .calendar-popup {
        width: 95%;
        padding: 16px;
    }
}

/* Payment breakdown chart */
.payment-chart { display: flex; flex-direction: column; gap: 8px; }
.payment-chart-item { display: flex; align-items: center; gap: 8px; }
.payment-chart-label { width: 70px; font-size: 13px; text-transform: capitalize; }
.payment-chart-bar-wrap { flex: 1; background: #e9ecef; border-radius: 4px; height: 22px; position: relative; overflow: hidden; }
.payment-chart-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.payment-chart-bar.qris { background: #0d6efd; }
.payment-chart-bar.transfer { background: #198754; }
.payment-chart-bar.cash { background: #fd7e14; }
.payment-chart-pct { width: 45px; font-size: 12px; text-align: right; color: #666; }
.payment-chart-amount { width: 90px; font-size: 12px; text-align: right; font-weight: 600; }

/* ============================================
   Warehouse / Branch-specific Inventory Styles
   ============================================ */

.branch-page-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(233,30,99,0.06), rgba(156,39,176,0.06));
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(233,30,99,0.12);
    font-size: 14px;
    color: #64748b;
}
.branch-page-header i {
    color: #E91E63;
}
.branch-page-header strong {
    color: #1e293b;
}

.inv-alert-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.inv-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.inv-alert-safe {
    background: #dcfce7;
    color: #166534;
}
.inv-alert-warning {
    background: #ffedd5;
    color: #9a3412;
}
.inv-alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   Cash Book Badges & Filters
   ============================================ */

.badge-pos {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
}
.badge-owner {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #ede9fe;
    color: #5b21b6;
}
