:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f4f7f6;
    --text-color: #333;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
}

nav li {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    transition: background 0.3s;
}

nav ul li {
    /* Override the generic "ul li" list styling below, which otherwise
       wins on source order and hides nav text (white-on-light-gray). */
    background: transparent;
    color: var(--white);
}

nav li:hover,
nav li.active {
    background-color: var(--secondary-color);
    color: var(--white);
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

video,
img {
    max-width: 100%;
}

/* Utilities */
.hidden {
    display: none !important;
}

.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
}

/* RTL Specific Adjustments */
html[dir="rtl"] nav ul {
    padding-right: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    main {
        padding: 1rem;
    }
}

/* Form Styles Generic */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    box-sizing: border-box;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    background-color: var(--secondary-color);
    color: var(--white);
    font-size: 1rem;
}

.btn:hover {
    opacity: 0.9;
}

/* List Styles */
ul {
    list-style: none;
    padding: 0;
}

ul li {
    background: #f9f9f9;
    margin: 5px 0;
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

ul li button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card .icon {
    font-size: 2rem;
    padding: 10px;
    border-radius: 50%;
    background: #f0f0f0;
}

.stat-card.blue .icon {
    background: #ebf5fb;
    color: #3498db;
}

.stat-card.green .icon {
    background: #e9f7ef;
    color: #2ecc71;
}

.stat-card.orange .icon {
    background: #fef5e7;
    color: #f39c12;
}

.stat-card h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #777;
}

.stat-card p {
    margin: 5px 0 0 0;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    /* LTR default */
    z-index: 1000;
}

html[dir="rtl"] #toast-container {
    right: auto;
    left: 20px;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 24px;
    margin-top: 10px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #2ecc71;
}

.toast-error {
    background: #e74c3c;
}

.toast-info {
    background: #3498db;
}

/* Print Styles */
@media print {

    header,
    nav,
    .btn,
    .form-group input,
    .form-group select,
    #toast-container {
        display: none !important;
    }

    body,
    main,
    .card {
        background: white;
        box-shadow: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    /* Specifically for receipt printing */
    #finance-details {
        display: block !important;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--secondary-color);
    background-color: #f0f8ff;
}

.tab-btn.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    font-weight: bold;
}