@font-face {
    font-family: 'droid_naskh';
    src: url('/font/droid_naskh.woff2') format('woff2'),
        url('/font/droid_naskh.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --home-bg: #f3f5f8;
    --home-bg-accent: #e9eef5;
    --home-surface: #ffffff;
    --home-surface-2: #f7f9fc;
    --home-border: #e2e8f0;
    --home-text: #1f2937;
    --home-text-soft: #64748b;
    --home-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --home-shadow-hover: 0 4px 12px rgba(15, 23, 42, .1), 0 16px 40px rgba(15, 23, 42, .12);
    --home-radius: 16px;

    --c-admin: #34495e;
    --c-blue: #2563eb;
    --c-green: #16a34a;
    --c-red: #dc2626;
    --c-teal: #0f6c58;
    --c-neutral: #64748b;
}

html.dark {
    --home-bg: #0b1120;
    --home-bg-accent: #0f172a;
    --home-surface: #111827;
    --home-surface-2: #0f1626;
    --home-border: #1f2a3c;
    --home-text: #e5edf7;
    --home-text-soft: #94a3b8;
    --home-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
    --home-shadow-hover: 0 6px 18px rgba(0, 0, 0, .5), 0 18px 44px rgba(0, 0, 0, .55);

    --c-admin: #7c93ac;
    --c-blue: #60a5fa;
    --c-green: #4ade80;
    --c-red: #f87171;
    --c-teal: #2dd4bf;
    --c-neutral: #94a3b8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    direction: rtl;
    font-family: droid_naskh, 'Segoe UI', Tahoma, sans-serif;
    color: var(--home-text);
    background:
        radial-gradient(1200px 600px at 100% -10%, var(--home-bg-accent), transparent 60%),
        var(--home-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.home-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 28px 16px 64px;
}

/* ---------- Theme toggle ---------- */
.home-theme-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--home-border);
    background: var(--home-surface);
    color: var(--home-text-soft);
    box-shadow: var(--home-shadow);
    cursor: pointer;
    transition: color .15s, box-shadow .15s, transform .1s;
}

.home-theme-toggle:hover {
    color: var(--c-teal);
    transform: translateY(-1px);
    box-shadow: var(--home-shadow-hover);
}

/* ---------- Header ---------- */
.home-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 8px 0 22px;
}

.home-header img {
    width: 96px;
    height: auto;
}

.home-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
}

.home-header .home-sub {
    color: var(--home-text-soft);
    font-size: 15px;
}

/* ---------- Search ---------- */
.home-search {
    position: relative;
    max-width: 620px;
    margin: 6px auto 30px;
}

.home-search input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--home-border);
    background: var(--home-surface);
    border-radius: 999px;
    padding: 0 54px 0 20px;
    font-family: inherit;
    font-size: 17px;
    color: var(--home-text);
    box-shadow: var(--home-shadow);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.home-search input:focus {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 4px rgba(15, 108, 88, .15), var(--home-shadow);
}

.home-search svg {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: var(--home-text-soft);
    pointer-events: none;
}

.home-no-results {
    display: none;
    text-align: center;
    color: var(--home-text-soft);
    font-size: 17px;
    padding: 40px 0;
}

/* ---------- Pinned "most used" ---------- */
.home-pinned {
    margin-bottom: 18px;
}

.home-pinned[hidden] {
    display: none;
}

.home-pinned .home-section__body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px 8px;
}

/* ---------- Grid & sections ---------- */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    align-items: start;
}

.home-section {
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
}

.home-section:hover {
    box-shadow: var(--home-shadow-hover);
}

.home-section__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--home-border);
}

.home-section__icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--sec-color, var(--c-neutral));
}

.home-section__icon svg {
    width: 22px;
    height: 22px;
}

.home-section__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.home-section__body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--home-text);
    text-decoration: none;
    font-size: 15.5px;
    line-height: 1.6;
    transition: background .13s, color .13s;
}

.home-link::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sec-color, var(--c-neutral));
    opacity: .55;
}

.home-link:hover {
    background: var(--home-surface-2);
    color: var(--sec-color, var(--c-teal));
}

.home-link:hover::before {
    opacity: 1;
}

/* section colors */
.sec--admin { --sec-color: var(--c-admin); }
.sec--blue { --sec-color: var(--c-blue); }
.sec--green { --sec-color: var(--c-green); }
.sec--red { --sec-color: var(--c-red); }
.sec--teal { --sec-color: var(--c-teal); }
.sec--neutral { --sec-color: var(--c-neutral); }

/* ---------- Footer actions ---------- */
.home-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--home-border);
    background: var(--home-surface);
    color: var(--home-text);
    transition: background .15s, box-shadow .15s, transform .1s;
}

.home-btn:hover {
    box-shadow: var(--home-shadow);
    transform: translateY(-1px);
}

.home-btn--primary {
    background: var(--c-teal);
    border-color: var(--c-teal);
    color: #fff;
}

.home-btn--danger {
    color: var(--c-red);
    border-color: color-mix(in srgb, var(--c-red) 40%, var(--home-border));
}

/* ---------- Guest / landing ---------- */
.home-hero {
    text-align: center;
    padding: 40px 16px 30px;
}

.home-hero img {
    width: 120px;
    height: auto;
    margin-bottom: 14px;
}

.home-hero h1 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.4;
}

.home-hero p {
    max-width: 640px;
    margin: 0 auto 22px;
    color: var(--home-text-soft);
    font-size: 17px;
    line-height: 1.9;
}

.home-services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.home-service {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-radius: 14px;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    box-shadow: var(--home-shadow);
    color: var(--home-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: box-shadow .18s, transform .12s, color .12s;
}

.home-service:hover {
    box-shadow: var(--home-shadow-hover);
    transform: translateY(-2px);
    color: var(--c-teal);
}

.home-service__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--c-teal);
}

.home-service__icon svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 480px) {
    .home-grid { grid-template-columns: 1fr; }
    .home-header h1 { font-size: 22px; }
    .home-hero h1 { font-size: 24px; }
}
