@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Open+Sans:wght@400;600;700&display=swap');

:root {
    --primary-color: #28a745;
    --dark-bg: #343a40;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --purple-color: #6f42c1;
    --warning-color: #ffc107;
    --orange-color: #fd7e14;
    --light-bg: #f8f9fa;
    --input-bg: #f0f0f0;
    --text-dark: #343a40;
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Cairo', 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--light-bg);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

input, button, select, textarea {
    font-family: inherit;
}

.custom-input {
    background-color: var(--input-bg) !important;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-input:focus {
    background-color: #ffffff !important;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.btn-farm-green {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-farm-green:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #ffffff;
}

.btn-farm-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: #ffffff;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-farm-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #ffffff;
}

.btn-farm-purple {
    background-color: var(--purple-color);
    border-color: var(--purple-color);
    color: #ffffff;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-farm-purple:hover {
    background-color: #5a32a3;
    border-color: #4e2b8c;
    color: #ffffff;
}

.btn-farm-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: #ffffff;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-farm-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: #ffffff;
}

.farm-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: none;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.farm-footer-bar {
    background-color: var(--dark-bg);
    color: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.amount-synced {
    color: #28a745 !important;
    font-weight: 700;
}

.amount-unsynced {
    color: #fd7e14 !important;
    font-weight: 700;
}

.trans-table {
    width: 100%;
    margin-bottom: 0;
}

.trans-table thead th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    padding: 10px 12px;
}

.trans-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.trans-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Sidebar & Navigation */
.app-sidebar {
    background: #1e2429;
    color: #ffffff;
    min-height: 100vh;
    width: 260px;
    transition: right 0.25s ease-in-out;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    margin: 0.2rem 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
    background-color: #28a745;
}

.app-brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.app-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.app-brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.role-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    color: #ffc107;
    display: inline-block;
}

/* Mobile Header */
.mobile-header {
    background-color: #1e2429;
    color: #ffffff;
    padding: 0.75rem 1rem;
    display: none;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        right: -300px;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1055;
        box-shadow: -5px 0 25px rgba(0,0,0,0.4);
        overflow-y: auto;
    }

    .app-sidebar.show {
        right: 0 !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.55);
        backdrop-filter: blur(2px);
        z-index: 1050;
    }

    .mobile-header {
        display: flex;
    }
}
