/* ══════════════════════════════════════════════════════════════════════
   ShopLied - Main Stylesheet
   Clean, customizable design using CSS custom properties.
   ══════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables (Theme) ──────────────────────────────────────────── */
:root {
    --primary:       #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary:     #1e40af;
    --accent:        #3b82f6;
    --success:       #16a34a;
    --success-light: #f0fdf4;
    --warning:       #d97706;
    --warning-light: #fffbeb;
    --danger:        #dc2626;
    --danger-light:  #fef2f2;
    --sidebar-bg:    #1e293b;
    --sidebar-text:  #e2e8f0;
    --sidebar-hover: #334155;
    --body-bg:       #f1f5f9;
    --card-bg:       #ffffff;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius:        8px;
    --radius-sm:     6px;
    --radius-lg:     12px;
    --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:     0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --transition:    0.15s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
table { border-collapse: collapse; width: 100%; }

/* ── Admin Layout ───────────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}
.sidebar-brand {
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-brand span { font-weight: 400; font-size: 11px; display: block; color: #94a3b8; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary);
}
.sidebar-nav a .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}
.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon { opacity: 1; }
.sidebar-section {
    padding: 16px 24px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 600;
}
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: #64748b;
}
.sidebar-footer a { color: #94a3b8; }
.sidebar-footer a:hover { color: #fff; }

/* ── Main Content ───────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: 250px;
    min-width: 0;
}
.topbar {
    background: var(--card-bg);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .breadcrumb { font-size: 12px; color: var(--text-muted); }
.topbar .breadcrumb a { color: var(--text-muted); }
.topbar .breadcrumb a:hover { color: var(--primary); }
.page-content { padding: 24px 32px; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text);
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Stat Cards ─────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
}
.stat-card .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
    line-height: 1.2;
}
.stat-card .stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Tables ─────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; }
.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .cell-id { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; color: var(--text-muted); }
.data-table .cell-actions { white-space: nowrap; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group .form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: #f1f5f9; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #e2e8f0; color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 6px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50px;
    line-height: 1.5;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: #f1f5f9; color: var(--text-muted); }
.badge-custom { color: #fff; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}
.page-link {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--card-bg);
    transition: all var(--transition);
}
.page-link:hover { background: #f1f5f9; color: var(--text); }
.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Timeline (Admin) ───────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content { padding-left: 8px; }
.timeline-action { font-size: 13px; font-weight: 600; }
.timeline-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.timeline-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.timeline-photos { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.timeline-photo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform var(--transition);
}
.timeline-photo:hover { transform: scale(1.05); }

/* ── Search & Filter Bar ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-bar .form-control { width: auto; min-width: 200px; }

/* ── Empty State ────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    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: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 15px; }
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Permission Grid ────────────────────────────────────────────────── */
.perm-grid { width: 100%; }
.perm-grid th { font-size: 11px; text-align: center; padding: 8px 12px; }
.perm-grid th:first-child { text-align: left; }
.perm-grid td { text-align: center; padding: 8px 12px; }
.perm-grid td:first-child { text-align: left; font-weight: 500; font-size: 13px; }
.perm-grid tbody tr:hover { background: #f8fafc; }

/* ── QR Code ────────────────────────────────────────────────────────── */
.qr-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.qr-container canvas { border-radius: 4px; }
.qr-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ── Login Page ─────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-bg);
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 380px;
}
.login-card .card-body { padding: 32px; }
.login-brand {
    text-align: center;
    margin-bottom: 24px;
}
.login-brand h1 { font-size: 24px; color: var(--primary); }
.login-brand p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════════════
   PUBLIC TRACKING PAGE
   ══════════════════════════════════════════════════════════════════════ */

.public-page {
    min-height: 100vh;
    background: var(--body-bg);
}
.public-header {
    background: var(--primary);
    color: #fff;
    padding: 24px 0;
    text-align: center;
}
.public-header h1 { font-size: 22px; font-weight: 700; }
.public-header p { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.public-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px;
}

/* Tracker Search */
.tracker-search {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-top: -20px;
    position: relative;
    z-index: 1;
}
.tracker-search h2 { font-size: 16px; margin-bottom: 16px; }
.tracker-search .search-row {
    display: flex;
    gap: 8px;
}
.tracker-search .search-row .form-control { flex: 1; }

/* Tracker Result */
.tracker-result { margin-top: 24px; }
.device-info-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.device-info-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 24px;
}
.device-info-header h3 { font-size: 18px; margin-bottom: 4px; }
.device-info-header .tracking-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-top: 8px;
}
.device-info-body { padding: 24px; }
.device-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.device-meta-item { }
.device-meta-item .meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}
.device-meta-item .meta-value {
    font-size: 14px;
    font-weight: 500;
    margin-top: 2px;
}

/* Public Timeline */
.public-timeline { padding-left: 28px; position: relative; }
.public-timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.public-timeline-item {
    position: relative;
    padding-bottom: 28px;
}
.public-timeline-item:last-child { padding-bottom: 0; }
.public-timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary);
}
.public-timeline-dot.dot-gray {
    background: #cbd5e1;
    box-shadow: 0 0 0 2px #cbd5e1;
}
.public-timeline-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.public-timeline-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.public-timeline-body {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.6;
}
.public-timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}
.public-timeline-photos {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.public-timeline-photo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform var(--transition);
}
.public-timeline-photo:hover { transform: scale(1.03); }

/* Current Status Banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    color: #fff;
}
.status-banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.status-banner-text { font-weight: 600; font-size: 15px; }
.status-banner-sub { font-size: 12px; opacity: 0.8; }

/* Service History */
.history-list { }
.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all var(--transition);
}
.history-item:hover { box-shadow: var(--shadow-md); }

/* ── Photo Lightbox ─────────────────────────────────────────────────── */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .topbar { padding: 12px 16px; }
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .device-meta { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-control { min-width: auto; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .tracker-search .search-row { flex-direction: column; }
}

/* ── Utility ────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}
.tab-btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-btn:hover {
    color: var(--text);
    background: #f8fafc;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.tab-btn .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-muted);
    border-radius: 50px;
}
.tab-btn.active .tab-count {
    background: var(--primary-light);
    color: var(--primary);
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* ── Part Billable Badge ────────────────────────────────────────────── */
.part-row-internal {
    background: #fef2f2 !important;
    opacity: 0.85;
}
.part-row-internal td { color: var(--text-muted); }
.badge-billable {
    background: var(--success-light);
    color: var(--success);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 600;
}
.badge-internal {
    background: var(--danger-light);
    color: var(--danger);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 600;
}

/* ── Receipt Builder ────────────────────────────────────────────────── */
.receipt-line {
    display: grid;
    grid-template-columns: 2fr 80px 120px 120px 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.receipt-line .form-control { padding: 7px 10px; font-size: 12px; }
.receipt-line .btn-remove {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition);
}
.receipt-line .btn-remove:hover { background: var(--danger); color: #fff; }
.receipt-summary {
    border-top: 2px solid var(--text);
    padding-top: 12px;
    margin-top: 16px;
}
.receipt-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}
.receipt-summary-row.total {
    font-size: 16px;
    font-weight: 700;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .tabs { gap: 0; }
    .tab-btn { padding: 8px 14px; font-size: 12px; }
    .receipt-line { grid-template-columns: 1fr; }
}
