/*
|--------------------------------------------------------------------------
| ملف التصميم العام لنظام التحصيل
|--------------------------------------------------------------------------
| تصميم مناسب للموبايل والتابلت والديسكتوب
| ألوان مستوحاة من الأحمر والأبيض والأسود
*/

:root {
    --primary: #e50914;
    --primary-dark: #b20710;
    --primary-light: #ff3b45;

    --dark: #111111;
    --dark-soft: #1f1f1f;

    --white: #ffffff;
    --light: #f7f7f7;
    --muted: #777777;
    --border: #eeeeee;

    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #2563eb;

    --shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.08);

    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
    background:
        radial-gradient(circle at top right, rgba(229, 9, 20, 0.22), transparent 32%),
        radial-gradient(circle at bottom left, rgba(0, 0, 0, 0.16), transparent 28%),
        #f4f4f4;
    color: var(--dark);
    min-height: 100vh;
}

a {
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/*
|--------------------------------------------------------------------------
| صفحة تسجيل الدخول
|--------------------------------------------------------------------------
*/

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow: hidden;
    position: relative;
}

.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(229, 9, 20, 0.95), rgba(120, 0, 8, 0.92)),
        url("../../assets/images/bg-pattern.png");
    z-index: -3;
}

.login-page::after {
    content: "";
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    top: -120px;
    left: -120px;
    z-index: -2;
}

.login-shell {
    width: 100%;
    max-width: 1080px;
    min-height: 610px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 34px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-hero {
    color: var(--white);
    padding: 46px;
    position: relative;
    background:
        linear-gradient(145deg, rgba(0,0,0,0.26), rgba(255,255,255,0.03));
}

.brand-mark {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: var(--white);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: bold;
    box-shadow: 0 18px 35px rgba(0,0,0,0.22);
    margin-bottom: 28px;
}

.login-hero h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.35;
    letter-spacing: -1px;
}

.login-hero p {
    color: rgba(255,255,255,0.88);
    font-size: 16px;
    line-height: 1.9;
    max-width: 470px;
    margin: 18px 0 0;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 34px;
}

.hero-feature {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 18px;
    padding: 15px;
    min-height: 92px;
}

.hero-feature span {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

.hero-feature strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.hero-feature small {
    color: rgba(255,255,255,0.76);
    line-height: 1.6;
}

.login-form-area {
    background: rgba(255,255,255,0.98);
    padding: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-modern {
    width: 100%;
    max-width: 390px;
}

.form-title {
    margin-bottom: 28px;
}

.form-title h2 {
    margin: 0;
    font-size: 30px;
    color: var(--dark);
}

.form-title p {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.input-control {
    width: 100%;
    height: 54px;
    border-radius: 16px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    padding: 0 46px 0 14px;
    font-size: 16px;
    outline: none;
    transition: 0.2s;
}

.input-control:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.10);
}

.btn-primary {
    width: 100%;
    height: 55px;
    border: none;
    border-radius: 17px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 14px 25px rgba(229, 9, 20, 0.26);
    transition: 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(229, 9, 20, 0.34);
}

.alert-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
    padding: 13px 14px;
    border-radius: 15px;
    margin-bottom: 18px;
    line-height: 1.6;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
}

/*
|--------------------------------------------------------------------------
| لوحة التحكم
|--------------------------------------------------------------------------
*/

.app-layout {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
}

.app-header {
    background:
        linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 18px 14px 74px;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    background: rgba(255,255,255,0.11);
    border-radius: 50%;
    left: -130px;
    top: -150px;
}

.app-header::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.09);
    border-radius: 50%;
    right: -90px;
    bottom: -120px;
}

.header-inner {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: auto;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--white);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

.app-brand-title {
    font-size: 19px;
    font-weight: bold;
}

.app-brand-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.78);
    margin-top: 3px;
}

.logout-btn {
    background: rgba(0,0,0,0.18);
    color: var(--white);
    padding: 10px 15px;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,0.18);
    white-space: nowrap;
    font-size: 14px;
}

.logout-btn:hover {
    background: rgba(0,0,0,0.30);
}

.header-welcome {
    margin-top: 34px;
}

.header-welcome h1 {
    margin: 0;
    font-size: 30px;
}

.header-welcome p {
    margin: 9px 0 0;
    color: rgba(255,255,255,0.86);
    line-height: 1.7;
}

.app-container {
    max-width: 1180px;
    margin: -50px auto 0;
    padding: 0 14px 28px;
    position: relative;
    z-index: 5;
}

.profile-card {
    background: rgba(255,255,255,0.96);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.8);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--dark), #363636);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.profile-info h2 {
    margin: 0;
    font-size: 20px;
}

.profile-info p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff1f2;
    color: var(--primary-dark);
    border: 1px solid #fecdd3;
    padding: 10px 13px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
}

.section-heading {
    margin: 26px 4px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-heading h3 {
    margin: 0;
    font-size: 19px;
}

.section-heading span {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.dashboard-card {
    background: var(--white);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    color: var(--dark);
    min-height: 160px;
    position: relative;
    overflow: hidden;
    transition: 0.22s;
}

.dashboard-card::after {
    content: "";
    position: absolute;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: rgba(229, 9, 20, 0.08);
    left: -30px;
    bottom: -30px;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 38px rgba(0,0,0,0.13);
    border-color: rgba(229, 9, 20, 0.24);
}

.card-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: #fff1f2;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 18px;
}

.dashboard-card strong {
    display: block;
    font-size: 17px;
    margin-bottom: 8px;
}

.dashboard-card small {
    display: block;
    color: var(--muted);
    line-height: 1.7;
    font-size: 13px;
}

.card-arrow {
    position: absolute;
    left: 18px;
    top: 20px;
    color: #bbb;
    font-size: 20px;
}

/*
|--------------------------------------------------------------------------
| صفحات داخلية عامة لاحقاً
|--------------------------------------------------------------------------
*/

.page-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    padding: 20px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 15px;
    border-radius: 13px;
    border: none;
    background: var(--primary);
    color: var(--white);
    cursor: pointer;
    font-weight: bold;
}

.action-btn.dark {
    background: var(--dark);
}

.action-btn.light {
    background: #f3f4f6;
    color: var(--dark);
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 1000px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .login-hero {
        padding: 34px;
    }

    .login-form-area {
        padding: 34px;
    }

    .login-hero h1 {
        font-size: 32px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-card {
        grid-template-columns: 1fr;
    }

    .role-badge {
        width: fit-content;
    }
}

@media (max-width: 560px) {
    body {
        background: #f5f5f5;
    }

    .login-page {
        align-items: flex-start;
        padding: 0;
        background: var(--white);
    }

    .login-shell {
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: var(--white);
    }

    .login-hero {
        padding: 30px 22px;
        border-radius: 0 0 34px 34px;
        background:
            linear-gradient(135deg, var(--primary), var(--primary-dark));
    }

    .brand-mark {
        width: 60px;
        height: 60px;
        border-radius: 19px;
        font-size: 27px;
        margin-bottom: 18px;
    }

    .login-hero h1 {
        font-size: 26px;
    }

    .login-hero p {
        font-size: 14px;
        margin-top: 10px;
    }

    .hero-features {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 22px;
    }

    .hero-feature {
        padding: 12px;
        min-height: 82px;
        border-radius: 15px;
    }

    .hero-feature small {
        display: none;
    }

    .login-form-area {
        padding: 28px 20px;
        align-items: flex-start;
    }

    .form-title h2 {
        font-size: 25px;
    }

    .app-header {
        padding-bottom: 68px;
    }

    .header-welcome h1 {
        font-size: 24px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dashboard-card {
        min-height: auto;
        padding: 16px;
        display: grid;
        grid-template-columns: 58px 1fr 24px;
        align-items: center;
        gap: 12px;
    }

    .dashboard-card::after {
        display: none;
    }

    .card-icon {
        margin-bottom: 0;
    }

    .card-arrow {
        position: static;
    }

    .section-heading {
        display: block;
    }

    .section-heading span {
        display: block;
        margin-top: 6px;
    }
}