:root {
    --primary: #0FA4A9;
    --primary-dark: #0C7F83;
    --danger: #C62828;
    --bg: #F6F7F9;
    --white: #FFFFFF;
    --text: #1F2937;
    --muted: #6B7280;
    --border: #E5E7EB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--primary-dark);
    color: #fff;
    padding: 20px;
}

.sidebar .logo {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px;
}

.sidebar .logo small {
    display: block;
    color: #FCA5A5;
    font-size: 12px;
}

.sidebar nav a {
    display: block;
    color: #E0F2F1;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 6px;
	position: relative;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: var(--primary);
	color: #ffffff;
    font-weight: 600;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
	
}

/* Header */
.header {
    background: var(--white);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

/* Content */
.content {
    padding: 20px;
}

/* Cards */
.card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card.alert {
    border-left: 5px solid var(--danger);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card h3 {
    font-size: 14px;
    color: var(--muted);
}

.card p {
    font-size: 24px;
    font-weight: bold;
    margin-top: 10px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-size: 13px;
}

tr:hover {
    background: #F9FAFB;
}

/* Status */
.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.status.paid {
    background: #DCFCE7;
    color: #166534;
}

.status.pending {
    background: #FEF3C7;
    color: #92400E;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100%;
        width: 240px;
        display: block; /* IMPORTANT */
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main {
        margin-left: 0;
    }
}
/* Collapsible Sidebar */
.sidebar {
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 70px;
    padding: 20px 10px;
}

.sidebar.collapsed .text,
.sidebar.collapsed small,
.sidebar.collapsed nav a span {
    display: none;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar.collapsed nav a {
    justify-content: center;
}

/* Main shift */
.main {
    transition: margin-left 0.3s ease;
}

.sidebar nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 4px;
    height: 100%;
    background: #ffffff;
    border-radius: 0 4px 4px 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 22px;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Filters */
.filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filters input,
.filters select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 14px;
    color: var(--text);
    min-width: 180px;
    transition: all 0.2s ease;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 164, 169, 0.15);
}

.filters input:hover,
.filters select:hover {
    border-color: var(--primary);
}

.card .filters {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
    .filters input,
    .filters select {
        width: 100%;
    }
}

.filters label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.btn-clear {
    background: #fff;
    border: 1px dashed var(--border);
    color: var(--muted);
}

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

.filters select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

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

/* Form Card */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    width: 100%;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-secondary {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--bg);
}

/* Optional small form validation message */
.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* Header right container */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Alerts Bell */
.alerts {
    position: relative;
    cursor: pointer;
    font-size: 22px;
}

.alerts .count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
}

/* Dropdown */
.alert-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 28px;
    background: var(--white);
    min-width: 220px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 999;
}

.alert-dropdown ul {
    list-style: none;
}

.alert-dropdown li {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.alert-dropdown li:last-child {
    border-bottom: none;
}

.alert-dropdown li:hover {
    background: var(--bg);
}

.alert-dropdown.show {
    display: block;
}

/* Submenu container */
.submenu {
    display: none;
    flex-direction: column;
    padding-left: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.submenu a {
    font-size: 14px;
    padding: 6px 10px;
}

/* Active link in submenu */
.submenu a.active {
    font-weight: 600;
    color: var(--primary);
}

/* Show submenu when parent has .open */
.has-submenu.open + .submenu {
    display: flex;
}

/* Cursor pointer */
.has-submenu {
    cursor: pointer;
}

@media (max-width: 768px) {
    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
	.card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card > * {
        min-width: max-content;
    }
	.main {
		min-width: 0; /* 🔥 ADD THIS LINE */
	}
}

#customer_results {
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    margin-top: 4px;
    
}

/* Each result row */
#customer_results > div {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s ease;
}

/* Hover / active */
#customer_results > div:hover,
#customer_results > div.active {
    background-color: #f3f6ff;
}

/* Optional: highlight phone number */
#customer_results > div span {
    color: #777;
    font-size: 13px;
}