/* Marketing Master Planner - Portale cliente
   Design system: Barlow (300/400/500) + accento #e5005b + sidebar #1a1a2e
*/

:root {
  --accent:        #e5005b;
  --accent-text:   #c4004e;
  --accent-bg:     #fff0f5;
  --accent-border: #f9b3ce;

  --sidebar-bg:        #1a1a2e;
  --sidebar-item:      rgba(255,255,255,0.55);
  --sidebar-item-act:  #ffffff;
  --sidebar-item-bg:   rgba(229,0,91,0.12);
  --sidebar-item-bdr:  #e5005b;

  --surface:    #ffffff;
  --bg:         #f6f7f9;
  --text:       #1a1a2e;
  --muted:      #6b7280;
  --border:     rgba(0,0,0,0.08);

  --cat-website:    #3b82f6;
  --cat-ecommerce:  #3b82f6;
  --cat-seo:        #10b981;
  --cat-adv:        #f59e0b;
  --cat-social:     #8b5cf6;
  --cat-dem:        #06b6d4;
  --cat-other:      #6b7280;

  --r-sm: 8px;
  --r-lg: 12px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Barlow', system-ui, sans-serif; font-weight: 400; line-height: 1.45; }
h1, h2, h3, h4 { font-weight: 500; margin: 0 0 8px; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
a  { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ===== Layout ===== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 220px;
  background: var(--sidebar-bg); color: var(--sidebar-item);
  display: flex; flex-direction: column;
  padding: 18px 0;
}
.brand { display:flex; gap:10px; align-items:center; padding: 0 18px 22px; }
.logo { width:34px; height:34px; border-radius:8px;
  background: var(--accent); color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight:500; font-size:14px; }
.brand-text .brand-title { color: #fff; font-weight: 500; font-size: 14px; }
.brand-text .brand-sub   { font-size: 11px; opacity: .7; }

.nav { padding: 0 12px; display:flex; flex-direction:column; gap:2px; flex: 1; }
.nav-item {
  display:flex; align-items:center; gap:10px; padding: 10px 12px;
  color: var(--sidebar-item); border-radius: var(--r-sm);
  font-size: 14px; border-left: 2px solid transparent;
}
.nav-item .ico { width:18px; text-align:center; font-size: 13px; }
.nav-item:hover { color: #fff; text-decoration: none; }
.nav-item.active {
  background: var(--sidebar-item-bg);
  color: var(--sidebar-item-act);
  border-left-color: var(--sidebar-item-bdr);
}
.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 10px; display:none;
}
.nav-badge.show { display: inline-block; }

.user-card {
  display:flex; gap:10px; align-items:center;
  margin: 12px; padding: 10px; background: rgba(255,255,255,0.05);
  border-radius: var(--r-sm);
}
.avatar { width: 32px; height: 32px; border-radius:50%;
  background: var(--accent); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size: 12px; font-weight: 500; }
.avatar.small { width: 28px; height: 28px; font-size: 11px; }
.user-card .name { color:#fff; font-size: 13px; font-weight: 500; }
.user-card .role { font-size: 11px; opacity: .65; }
.user-card .logout { margin-left:auto; }
.user-card .logout button { background:transparent; border:none; color: rgba(255,255,255,0.6);
  cursor:pointer; font-size: 16px; }
.user-card .logout button:hover { color: #fff; }

.main { margin-left: 220px; min-height: 100vh; }
.topbar {
  display:flex; align-items:center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.page-title { margin: 0; font-size: 18px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; position: relative; }
.chip { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #eef0f3; color: var(--text); }
.chip-urgent { background: var(--accent-bg); color: var(--accent-text); border: 1px solid var(--accent-border); }

.bell { background: transparent; border: 1px solid var(--border); border-radius: 50%;
  width: 38px; height: 38px; cursor:pointer; position: relative; font-size: 15px; }
.bell-badge { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 10px; display:none; }
.bell-badge.show { display: inline-block; }
.notif-panel { position: absolute; top: 48px; right: 0; width: 340px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 10px 30px rgba(0,0,0,.08);
  z-index: 50; max-height: 60vh; overflow: hidden; display: flex; flex-direction: column; }
.notif-head { display:flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--border); }
.notif-head .link { background: none; border: none; color: var(--accent-text); cursor: pointer; font-size: 12px; }
.notif-list { overflow-y: auto; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-item.unread { background: var(--accent-bg); }
.notif-item .title { font-weight: 500; }
.notif-item .meta { color: var(--muted); font-size: 11px; }

.content { padding: 24px 28px; max-width: 1300px; margin: 0 auto; }

.alert { margin: 14px 28px 0; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-error   { background: var(--accent-bg); color: var(--accent-text); border: 1px solid var(--accent-border); }

/* ===== Banner alert ===== */
.banner-alert {
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  color: var(--accent-text); padding: 14px 18px; border-radius: var(--r-lg);
  margin-bottom: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 14px;
}
.banner-alert strong { font-weight: 500; }
.link-urgent { color: var(--accent-text); font-weight: 500; margin-left: auto; }

/* ===== Metrics ===== */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; }
.metric-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.metric-value { font-size: 26px; font-weight: 500; }
.metric.metric-accent .metric-value { color: var(--accent); }

@media (max-width: 980px) { .metrics { grid-template-columns: repeat(2, 1fr); } }

/* ===== Cards ===== */
.card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card .link { font-size: 13px; }
.empty { text-align: center; padding: 40px 20px; }

/* ===== Projects grid ===== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 14px; }
.project-card { display: block; padding: 16px; border-radius: var(--r-lg); border: 0.5px solid var(--border);
  background: var(--surface); }
.project-card:hover { text-decoration: none; border-color: var(--accent-border); }
.project-card-head { display: flex; align-items: center; gap: 10px;
  border-left: 4px solid var(--cat-other); padding-left: 8px; margin-bottom: 10px; }
.project-card-head h3 { margin: 0; font-size: 15px; font-weight: 500; color: var(--text); }
.project-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); }

.health { width: 10px; height: 10px; border-radius: 50%; }
.health-green   { background: #10b981; }
.health-yellow  { background: #f59e0b; }
.health-red     { background: #e5005b; }
.health-dot     { display:inline-block; width:10px; height:10px; border-radius:50%; margin-left: 8px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 500;
  background: #eef0f3; color: var(--text); }
.pill-active    { background: #d1fae5; color: #047857; }
.pill-on_hold   { background: #fef3c7; color: #92400e; }
.pill-completed { background: #e0e7ff; color: #3730a3; }
.pill-archived  { background: #e5e7eb; color: #374151; }
.pill-draft     { background: #f3f4f6; color: #6b7280; }

/* ===== Approvals ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { text-decoration: none; color: var(--text); }

.approval-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.approval-list.compact { gap: 6px; }
.approval-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; }
.approval-card.urgent-card { border-left: 3px solid var(--accent); }
.approval-link { display: block; color: var(--text); }
.approval-link:hover { text-decoration: none; }
.approval-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.approval-card-foot { display:flex; justify-content: space-between; margin-top: 8px; }
.approval-title { margin: 4px 0; font-size: 15px; font-weight: 500; }

.type-badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500;
  background: #e0e7ff; color: #3730a3; }
.type-deliverable    { background: #dbeafe; color: #1e40af; }
.type-content        { background: #f3e8ff; color: #6b21a8; }
.type-milestone      { background: #fce7f3; color: #9d174d; }
.type-budget         { background: #fef3c7; color: #92400e; }
.type-change_request { background: #fee2e2; color: #991b1b; }

.version-badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; background: #f3f4f6; color: var(--muted); }
.status-pill   { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.status-pending             { background: #fff7ed; color: #9a3412; }
.status-approved            { background: #d1fae5; color: #047857; }
.status-rejected            { background: var(--accent-bg); color: var(--accent-text); }
.status-revision_requested  { background: #fef3c7; color: #92400e; }

.badge { background: #eef0f3; color: var(--text); padding: 2px 9px; border-radius: 999px; font-size: 11px; }
.badge-urgent  { background: var(--accent-bg); color: var(--accent-text); border: 1px solid var(--accent-border); }
.badge-overdue { background: #e5e7eb; color: #374151; }
.badge-soon    { background: #fff7ed; color: #9a3412; }

.approval-list .approval-item { display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 0.5px solid var(--border); }
.approval-list .approval-item.soon    { border-left: 3px solid #f59e0b; }
.approval-list .approval-item.overdue { border-left: 3px solid var(--accent); }
.approval-list .approval-item a { display: block; color: var(--text); }
.approval-list .approval-item a:hover { text-decoration: none; }
.approval-type { font-size: 11px; color: var(--muted); margin-bottom: 2px; }

/* ===== Approval detail ===== */
.approval-detail-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.approval-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.action-form { margin-top: 12px; padding: 14px; background: #f9fafb; border-radius: var(--r-sm); }
.action-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; font-family: inherit; font-size: 14px; }
.action-form .row { margin-top: 10px; display: flex; gap: 8px; }

.attachments { list-style: none; padding: 0; }
.attachments li { padding: 6px 0; }

.versions { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 12px; }
.versions li { padding: 10px; background: #f9fafb; border-radius: var(--r-sm); }
.versions-head { display: flex; justify-content: space-between; }

/* ===== Forms / buttons ===== */
.form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.form input[type=email], .form input[type=password], .form input[type=text] {
  display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-family: inherit; font-size: 14px; color: var(--text);
  margin-top: 4px;
}
.form .row { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 500; transition: background .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #cf0052; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger { background: #fff; color: var(--accent-text); border: 1px solid var(--accent-border); }
.btn-danger:hover { background: var(--accent-bg); }
.btn-block { display: block; width: 100%; }

/* ===== Login ===== */
.guest { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #f6f7f9 0%, #fff0f5 100%); }
.guest-main { width: 100%; max-width: 420px; padding: 24px; }
.login-card { background: #fff; padding: 32px; border-radius: var(--r-lg); border: 0.5px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.05); }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .logo-big { width: 56px; height: 56px; border-radius: 12px; margin: 0 auto 14px;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 500; }
.login-logo h1 { font-size: 18px; margin: 0; }
.login-logo p  { margin: 4px 0 0; font-size: 13px; }

/* ===== Comments ===== */
.thread { display: grid; gap: 12px; margin-bottom: 14px; }
.comment { display: flex; gap: 10px; padding: 10px; border-radius: var(--r-sm); background: #f9fafb; }
.comment.is-client { background: #fff; border: 1px solid var(--border); }
.comment-head { display: flex; gap: 8px; align-items: center; }
.comment-text { font-size: 14px; margin-top: 2px; }
.mention { background: var(--accent-bg); color: var(--accent-text); padding: 0 6px; border-radius: 4px; font-weight: 500; }
.comment-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px; font-family: inherit; font-size: 14px; }
.comment-form .row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* ===== Gantt ===== */
.gantt-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
.gantt-filters { display: flex; gap: 12px; align-items: center; }
.gantt-filters label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.gantt-filters select { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-family: inherit; background: #fff; }
.gantt-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.gantt-card { overflow-x: auto; padding: 6px; }
#gantt-container { min-height: 400px; }
.gantt .bar { fill: var(--cat-other); }
.gantt .bar-progress { fill: rgba(0,0,0,0.25); }
.gantt .has-approval .bar { stroke: var(--accent); stroke-width: 1.5px; }
.gantt .milestone .bar { fill: var(--accent); }
.gantt .status-completed .bar { opacity: 0.55; }

/* Tooltip Gantt */
.gantt .details-container { background: #1a1a2e; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 12px; }
.gantt .details-container h5 { margin: 0 0 4px; color: #fff; font-weight: 500; font-size: 13px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-inner { background: #fff; padding: 24px; border-radius: var(--r-lg); width: 90%; max-width: 520px; position: relative; }
.modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }

@media (max-width: 720px) {
  .sidebar { position: relative; width: 100%; }
  .main { margin-left: 0; }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
