/* Freelance Hub — app styles */
:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f2f4f8;
  --card: #ffffff;
  --blue: #2764AA;
  --blue-dark: #1d4e86;
  --green: #12805c;
  --green-bg: #e7f6f0;
  --red: #d92d20;
  --red-bg: #fef3f2;
  --amber: #b54708;
  --amber-bg: #fffaeb;
  --info-bg: #eff6ff;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 14px; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--ink); color: #fff;
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; margin-bottom: 26px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); display: inline-block; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  color: #cbd5e1; padding: 10px 12px; border-radius: 8px; font-size: 14px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.sidebar nav a.on { background: var(--blue); color: #fff; }
.sidebar-foot { margin-top: auto; }
.sidebar-foot a { color: #94a3b8; font-size: 13px; }
.main { flex: 1; padding: 28px 32px; max-width: 1200px; }

/* Cards & headers */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: start; }

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; display: flex; flex-direction: column; gap: 2px;
}
.stat-n { font-size: 22px; font-weight: 700; }
.stat-l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-bad .stat-n { color: var(--red); }

/* Focus card */
.focus-card {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 26px 24px; margin-bottom: 20px;
}
.focus-label { font-size: 12px; letter-spacing: .12em; opacity: .85; margin-bottom: 8px; font-weight: 700; }
.focus-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; line-height: 1.35; }
.focus-client { font-weight: 400; opacity: .85; font-size: 16px; }
.focus-done { background: var(--green); }
.done-btn {
  background: #fff; color: var(--blue-dark); border: 0; border-radius: 8px;
  padding: 10px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.done-btn:hover { transform: translateY(-1px); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-weight: 400; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.quick-add { display: flex; gap: 10px; }
.quick-add input[type=text] { flex: 1; }
.quick-add select { width: auto; }
.mini-input { width: 110px; display: inline-block; padding: 5px 8px; font-size: 13px; }

/* Buttons */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.link-btn {
  background: none; border: 0; color: var(--blue); cursor: pointer;
  font: inherit; font-size: 13px; padding: 2px 4px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }
.link-btn.ok { color: var(--green); }
.inline { display: inline; }
.push-right { margin-left: auto; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.danger { background: var(--red-bg); color: var(--red); }
.badge.info { background: var(--info-bg); color: var(--blue); }
.badge.muted { background: var(--bg); color: var(--muted); }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.actions { white-space: nowrap; }

/* Task list */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.task-list li:last-child { border-bottom: 0; }
.task-list li.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.check {
  width: 24px; height: 24px; flex-shrink: 0;
  border: 2px solid var(--line); border-radius: 50%; background: #fff;
  cursor: pointer; font-size: 13px; line-height: 1; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.check:hover { border-color: var(--blue); }
.check.checked { background: var(--green); border-color: var(--green); }
.task-title { flex-shrink: 1; }
.tag {
  background: var(--info-bg); color: var(--blue); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag-alt { background: var(--bg); color: var(--muted); }

/* Row list (dashboard side panels) */
.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.row-list li:last-child { border-bottom: 0; }

/* Progress bar */
.bar {
  display: inline-block; width: 70px; height: 7px; vertical-align: middle;
  background: var(--line); border-radius: 999px; overflow: hidden;
}
.bar span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }

/* Alarm banner */
.alarm-banner {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  background: var(--red); color: #fff; padding: 14px 18px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px; max-width: 380px;
}
.alarm-banner button {
  background: none; border: 0; color: #fff; font-size: 15px; cursor: pointer; margin-left: 8px;
}

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px; width: 100%; max-width: 400px;
}
.auth-card h1 { font-size: 20px; text-align: center; margin: 14px 0 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }

/* Date nav */
.date-nav { display: flex; align-items: center; gap: 10px; }

/* Responsive */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; }
  .sidebar nav { flex-direction: row; }
  .sidebar .brand { margin-bottom: 0; margin-right: 10px; white-space: nowrap; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .main { padding: 18px 14px; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .quick-add { flex-wrap: wrap; }
}
