/*
Theme Name: From Scratch — Task Management
Theme URI: https://tasks.fromscratch.ink
Author: From Scratch
Author URI: https://fromscratch.ink
Description: لوحة إدارة مهام فريق From Scratch — موظفين، مهام أسبوعية بديدلاين، تحديثات، كانبان، وإيميلات تلقائية. مصممة لـ tasks.fromscratch.ink.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: Proprietary
Text Domain: fs-tasks
*/

:root {
	--mint: #3af7b3;
	--ink: #023433;
	--ink-2: #0d4a47;
	--bg: #f3faf8;
	--card: #ffffff;
	--line: #d9ece6;
	--muted: #5f7f7c;
	--red: #c0262d;
	--amber: #b7791f;
	--blue: #1f6feb;
	--green: #0f9f6e;
	--r: 14px;
	--shadow: 0 1px 2px rgba(2, 52, 51, .05), 0 6px 20px rgba(2, 52, 51, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	font-family: "Readex Pro", Tahoma, sans-serif;
	background: var(--bg);
	color: var(--ink);
	font-size: 15px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
h1, h2, h3 { font-weight: 400; margin: 0; line-height: 1.35; }
h3 { font-size: 17px; font-weight: 500; }
img { max-width: 100%; }
.fs-muted { color: var(--muted); }
.fs-red { color: var(--red); }
input, select, textarea, button { font: inherit; color: inherit; }

/* ---------- الهيكل ---------- */
.fs-shell { display: flex; min-height: 100vh; }
.fs-side {
	width: 260px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--line);
	display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 16px;
}
.fs-brand { display: flex; flex-direction: column; gap: 6px; text-decoration: none; padding: 0 8px 22px; border-bottom: 3px solid var(--ink); margin-bottom: 16px; }
.fs-brand img { width: 170px; height: auto; }
.fs-brand span { font-size: 13px; letter-spacing: .5px; color: var(--muted); }
.fs-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.fs-nav a {
	display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
	text-decoration: none; color: var(--ink); transition: background .15s;
}
.fs-nav a i { font-style: normal; width: 22px; text-align: center; opacity: .7; }
.fs-nav a:hover { background: var(--bg); }
.fs-nav a.is-active { background: var(--ink); color: #fff; }
.fs-nav a.is-active i { color: var(--mint); opacity: 1; }
.fs-me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.fs-me img { border-radius: 50%; }
.fs-me div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.fs-me small { color: var(--muted); font-size: 12px; }
.fs-logout { text-decoration: none; font-size: 20px; color: var(--muted); }
.fs-logout:hover { color: var(--red); }

.fs-main { flex: 1; min-width: 0; }
.fs-top {
	display: flex; align-items: center; gap: 14px; padding: 18px 32px; background: rgba(243, 250, 248, .9);
	backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line);
}
.fs-page-title { font-size: 24px; flex: 1; }
.fs-burger { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.fs-content { padding: 26px 32px 60px; max-width: 1400px; }
.fs-overlay { display: none; }

/* ---------- أزرار ---------- */
.fs-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px;
	border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink);
	text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .1s, box-shadow .15s;
}
.fs-btn:hover { box-shadow: var(--shadow); }
.fs-btn:active { transform: translateY(1px); }
.fs-btn-primary { background: var(--mint); border-color: var(--mint); color: var(--ink); font-weight: 500; }
.fs-btn-ghost { background: transparent; }
.fs-btn-danger { color: var(--red); border-color: #f0c9cb; background: #fff; }
.fs-btn-block { width: 100%; margin-top: 10px; }

/* ---------- رسائل ---------- */
.fs-flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.fs-flash-ok { background: #e6fdf4; border-color: var(--mint); }
.fs-flash-warn { background: #fff8e6; border-color: #f2d38a; }
.fs-flash-err { background: #fdecec; border-color: #f1b8bb; color: var(--red); }
.fs-alert {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	background: var(--ink); color: #fff; padding: 14px 18px; border-radius: var(--r); margin-bottom: 18px;
}
.fs-alert strong { color: var(--mint); font-size: 18px; }
.fs-alert-soft { background: #fff8e6; color: var(--ink); border: 1px solid #f2d38a; }
.fs-alert-soft strong { color: var(--amber); }
.fs-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- ترحيب و كروت ---------- */
.fs-hello {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	background: #fff; border-radius: var(--r); padding: 22px 26px; box-shadow: var(--shadow); margin-bottom: 18px;
	border-bottom: 4px solid var(--mint);
}
.fs-hello h2 { font-size: 26px; font-weight: 300; }
.fs-hello p { margin: 4px 0 0; }
.fs-ring {
	--p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
	background: conic-gradient(var(--mint) calc(var(--p) * 1%), var(--line) 0);
}
.fs-ring span { width: 66px; height: 66px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 500; }

.fs-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.fs-card {
	background: #fff; border-radius: var(--r); padding: 16px 18px; text-decoration: none; box-shadow: var(--shadow);
	display: flex; flex-direction: column; border-top: 3px solid var(--ink); transition: transform .15s;
}
a.fs-card:hover { transform: translateY(-2px); }
.fs-card span { color: var(--muted); font-size: 14px; }
.fs-card strong { font-size: 34px; font-weight: 300; line-height: 1.2; }
.fs-card.c-blue { border-top-color: var(--blue); }
.fs-card.c-green { border-top-color: var(--mint); }
.fs-card.c-red { border-top-color: var(--red); }
.fs-card.c-red strong { color: var(--red); }

/* ---------- صناديق ---------- */
.fs-box { background: #fff; border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.fs-box > h3 { margin-bottom: 14px; }
.fs-box-flush { padding: 0; overflow: hidden; }
.fs-pad { padding: 18px 22px 0; }
.fs-box-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fs-box-head a { text-decoration: none; color: var(--muted); font-size: 14px; }
.fs-box-head a:hover { color: var(--ink); }
.fs-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fs-grid-2 > .fs-box { margin-bottom: 0; }
.fs-grid-2 { margin-bottom: 18px; }
.fs-grid-wide { grid-template-columns: 1.6fr 1fr; align-items: start; }
.fs-narrow { max-width: 760px; }

/* ---------- الجدول ---------- */
.fs-table-wrap { overflow-x: auto; }
.fs-table { width: 100%; border-collapse: collapse; }
.fs-table th {
	text-align: right; font-weight: 400; font-size: 13px; color: var(--muted); padding: 12px 14px;
	border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfefd;
}
.fs-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fs-table tbody tr:hover { background: #f8fdfb; }
.fs-table tr.is-overdue td:first-child { box-shadow: inset -3px 0 0 var(--red); }
.fs-table select, .fs-table input[type=date] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 170px; }
.fs-num { color: var(--muted); font-size: 13px; width: 40px; }
.fs-task-link { text-decoration: none; font-weight: 500; }
.fs-task-link:hover { text-decoration: underline; text-decoration-color: var(--mint); text-underline-offset: 4px; }
.fs-title-cell small { display: block; }
.fs-rec { color: var(--muted); font-size: 13px; margin-inline-start: 4px; }
.fs-stale { font-size: 11px; background: #fff3d6; color: var(--amber); padding: 1px 8px; border-radius: 20px; margin-inline-start: 4px; white-space: nowrap; }
.fs-count { margin: 0 0 10px; font-size: 14px; }

/* ---------- شارات ---------- */
.fs-status, .fs-tag, .fs-pri, .fs-dl {
	display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px; white-space: nowrap; line-height: 1.6;
}
.fs-status { background: #eef2f2; }
.s-new { background: #eef2f2; color: var(--ink); }
.s-in_progress { background: #e7f0ff; color: var(--blue); }
.s-waiting { background: #fff3d6; color: var(--amber); }
.s-done { background: #dcfdf0; color: var(--green); }
.fs-tag { background: var(--bg); border: 1px solid var(--line); }
.b-from-scratch { background: var(--ink); color: var(--mint); border-color: var(--ink); }
.b-food-solutions { background: #eaf6ff; border-color: #cfe7fb; }
.b-food-guide { background: #fff1e8; border-color: #fbdcc8; }
.b-chicken-gourmet { background: #fff6dc; border-color: #f6e3a7; }
.b-crepe { background: #fdeef6; border-color: #f5d0e3; }
.b-milestone { background: #eeeefe; border-color: #d8d8fb; }
.fs-pri-high { background: #fff3d6; color: var(--amber); }
.fs-pri-urgent { background: #fdecec; color: var(--red); }
.fs-pri-low, .fs-pri-normal { background: #eef2f2; }
.fs-dl { background: #eef2f2; }
.fs-dl-late { background: #fdecec; color: var(--red); }
.fs-dl-today { background: var(--mint); color: var(--ink); font-weight: 500; }
.fs-dl-soon { background: #fff3d6; color: var(--amber); }
.fs-dl-done { opacity: .6; }
.fs-dl-none { color: var(--muted); }

/* ---------- شريط التقدم ---------- */
.fs-progress { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; min-width: 70px; }
.fs-progress span { display: block; height: 100%; background: var(--mint); border-radius: 6px; }
.fs-progress + small { font-size: 12px; color: var(--muted); }
.fs-progress-lg { height: 10px; margin-top: 18px; }

/* ---------- الفريق و التحديثات ---------- */
.fs-team, .fs-feed { list-style: none; margin: 0; padding: 0; }
.fs-team li a { display: flex; align-items: center; gap: 12px; padding: 10px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.fs-team li:last-child a { border: 0; }
.fs-team img, .fs-user img { border-radius: 50%; }
.fs-team-info { flex: 1; display: flex; flex-direction: column; gap: 4px; line-height: 1.4; }
.fs-team-info small { color: var(--muted); }
.fs-team em { font-style: normal; font-weight: 500; }
.fs-feed li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fs-feed li:last-child { border: 0; }
.fs-feed p { margin: 4px 0; color: var(--ink-2); }
.fs-feed small { color: var(--muted); }
.fs-user { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.fs-user span { display: flex; flex-direction: column; line-height: 1.4; }

/* ---------- الفلاتر و النماذج ---------- */
.fs-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.fs-filters input[type=search], .fs-filters select {
	padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 150px;
}
.fs-filters input[type=search] { flex: 1; min-width: 200px; }
.fs-form { display: flex; flex-direction: column; gap: 14px; }
.fs-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.fs-form input[type=text], .fs-form input[type=email], .fs-form input[type=tel], .fs-form input[type=date],
.fs-form select, .fs-form textarea {
	padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
.fs-form input:focus, .fs-form select:focus, .fs-form textarea:focus, .fs-filters input:focus, .fs-filters select:focus {
	outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(58, 247, 179, .35);
}
.fs-form .fs-check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.fs-check input { accent-color: var(--ink); width: 17px; height: 17px; }
.fs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fs-form output { color: var(--ink); font-weight: 500; }
input[type=range] { accent-color: var(--ink); width: 100%; }
.fs-actions { display: flex; gap: 10px; }
.fs-sticky-bar {
	position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
	background: #fff; border-top: 3px solid var(--mint); padding: 14px 18px; border-radius: var(--r) var(--r) 0 0; box-shadow: 0 -6px 20px rgba(2,52,51,.08);
}

/* ---------- صفحة المهمة ---------- */
.fs-task-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.fs-task-side { position: sticky; top: 90px; }
.fs-task-head { display: flex; align-items: baseline; gap: 12px; }
.fs-task-head h2 { font-size: 24px; }
.fs-num-big { color: var(--muted); font-size: 18px; }
.fs-task-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.fs-desc { color: var(--ink-2); background: var(--bg); padding: 4px 16px; border-radius: 10px; }
.fs-meta { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0 0 8px; }
.fs-meta dt { color: var(--muted); font-size: 14px; }
.fs-meta dd { margin: 0; }
.fs-timeline { list-style: none; margin: 0; padding: 0 18px 0 0; border-right: 2px solid var(--line); }
.fs-timeline li { position: relative; padding: 0 0 18px; }
.fs-timeline li::before {
	content: ""; position: absolute; right: -25px; top: 7px; width: 12px; height: 12px; border-radius: 50%;
	background: var(--mint); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--mint);
}
.fs-tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-tl-head small { color: var(--muted); }
.fs-timeline p { margin: 6px 0 0; color: var(--ink-2); }

/* ---------- كانبان ---------- */
.fs-board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.fs-col { background: #e9f5f1; border-radius: var(--r); padding: 12px; min-height: 200px; }
.fs-col header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fs-col header em { font-style: normal; color: var(--muted); }
.fs-kcard {
	display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 12px; padding: 12px 14px;
	text-decoration: none; margin-bottom: 10px; box-shadow: var(--shadow); border-right: 3px solid transparent; transition: transform .15s;
}
.fs-kcard:hover { transform: translateY(-2px); }
.fs-kcard.is-overdue { border-right-color: var(--red); }
.fs-kcard .fs-tag { align-self: flex-start; }
.fs-kcard strong { font-weight: 500; line-height: 1.5; }
.fs-kcard footer { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.fs-kcard footer small { color: var(--muted); }
.fs-col-empty { text-align: center; }

/* ---------- الدخول ---------- */
.fs-login-page {
	min-height: 100vh; display: grid; place-items: center; padding: 20px;
	background: radial-gradient(circle at 85% 10%, rgba(58, 247, 179, .25), transparent 40%), var(--bg);
}
.fs-login-card {
	width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow);
	border-bottom: 5px solid var(--ink); text-align: center;
}
.fs-login-logo { width: 220px; margin-bottom: 18px; }
.fs-login-card h1 { font-size: 24px; font-weight: 300; }
.fs-login-card form { text-align: right; margin-top: 20px; }
.fs-login-card form p { margin: 0 0 14px; }
.fs-login-card label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.fs-login-card input[type=text], .fs-login-card input[type=password] {
	width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; direction: ltr; text-align: left;
}
.fs-login-card input[type=submit] {
	width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; cursor: pointer; font-size: 16px;
}
.fs-login-card input[type=submit]:hover { background: var(--ink-2); }
.fs-login-card .login-remember label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.fs-lost { font-size: 14px; color: var(--muted); }

/* ---------- موبايل ---------- */
@media (max-width: 1100px) {
	.fs-grid-2, .fs-grid-wide, .fs-task-layout { grid-template-columns: 1fr; }
	.fs-task-side { position: static; }
}
@media (max-width: 900px) {
	.fs-side {
		position: fixed; right: 0; top: 0; z-index: 30; transform: translateX(100%); transition: transform .25s; box-shadow: none;
	}
	body.nav-open .fs-side { transform: none; box-shadow: -10px 0 40px rgba(2, 52, 51, .2); }
	body.nav-open .fs-overlay { display: block; position: fixed; inset: 0; background: rgba(2, 52, 51, .35); z-index: 20; }
	.fs-burger { display: block; }
	.fs-top { padding: 12px 16px; }
	.fs-page-title { font-size: 20px; }
	.fs-content { padding: 16px 14px 60px; }
	.fs-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.fs-card strong { font-size: 28px; }
	.fs-row { grid-template-columns: 1fr; }
	.fs-board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
	.fs-col { scroll-snap-align: start; }

	/* الجدول يتحول لكروت */
	.fs-table-cards thead { display: none; }
	.fs-table-cards, .fs-table-cards tbody, .fs-table-cards tr, .fs-table-cards td { display: block; width: 100%; }
	.fs-table-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
	.fs-table-cards tr.is-overdue { box-shadow: inset -3px 0 0 var(--red); }
	.fs-table-cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
	.fs-table-cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; flex-shrink: 0; }
	.fs-table-cards td.fs-title-cell, .fs-table-cards td[data-label="المهمة"] { display: block; font-size: 16px; }
	.fs-table-cards td.fs-title-cell::before, .fs-table-cards td[data-label="المهمة"]::before, .fs-table-cards td.fs-num::before { display: none; }
	.fs-table-cards td.fs-num { font-size: 12px; }
	.fs-table-cards .fs-progress { flex: 1; max-width: 140px; }
	.fs-table tr.is-overdue td:first-child { box-shadow: none; }
	.fs-table select, .fs-table input[type=date] { max-width: 60%; }
}
