/* ===== Ahmed Cash — التصميم الموحد ===== */
:root {
    --red: #c8102e;
    --red-dark: #8f0a20;
    --red-soft: #fdecef;
    --gray-50: #f7f8fa;
    --gray-100: #eef0f3;
    --gray-200: #d9dde3;
    --gray-400: #8b93a1;
    --gray-600: #4a5361;
    --gray-800: #1f2530;
    --green: #0f8a3c;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 4px 16px rgba(20,25,40,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", system-ui, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    direction: rtl;
    line-height: 1.6;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* تنسيقات لوحة التحكم (Layout) */
.app-wrapper { display: flex; min-height: 100vh; flex-direction: column; }
.topbar {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand { font-size: 24px; font-weight: bold; color: var(--red); }
.brand span { color: var(--gray-800); }
.nav-links a { color: var(--gray-600); margin-left: 20px; font-weight: bold; }
.nav-links a:hover, .nav-links a.active { color: var(--red); text-decoration: none; }
.userbox { display: flex; gap: 20px; align-items: center; }
.logout { background: var(--red-soft); color: var(--red); padding: 8px 16px; border-radius: 8px; text-decoration: none; font-weight: bold; }

.main-container { padding: 30px; max-width: 1200px; margin: 0 auto; width: 100%; flex: 1; }

/* البطاقات (Cards) */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card { background: var(--white); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-100); }
.card h3 { font-size: 14px; color: var(--gray-600); margin-bottom: 10px; }
.card .value { font-size: 28px; font-weight: bold; }
.card .sub { font-size: 13px; color: var(--gray-600); margin-top: 5px; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

/* الجداول (Tables) */
.table-container { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; overflow-x: auto; margin-bottom: 20px; }
.table-container h2 { margin-bottom: 20px; font-size: 20px; color: var(--gray-800); }
table { width: 100%; border-collapse: collapse; text-align: right; font-size: 14px; }
th, td { padding: 12px; border-bottom: 1px solid var(--gray-100); }
th { background: var(--gray-50); font-weight: bold; color: var(--gray-600); }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: bold; background: #e6f6ec; color: var(--green); }

/* النماذج (Forms) */
.form-card { background: var(--white); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; align-items: end; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 13px; color: var(--gray-600); margin-bottom: 5px; }
.form-group input, .form-group select { padding: 10px; border: 1px solid var(--gray-200); border-radius: 8px; font-family: inherit; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: var(--red); }
.btn { padding: 10px 20px; background: var(--red); color: #fff; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; text-align: center; display: inline-block; }
.btn:hover { background: var(--red-dark); text-decoration: none; }
.btn-secondary { background: var(--gray-600); }

/* التنبيهات */
.alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: bold; }
.alert-success { background: #e6f6ec; color: var(--green); border: 1px solid #bce3c8; }
.alert-error { background: var(--red-soft); color: var(--red); border: 1px solid #f5c2cd; }

/* صفحة تسجيل الدخول */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%); }
.login-card { background: var(--white); padding: 40px 30px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); width: 100%; max-width: 400px; }
.login-card h1 { color: var(--red); text-align: center; margin-bottom: 5px; }
.login-card p.subtitle { color: var(--gray-600); text-align: center; margin-bottom: 25px; font-size: 14px; }