/* InternConnect - Main Stylesheet */
:root {
  --blue:       #2563eb;
  --blue-dark:  #1d4ed8;
  --blue-light: #eff6ff;
  --green:      #16a34a;
  --green-light:#f0fdf4;
  --red:        #dc2626;
  --red-light:  #fef2f2;
  --orange:     #ea580c;
  --orange-light:#fff7ed;
  --purple:     #7c3aed;
  --sidebar:    #0f172a;
  --bg:         #f1f5f9;
  --white:      #ffffff;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --muted:      #64748b;
  --radius:     10px;
  --shadow:     0 1px 3px rgba(0,0,0,.1);
  --shadow-md:  0 4px 12px rgba(0,0,0,.1);
  --font:       'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  font-size:   14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }
img { display: block; max-width: 100%; }

html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* ==============================
   LAYOUT
============================== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==============================
   SIDEBAR
============================== */
.sidebar {
  width: 230px;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 20px 18px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #60a5fa;
  letter-spacing: -.02em;
  border-bottom: 1px solid #1e293b;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: #94a3b8;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover  { background: #1e293b; color: #fff; }
.sidebar-nav a.active { background: var(--blue); color: #fff; font-weight: 600; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid #1e293b;
}
.sidebar-footer button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: .85rem;
  width: 100%;
  padding: 8px 4px;
  transition: color .15s;
  cursor: pointer;
}
.sidebar-footer button:hover { color: #f87171; }

/* ==============================
   MAIN AREA
============================== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}

.top-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}
.top-header h1 { font-size: 1.05rem; font-weight: 700; }
.top-header p  { font-size: .78rem; color: var(--muted); margin-top: 1px; }

.header-badge {
  font-size: .75rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--muted);
}

.page-content {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==============================
   CARDS
============================== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body { padding: 22px; }

.card-header {
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ==============================
   STAT CARDS
============================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: var(--blue); }
.stat-icon.green  { background: var(--green-light); color: var(--green); }
.stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-icon.purple { background: #f3e8ff; color: var(--purple); }

.stat-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 3px;
}
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }

/* ==============================
   STATUS CARD
============================== */
.status-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 5px solid #f59e0b;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.status-card.accepted { border-left-color: var(--green); }
.status-card.rejected { border-left-color: var(--red); }
.status-card.none     { border-left-color: #cbd5e1; }

.status-label   { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 5px; }
.status-value   { font-size: 1.7rem; font-weight: 900; }
.status-company { font-size: .85rem; color: var(--muted); margin-top: 5px; }

.status-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.status-icon-box.yellow { background: #fef3c7; color: #d97706; }
.status-icon-box.green  { background: var(--green-light); color: var(--green); }
.status-icon-box.red    { background: var(--red-light); color: var(--red); }
.status-icon-box.gray   { background: #f1f5f9; color: #94a3b8; }

/* ==============================
   CTA BANNER
============================== */
.cta-banner {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  border-radius: var(--radius);
  padding: 24px 28px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-md);
}
.cta-banner h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 3px; }
.cta-banner p  { opacity: .85; font-size: .85rem; }
.cta-banner .btn { background: #fff; color: var(--blue); flex-shrink: 0; }
.cta-banner .btn:hover { background: #eff6ff; }

/* ==============================
   BUTTONS
============================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--blue);  color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger  { background: var(--red);   color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-ghost   { background: #f8fafc; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover   { background: #f1f5f9; }
.btn-sm  { padding: 5px 12px; font-size: .78rem; border-radius: 6px; }
.btn-lg  { padding: 11px 24px; font-size: .9rem; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ==============================
   BADGES
============================== */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-accepted   { background: var(--green-light); color: var(--green); }
.badge-rejected   { background: var(--red-light); color: var(--red); }
.badge-admin      { background: #f3e8ff; color: var(--purple); }
.badge-supervisor { background: var(--green-light); color: var(--green); }
.badge-intern     { background: var(--blue-light); color: var(--blue); }

/* ==============================
   FORMS
============================== */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.form-control {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  background: #f8fafc;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-control:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control:disabled { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .72rem; color: var(--muted); }
.form-stack { display: flex; flex-direction: column; gap: 12px; }

/* ==============================
   TABLES
============================== */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table thead tr { background: #f8fafc; }
.data-table th {
  padding: 10px 18px;
  text-align: left;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 11px 18px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .empty-row td { text-align: center; padding: 36px; color: var(--muted); font-style: italic; }
.td-name { font-weight: 600; }
.td-sub  { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.td-actions { text-align: right; white-space: nowrap; }

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: .78rem;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.action-btn.edit:hover   { color: var(--blue); background: var(--blue-light); }
.action-btn.delete:hover { color: var(--red);  background: var(--red-light); }

/* ==============================
   MODALS
============================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: popIn .18s ease;
}
.modal-box.wide { max-width: 540px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.1rem; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-footer { display: flex; gap: 10px; margin-top: 18px; }
.modal-footer .btn { flex: 1; }

@keyframes popIn {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==============================
   ALERTS
============================== */
.alert {
  padding: 11px 15px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid transparent;
  display: none;
  margin-bottom: 12px;
}
.alert.show       { display: block; }
.alert-success    { background: var(--green-light); border-color: #bbf7d0; color: var(--green); }
.alert-danger     { background: var(--red-light);   border-color: #fecaca; color: var(--red); }
.alert-warning    { background: #fefce8; border-color: #fde68a; color: #92400e; }
.alert-info       { background: var(--blue-light); border-color: #bfdbfe; color: var(--blue); }

/* ==============================
   FEEDBACK BOX
============================== */
.feedback-box {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}
.feedback-box.show { display: block; }
.feedback-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; color: #c2410c; letter-spacing: .07em; margin-bottom: 4px; }
.feedback-box p { font-size: .85rem; color: #9a3412; font-style: italic; }

/* ==============================
   INFO ROW
============================== */
.info-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: none;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}
.info-row.show { display: flex; }
.info-item-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .07em; }
.info-item-value { font-size: .875rem; font-weight: 600; margin-top: 2px; }

/* ==============================
   PROFILE
============================== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-box {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 3px solid #dbeafe;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 2rem;
}
.avatar-box img { width: 100%; height: 100%; object-fit: cover; }

.avatar-edit {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .7rem;
}
.avatar-edit:hover { background: var(--blue-dark); }

.profile-name  { font-size: 1.1rem; font-weight: 800; }
.profile-email { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.role-tag {
  display: inline-block;
  margin-top: 5px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--blue-light);
  color: var(--blue);
}
.role-tag.green { background: var(--green-light); color: var(--green); }

/* ==============================
   IMAGE UPLOAD
============================== */
.img-upload-wrap { display: flex; align-items: center; gap: 14px; }
.img-upload-box {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.5rem;
  color: #94a3b8;
  transition: border-color .15s;
}
.img-upload-box:hover { border-color: var(--blue); background: var(--blue-light); }
.img-upload-box img { width: 100%; height: 100%; object-fit: cover; }

/* ==============================
   COMPANY CARDS
============================== */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.company-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, transform .15s;
}
.company-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.company-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 1.3rem;
}
.company-card h3 { font-size: .95rem; font-weight: 700; }
.company-card p  { font-size: .82rem; color: var(--muted); }

/* ==============================
   AUTH PAGES
============================== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  padding: 20px;
}

.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.auth-logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -.03em;
  margin-bottom: 20px;
  display: block;
}

.auth-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.auth-card > p { font-size: .85rem; color: var(--muted); margin-bottom: 22px; }
.auth-footer { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 16px; }
.auth-footer a { color: var(--blue); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ==============================
   DEPLOY FORM
============================== */
.deploy-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.deploy-col-title {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 14px;
}
.deploy-col-title.blue  { color: var(--blue); border-color: #bfdbfe; }
.deploy-col-title.green { color: var(--green); border-color: #bbf7d0; }

/* ==============================
   TWO COLUMN
============================== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-col.wide { grid-template-columns: 2fr 1fr; }

/* ==============================
   READONLY CARD
============================== */
.readonly-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.company-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.4rem;
  color: #94a3b8;
}
.company-thumb img { width: 100%; height: 100%; object-fit: cover; }
.readonly-card h3  { font-size: .95rem; font-weight: 800; }
.readonly-card p   { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.hint-text { font-size: .72rem; color: var(--muted); font-style: italic; margin-bottom: 14px; }

/* ==============================
   QUOTA WARNING
============================== */
.quota-warning {
  display: none;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .85rem;
  font-weight: 600;
  color: #92400e;
  align-items: center;
  gap: 10px;
}
.quota-warning.show { display: flex; }

/* ==============================
   PROTECTED LABEL
============================== */
.protected-label { font-size: .72rem; color: #cbd5e1; font-style: italic; }

/* ==============================
   DETAIL VIEW
============================== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.detail-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.detail-box-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .07em; margin-bottom: 5px; }
.detail-box h4 { font-weight: 700; font-size: .9rem; }
.detail-box p  { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ==============================
   QR CODE
============================== */
.qr-wrap {
  display: inline-flex;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow .15s;
}
.qr-wrap:hover { box-shadow: var(--shadow-md); }
.qr-wrap canvas { display: block !important; }

/* ==============================
   PRINT
============================== */
.print-toolbar {
  background: var(--sidebar);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.print-toolbar-left  { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: #94a3b8; }
.print-toolbar-left a:hover { color: #fff; }
.print-toolbar-right { display: flex; gap: 8px; }
.print-wrap { max-width: 1080px; margin: 0 auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.print-header { text-align: center; }
.print-header h1 { font-size: 1.4rem; font-weight: 900; }
.print-header p  { color: var(--muted); font-size: .85rem; margin-top: 4px; }

@media print {
  .no-print  { display: none !important; }
  body       { background: #fff; }
  .card      { box-shadow: none !important; }
  table      { page-break-inside: auto; }
  tr         { page-break-inside: avoid; }
}

/* ==============================
   SIDEBAR TOGGLE (hamburger)
============================== */
.nav-toggle { display: none; }

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
}
.hamburger:hover { background: var(--bg); }

.sidebar-overlay { display: none; }

/* ==============================
   RESPONSIVE (mobile)
============================== */
@media (max-width: 768px) {
  .app-layout {
    height: 100vh;
    overflow: hidden;
  }

  .hamburger {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-md);
  }

  #nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }

  #nav-toggle:checked ~ .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .main-area {
    width: 100%;
  }
}