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

body {
    background-color: #f5f7fa;
    color: #333;
    direction: rtl;
    line-height: 1.6;
    padding: 20px;
}

/* عناوين الصفحات */
h1,
h2,
h3,
h4 {
    color: #1e293b;
}

h1 {
    font-size: 2rem;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.4rem;
}

/* النماذج والعناصر */
.content {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 15px 12px 15px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.search-box button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
}

button[type="submit"] {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #2563eb;
}

/* نتائج البحث والفواتير */
.results-container {
    margin-top: 2rem;
}

.invoice-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    max-width: 100%;
    overflow-x: auto;
}

.invoice-card * {
    white-space: nowrap;
}

.invoice-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.invoice-header {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 1.5rem;
}

.invoice-header span {
    display: flex;
    gap: 1.5rem;
}

@media screen and (max-width: 550px) {
    .invoice-header {
        justify-content: space-between;
    }

    .invoice-header span {
        flex-direction: column;
        gap: 1rem;
    }
}

.invoice-details {
    margin-top: 1rem;
    padding-right: 1rem;
    border-right: 3px solid #3b82f6;
}

.invoice-items {
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 12px 15px;
    text-align: right;
    border: 1px solid #e2e8f0;
}

th {
    color: #fff;
    background-color: #3b82f6;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f8fafc;
}

/* حالات الضمان */
.warranty-active {
    background-color: #dcfce7;
    color: #166534;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.warranty-expired {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* حالة عدم وجود نتائج */
.no-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.no-results i {
    font-size: 3rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.no-results h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* التنبيهات */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.alert.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* النماذج */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #1e293b;
}

select,
input,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

select:focus,
input:focus,
textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

/* العناصر المخصصة للفاتورة */
#items-container {
    margin-bottom: 1rem;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.item-row select {
    flex: 2;
}

.item-row input {
    flex: 1;
}

.item-total {
    flex: 1;
    text-align: center;
    font-weight: bold;
}

.remove-item {
    background-color: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
}

.remove-item:hover {
    background-color: #fecaca;
}

#add-item {
    background-color: #e0f2fe;
    color: #0369a1;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
}

#add-item:hover {
    background-color: #bae6fd;
}

/* التنسيق العام */
.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.gap-4 {
    gap: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.text-blue-600 {
    color: #2563eb;
}

.bg-gray-100 {
    background-color: #f1f5f9;
}

.rounded-lg {
    border-radius: 8px;
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.warranty {
    margin-top: 50px;
    border-top: 2px solid var(--border-color);
    padding-top: 20px;
}

.warranty h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 27px;
}

.warranty ul {
    padding-right: 20px;
    line-height: 1.8;
}

.warranty li {
    margin-bottom: 10px;
}

.btn {
  padding: 10px 25px;
  border-radius: 5px;
  color: #fff;
  text-decoration: none;
  border: none;
  outline: none;
  font-size: 1.05rem;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}