/* === v1.6.7: Prioridade/SLAs, badges, e ajustes === */
/* base (herdado das versões anteriores) */
.frc-login-hero{ background: linear-gradient(180deg,#f5f8ff,#eef3fb); padding:0; }
.frc-login-grid{ display:grid; grid-template-columns: 1fr; min-height: 76vh; }
.frc-hero-illustration{ display:none; background-size:cover; background-position:center; }
@media (min-width: 992px){
  .frc-login-grid{ grid-template-columns: 55% 45%; }
  .frc-hero-illustration{ display:block; }
  .frc-login{ display:flex; align-items:center; justify-content:flex-end; padding: 28px 22px; }
}
@media (max-width: 991.98px){
  .frc-login{ display:flex; align-items:center; justify-content:center; padding: 28px 12px; }
}
.frc-login-card{ width:100%; max-width:520px; background:#fff; border:1px solid #e6ebf5; border-radius:16px; box-shadow:0 6px 18px rgba(16,24,40,.06); padding:22px 20px; }
.frc-login-brand{ display:flex; gap:12px; align-items:center; margin-bottom:6px; }
.frc-login-brand img{ max-height:48px; width:auto; }
.frc-login-name{ font-size:18px; font-weight:700; line-height:1.2; }
.frc-login-site{ font-size:12px; color:#475569; }
.frc-login-title{ font-size:20px; margin:8px 0 4px; }
.frc-login-sub{ margin:0 0 12px; color:#475569; }
.frc-login-form .login-username label,
.frc-login-form .login-password label{ display:block; font-size:13px; color:#334155; margin:8px 0 4px; }
.frc-login-form input[type="text"],
.frc-login-form input[type="password"]{ width:100%; padding:10px 12px; border:1px solid #dbe2f0; border-radius:10px; }
.frc-login-form .login-remember{ margin-top:8px; }
.frc-login-form .login-submit input[type="submit"]{ width:100%; padding:10px 14px; border-radius:10px; background:#0a3d62; color:#fff; border:0; font-weight:600; cursor:pointer; }
.frc-login-links{ margin-top:10px; font-size:13px; }
.frc-login-links a{ color:#0a3d62; text-decoration:none; }
.frc-login-links a:hover{ text-decoration:underline; }
.frc-login-footer{ margin-top:10px; font-size:12px; color:#64748b; }

.frc-portal{ padding:16px; }
.frc-portal-head{ display:flex; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid #e5e7eb; padding-bottom:8px; margin-bottom:12px; }
.frc-portal-head .brand{ display:flex; gap:10px; align-items:center; }
.frc-portal-head img{ height:32px; width:auto; }
.frc-portal-head .nm{ font-weight:700; }
.frc-portal-head .links{ margin-top:4px; font-size:12px; }
.frc-lnk{ color:#0a3d62; text-decoration:none; }
.frc-lnk:hover{ text-decoration:underline; }

.frc-actions{ display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 12px; }
.frc-btn{ display:inline-block; background:#0a3d62; color:#fff; padding:6px 10px; border-radius:8px; text-decoration:none; }
.frc-btn.secondary{ background:#64748b; }
.frc-btn.danger{ background:#ef4444; }

.frc-table{ width:100%; border-collapse:collapse; }
.frc-table th, .frc-table td{ border:1px solid #e5e7eb; padding:8px; text-align:left; }
.frc-table th{ background:#f8fafc; }

.frc-form .row{ margin-bottom:10px; }
.frc-form label{ display:block; font-size:13px; margin-bottom:4px; color:#334155; }
.frc-form input[type="text"], .frc-form input[type="email"], .frc-form input[type="password"], .frc-form select, .frc-form textarea{ width:100%; border:1px solid #dbe2f0; border-radius:8px; padding:8px 10px; }
.frc-form .actions{ display:flex; gap:8px; margin-top:8px; }

.frc-ticket .head{ display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:flex-start; border-bottom:1px solid #e5e7eb; padding-bottom:8px; margin-bottom:12px; }
.frc-ticket .meta span{ margin-right:10px; color:#334155; font-size:13px; }
.frc-ticket .body{ margin-bottom:16px; }
.frc-thread{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.frc-thread .meta{ font-size:12px; color:#64748b; margin-bottom:4px; }
.frc-thread .msg{ background:#fff; border:1px solid #e5e7eb; border-radius:8px; padding:8px; }
.reply textarea{ width:100%; border:1px solid #dbe2f0; border-radius:8px; padding:8px 10px; }

/* filtros */
.frc-filters{ display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; margin-bottom:10px; }
.frc-filters label{ font-size:12px; color:#334155; display:flex; flex-direction:column; gap:4px; }
.frc-filters input, .frc-filters select{ min-width:160px; border:1px solid #dbe2f0; border-radius:8px; padding:6px 8px; }

/* cards e painéis de stats */
.frc-stats .cards{ display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.frc-stats .card{ background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:10px; }
.frc-stats .card .k{ font-size:12px; color:#64748b; }
.frc-stats .card .v{ font-size:20px; font-weight:700; }
.frc-stats .grid2{ display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
.frc-stats .panel{ background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:10px; }
.bars{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.bars li{ display:grid; grid-template-columns: 1fr auto 40px; gap:8px; align-items:center; }
.bars .lbl{ font-size:12px; }
.bars .bar{ background:#eef2f7; height:8px; border-radius:8px; overflow:hidden; }
.bars .bar i{ display:block; height:8px; background:#0a3d62; }
.bars .val{ font-size:12px; text-align:right; }

/* badges */
.badge{ display:inline-block; padding:2px 6px; border-radius:999px; font-size:11px; font-weight:600; color:#fff; }
.prio-red{ background:#dc2626; }
.prio-gray{ background:#6b7280; }
.st-blue{ background:#2563eb; }
.st-gray{ background:#6b7280; }
.note{ color:#64748b; font-size:12px; margin-left:8px; }

.badge.st-wait{background:#2563eb;color:#fff;padding:2px 6px;border-radius:12px;font-size:12px}
.badge.st-progress{background:#16a34a;color:#fff;padding:2px 6px;border-radius:12px;font-size:12px}
/* v1.7.4 login centered */
.frc-login-centered{min-height:70vh;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--frc-login-bg,#f5f7fb)}
.frc-login-card{width:100%;max-width:420px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,.06);padding:22px}
.frc-login-brand{display:flex;gap:10px;align-items:center;margin-bottom:8px}
.frc-login-brand img{height:42px;width:auto}
.frc-login-name{font-weight:700;color:#0a3d62}
.frc-login-site{font-size:12px;color:#64748b}
.frc-login-title{margin:12px 0 8px 0;font-size:18px}
/* Icons on login inputs (data-URI SVGs) */
#loginform p label{display:block;font-size:13px;color:#334155;margin-bottom:4px}
#user_login,#user_pass{width:100%;box-sizing:border-box;padding-left:36px;background-repeat:no-repeat;background-position:10px center;background-size:18px 18px}
#user_login{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2367748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>")}
#user_pass{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2367748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2' ry='2'/><path d='M7 11V7a5 5 0 0 1 10 0v4'/></svg>")}
/* Alerts */
.frc-alert.error{background:#fee2e2;border:1px solid #fecaca;color:#991b1b;padding:10px 12px;border-radius:8px;margin:10px 0}

.mini-note{margin-left:8px;font-size:12px;color:#334155;opacity:.85}

/* v1.7.7: Prazo highlighting & countdown */
.deadline-soon{background:#fff7ed !important;color:#b45309 !important}
.deadline-due{background:#fee2e2 !important;color:#991b1b !important}
.sla-countdown{margin:6px 0 0 0;font-size:13px;color:#334155}
.sla-countdown.deadline-soon{color:#b45309}
.sla-countdown.deadline-due{color:#991b1b}

/* v1.7.9: Deadline badge */
.badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;line-height:1;border:1px solid #e5e7eb;background:#f8fafc;color:#0f172a}
.badge-deadline.deadline-soon{background:#fff7ed;border-color:#fdba74;color:#b45309}
.badge-deadline.deadline-due{background:#fee2e2;border-color:#fca5a5;color:#991b1b}

/* v1.8.1 visual polish */
.badge-prio{color:#fff;border:none}
.badge-prio-prioritario{background:#e74c3c}
.badge-prio-padrao{background:#3498db}
.frc-admin-quick{margin:8px 0 14px 0; display:flex; gap:8px; flex-wrap:wrap}
.frc-admin-quick .button .dashicons{vertical-align:middle; margin-right:4px}
.frc-filters label{display:inline-flex;flex-direction:column;font-size:12px;color:#334155;margin-right:10px;gap:3px}
.frc-table th,.frc-table td{vertical-align:middle}

/* v1.9.0 Responsive */
.frc-table-wrap{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
.frc-btn{min-height:40px;padding:8px 12px}
.frc-form input[type="text"], .frc-form input[type="email"], .frc-form input[type="password"], .frc-form select, .frc-form textarea{min-height:44px}
/* Breakpoints */
@media (max-width: 640px){
  .frc-portal-head{flex-direction:column;align-items:flex-start;gap:10px}
  .frc-portal-head .user{text-align:left}
  .frc-filters{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .frc-filters label{margin-right:0}
  .frc-table th:nth-child(1), .frc-table td:nth-child(1){display:table-cell} /* ID mantém */
  .frc-table th:nth-child(3), .frc-table td:nth-child(3){display:none} /* Autor some no mobile */
  .frc-table th:nth-child(6), .frc-table td:nth-child(6){display:none} /* Status pode ocultar se apertado */
  .frc-actions{display:flex;flex-wrap:wrap;gap:6px}
}
@media (min-width: 641px) and (max-width: 1024px){
  .frc-filters{display:flex;flex-wrap:wrap;gap:10px}
}
@media (min-width: 1440px){
  .frc-table{font-size:15px}
  .frc-login-card{max-width:520px}
}
/* TV and large screens */
@media (min-width: 1920px){
  .frc-table{font-size:16px}
  .frc-portal-head .brand img{height:56px}
}

/* v1.9.1: minimal user panel */
.frc-portal-head .user.mini{font-size:12px; line-height:1.25; color:#475569}
.frc-portal-head .user.mini .u{font-weight:600; color:#0f172a}
.frc-portal-head .user.mini .cmp{color:#64748b; margin-top:2px}
.frc-portal-head .user.mini .stats{margin-top:4px; display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end}
@media (max-width:640px){ .frc-portal-head .user.mini .stats{justify-content:flex-start} }
.badge-count{background:#f1f5f9; border:1px solid #e2e8f0; color:#0f172a; padding:2px 8px; border-radius:999px; font-size:12px}

/* v1.9.3 Footer */
.frc-footer{margin-top:24px;padding:12px 10px;border-top:1px solid #e5e7eb;text-align:center;color:#475569;background:#f8fafc;font-size:13px}

/* v1.9.5+ responsividade e UI mobile */
.frc-view-toggle{display:none; margin:8px 0; padding:8px 12px; border:1px solid #e5e7eb; border-radius:8px; background:#fff}
@media (max-width:640px){ .frc-view-toggle{display:inline-flex} }
.frc-filter-toggle{position:relative}
@media (max-width:640px){
  .frc-filter-toggle{
    position:fixed; right:12px; bottom:12px; z-index:20;
    box-shadow:0 6px 16px rgba(0,0,0,.12);
    background:#0ea5e9; color:#fff; border-color:#0284c7
  }
  .frc-filters.is-collapsible{
    overflow:hidden; transition:max-height .25s ease, opacity .25s ease;
    opacity:0; border:1px solid #e5e7eb; border-radius:12px; padding:10px;
    background:#fff; margin-bottom:8px
  }
  .frc-filters.is-collapsible.open{opacity:1}
  .frc-table.as-cards thead{display:none}
  .frc-table.as-cards, .frc-table.as-cards tbody, .frc-table.as-cards tr, .frc-table.as-cards td{display:block; width:100%}
  .frc-table.as-cards tr{background:#fff;border:1px solid #e5e7eb;border-radius:12px;margin:10px 0;padding:10px}
  .frc-table.as-cards td{display:flex;justify-content:space-between;gap:10px;padding:6px 0}
  .frc-table.as-cards td::before{content: attr(data-label); font-weight:600; color:#334155}
  .frc-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-start}
}

/* v1.9.12-hotfix: reabertura oculta por padrão + ajustes de ações no cabeçalho */
.frc-reopen-form{display:none}
.frc-portal-head .user .actions{margin-top:2px; display:flex; gap:10px; justify-content:flex-end}
.frc-portal-head .user .actions a{font-size:12px; color:#0369a1; text-decoration:none}
.frc-portal-head .user .actions a:hover{text-decoration:underline}
@media (max-width:640px){ .frc-portal-head .user .actions{justify-content:flex-start} }

/* v1.9.16 (CSS-only): reabrir + justificativa ao lado direito */
.frc-actions, .frc-action-row{display:flex; flex-wrap:wrap; gap:8px; align-items:flex-start}
.frc-reopen-form{display:inline-block; margin-left:8px; vertical-align:top}
.frc-reopen-form textarea{min-width:260px; max-width:520px}
.frc-reopen-form .frc-btn{margin-top:4px}

/* header: manter "Sair" ao lado do usuário */
.frc-portal-head .user{display:flex; flex-direction:column; align-items:flex-end}
.frc-portal-head .user .actions{display:flex; gap:10px; align-items:center}
@media (max-width:640px){
  .frc-portal-head .user{align-items:flex-start}
}
