/* AiTurnPro Client Portal — scoped, responsive frontend styles. */
.atp-portal {
  --atp-ink: #19243a;
  --atp-muted: #65748a;
  --atp-blue: #2368d6;
  --atp-border: #dce5ef;
  --atp-surface: #fff;
  --atp-bg: #f5f8fc;
  color: var(--atp-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  max-width: 1150px;
  margin: 24px auto;
  box-sizing: border-box;
}
.atp-portal *, .atp-portal *::before, .atp-portal *::after { box-sizing: border-box; }
.atp-portal h1, .atp-portal h2 { color: var(--atp-ink); line-height: 1.24; margin: 0 0 10px; }
.atp-portal h1 { font-size: clamp(24px, 4vw, 30px); font-weight: 750; }
.atp-portal h2 { font-size: 20px; font-weight: 730; }
.atp-portal p { margin: 0 0 16px; }
.atp-portal a { color: var(--atp-blue); }
.atp-portal input { font: inherit; }
.atp-portal button { cursor: pointer; font: inherit; }
.atp-portal--login { min-height: 540px; display: flex; align-items: center; justify-content: center; }
.atp-panel { border: 1px solid var(--atp-border); background: var(--atp-surface); border-radius: 14px; padding: 25px; box-shadow: 0 6px 26px rgba(28, 54, 90, .055); margin-bottom: 20px; }
.atp-login-card { width: 100%; max-width: 450px; padding: 35px; }
.atp-brand { font-size: 21px; font-weight: 800; letter-spacing: -.4px; color: #17346c; margin-bottom: 24px; }
.atp-brand span { color: #3b73d4; font-weight: 550; }
.atp-muted { color: var(--atp-muted); }
.atp-login-card label, .atp-upload-panel label { display: block; color: #243650; font-weight: 650; font-size: 14px; margin: 15px 0 6px; }
.atp-portal input[type="text"], .atp-portal input[type="password"], .atp-portal input[type="file"] {
  width: 100%; max-width: 100%; padding: 11px 13px; background: #fff;
  border: 1px solid #ccd8e7; border-radius: 8px; color: #202c42;
}
.atp-portal input:focus-visible, .atp-portal button:focus-visible, .atp-portal a:focus-visible { outline: 3px solid #82b3ff; outline-offset: 2px; }
.atp-portal input[type="file"] { min-width: 200px; }
.atp-button { border: 0; display: inline-flex; align-items: center; justify-content: center; min-height: 43px; border-radius: 8px; background: var(--atp-blue); color: #fff !important; padding: 10px 19px; font-weight: 700; text-decoration: none; transition: background .15s ease; }
.atp-button:hover { background: #154da7; color: #fff; }
.atp-login-card .atp-button { width: 100%; margin-top: 20px; }
.atp-login-footer { margin-top: 25px; padding-top: 17px; border-top: 1px solid var(--atp-border); color: var(--atp-muted); font-size: 13px; }
.atp-notice { margin: 12px 0 20px; padding: 11px 14px; border-radius: 8px; font-size: 14px; background: #fff8ed; color: #714719; border: 1px solid #f4d99d; }
.atp-notice--success { background: #eef9f2; color: #176343; border-color: #a3dcb5; }
.atp-topbar { display: flex; gap: 15px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.atp-topbar .atp-brand { margin: 0; }
.atp-user-actions { display: flex; align-items: baseline; gap: 18px; font-size: 13px; color: var(--atp-muted); flex-wrap: wrap; }
.atp-user-actions a { font-weight: 650; }
.atp-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.atp-stat { background: #f2f7ff; border: 1px solid #dfebfb; border-radius: 12px; padding: 18px 20px; }
.atp-stat span { display: block; color: #556c8d; font-weight: 600; font-size: 13px; }
.atp-stat strong { display: block; font-size: 30px; line-height: 1.2; margin-top: 8px; color: #234675; }
.atp-upload-panel form { display: flex; align-items: end; flex-wrap: wrap; gap: 13px; margin: 14px 0 11px; }
.atp-upload-panel form label { width: 100%; margin: 0 0 -8px; }
.atp-upload-panel input[type="file"] { max-width: 510px; flex: 1 1 270px; }
.atp-upload-panel .atp-button { flex: 0 0 auto; }
.atp-help { color: #67758a; font-size: 12px; line-height: 1.65; margin: 12px 0 0 !important; }
.atp-section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.atp-section-head .atp-muted { font-size: 12px; }
.atp-table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--atp-border); border-radius: 9px; }
.atp-table { width: 100%; min-width: 680px; border-collapse: collapse; color: var(--atp-ink); font-size: 13px; line-height: 1.5; }
.atp-table thead { background: #f4f7fb; }
.atp-table th { text-align: left; padding: 12px 14px; color: #486080; font-weight: 700; border-bottom: 1px solid var(--atp-border); white-space: nowrap; }
.atp-table td { padding: 14px; vertical-align: top; border-bottom: 1px solid #ebf0f6; max-width: 340px; overflow-wrap: anywhere; }
.atp-table tbody tr:last-child td { border-bottom: none; }
.atp-table .atp-subtext { display: block; font-size: 11px; color: var(--atp-muted); margin-top: 3px; }
.atp-status { display: inline-block; font-size: 12px; line-height: 1.4; padding: 4px 9px; border-radius: 20px; font-weight: 700; background: #edf2f8; color: #415671; white-space: nowrap; }
.atp-status--completed { background: #e5f7eb; color: #18683c; }
.atp-status--processing, .atp-status--submitting { background: #e7f0fe; color: #245ca8; }
.atp-status--failed, .atp-status--submission_failed, .atp-status--submission_unknown { background: #fff0e6; color: #91481f; }
.atp-link { display: inline-block; font-weight: 650; margin: 0 10px 6px 0; white-space: nowrap; }
.atp-small-button { background: #fff; border: 1px solid #cad9ed; color: #21569c; border-radius: 6px; padding: 5px 8px; font-size: 12px !important; font-weight: 700; }
.atp-small-button:hover { border-color: #3776cf; background: #f4f9ff; }
.atp-inline-form { display: block; margin: 2px 0 0; }
.atp-retry summary { color: #21569c; font-weight: 700; cursor: pointer; }
.atp-retry form { margin: 10px 0; }
.atp-retry input[type="file"] { display: block; font-size: 12px; margin: 8px 0; }
.atp-empty { text-align: center; padding: 26px 10px; color: var(--atp-muted); }
.atp-pagination { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0; }
.atp-pagination a { text-decoration: none; border: 1px solid var(--atp-border); padding: 4px 10px; border-radius: 6px; }
.atp-pagination a.is-current { background: var(--atp-blue); color: #fff; }
@media (max-width: 700px) {
  .atp-portal { margin: 10px auto; font-size: 14px; }
  .atp-portal--login { min-height: 430px; }
  .atp-panel { padding: 14px; border-radius: 10px; }
  .atp-login-card { padding: 20px 15px; }
  .atp-stat-grid { gap: 7px; }
  .atp-stat { padding: 11px 9px; }
  .atp-stat strong { font-size: 24px; }
  .atp-stat span { font-size: 11px; }
  .atp-upload-panel .atp-button { width: 100%; }
  .atp-upload-panel input[type="file"] { flex-basis: 100%; }
  .atp-topbar .atp-brand { font-size: 18px; }
}
