/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - 80% White + 20% Dark Green */
    --primary-bg: linear-gradient(135deg, #f8f9fa 80%, #1e4d3b 20%);
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --accent-green: #1e4d3b;
    --accent-light: #e8f5e8;
    --shadow-light: rgba(255, 255, 255, 0.8);
    --shadow-dark: rgba(0, 0, 0, 0.1);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--primary-bg);
    min-height: 100vh;
    direction: rtl;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.company-logo {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-wrapper {
    position: relative;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    transition: var(--transition);
}

.company-logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
    transition: var(--transition);
    display: block;
    object-fit: cover;
}

.logo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 77, 59, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
    border-radius: 50%;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}

.logo-overlay i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.logo-wrapper:hover .logo-overlay {
    opacity: 1;
}

.logo-wrapper:hover .company-logo-img {
    transform: scale(1.05);
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
}

.logo-wrapper:active {
    transform: scale(0.98);
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin: 0;
}

.logo-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
    font-style: italic;
}

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

.system-title h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.system-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 5px 0 0 0;
    font-style: italic;
}

/* Barn Code Display */
.barn-code-display {
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-green), #2d6a4f);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
    animation: slideIn 0.5s ease-out;
}

.code-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
}

.code-value {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    word-break: break-all;
    line-height: 1.3;
}

/* شريط تقدم الحقول */
.fields-progress {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 15px 20px;
    margin: 15px 0;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
    border: 2px solid transparent;
    transition: var(--transition);
}

.progress-label {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.progress-bar {
    position: relative;
    background: var(--main-bg);
    border-radius: 20px;
    height: 25px;
    overflow: hidden;
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 20px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 15px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green), #2d6a4f);
    color: white;
    box-shadow: 
        4px 4px 8px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        6px 6px 12px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 
        4px 4px 8px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light);
}

.btn:active {
    transform: translateY(1px);
    box-shadow:
        2px 2px 4px var(--shadow-dark),
        -1px -1px 2px var(--shadow-light);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle::after {
    content: '';
    margin-right: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow:
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    margin-top: 5px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
    margin: 4px;
}

.dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent-green);
    transform: translateX(-3px);
}

.dropdown-item:first-child {
    margin-top: 8px;
}

.dropdown-item:last-child {
    margin-bottom: 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Search Section */
.search-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.search-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-light);
}

.search-header h3 {
    color: var(--accent-green);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--accent-light);
    color: var(--accent-green);
}

.search-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-controls input,
.search-controls select {
    flex: 1;
    min-width: 200px;
}

/* Form Section */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: stretch;
}

/* Panel Cards */
.panel-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow:
        8px 8px 16px var(--shadow-dark),
        -8px -8px 16px var(--shadow-light);
    transition: var(--transition);
}

.full-width-panel {
    width: 100%;
}

.panel-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--accent-light);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: 
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light),
        0 0 0 3px rgba(30, 77, 59, 0.1);
}

.form-input:read-only {
    background: var(--accent-light);
    color: var(--accent-green);
    font-weight: 600;
}

/* Custom Manufacturer Input */
.custom-manufacturer {
    animation: slideDown 0.3s ease-out;
    border: 2px solid var(--accent-green) !important;
}

.custom-manufacturer:focus {
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light),
        0 0 0 3px rgba(30, 77, 59, 0.2) !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 50px;
    }
}

/* Availability Section Styles */
.availability-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--accent-light);
    border-radius: 15px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.availability-section:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-green);
}

.section-header i {
    color: var(--accent-green);
    font-size: 1.2rem;
}

.section-header h4 {
    color: var(--accent-green);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.status-card {
    cursor: pointer;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    background: var(--card-bg);
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.status-card input[type="radio"] {
    display: none;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.card-content i {
    font-size: 1.5rem;
    transition: var(--transition);
}

.card-content span {
    font-weight: 600;
    font-size: 0.9rem;
}

.status-card.available .card-content i {
    color: #28a745;
}

.status-card.reserved .card-content i {
    color: #ffc107;
}

.status-card.sold .card-content i {
    color: #dc3545;
}

.status-card input[type="radio"]:checked + .card-content {
    transform: scale(1.05);
}

.status-card.available input[type="radio"]:checked ~ * {
    color: #28a745;
}

.status-card.reserved input[type="radio"]:checked ~ * {
    color: #ffc107;
}

.status-card.sold input[type="radio"]:checked ~ * {
    color: #dc3545;
}

.status-card:hover {
    transform: translateY(-3px);
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
}

/* Equipment Items */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.equipment-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 0;
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.equipment-item:hover {
    transform: translateX(-3px);
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
}

.equipment-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.equipment-info i {
    color: var(--accent-green);
    font-size: 1.5rem;
    margin-top: 5px;
}

.equipment-details h5 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.equipment-details p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.switch {
    cursor: pointer;
    position: relative;
}

.switch input[type="radio"] {
    display: none;
}

.slider {
    display: block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    min-width: 70px;
}

.slider.yes {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    color: #28a745;
    box-shadow:
        inset 2px 2px 4px rgba(40, 167, 69, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.slider.no {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #dc3545;
    box-shadow:
        inset 2px 2px 4px rgba(220, 53, 69, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.switch input[type="radio"]:checked + .slider {
    transform: scale(1.05);
    border-color: currentColor;
    box-shadow:
        2px 2px 4px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light);
}

/* Feed System Options */
.feed-system-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.feed-option {
    cursor: pointer;
    border-radius: 12px;
    padding: 15px;
    background: var(--card-bg);
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
    flex: 1;
    max-width: 120px;
}

.feed-option input[type="radio"] {
    display: none;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.option-content i {
    font-size: 1.3rem;
    color: var(--accent-green);
    transition: var(--transition);
}

.option-content span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.feed-option:hover {
    transform: translateY(-2px);
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
}

.feed-option input[type="radio"]:checked + .option-content {
    transform: scale(1.1);
}

.feed-option input[type="radio"]:checked + .option-content i {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(30, 77, 59, 0.3);
}

/* Date Inputs */
.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.date-group {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
}

.date-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.date-group label i {
    color: var(--accent-green);
    font-size: 1rem;
}

.date-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    background: var(--accent-light);
    color: var(--text-primary);
    transition: var(--transition);
    direction: ltr;
    text-align: center;
}

.date-input:focus {
    outline: none;
    border-color: var(--accent-green);
    background: var(--card-bg);
    box-shadow:
        0 0 0 3px rgba(30, 77, 59, 0.1),
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light);
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-top: 30px;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 25px;
}

.footer-section h3 {
    color: var(--accent-green);
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section h4 {
    color: var(--accent-green);
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section p {
    margin: 5px 0;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section a {
    color: var(--accent-green);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.company-subtitle {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 2px solid var(--accent-light);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    margin: 5px 0;
}

.footer-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.developer-credit {
    font-size: 0.75rem;
    color: #495057;
    margin-top: 8px;
    padding: 5px 10px;
    background: rgba(30, 77, 59, 0.1);
    border-radius: 15px;
    display: inline-block;
    border: 1px solid rgba(30, 77, 59, 0.2);
    font-weight: 500;
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    transition: var(--transition);
    box-shadow: 
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.toast.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.toast.info {
    background: linear-gradient(135deg, #17a2b8, #20c997);
}

/* Print Styles */
.print-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.print-content {
    background: white;
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    max-height: 90vh;
}

@media print {
    body * {
        visibility: hidden;
    }

    .print-content,
    .print-content * {
        visibility: visible;
    }

    .print-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        padding: 15mm;
        box-shadow: none;
    }

    .print-header {
        margin-bottom: 30px;
        border-bottom: 2px solid var(--accent-green);
        padding-bottom: 15px;
    }

    .print-logo-section {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 15px;
    }

    .print-company-info {
        text-align: center;
    }

    .print-title {
        font-size: 18pt;
        font-weight: bold;
        color: var(--accent-green);
        margin-bottom: 5px;
    }

    .print-company {
        font-size: 14pt;
        color: var(--text-primary);
        margin-bottom: 3px;
    }

    .print-company-en {
        font-size: 12pt;
        color: var(--text-secondary);
        font-style: italic;
    }

    .print-contact-info {
        text-align: center;
        color: var(--text-secondary);
        border-top: 1px solid var(--accent-light);
        padding-top: 10px;
    }

    .print-section {
        margin-bottom: 25px;
        page-break-inside: avoid;
    }

    .print-section-title {
        font-size: 14pt;
        font-weight: bold;
        color: var(--accent-green);
        margin-bottom: 15px;
        border-bottom: 1px solid var(--accent-light);
        padding-bottom: 5px;
    }

    .print-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        padding: 5px 0;
        border-bottom: 1px dotted #ccc;
    }

    .print-label {
        font-weight: bold;
        color: var(--text-primary);
    }

    .print-value {
        color: var(--text-secondary);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .equipment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .header-actions {
        justify-content: center;
    }

    .company-logo h1 {
        font-size: 1.4rem;
    }

    .system-title h2 {
        font-size: 1.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .panel-card {
        padding: 20px;
    }

    .panel-title {
        font-size: 1.2rem;
    }

    .equipment-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .equipment-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .search-controls {
        flex-direction: column;
    }

    .search-controls input,
    .search-controls select {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .panel-title {
        font-size: 1.1rem;
    }

    .company-logo i {
        font-size: 2rem;
    }

    .company-logo h1 {
        font-size: 1.2rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Search Results Styles */
.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    background: var(--accent-light);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.search-result-item:hover {
    background: var(--accent-green);
    color: white;
    transform: translateX(-5px);
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.search-result-details {
    font-size: 0.9rem;
    opacity: 0.8;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Registered Barns Section */
.registered-barns-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--main-bg);
    z-index: 1000;
    overflow-y: auto;
    padding: 0;
}

.barns-card {
    background: var(--card-bg);
    border-radius: 0;
    padding: 30px;
    width: 100%;
    min-height: 100vh;
    box-shadow: none;
}

.barns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-light);
}

.usage-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e3f2fd, #f0f8ff);
    color: #1976d2;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(25, 118, 210, 0.2);
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.1);
    flex: 1;
    min-width: 300px;
    order: 2;
}

.usage-tip i {
    color: #1976d2;
    font-size: 0.9rem;
}

.barns-header h3 {
    color: var(--accent-green);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.barns-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.barns-search-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.barns-search-input {
    padding: 8px 12px;
    border: 2px solid var(--accent-light);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    min-width: 200px;
    transition: var(--transition);
}

.barns-search-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(30, 77, 59, 0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.sort-select {
    padding: 8px 12px;
    border: 2px solid var(--accent-light);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

/* Barns Statistics */
.barns-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: var(--accent-light);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
}

.stat-item i {
    font-size: 1.2rem;
    color: var(--accent-green);
}

.stat-item span {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.stat-item strong {
    color: var(--accent-green);
    font-weight: 700;
}

/* Barns Filters */
.barns-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 16px;
    border: 2px solid var(--accent-light);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow:
        2px 2px 4px var(--shadow-dark),
        -2px -2px 4px var(--shadow-light);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.filter-btn.active {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.filter-btn i {
    font-size: 0.9rem;
}

/* Barns Grid */
.barns-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.barn-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 80px;
}

.barn-code-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-start;
}

.barn-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-green);
    transition: var(--transition);
}

.barn-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-green);
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
}

.barn-card:hover::before {
    width: 8px;
}

.barn-card.highlighted {
    border: 3px solid #ffc107;
    background: linear-gradient(135deg, #fff9c4, #fff3cd);
    box-shadow:
        0 0 20px rgba(255, 193, 7, 0.4),
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
    animation: highlight-pulse 2s ease-in-out infinite;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(255, 193, 7, 0.4),
            4px 4px 8px var(--shadow-dark),
            -4px -4px 8px var(--shadow-light);
    }
    50% {
        box-shadow:
            0 0 30px rgba(255, 193, 7, 0.6),
            6px 6px 12px var(--shadow-dark),
            -6px -6px 12px var(--shadow-light);
    }
}

.barn-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.barn-title h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 3px 0;
    line-height: 1.2;
}

.barn-title p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.barn-status {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
}

.barn-status.available {
    background: #d4edda;
    color: #155724;
}

.barn-status.reserved {
    background: #fff3cd;
    color: #856404;
}

.barn-status.sold {
    background: #f8d7da;
    color: #721c24;
}

.barn-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    flex: 2;
}

.barn-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.barn-detail i {
    color: var(--accent-green);
    font-size: 0.9rem;
    width: 12px;
}

.barn-code-detail {
    background: var(--accent-green);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.8px;
    box-shadow:
        0 3px 8px rgba(30, 77, 59, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: var(--transition);
    border: 2px solid transparent;
}

.barn-code-detail:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(30, 77, 59, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.barn-code-detail i {
    color: white;
    font-size: 1rem;
}

.barn-code-text {
    font-size: 0.85rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.edited-badge {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 8px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(255, 107, 53, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.barn-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.barn-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.barn-action-btn.edit {
    background: #e3f2fd;
    color: #1976d2;
}

.barn-action-btn.delete {
    background: #ffebee;
    color: #d32f2f;
}

.barn-action-btn.original {
    background: #f8f9fa;
    color: #6c757d;
}

.barn-action-btn.export {
    background: #e3f2fd;
    color: #1976d2;
}

.barn-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* No Barns Message */
.no-barns {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-barns i {
    font-size: 4rem;
    color: var(--accent-light);
    margin-bottom: 20px;
}

.no-barns h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.no-barns p {
    font-size: 0.9rem;
    margin: 0;
}

/* Export Modal */
.export-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.export-modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow:
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.export-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-light);
}

.export-modal-header h3 {
    color: var(--accent-green);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.export-barn-info {
    background: var(--accent-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid var(--accent-green);
}

.export-barn-info h4 {
    color: var(--accent-green);
    font-size: 1.1rem;
    margin: 0 0 10px 0;
}

.export-barn-info p {
    color: var(--text-secondary);
    margin: 5px 0;
    font-size: 0.9rem;
}

.export-barn-code {
    background: var(--accent-green);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    display: inline-block;
    margin-top: 10px;
}

.export-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.export-option-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 15px;
    background: var(--card-bg);
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.export-option-btn:hover {
    transform: translateY(-3px);
    border-color: var(--accent-green);
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
}

.export-option-btn i {
    font-size: 2.5rem;
    transition: var(--transition);
}

.export-option-btn.pdf i {
    color: #dc3545;
}

.export-option-btn.word i {
    color: #2b579a;
}

.export-option-btn.print i {
    color: #6f42c1;
}

.option-details h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.option-details p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.export-option-btn:hover i {
    transform: scale(1.1);
}

.export-option-btn:active {
    transform: translateY(-1px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow:
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--accent-light);
    border-top: 4px solid var(--accent-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

/* Statistics Panel */
.stats-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    z-index: 100;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.stats-item i {
    color: var(--accent-green);
    font-size: 1rem;
}

.stats-label {
    font-weight: 500;
}

.stats-value {
    font-weight: 700;
    color: var(--accent-green);
}

/* Custom Icons */
.fa-conveyor-belt::before {
    content: "\f55b"; /* Using truck-loading icon as alternative */
}

.fa-control-panel::before {
    content: "\f108"; /* Using desktop icon as alternative */
}

/* Enhanced Form Validation */
.form-input.error {
    border-color: #dc3545;
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light),
        0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* تمييز الحقول المفقودة */
input.error, select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.missing-field {
    border: 2px solid #dc3545 !important;
    background: linear-gradient(135deg, #fff5f5, #ffebee) !important;
    animation: missing-field-pulse 2s ease-in-out infinite;
}

@keyframes missing-field-pulse {
    0%, 100% {
        border-color: #dc3545;
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
    }
    50% {
        border-color: #ff1744;
        box-shadow: 0 0 15px rgba(255, 23, 68, 0.5);
    }
}

/* تمييز التركيز */
.focus-highlight {
    border: 3px solid #ffc107 !important;
    background: linear-gradient(135deg, #fff9c4, #fff3cd) !important;
    animation: focus-highlight-pulse 1s ease-in-out 2;
}

@keyframes focus-highlight-pulse {
    0%, 100% {
        border-color: #ffc107;
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
    }
    50% {
        border-color: #ff8f00;
        box-shadow: 0 0 20px rgba(255, 143, 0, 0.6);
    }
}

.form-input.success {
    border-color: #28a745;
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light),
        0 0 0 3px rgba(40, 167, 69, 0.1);
}

.field-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.field-error i {
    font-size: 0.7rem;
}

/* Improved Mobile Responsiveness */
@media (max-width: 768px) {
    .stats-panel {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 20px;
        flex-direction: column;
        gap: 10px;
    }

    .dropdown-menu {
        right: auto;
        left: 0;
        min-width: 180px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .company-logo-img {
        width: 50px;
        height: 50px;
    }

    .logo-text h1 {
        font-size: 1.4rem;
    }

    .logo-overlay {
        font-size: 0.6rem;
    }

    .logo-overlay i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        padding: 10px 15px;
        font-size: 0.8rem;
    }

    .loading-spinner {
        padding: 20px;
    }

    .spinner {
        width: 40px;
        height: 40px;
    }

    .footer {
        padding: 20px;
    }

    .footer-section h3 {
        font-size: 1rem;
    }

    .footer-section h4 {
        font-size: 0.9rem;
    }

    .footer-section p {
        font-size: 0.8rem;
    }

    .company-logo-img {
        width: 40px;
        height: 40px;
    }

    .logo-text h1 {
        font-size: 1.2rem;
    }

    .logo-subtitle {
        font-size: 0.8rem;
    }

    .logo-overlay {
        font-size: 0.5rem;
    }

    .logo-overlay i {
        font-size: 0.8rem;
        margin-bottom: 1px;
    }

    .logo-overlay span {
        display: none; /* إخفاء النص على الهواتف */
    }

    /* Responsive Availability Section */
    .status-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .status-card {
        padding: 12px;
    }

    .card-content {
        flex-direction: row;
        justify-content: center;
    }

    .card-content i {
        font-size: 1.2rem;
    }

    .equipment-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .equipment-info i {
        font-size: 2rem;
        margin-top: 0;
    }

    .toggle-switch {
        flex-direction: column;
        gap: 8px;
    }

    .feed-system-options {
        flex-direction: column;
        gap: 10px;
    }

    .feed-option {
        max-width: none;
    }

    .date-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .availability-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .section-header i {
        font-size: 1.5rem;
    }

    /* Responsive Registered Barns */
    .barns-card {
        padding: 20px;
        max-height: 95vh;
    }

    .barns-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .usage-tip {
        min-width: auto;
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .barns-header-actions {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    .barns-search-controls {
        flex-direction: column;
        width: 100%;
    }

    .barns-search-input {
        min-width: auto;
        width: 100%;
    }

    .barn-code-display {
        padding: 10px 15px;
        margin-top: 10px;
    }

    .code-value {
        font-size: 1rem;
    }

    .barn-code-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .barns-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .barns-filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .barns-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .barn-card {
        padding: 15px;
    }

    .barn-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .barn-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .barn-action-btn {
        flex: 1;
        min-width: 70px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .barns-card {
        padding: 15px;
    }

    .barns-stats {
        grid-template-columns: 1fr;
    }

    .stat-item {
        padding: 12px;
        font-size: 0.85rem;
    }

    .barns-filters {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .barn-card {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        min-height: auto;
    }

    .barn-header {
        flex-direction: column;
        gap: 10px;
    }

    .barn-details {
        flex-direction: column;
        gap: 10px;
    }

    .barn-title h4 {
        font-size: 1rem;
    }

    .barn-status {
        align-self: center;
        margin-top: 5px;
    }

    .barn-detail {
        font-size: 0.75rem;
    }

    .barn-code-header {
        margin-bottom: 10px;
        justify-content: center;
    }

    .barn-code-detail {
        padding: 6px 12px;
        font-size: 0.75rem;
        border-radius: 20px;
    }

    .barn-code-detail i {
        font-size: 0.9rem;
    }

    .barn-code-text {
        font-size: 0.75rem;
    }

    .barn-action-btn {
        padding: 8px;
        font-size: 0.7rem;
    }

    .barn-actions {
        justify-content: center;
        border-top: 1px solid var(--accent-light);
        padding-top: 15px;
        margin-top: 10px;
    }

    .no-barns i {
        font-size: 3rem;
    }

    .no-barns h4 {
        font-size: 1rem;
    }

    .no-barns p {
        font-size: 0.8rem;
    }

    .export-modal-content {
        padding: 20px;
        margin: 10px;
    }

    .export-options {
        gap: 10px;
    }

    .export-option-btn {
        padding: 15px;
        gap: 15px;
    }

    .export-option-btn i {
        font-size: 2rem;
    }

    .barn-code-display {
        flex-direction: column;
        gap: 5px;
        padding: 8px 12px;
    }

    .code-value {
        font-size: 0.9rem;
    }
}

/* Database Management Panel Styles */
.database-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.database-panel-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
    animation: slideIn 0.3s ease-out;
}

.database-panel-header {
    background: linear-gradient(135deg, var(--accent-green), #2d6a4f);
    color: white;
    padding: 20px 30px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.database-panel-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.database-panel-body {
    padding: 30px;
}

.database-panel-body h4 {
    color: var(--accent-green);
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-light);
}

/* Connection Status Section */
.connection-status-section {
    margin-bottom: 30px;
}

.status-cards-db {
    display: flex;
    gap: 15px;
}

.status-card-db {
    background: var(--accent-light);
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
    box-shadow:
        4px 4px 8px var(--shadow-dark),
        -4px -4px 8px var(--shadow-light);
}

.status-card-db:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
}

.status-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #6c757d, #495057);
    transition: var(--transition);
}

.status-icon.connected {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.status-icon.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.status-icon.loading {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.status-info {
    flex: 1;
}

.status-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.status-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Database Statistics */
.database-stats-section {
    margin-bottom: 30px;
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid var(--accent-light);
    transition: var(--transition);
    box-shadow:
        3px 3px 6px var(--shadow-dark),
        -3px -3px 6px var(--shadow-light);
}

.stat-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow:
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), #2d6a4f);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-green);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Sync Section */
.sync-section {
    margin-bottom: 30px;
}

.sync-info {
    background: var(--accent-light);
    border-radius: 12px;
    padding: 20px;
    box-shadow:
        inset 2px 2px 4px var(--shadow-dark),
        inset -2px -2px 4px var(--shadow-light);
}

.sync-status {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.sync-status span:first-child {
    font-weight: 600;
}

.sync-status span:last-child {
    color: var(--accent-green);
    font-weight: 500;
}

.sync-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Tables Section */
.tables-section {
    margin-bottom: 20px;
}

.tables-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tables-status {
    background: var(--card-bg);
    border: 2px solid var(--accent-light);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.tables-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.9rem;
}

.tables-info > div {
    padding: 8px 12px;
    background: var(--accent-light);
    border-radius: 6px;
}

.tables-info span {
    font-weight: 600;
    color: var(--accent-green);
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background: var(--accent-light);
    margin: 8px 0;
}

/* Loading Animation for Buttons */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.success-state {
    color: #28a745 !important;
    background: linear-gradient(135deg, #d4edda, #c3e6cb) !important;
}

.error-state {
    color: #dc3545 !important;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb) !important;
}

/* Responsive Design for Database Panel */
@media (max-width: 768px) {
    .database-panel-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .database-panel-header {
        padding: 15px 20px;
    }
    
    .database-panel-body {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .status-cards-db {
        flex-direction: column;
    }
    
    .sync-actions {
        flex-direction: column;
    }
    
    .tables-actions {
        flex-direction: column;
    }
    
    .tables-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .database-panel {
        padding: 10px;
    }
    
    .database-panel-header h3 {
        font-size: 1.1rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .status-card-db {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Animation for panel appearance */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Toast Improvements */
.toast {
    font-family: 'Cairo', sans-serif;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.show {
    transform: translateX(0) !important;
    opacity: 1;
}

/* Connection Status Indicator Improvements */
#db-connection-status {
    font-family: 'Cairo', sans-serif;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#db-connection-status:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}


/* ═══════════════════════════════════════════════════════════════ */
/*                    نظام الصلاحيات - Permissions                */
/* ═══════════════════════════════════════════════════════════════ */

/* شارة المستخدم */
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-right: 15px;
    animation: slideIn 0.3s ease-out;
}

.user-badge i {
    font-size: 18px;
    color: #1e4d3b;
}

.user-badge .user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-badge .role-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.user-badge .role-badge.admin {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.user-badge .role-badge.user {
    background: linear-gradient(135deg, #007bff, #17a2b8);
    color: white;
}

/* الأزرار المعطلة */
button:disabled,
button.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important;
}

button:disabled:hover,
button.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* عناصر القائمة المعطلة */
.dropdown-item.disabled,
.dropdown-item[style*="pointer-events: none"] {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.dropdown-item.disabled:hover,
.dropdown-item[style*="pointer-events: none"]:hover {
    background: transparent !important;
}

/* أيقونة القفل */
.dropdown-item .fa-lock {
    margin-left: 8px;
    color: #dc3545;
    font-size: 12px;
}

/* Tooltip للعناصر المحظورة */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    animation: fadeIn 0.2s;
}

/* رسالة رفض الصلاحية */
.permission-denied-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

.permission-denied-modal {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease-out;
}

.permission-denied-modal i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 20px;
}

.permission-denied-modal h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 22px;
}

.permission-denied-modal p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسينات للموبايل */
@media (max-width: 768px) {
    .user-badge {
        padding: 6px 12px;
        gap: 8px;
    }

    .user-badge .user-name {
        font-size: 12px;
    }

    .user-badge .role-badge {
        padding: 3px 10px;
        font-size: 11px;
    }

    .permission-denied-modal {
        margin: 20px;
        padding: 25px;
    }
}
