:root {
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --sidebar-active: #e0f2fe;
    --sidebar-active-text: #0284c7;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --card-bg: #ffffff;
    
    --stat-blue: #3b82f6;
    --stat-purple: #8b5cf6;
    --stat-green: #10b981;
    --stat-orange: #f59e0b;
    --accent-gold: #f59e0b;
    --accent-emerald: #10b981;
    --accent-orange: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 24px;
}

.sidebar-nav {
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.nav-btn:hover {
    background: #f1f5f9;
}

.nav-btn.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-header {
    background: #ffffff;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-body {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.stat-card.blue .stat-icon { background: var(--stat-blue); }
.stat-card.purple .stat-icon { background: var(--stat-purple); }
.stat-card.green .stat-icon { background: var(--stat-green); }
.stat-card.orange .stat-icon { background: var(--stat-orange); }
.stat-card.cyan .stat-icon { background: #06b6d4; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

/* Cards & Lists */
.section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.section-header {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.rentals-list > div {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

/* Grid layout for sections */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.grid-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}
.modal-backdrop.show {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}
.modal-box {
    background: var(--bg-color);
    width: 95%;
    max-width: 500px;
    border-radius: 16px;
    padding: 24px 24px 0 24px;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
}
.close-btn {
    background: #f1f5f9;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.close-btn:hover {
    background: #e2e8f0;
    color: #ef4444;
}

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 500;}
.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
}

/* Mobile Bottom Nav */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 900;
}
.bottom-nav-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
}
.bottom-nav-btn i { font-size: 20px; }
.bottom-nav-btn.active { color: var(--primary-color); }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .bottom-nav { display: flex; }
    .app-container { height: calc(100vh - 60px); }
    .content-body { padding: 15px; }
    .main-header { padding: 15px; }
}

/* Equipment Cards */
.eq-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.eq-img-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.eq-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.eq-img-wrapper:hover img {
    transform: scale(1.05);
}
.eq-badge-types {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f59e0b;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.eq-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.eq-card-title {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 600;
}
.eq-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex: 1;
}
.eq-price {
    color: #f59e0b;
    font-weight: 600;
    font-size: 14px;
}
.stock-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.stock-badge.available { background: #dcfce7; color: #166534; }
.stock-badge.empty { background: #fee2e2; color: #991b1b; }
.btn-block { width: 100%; display: block; text-align: center; }
.btn-primary.btn-block { background: #f59e0b; color: #fff; }
.btn-primary.btn-block:hover { background: #d97706; }

.btn-secondary { background: #fff; color: #1e293b; border: 1px solid #cbd5e1; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn-secondary:hover { background: #f8fafc; }
.btn-success { background: #10b981; color: #fff; border: 1px solid #10b981; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn-success:hover { background: #059669; }

.rentals-grid { display: flex; flex-direction: column; gap: 16px; padding: 10px 0; }
.rental-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.rental-client-info { padding: 15px; border-bottom: 1px solid var(--border-color); }
.rental-client-info h4 { margin: 0 0 5px 0; font-size: 16px; color: var(--text-main); }
.rental-client-info p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* Order index badge (1, 2, 3...) */
.rental-order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    background: #f1f5f9;
    color: #0284c7;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    margin-right: 8px;
}

/* Call button on the right */
.rental-phone-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.rental-phone-call-btn:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}
.rental-items-badge-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rental-item-tag { background: #f1f5f9; border: 1px solid #e2e8f0; padding: 4px 8px; border-radius: 6px; font-size: 12px; color: #334155; }
.rental-meta-box { padding: 15px; background: #fafafa; display: flex; flex-direction: column; align-items: flex-end; }
.rental-timer { font-size: 13px; color: var(--text-muted); }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 12px; }
.btn-secondary.sm, .btn-success.sm { padding: 4px 8px; font-size: 12px; }

/* Toolbar and Search Box */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}
.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}
.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}
