/* =========================================================
   public/css/app.css
   -----------------------------------------
   التنسيقات العامة الموحدة لنظام CRM
   - RTL
   - تصميم بسيط احترافي
   - بدون تكرار داخل الصفحات
   ========================================================= */

/* ===============================
   Reset & Base
=============================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f4f6f9;
    color: #333;
    direction: rtl;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ===============================
   Layout
=============================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 250px;
    background: #1f2937;
    color: #fff;
    transition: width 0.3s ease;
}

.sidebar-collapsed .app-sidebar {
    width: 70px;
}

.app-content {
    flex: 1;
    padding: 20px;
    background-color: #f4f6f9;
}

/* ===============================
   Navbar
=============================== */
.app-navbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

.navbar-title {
    font-size: 16px;
    font-weight: 600;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user {
    text-align: right;
}

.user-name {
    font-weight: 600;
    display: block;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}

.navbar-actions .nav-link {
    padding: 6px 10px;
    border-radius: 4px;
    background: #e5e7eb;
    font-size: 13px;
}

.navbar-actions .nav-link.danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ===============================
   Sidebar
=============================== */
.sidebar-header {
    padding: 15px;
    text-align: center;
    background: #111827;
    font-weight: 700;
}

.sidebar-menu {
    padding: 10px 0;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: #e5e7eb;
}

.sidebar-menu a:hover {
    background: #374151;
}

.menu-section {
    padding: 10px 20px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

/* ===============================
   Flash Messages
=============================== */
.flash-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-warning {
    background: #fef9c3;
    color: #854d0e;
}

.flash-info {
    background: #e0f2fe;
    color: #075985;
}

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* ===============================
   Cards
=============================== */
.card {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.card-header {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.card-body {
    padding: 15px;
}

.card-footer {
    padding: 12px 15px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ===============================
   Tables
=============================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th, td {
    padding: 10px;
    border: 1px solid #e5e7eb;
    text-align: right;
    font-size: 14px;
}

th {
    background: #f3f4f6;
    font-weight: 600;
}

/* ===============================
   Forms
=============================== */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-family: inherit;
    font-size: 14px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===============================
   Buttons
=============================== */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
}

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

/* ===============================
   Auth Pages
=============================== */
.auth-content {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f4f6;
}

.auth-box {
    width: 360px;
    background: #ffffff;
    padding: 25px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* ===============================
   Utilities
=============================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.hidden {
    display: none;
}

/* ===============================
   Responsive
=============================== */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        right: -250px;
        top: 0;
        height: 100%;
        z-index: 1000;
    }

    .sidebar-collapsed .app-sidebar {
        right: 0;
    }

    .app-content {
        padding: 15px;
    }
}
