:root {
  color-scheme: light;
  --page-bg: #f5f7f8;
  --surface: #ffffff;
  --text: #202a32;
  --muted: #75818b;
  --border: #e5eaed;
  --primary: #087f8c;
  --primary-dark: #066b76;
  --primary-soft: #e7f5f5;
  --accent: #e5a33b;
  --shadow: 0 8px 28px rgba(28, 47, 56, 0.055);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(8, 127, 140, .25);
  outline-offset: 3px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text);
  font-size: 21px; font-weight: 800; letter-spacing: -.8px; text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-grid; width: 36px; height: 36px; place-items: center;
  border-radius: 11px; background: var(--primary); color: #fff;
  font-size: 20px; font-weight: 800; letter-spacing: -1px;
}
.brand-accent { color: var(--primary); }

/* Login */
.auth-loading {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; color: var(--muted); font-size: 13px;
}
.loading-spinner {
  width: 30px; height: 30px; border: 3px solid #dcebed;
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-view {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px 18px 20px;
}
.login-card {
  width: min(100%, 440px); padding: 38px 42px 32px; border: 1px solid var(--border);
  border-radius: 22px; background: var(--surface);
  box-shadow: 0 18px 60px rgba(28, 47, 56, .075); text-align: center;
}
.brand-login { justify-content: center; margin-bottom: 24px; }
.login-illustration {
  height: 118px; display: grid; place-items: center; margin-bottom: 23px;
  border-radius: 16px; background: linear-gradient(135deg, #e8f5f4, #f4f7f5);
}
.illustration-sheet {
  position: relative; width: 74px; height: 82px; padding: 20px 12px;
  border: 1px solid #d8e9e8; border-radius: 10px; background: #fff;
  box-shadow: 0 8px 18px rgba(8, 127, 140, .10); transform: rotate(-5deg);
}
.sheet-line {
  display: block; width: 38px; height: 5px; margin-bottom: 8px;
  border-radius: 5px; background: #e4e9e9;
}
.sheet-line.line-long { width: 48px; background: #9bd0d0; }
.sheet-line.line-short { width: 28px; }
.sheet-check {
  position: absolute; right: -13px; bottom: -9px; display: grid; width: 31px; height: 31px;
  place-items: center; border: 3px solid #fff; border-radius: 50%;
  background: #25a879; color: #fff; font-size: 15px; font-weight: 800;
}
.eyebrow {
  display: inline-block; color: var(--primary); font-size: 10px;
  font-weight: 800; letter-spacing: 1.3px;
}
.login-card h1 {
  margin: 10px 0 12px; font-size: 27px; font-weight: 800;
  letter-spacing: -1px; line-height: 1.25;
}
.login-description { margin: 0 auto 25px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.btn-google {
  display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 12px;
  border: 1px solid #dfe5e8; border-radius: 10px; background: #fff; color: #303b43;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}
.btn-google:hover { border-color: #a9d2d3; background: #f8fcfc; color: #303b43; transform: translateY(-1px); }
.btn-google svg { width: 19px; height: 19px; }
.status-message { min-height: 18px; margin: 13px 0 0; color: #c34b55; font-size: 12px; line-height: 1.5; }
.login-footnote, .login-footer { color: #929da4; font-size: 11px; line-height: 1.6; }
.login-footnote { margin: 15px 0 0; }
.login-footer { margin-top: 24px; }

/* Main application layout */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 248px;
  flex-direction: column; padding: 27px 18px 18px; border-right: 1px solid var(--border);
  background: var(--surface);
}
.sidebar-brand { padding: 0 9px; margin-bottom: 49px; }
.sidebar-label {
  padding: 0 12px; margin-bottom: 12px; color: #929da4;
  font-size: 9px; font-weight: 800; letter-spacing: 1.2px;
}
.sidebar-nav { display: grid; gap: 6px; }
.nav-link {
  display: flex; width: 100%; min-height: 45px; align-items: center; gap: 13px;
  padding: 0 13px; border: 0; border-radius: 9px; background: transparent;
  color: #697780; font-size: 13px; font-weight: 600; text-align: left;
  text-decoration: none; cursor: pointer; transition: background .18s, color .18s;
}
.nav-link:hover { background: #f2f7f7; color: var(--primary); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); }
.nav-icon { display: inline-grid; width: 20px; place-items: center; font-size: 19px; line-height: 1; }
.sidebar-bottom { margin-top: auto; }
.sidebar-tip { padding: 16px; border: 1px solid #e0eeee; border-radius: 12px; background: #f3f9f8; }
.tip-icon { margin-bottom: 9px; color: var(--primary); font-size: 19px; }
.sidebar-tip strong { display: block; margin-bottom: 6px; font-size: 12px; }
.sidebar-tip p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.sidebar-copyright { padding: 18px 4px 0; color: #929da4; font-size: 10px; }
.main-area { min-height: 100vh; margin-left: 248px; }
.topbar {
  position: sticky; z-index: 10; top: 0; display: flex; height: 72px; align-items: center;
  justify-content: flex-end; padding: 0 38px; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px);
}
.topbar-mobile-brand { display: none; align-items: center; gap: 9px; font-size: 17px; letter-spacing: -.5px; }
.topbar-mobile-brand .brand-mark { width: 31px; height: 31px; border-radius: 9px; font-size: 17px; }
.topbar-spacer { flex: 1; }
.account-area { display: flex; align-items: center; gap: 22px; }
.account-identity { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 37px; height: 37px; flex: 0 0 37px; border: 2px solid #e5eeee; border-radius: 50%; object-fit: cover; }
.account-text { display: grid; gap: 2px; }
.account-name {
  max-width: 190px; overflow: hidden; color: #303b43; font-size: 12px;
  font-weight: 700; text-overflow: ellipsis; white-space: nowrap;
}
.account-email { max-width: 190px; overflow: hidden; color: #929da4; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout {
  display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 12px;
  border: 1px solid #f0dfe1; border-radius: 8px; background: #fff; color: #bd5963;
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.btn-logout:hover { background: #fff7f7; }
.btn-logout:disabled { opacity: .55; cursor: wait; }

/* Dashboard */
.dashboard-content { width: min(100%, 1220px); padding: 36px 38px 28px; margin: 0 auto; }
.welcome-section { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.welcome-section h1 { margin: 7px 0 5px; color: var(--text); font-size: 29px; font-weight: 800; letter-spacing: -1px; }
.welcome-section p { margin: 0; color: var(--muted); font-size: 12px; }
.btn-primary-action {
  display: inline-flex; min-height: 43px; flex: 0 0 auto; align-items: center; justify-content: center;
  gap: 8px; padding: 0 17px; border: 0; border-radius: 9px; background: var(--primary);
  box-shadow: 0 5px 12px rgba(8, 127, 140, .18); color: #fff; font-size: 12px;
  font-weight: 700; cursor: pointer; transition: background .2s, transform .2s;
}
.btn-primary-action:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary-action span { font-size: 19px; line-height: 1; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.section-heading h2 { margin: 0 0 5px; color: #303b43; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.section-heading p { margin: 0; color: #87939a; font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.stat-card {
  min-height: 137px; padding: 18px 19px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(28, 47, 56, .08); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: #626f77; font-size: 11px; font-weight: 700; }
.stat-icon { display: inline-grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; font-size: 17px; font-weight: 700; }
.stat-value { margin-top: 9px; color: #26343b; font-size: 27px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.stat-caption { display: block; margin-top: 5px; color: #929da4; font-size: 10px; }
.stat-total .stat-icon { background: #e7f5f5; color: #087f8c; }
.stat-saved .stat-icon { background: #f0f2f3; color: #75818b; }
.stat-applied .stat-icon { background: #eaf3ff; color: #3984dc; }
.stat-interview .stat-icon { background: #f2edff; color: #8b65d6; }
.stat-assessment .stat-icon { background: #fff3e7; color: #d98b2f; }
.stat-offer .stat-icon { background: #e9f8f0; color: #269b6d; }
.data-notice { margin: 12px 0 0; color: #929da4; font-size: 10px; line-height: 1.6; }

/* Recent activity */
.activity-section { margin-top: 34px; }
.activity-panel {
  display: flex; min-height: 205px; flex-direction: column; align-items: center; justify-content: center;
  padding: 26px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  text-align: center; box-shadow: var(--shadow);
}
.activity-empty-icon {
  display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 12px;
  border-radius: 50%; background: #e7f5f5; color: var(--primary); font-size: 24px;
}
.activity-panel strong { color: #46545b; font-size: 12px; }
.activity-panel p { max-width: 390px; margin: 7px 0 0; color: #87939a; font-size: 11px; line-height: 1.7; }
.app-status { min-height: 18px; margin-top: 16px; color: #9a6c35; font-size: 11px; }
.app-footer { padding-top: 16px; margin-top: 10px; border-top: 1px solid var(--border); color: #929da4; font-size: 10px; }
.mobile-nav { display: none; }

@media (max-width: 1050px) {
  .sidebar { width: 215px; }
  .main-area { margin-left: 215px; }
  .dashboard-content { padding-right: 26px; padding-left: 26px; }
  .topbar { padding-right: 26px; padding-left: 26px; }
}
@media (max-width: 760px) {
  body { padding-bottom: 72px; }
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .topbar { height: 62px; justify-content: space-between; padding: 0 17px; }
  .topbar-mobile-brand { display: inline-flex; }
  .account-area { gap: 10px; }
  .account-identity { gap: 7px; }
  .user-avatar { width: 33px; height: 33px; flex-basis: 33px; }
  .account-name { max-width: 115px; font-size: 11px; }
  .account-email { display: none; }
  .btn-logout { width: 35px; min-height: 35px; justify-content: center; padding: 0; font-size: 16px; }
  .logout-label { display: none; }
  .dashboard-content { padding: 27px 17px 24px; }
  .welcome-section { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 28px; }
  .welcome-section h1 { font-size: 26px; }
  .btn-primary-action { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { min-height: 126px; padding: 14px; }
  .stat-label { font-size: 10px; }
  .stat-icon { width: 28px; height: 28px; font-size: 15px; }
  .stat-value { font-size: 25px; }
  .activity-section { margin-top: 29px; }
  .activity-panel { min-height: 190px; padding: 22px 17px; }
  .mobile-nav {
    position: fixed; z-index: 30; inset: auto 0 0; display: grid;
    grid-template-columns: repeat(4, 1fr); min-height: 66px;
    padding: 7px 5px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px);
  }
  .mobile-nav-link {
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px;
    border: 0; background: transparent; color: #87939a; font-size: 9px; font-weight: 600;
    text-decoration: none; cursor: pointer;
  }
  .mobile-nav-link.active { color: var(--primary); }
  .mobile-nav-icon { font-size: 19px; line-height: 1.1; }
  .app-footer { margin-top: 6px; }
}
@media (max-width: 390px) {
  .topbar { padding-right: 12px; padding-left: 12px; }
  .topbar-mobile-brand { gap: 7px; font-size: 15px; }
  .account-name { max-width: 88px; }
  .dashboard-content { padding-right: 13px; padding-left: 13px; }
  .stat-card { padding: 12px; }
  .stat-label, .stat-caption { font-size: 9px; }
}
@media (max-width: 420px) {
  .login-card { padding: 30px 23px 25px; }
  .login-card h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Application form */
.application-form-panel {
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.form-panel-header h2 {
  margin: 7px 0 5px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.6px;
}

.form-panel-header p,
.form-section > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.form-close-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #697780;
  font-size: 23px;
  cursor: pointer;
}

.form-close-button:hover {
  background: #f5f7f8;
}

.form-section {
  padding: 23px 0;
  border-bottom: 1px solid var(--border);
}

.form-section h3 {
  margin: 0 0 5px;
  color: #303b43;
  font-size: 14px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  margin-top: 17px;
}

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.form-field > span {
  color: #46545b;
  font-size: 11px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #dfe6e9;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  transition: border-color .18s, box-shadow .18s;
}

.form-field textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.6;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #a3adb3;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 127, 140, .10);
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-status-note {
  margin-top: 19px;
  padding: 13px 15px;
  border: 1px solid #dceeee;
  border-radius: 9px;
  background: #f3f9f8;
  color: #52666a;
  font-size: 11px;
  line-height: 1.6;
}

.form-status-note strong {
  color: var(--primary-dark);
}

.form-message {
  min-height: 18px;
  margin-top: 12px;
  color: #bd5963;
  font-size: 11px;
  line-height: 1.6;
}

.form-message.success {
  color: #21865f;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
}

.btn-form-cancel {
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #697780;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-form-cancel:hover {
  background: #f5f7f8;
}

.form-actions button:disabled {
  opacity: .6;
  cursor: wait;
}

@media (max-width: 760px) {
  .application-form-panel {
    padding: 19px 15px;
    margin-top: 23px;
  }

  .form-panel-header h2 {
    font-size: 19px;
  }

  .form-section {
    padding: 20px 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-field-full {
    grid-column: auto;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions button {
    width: 100%;
  }
}
