/* ----------- القاعدة العامة ----------- */
html, body {
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
    background: #f4f7fb;
    margin: 0;
    padding: 0;
    direction: rtl;
    color: #222c3c;
}

/* ----------- ألوان وهوية ----------- */
:root {
    --blue-main: #2375be;
    --blue-dark: #184b80;
    --blue-light: #6da5df;
    --blue-bg: #e8f1fb;
    --border-main: #b6d3ee;
    --gray-light: #f7fafc;
    --gray: #cfdbe8;
    --danger: #d13b3b;
    --success: #37bb73;
}

/* ----------- العناوين والنصوص ----------- */
h1, h2, h3, h4, h5 {
    font-family: inherit;
    color: var(--blue-main);
    margin-top: 0;
}

h1 { font-size: 2.2em; font-weight: bold; }
h2 { font-size: 1.6em; font-weight: bold; }
h3 { font-size: 1.2em; }

a { color: var(--blue-main); text-decoration: none; transition: color 0.2s; }
a:hover, a:focus { color: var(--blue-dark); }

p { line-height: 1.7; }

/* ----------- الحاويات ----------- */
.container {
    width: 100%;
    max-width: 900px;
    margin: 30px auto 40px auto;
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 3px 20px #0001, 0 1.5px 8px #91b2d51a;
    padding: 36px 32px 32px 32px;
    min-height: 400px;
}

/* ----------- شريط المستخدم وأعلى الصفحة ----------- */
.header-bar, .user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--blue-main);
    color: #fff;
    padding: 13px 35px;
    border-radius: 10px 10px 0 0;
    font-size: 1.1em;
    box-shadow: 0 2px 8px #2375be10;
    margin-bottom: 22px;
}
.user-bar a, .header-bar a { color: #fff; font-weight: bold; }

.logout-btn {
    background: var(--danger);
    color: #fff !important;
    border: none;
    padding: 5px 18px;
    border-radius: 6px;
    margin-right: 7px;
    font-size: 0.97em;
    cursor: pointer;
    transition: background 0.17s;
}
.logout-btn:hover { background: #b22c2c; }

/* ----------- أزرار ----------- */
.btn {
    background: var(--blue-main);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 24px;
    font-size: 1em;
    margin: 6px 0;
    cursor: pointer;
    transition: background 0.17s, box-shadow 0.17s;
    box-shadow: 0 1.5px 7px #2375be20;
}
.btn:hover, .btn:focus {
    background: var(--blue-dark);
    box-shadow: 0 3px 15px #2375be28;
}
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a92222; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #258a52; }

/* ----------- بطاقات الروابط الرئيسية ----------- */
.card-link, .card {
    display: block;
    background: var(--blue-bg);
    color: var(--blue-dark);
    border: 1.5px solid var(--border-main);
    border-radius: 9px;
    text-align: center;
    padding: 28px 15px 19px 15px;
    font-size: 1.17em;
    margin: 0 8px 18px 8px;
    min-width: 180px;
    min-height: 80px;
    font-weight: bold;
    box-shadow: 0 2px 8px #b6d3ee16;
    transition: box-shadow 0.18s, border 0.15s, color 0.13s;
}
.card-link:hover, .card:hover {
    box-shadow: 0 7px 25px #2375be22;
    color: var(--blue-main);
    border-color: var(--blue-main);
    background: #f5faff;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
    margin-top: 16px;
}

/* ----------- الجداول ----------- */
.table-box {
    margin-top: 30px;
    overflow-x: auto;
    border-radius: 9px;
    background: #f8fbff;
    box-shadow: 0 1.5px 6px #2375be11;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    font-size: 1em;
}
th, td {
    padding: 13px 8px;
    border-bottom: 1.2px solid #e2e9f2;
    text-align: right;
}
th {
    background: var(--blue-main);
    color: #fff;
    font-weight: bold;
}
tr:nth-child(even) td {
    background: #f6fafd;
}
tr:hover td {
    background: #e8f1fb;
    transition: background 0.15s;
}

/* ----------- حقول وإدخال ----------- */
input[type="text"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
    border: 1.5px solid var(--border-main);
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 1.02em;
    background: #f9fbfe;
    margin-bottom: 8px;
    transition: border 0.17s;
    width: 98%;
    color: #1c3456;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--blue-main);
    outline: none;
    background: #f0f7ff;
}

label {
    display: block;
    margin-bottom: 4px;
    color: var(--blue-dark);
    font-weight: 500;
    font-size: 0.98em;
}

/* ----------- رسائل النظام ----------- */
.alert {
    border-radius: 6px;
    padding: 13px 15px;
    margin: 20px 0;
    font-size: 1.07em;
    background: #e8f2fc;
    color: #184b80;
    border: 1.3px solid var(--blue-main);
}
.alert-success {
    background: #dff7eb;
    color: #258a52;
    border-color: var(--success);
}
.alert-danger {
    background: #fae4e4;
    color: #b22c2c;
    border-color: var(--danger);
}

/* ----------- شريط التنقل العلوي ----------- */
.topnav {
    background: var(--blue-dark);
    padding: 0 30px;
    min-height: 54px;
    display: flex;
    align-items: center;
    border-radius: 0 0 13px 13px;
    box-shadow: 0 1px 7px #2375be10;
}
.topnav a {
    color: #fff;
    font-size: 1.07em;
    font-weight: 500;
    margin-left: 28px;
    padding: 7px 9px;
    border-radius: 6px;
    transition: background 0.14s, color 0.14s;
}
.topnav a.active, .topnav a:hover {
    background: var(--blue-main);
    color: #fff;
}

/* ----------- فوتر ----------- */
.footer {
    text-align: center;
    color: #6da5df;
    font-size: 1em;
    margin-top: 38px;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* ----------- عناصر إضافية ----------- */
.img-product {
    max-width: 170px;
    border-radius: 11px;
    box-shadow: 0 2px 15px #b6d3ee30;
    margin-bottom: 15px;
}

@media (max-width: 800px) {
    .container { padding: 15px 4vw; }
    .header-bar, .user-bar { padding: 8px 8vw; }
}
@media (max-width: 600px) {
    .links { flex-direction: column; gap: 12px; }
    .container { min-width: 99vw; }
}
