@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --dark: #0f172a;
    --muted: #64748b;
    --bg: #f4f7fb;
    --border: #e2e8f0;
    --white: #ffffff;
}

* {
    font-family: 'Tajawal', sans-serif;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    direction: rtl;
}

body {
    background: var(--bg);
    color: #1e293b;
    overflow-x: hidden;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(180deg, #0f172a, #123a3a);
    color: white;
    padding: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    min-width: 0;
    width: calc(100% - 280px);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #14b8a6;
    display: grid;
    place-items: center;
    font-size: 25px;
}

.brand-title {
    font-weight: 800;
    font-size: 20px;
}

.brand small {
    color: #cbd5e1;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu a {
    color: #dbeafe;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 14px;
    transition: .2s;
    white-space: nowrap;
}

.menu a:hover,
.menu a.active {
    background: rgba(255, 255, 255, .13);
    color: #fff;
}

.topbar {
    height: 78px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
    font-weight: 800;
}

.topbar span {
    color: var(--muted);
}

.content-wrapper,
.page-content,
.dashboard-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 24px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.page-title,
.page-actions {
    margin-bottom: 22px;
}

.page-title h2,
.page-actions h2 {
    font-weight: 800;
    margin-bottom: 4px;
}

.page-title p,
.page-actions p {
    color: var(--muted);
    margin: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-card,
.table-card,
.form-card,
.filter-card {
    background: white;
    border-radius: 22px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .06);
    border: 1px solid var(--border);
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 30px;
    color: var(--brand);
}

.table-card,
.form-card {
    padding: 18px;
}

.filter-card {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 18px;
    flex-wrap: wrap;
}

.form-control,
.form-select {
    border-radius: 12px;
}

.btn {
    border-radius: 12px;
    padding: .55rem 1rem;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    color: #475569;
    background: #f8fafc;
    white-space: nowrap;
}

.table td,
.table th {
    vertical-align: middle;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0f766e, #0f172a);
}

.login-card {
    width: min(430px, 92vw);
    background: white;
    border-radius: 26px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.login-logo {
    font-size: 46px;
    margin-bottom: 10px;
}

.app-footer {
    flex-shrink: 0;
    margin: auto 24px 20px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
    color: #475569;
    overflow: hidden;
}

.app-footer::before {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(90deg, #0f766e, #38bdf8, #0f172a);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 16px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(15, 118, 110, .13), rgba(56, 189, 248, .13));
    color: var(--brand);
    font-size: 21px;
}

.footer-brand strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 3px;
}

.footer-brand span {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.footer-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 12px;
    direction: rtl;
}

.footer-meta span {
    white-space: nowrap;
    padding-inline-start: 0;
    position: static;
}

.footer-meta span::before {
    display: none;
}

.footer-meta span:not(:last-child)::after {
    content: "•";
    margin-inline: 8px;
    color: #cbd5e1;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
    }

    .topbar {
        height: auto;
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .content-wrapper,
    .page-content,
    .dashboard-page {
        padding: 16px;
    }

    .page-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-card {
        flex-direction: column;
    }

     .app-footer {
        margin: 0 16px 16px;
        border-radius: 18px;
    }

    .footer-content {
        padding: 12px 14px;
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-meta {
        justify-content: flex-start;
        text-align: right;
    }

    .footer-meta span {
        white-space: normal;
    }
}