/* بوابة المواد العلمية للكليات التكنولوجية
   هوية رسمية: كحلي غامق + ذهبي مطفي، بلا تدرجات أو زخارف غير ضرورية. */

:root {
    --navy: #0b2a4a;
    --navy-dark: #081d33;
    --gold: #9c7a2e;
    --gold-light: #b99a4e;
    --bg: #ffffff;
    --bg-alt: #f5f6f8;
    --text: #262626;
    --text-muted: #5a5f66;
    --border: #d9dde2;
    --danger: #8a2525;
    --success: #1f5c3a;
    --radius: 4px;
}

* { box-sizing: border-box; }

html { direction: rtl; }

body {
    margin: 0;
    font-family: 'Cairo', 'Tahoma', sans-serif;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
    background: var(--navy);
    color: #fff;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--gold);
}

.site-header .brand {
    display: flex;
    flex-direction: column;
}

.site-header .brand .ministry {
    font-size: 0.8rem;
    color: #d8dde3;
}

.site-header .brand .title {
    font-size: 1.15rem;
    font-weight: 700;
}

.site-header nav a {
    color: #fff;
    margin-inline-start: 1.2rem;
    font-size: 0.92rem;
}

.site-header .user-box {
    font-size: 0.85rem;
    color: #e7e9ec;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 0.6rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { margin: 0 0.4rem; }

/* ===== Layout ===== */
.app-layout {
    display: flex;
    min-height: calc(100vh - 110px);
}

.sidebar {
    width: 220px;
    background: #fff;
    border-inline-end: 1px solid var(--border);
    padding: 1rem 0;
    flex-shrink: 0;
}

.sidebar a {
    display: block;
    padding: 0.55rem 1.2rem;
    color: var(--text);
    font-size: 0.92rem;
    border-inline-start: 3px solid transparent;
}

.sidebar a:hover, .sidebar a.active {
    background: var(--bg-alt);
    border-inline-start-color: var(--gold);
    text-decoration: none;
    color: var(--navy);
}

.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 1100px;
}

/* ===== Cards / Stats ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}

.stat-card .label { font-size: 0.82rem; color: var(--text-muted); }
.stat-card .value { font-size: 1.8rem; font-weight: 700; color: var(--navy); }

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
}

.card h2, .card h3 { margin-top: 0; color: var(--navy); }

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: start;
    font-size: 0.9rem;
}

th { background: var(--bg-alt); color: var(--navy); font-weight: 700; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.badge.active { background: #e4f0e8; color: var(--success); }
.badge.inactive { background: #f3e4e4; color: var(--danger); }

/* ===== Forms ===== */
label { display: block; font-size: 0.88rem; margin-bottom: 0.3rem; color: var(--text-muted); }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=file], select, textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.92rem;
    margin-bottom: 1rem;
    background: #fff;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--navy);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); text-decoration: none; }

.btn-secondary { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--navy); text-decoration: none; }

.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }

/* ===== Alerts ===== */
.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #e4f0e8; color: var(--success); border: 1px solid #bfe0cc; }
.alert-error { background: #f3e4e4; color: var(--danger); border: 1px solid #e3bcbc; }

/* ===== Login page ===== */
.login-wrap {
    max-width: 380px;
    margin: 4rem auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.login-wrap .ministry-title {
    text-align: center;
    color: var(--navy);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ===== Public homepage ===== */
.hero {
    background: var(--navy);
    color: #fff;
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-bottom: 3px solid var(--gold);
}

.hero h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.hero p { color: #dfe3e8; max-width: 640px; margin: 0 auto; }

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

@media (max-width: 780px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; border-inline-end: none; border-bottom: 1px solid var(--border); }
    .main-content { padding: 1rem; }
}
