/*
Theme Name: Wordpress Team
Theme URI: https://pimula.host
Author: Pimula
Description: Task management for a WordPress team. The team leader assigns tasks, developers update status from the front end, testers and a UI/UX team check the work, the Project Manager gives final approval, and email notifications go to the leader and the selected account manager.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: wordpress-team
*/

:root {
	--wpt-brand: #2038f5;
	--wpt-brand-dark: #1426b8;
	--wpt-brand-soft: #e8ebff;
	--wpt-bg: #f4f6fb;
	--wpt-card: #ffffff;
	--wpt-text: #151a30;
	--wpt-muted: #667085;
	--wpt-line: #e4e7ef;
	--wpt-green: #12a05c;
	--wpt-amber: #d98a05;
	--wpt-red: #d92d20;
	--wpt-radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--wpt-bg);
	color: var(--wpt-text);
	font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--wpt-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }

.wpt-wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* Header */
.wpt-header { background: var(--wpt-brand); color: #fff; }
.wpt-header .wpt-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; flex-wrap: wrap; }
.wpt-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; }
.wpt-brand:hover { text-decoration: none; }
.wpt-brand img { height: 44px; width: auto; border-radius: 6px; display: block; }
.wpt-user { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.wpt-user a { color: #fff; opacity: .9; }
.wpt-role { background: rgba(255,255,255,.18); padding: 2px 10px; border-radius: 99px; font-size: .75rem; }

main.wpt-main { padding: 28px 0 56px; }

/* Cards */
.wpt-card { background: var(--wpt-card); border: 1px solid var(--wpt-line); border-radius: var(--wpt-radius); padding: 20px; margin-bottom: 20px; }
.wpt-card > h2:first-child { margin-top: 0; }
.wpt-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.wpt-page-head h1 { margin: 0; }
.wpt-muted { color: var(--wpt-muted); }

/* Stats */
.wpt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.wpt-stat { background: var(--wpt-card); border: 1px solid var(--wpt-line); border-radius: var(--wpt-radius); padding: 16px 18px; }
.wpt-stat b { display: block; font-size: 1.9rem; line-height: 1.1; }
.wpt-stat span { color: var(--wpt-muted); font-size: .85rem; }
.wpt-stat.is-alert b { color: var(--wpt-red); }

/* Layout */
.wpt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

/* Buttons & forms */
.wpt-btn, button.wpt-btn {
	display: inline-block; border: 0; cursor: pointer; background: var(--wpt-brand); color: #fff;
	padding: 9px 18px; border-radius: 8px; font: inherit; font-weight: 600;
}
.wpt-btn:hover { background: var(--wpt-brand-dark); text-decoration: none; color: #fff; }
.wpt-btn.is-ghost { background: var(--wpt-brand-soft); color: var(--wpt-brand); }
.wpt-btn.is-ghost:hover { background: #d6dbff; }
.wpt-btn.is-danger { background: #fee4e2; color: var(--wpt-red); }

.wpt-form label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.wpt-form .wpt-field { margin-bottom: 14px; }
.wpt-form input[type=text], .wpt-form input[type=password], .wpt-form input[type=date], .wpt-form input[type=url],
.wpt-form select, .wpt-form textarea, .wpt-filters input, .wpt-filters select {
	width: 100%; padding: 9px 11px; border: 1px solid var(--wpt-line); border-radius: 8px;
	font: inherit; background: #fff; color: var(--wpt-text);
}
.wpt-form input:focus, .wpt-form select:focus, .wpt-form textarea:focus,
.wpt-filters input:focus, .wpt-filters select:focus { outline: 2px solid var(--wpt-brand); outline-offset: 0; border-color: var(--wpt-brand); }
.wpt-form .wpt-check label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.wpt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

details.wpt-fold > summary { cursor: pointer; font-weight: 700; list-style: none; }
details.wpt-fold > summary::-webkit-details-marker { display: none; }
details.wpt-fold[open] > summary { margin-bottom: 16px; }

.wpt-filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: center; margin-bottom: 16px; }

/* Table */
.wpt-table-wrap { overflow-x: auto; }
table.wpt-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.wpt-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--wpt-muted); padding: 8px 10px; border-bottom: 1px solid var(--wpt-line); }
.wpt-table td { padding: 12px 10px; border-bottom: 1px solid var(--wpt-line); vertical-align: middle; }
.wpt-table tr:last-child td { border-bottom: 0; }
.wpt-table td.title a { font-weight: 600; color: var(--wpt-text); }
.is-overdue { color: var(--wpt-red); font-weight: 600; }

/* Badges */
.wpt-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: #eef0f6; color: #475467; white-space: nowrap; }
.st-in_progress { background: #e0ecff; color: #1d4ed8; }
.st-blocked { background: #fee4e2; color: #b42318; }
.st-in_review { background: #f4e8ff; color: #7a2fc2; }
.st-changes_requested { background: #fff1d6; color: #a35f00; }
.st-in_testing { background: #e0f4fb; color: #0b6e8a; }
.st-test_passed { background: #e3f6e0; color: #2b7a1f; }
.st-awaiting_pm { background: #ffe9f1; color: #b0245e; }
.st-completed { background: #d9f5e5; color: #0b7a44; }
.pr-high { background: #fff1d6; color: #a35f00; }
.pr-urgent { background: #fee4e2; color: #b42318; }

/* Task detail */
.wpt-meta { list-style: none; margin: 0; padding: 0; }
.wpt-meta li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--wpt-line); }
.wpt-meta li:last-child { border-bottom: 0; }
.wpt-meta span:first-child { color: var(--wpt-muted); }

.wpt-log { list-style: none; margin: 0 0 16px; padding: 0; }
.wpt-log li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--wpt-line); margin-left: 6px; }
.wpt-log li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--wpt-brand); }
.wpt-log li.type-status::before { background: var(--wpt-green); }
.wpt-log li.type-note::before { background: var(--wpt-amber); }
.wpt-log small { color: var(--wpt-muted); display: block; }

/* Notices */
.wpt-notice { padding: 11px 16px; border-radius: 8px; margin-bottom: 18px; background: #d9f5e5; color: #0b7a44; font-weight: 600; }
.wpt-notice.is-error { background: #fee4e2; color: #b42318; }

/* Login */
.wpt-login { max-width: 420px; margin: 6vh auto 0; text-align: center; }
.wpt-login img { height: 96px; border-radius: 14px; margin-bottom: 20px; }
.wpt-login .wpt-card { text-align: left; }
.wpt-login .wpt-btn { width: 100%; }

@media (max-width: 860px) {
	.wpt-grid { grid-template-columns: 1fr; }
	.wpt-stats { grid-template-columns: repeat(2, 1fr); }
	.wpt-filters { grid-template-columns: 1fr 1fr; }
}

/* Progress & sub-tasks */
.wpt-progress { height: 6px; background: var(--wpt-line); border-radius: 99px; overflow: hidden; margin: 4px 0; min-width: 90px; }
.wpt-progress span { display: block; height: 100%; background: var(--wpt-green); }
.wpt-subtasks { list-style: none; margin: 12px 0 16px; padding: 0; }
.wpt-subtasks li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--wpt-line); flex-wrap: wrap; }
.wpt-subtasks li:last-child { border-bottom: 0; }
.wpt-subtasks li.is-done .wpt-sub-title { text-decoration: line-through; color: var(--wpt-muted); }
.wpt-inline { display: flex; gap: 6px; align-items: center; }
.wpt-inline select { padding: 6px 8px; border: 1px solid var(--wpt-line); border-radius: 8px; font: inherit; }
.wpt-inline .wpt-btn { padding: 6px 12px; }
.wpt-log li.type-subtask::before { background: #7a2fc2; }
