/* ═══════════════════════════════════════════════════════
   Imperial Education Services – Student Portal CSS
═══════════════════════════════════════════════════════ */

:root {
  --ies-navy:   #1a3a5c;
  --ies-gold:   #c8a84b;
  --ies-gold-l: #f5e6b8;
  --ies-white:  #ffffff;
  --ies-bg:     #f0f4f8;
  --ies-border: #dde3ea;
  --ies-text:   #2d3748;
  --ies-muted:  #718096;
  --ies-radius: 10px;
  --ies-shadow: 0 2px 16px rgba(26,58,92,.10);
}

/* ── Reset ── */
.ies-portal-wrap *, .ies-dashboard * { box-sizing: border-box; }

/* ════════════ APPLY / LOGIN PAGE ════════════ */
.ies-portal-wrap {
  max-width: 560px;
  margin: 40px auto;
  background: var(--ies-white);
  border-radius: var(--ies-radius);
  box-shadow: var(--ies-shadow);
  overflow: hidden;
}

.ies-tabs {
  display: flex;
  background: var(--ies-navy);
}
.ies-tab {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.ies-tab.active, .ies-tab:hover {
  color: var(--ies-gold);
  border-bottom: 3px solid var(--ies-gold);
}

.ies-tab-content { display: none; padding: 32px; }
.ies-tab-content.active { display: block; }

.ies-form-title { margin: 0 0 6px; color: var(--ies-navy); font-size: 22px; }
.ies-form-subtitle { color: var(--ies-muted); margin: 0 0 24px; font-size: 14px; }

.ies-form-row { display: flex; gap: 16px; }
.ies-form-row .ies-form-group { flex: 1; }

.ies-form-group { margin-bottom: 18px; }
.ies-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ies-navy);
  margin-bottom: 6px;
}
.ies-form-group input,
.ies-form-group select,
.ies-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--ies-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ies-text);
  background: #fafbfc;
  transition: border-color .2s;
}
.ies-form-group input:focus,
.ies-form-group select:focus,
.ies-form-group textarea:focus {
  outline: none;
  border-color: var(--ies-gold);
  background: #fff;
}

.ies-checkbox-row label { display: flex; align-items: center; gap: 8px; font-weight: normal; font-size: 13px; }

.req { color: #e53e3e; }

/* ── Buttons ── */
.ies-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.ies-btn-primary { background: var(--ies-gold); color: var(--ies-navy); }
.ies-btn-primary:hover { background: #b8962f; }
.ies-btn-outline { background: transparent; border: 1.5px solid var(--ies-border); color: var(--ies-text); }
.ies-btn-outline:hover { border-color: var(--ies-gold); color: var(--ies-navy); }
.ies-btn-sm { padding: 7px 14px; font-size: 12px; }
.ies-btn-lg { width: 100%; justify-content: center; padding: 14px; font-size: 16px; }

.ies-form-footer { margin-top: 20px; font-size: 13px; color: var(--ies-muted); text-align: center; }
.ies-form-footer a { color: var(--ies-gold); font-weight: 600; }

/* ── Messages ── */
.ies-msg {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.ies-msg.success { background: #f0fff4; border: 1px solid #68d391; color: #276749; }
.ies-msg.error   { background: #fff5f5; border: 1px solid #fc8181; color: #9b2c2c; }
.ies-msg.info    { background: #ebf8ff; border: 1px solid #63b3ed; color: #2b6cb0; }

.ies-notice { padding: 14px 18px; border-radius: 6px; margin: 20px 0; font-size: 14px; }
.ies-notice-info    { background: #ebf8ff; border-left: 4px solid #3182ce; color: #2b6cb0; }
.ies-notice-warning { background: #fffbeb; border-left: 4px solid #f6ad55; color: #744210; }

/* ════════════ DASHBOARD ════════════ */
.ies-dashboard {
  display: flex;
  min-height: 100vh;
  background: var(--ies-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Sidebar ── */
.ies-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--ies-navy);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.ies-sidebar-profile {
  padding: 30px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.ies-avatar {
  width: 56px; height: 56px;
  background: var(--ies-gold);
  color: var(--ies-navy);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.ies-sidebar-name { color: #fff; font-weight: 700; font-size: 15px; }
.ies-sidebar-email { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 2px; word-break: break-all; }

.ies-sidebar-nav { flex: 1; padding: 16px 0; }
.ies-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
  position: relative;
}
.ies-nav-item:hover, .ies-nav-item.active {
  background: rgba(255,255,255,.08);
  color: var(--ies-gold);
  border-left: 3px solid var(--ies-gold);
}
.ies-nav-icon { font-size: 18px; }

.ies-badge {
  margin-left: auto;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
}

.ies-sidebar-footer { padding: 20px 24px; border-top: 1px solid rgba(255,255,255,.1); }
.ies-sidebar-footer .ies-btn { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.2); width: 100%; justify-content: center; }
.ies-sidebar-footer .ies-btn:hover { color: #fff; border-color: rgba(255,255,255,.5); }

/* ── Main ── */
.ies-main { flex: 1; padding: 32px; overflow-y: auto; }

.ies-panel { display: none; }
.ies-panel.active { display: block; }

.ies-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.ies-panel-header h2 { margin: 0; color: var(--ies-navy); font-size: 22px; }

.ies-live-dot {
  width: 10px; height: 10px;
  background: #48bb78;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(1.3)} }

/* ── Cards ── */
.ies-card {
  background: var(--ies-white);
  border-radius: var(--ies-radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--ies-shadow);
}
.ies-card h3 { margin: 0 0 16px; color: var(--ies-navy); font-size: 16px; border-bottom: 1px solid var(--ies-border); padding-bottom: 10px; }

/* ── Status card ── */
.ies-status-card {
  background: var(--ies-navy);
  color: #fff;
  border-radius: var(--ies-radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--ies-shadow);
}
.ies-status-header { display: flex; align-items: center; justify-content: space-between; }
.ies-ref-label { font-size: 12px; opacity: .7; text-transform: uppercase; letter-spacing: 1px; }
.ies-ref-code { font-size: 22px; font-weight: 700; font-family: monospace; color: var(--ies-gold); }
.ies-status-badge {
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.ies-admin-notes {
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(200,168,75,.15);
  border-left: 4px solid var(--ies-gold);
  border-radius: 4px;
  font-size: 14px;
}
.ies-admin-notes p { margin: 6px 0 0; }

/* ── Detail grid ── */
.ies-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ies-detail-item span { font-size: 12px; color: var(--ies-muted); display: block; }
.ies-detail-item strong { font-size: 14px; color: var(--ies-text); }
.ies-ps-text { font-size: 14px; line-height: 1.7; color: var(--ies-text); white-space: pre-wrap; }

/* ── Empty state ── */
.ies-empty-state { text-align: center; padding: 60px 20px; }
.ies-empty-icon { font-size: 64px; margin-bottom: 16px; }
.ies-empty-state h3 { color: var(--ies-navy); margin-bottom: 8px; }
.ies-empty-state p { color: var(--ies-muted); margin-bottom: 24px; }

/* ── Upload area ── */
.ies-upload-drop {
  border: 2px dashed var(--ies-border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  color: var(--ies-muted);
  font-size: 14px;
  transition: all .2s;
}
.ies-upload-drop.dragover { border-color: var(--ies-gold); background: var(--ies-gold-l); }

/* ── Document list ── */
.ies-doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ies-border);
  font-size: 14px;
  flex-wrap: wrap;
}
.ies-doc-row:last-child { border-bottom: none; }
.ies-doc-icon { font-size: 22px; }
.ies-doc-info { flex: 1; }
.ies-doc-name { font-weight: 600; color: var(--ies-text); }
.ies-doc-meta { font-size: 12px; color: var(--ies-muted); }
.ies-doc-status { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.ies-doc-uploaded { background: #ebf8ff; color: #2b6cb0; }
.ies-doc-approved { background: #f0fff4; color: #276749; }
.ies-doc-rejected { background: #fff5f5; color: #9b2c2c; }
.ies-doc-requested{ background: #fffbeb; color: #744210; }

/* ── Timeline ── */
.ies-timeline { position: relative; padding: 10px 0; }
.ies-tl-item { display: flex; gap: 16px; margin-bottom: 20px; }
.ies-tl-left { display: flex; flex-direction: column; align-items: center; }
.ies-tl-dot {
  width: 14px; height: 14px;
  background: var(--ies-gold);
  border-radius: 50%;
  border: 3px solid var(--ies-white);
  box-shadow: 0 0 0 2px var(--ies-gold);
  flex-shrink: 0;
}
.ies-tl-line { flex: 1; width: 2px; background: var(--ies-border); margin-top: 4px; }
.ies-tl-content { flex: 1; background: var(--ies-white); border-radius: 8px; padding: 14px 18px; box-shadow: var(--ies-shadow); }
.ies-tl-date { font-size: 12px; color: var(--ies-muted); margin-bottom: 4px; }
.ies-tl-msg { font-size: 14px; color: var(--ies-text); }

/* ── Chat ── */
.ies-chat-wrap { display: flex; flex-direction: column; }
.ies-chat-messages {
  background: var(--ies-white);
  border-radius: var(--ies-radius);
  padding: 20px;
  min-height: 300px;
  max-height: 450px;
  overflow-y: auto;
  margin-bottom: 16px;
  box-shadow: var(--ies-shadow);
}
.ies-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.ies-bubble-student { background: var(--ies-gold-l); margin-left: auto; border-bottom-right-radius: 4px; }
.ies-bubble-admin   { background: #ebf8ff; margin-right: auto; border-bottom-left-radius: 4px; }
.ies-bubble-meta { font-size: 11px; color: var(--ies-muted); margin-top: 4px; }

.ies-chat-compose { background: var(--ies-white); border-radius: var(--ies-radius); padding: 16px; box-shadow: var(--ies-shadow); display: flex; gap: 12px; align-items: flex-end; }
.ies-chat-compose textarea { flex: 1; border: 1.5px solid var(--ies-border); border-radius: 6px; padding: 10px 14px; resize: none; font-size: 14px; }
.ies-chat-compose textarea:focus { outline: none; border-color: var(--ies-gold); }

.ies-muted { color: var(--ies-muted); font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ies-dashboard { flex-direction: column; }
  .ies-sidebar { width: 100%; height: auto; position: relative; }
  .ies-sidebar-nav { display: flex; overflow-x: auto; padding: 0; }
  .ies-nav-item { padding: 12px 16px; white-space: nowrap; }
  .ies-main { padding: 20px 16px; }
  .ies-detail-grid { grid-template-columns: 1fr; }
  .ies-form-row { flex-direction: column; gap: 0; }
  .ies-status-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
