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

:root {
    --ink: #102a2e;
    --ink-soft: #2f4b51;
    --brand: #0f8a8a;
    --brand-dark: #0c5c5f;
    --accent: #f39c12;
    --bg: #f4f1ea;
    --card: #ffffff;
    --muted: #c7d4d6;
    --shadow: 0 24px 60px rgba(16, 42, 46, 0.12);
}

* {
    box-sizing: border-box;
}

body.app-body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 10% 10%, #fff4d6 0%, #f4f1ea 40%, #e7f3f2 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px clamp(20px, 5vw, 64px);
    flex-direction: row-reverse;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-direction: row-reverse;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 12px 30px rgba(15, 138, 138, 0.25);
}

.brand-name {
    font-family: 'Marhey', cursive;
    font-size: 1.4rem;
    letter-spacing: 0.02em;
}

.brand-tag {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.topbar-actions {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-direction: row-reverse;
}

.link {
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
}

button.link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.content {
    flex: 1;
    padding: 0 clamp(20px, 5vw, 64px) 64px;
}

.footer {
    padding: 24px clamp(20px, 5vw, 64px) 40px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.footer-meta {
    margin-top: 6px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: clamp(20px, 4vw, 64px);
    align-items: center;
    margin-top: 24px;
}

.auth-card {
    background: var(--card);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.auth-header h1 {
    margin: 12px 0 8px;
    font-size: 2rem;
}

.auth-header p {
    margin: 0;
    color: var(--ink-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e5f5f2;
    color: var(--brand-dark);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.alert {
    margin: 18px 0;
    padding: 12px 14px;
    background: #ffe8e0;
    color: #7a2c1f;
    border-radius: 12px;
    font-weight: 600;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    color: var(--ink);
}

.field input,
.field select,
.field textarea {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--muted);
    font-family: inherit;
    font-size: 1rem;
    text-align: right;
}

.button {
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(15, 138, 138, 0.2);
}

.button.ghost {
    background: transparent;
    color: var(--brand-dark);
    border: 1px solid var(--brand);
    box-shadow: none;
}

.auth-footnote {
    margin-top: 14px;
    color: var(--ink-soft);
}

.auth-panel {
    display: flex;
    justify-content: center;
}

.panel-card {
    background: linear-gradient(135deg, rgba(15, 138, 138, 0.08), rgba(243, 156, 18, 0.08));
    border-radius: 28px;
    padding: 32px;
    max-width: 480px;
}

.panel-card h2 {
    margin-top: 0;
    font-size: 1.6rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 12px;
}

.feature-list li {
    background: #ffffffaa;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--ink-soft);
}

.dashboard .hero {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 8px;
}

.hero-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    background: var(--card);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    min-width: 280px;
}

.stat-label {
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 6px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.panel {
    background: var(--card);
    padding: 22px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
}

.section {
    display: grid;
    gap: 20px;
    margin-top: 12px;
}

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

.table-wrap {
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th,
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f2;
}

.table th {
    background: #f7fbfb;
    font-weight: 700;
}

.form {
    display: grid;
    gap: 16px;
    max-width: 520px;
}

.inline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-inline-start: 8px;
}

.inline select {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--muted);
    font-family: inherit;
}

.danger {
    color: #a72323;
}

.muted {
    color: var(--ink-soft);
}

.notify {
    position: relative;
}

.notify-btn {
    background: #ffffff;
    border: 1px solid #e0e9eb;
    border-radius: 12px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.notify-count {
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

.notify-panel {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 280px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px;
    display: none;
    z-index: 20;
}

.notify-panel.active {
    display: block;
}

.notify-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.notify-list {
    display: grid;
    gap: 10px;
}

.notify-item {
    padding: 10px;
    border-radius: 10px;
    background: #f6fbfb;
    display: grid;
    gap: 6px;
}

.notify-item button {
    border: none;
    background: transparent;
    color: var(--brand-dark);
    font-weight: 700;
    cursor: pointer;
}

.notify-empty {
    color: var(--ink-soft);
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

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