/* جرد الأجهزة المكتبية حسب الدور — هوية مستقلة: كحلي مائل للأخضر + أخضر مكتبي هادئ */

:root {
    --ink: #1e2b26;
    --ink-light: #27352f;
    --teal: #2f7a66;
    --teal-light: #4fa189;
    --bg: #f2f5f3;
    --card: #ffffff;
    --border: #dde4e0;
    --text: #1c2521;
    --text-muted: #5f6b65;
    --danger: #9c3b33;
    --success: #276a4e;
    --radius: 8px;
}

* { box-sizing: border-box; max-width: 100%; }
html { direction: rtl; }

body {
    margin: 0;
    font-family: 'Tahoma', 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
a, button, .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

.site-header {
    background: var(--ink);
    color: #fff;
    padding: 0.9rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 3px solid var(--teal);
}
.site-header .brand { display: flex; flex-direction: column; min-width: 0; }
.site-header .brand .ministry { font-size: 0.78rem; color: #c3cdc8; }
.site-header .brand .title { font-size: 1.05rem; font-weight: 700; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.2rem 0.4rem; }
.site-header nav a { color: #fff; font-size: 0.9rem; padding: 0.4rem 0.5rem; display: inline-block; }

.main-content { padding: 1.5rem; max-width: 900px; margin: 0 auto; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.card h1, .card h2, .card h3 { margin-top: 0; color: var(--ink); }

.section-title { font-size: 0.95rem; font-weight: 700; color: var(--teal); margin: 1.3rem 0 0.6rem; border-right: 3px solid var(--teal); padding-right: 0.6rem; }

.field { margin-bottom: 1.1rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.field-row .field { flex: 1 1 180px; min-width: 0; }

label { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; color: var(--text-muted); font-weight: 600; }
input[type=text], input[type=number], input[type=password], select {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--teal); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.3rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    background: var(--teal);
    color: #fff;
}
.btn:hover { background: var(--teal-light); }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #f4e3e1; color: var(--danger); border: 1px solid #e0bab5; }
.alert-success { background: #e1efe8; color: var(--success); border: 1px solid #b9dcc8; }
.alert ul { margin: 0; padding-right: 1.2rem; }

.meta-note { font-size: 0.82rem; color: var(--text-muted); margin-top: -0.3rem; margin-bottom: 1rem; }

.login-wrap {
    max-width: 380px;
    margin: 4rem auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.login-wrap h1 { text-align: center; color: var(--ink); font-size: 1.05rem; margin-bottom: 1.5rem; font-weight: 700; }

.site-footer { text-align: center; padding: 1.2rem; font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border); background: #fff; }

table { border-collapse: collapse; background: #fff; }
th, td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); text-align: start; font-size: 0.82rem; word-break: break-word; }
th { background: var(--bg); color: var(--ink); font-weight: 700; }
tr.totals-row td { font-weight: 700; background: var(--bg); color: var(--ink); }

/* Wide data tables (admin overview, 13 columns): let them overflow their
   .card and scroll horizontally instead of squeezing every column to fit
   the phone's width — overriding the universal max-width:100% safety net
   above, which otherwise wraps every Arabic label into an unreadable mess. */
.card table.wide { width: max-content; min-width: 100%; max-width: none; }
.card table.wide th, .card table.wide td { white-space: nowrap; word-break: normal; }

@media (max-width: 480px) {
    .site-header { padding: 0.7rem 1rem; }
    .main-content { padding: 1rem; }
    .card { padding: 1.1rem; }
    .login-wrap { margin: 2rem auto; padding: 1.5rem; max-width: calc(100% - 2rem); }
    .field-row { gap: 0.75rem; }
}
