:root {
    --primary-color: #475569;
    --primary-hover: #334155;
    --secondary-color: #94a3b8;
    --background-color: #f1f5f9;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #cbd5e1;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0; /* Changed from 2rem to 0 to full width on root */
    direction: rtl;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem; /* Restore padding for container if used */
}

/* Card Style */
.card {
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.client-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 1.1rem;
}

.client-name {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

/* Table Design */
.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
}

th {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: right;
    padding: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Inputs */
input,
select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #ffffff;
    box-sizing: border-box; /* Fix width overlap */
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-icon {
    padding: 0.4rem;
    border-radius: 0.4rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
}

.btn-icon:hover {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: white;
    border-left: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out; 
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    background-color: var(--background-color);
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--background-color);
}

.sidebar-menu h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    padding: 0.7rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--background-color);
    color: var(--primary-color);
}

/* Mobile & Overlay */
.mobile-header {
    display: none;
    margin-bottom: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .dashboard-container {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(100%); /* Hidden by default RTL (+100% means right) */
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar .mobile-close-btn {
        display: block !important;
    }

    .mobile-header {
        display: block;
    }

    .main-content {
        padding: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
}