
/* Portal UI - Ratib */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Tajawal","Cairo","Segoe UI",Tahoma,Arial,sans-serif;
  direction: rtl;
}

/* Background + frame */
.portal-shell{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  background: radial-gradient(1200px 700px at 50% 0%, #e7ecff 0%, #d7defa 40%, #cfd5f2 100%);
}

.portal-frame{
  width: 1180px;
  max-width: 96vw;
  background:#ffffff;
  border-radius:18px;
  box-shadow: 0 16px 45px rgba(0,0,0,.18);
  overflow:hidden;
}

/* Top bar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px;
  background: linear-gradient(180deg, #2f74d9 0%, #2b66c2 100%);
}

.btn-exit{
  display:inline-block;
  padding:10px 22px;
  border-radius:10px;
  color:#fff;
  text-decoration:none;
  font-weight:900;
  background: rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.25);
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:16px;
}

.topbar-title{
  color:#fff;
  font-size:22px;
  font-weight:900;
  white-space:nowrap;
}

.topbar-badge{
  width:140px;
  height:34px;
  background:#ffffff;
  border-radius:4px;
  opacity:.92;
}

/* Main area */
.portal-main{
  padding:36px 22px 40px;
  background: linear-gradient(180deg, #dde3ff 0%, #cfd6f4 100%);
}

.card{
  max-width: 650px;
  margin:0 auto;
  background: rgba(255,255,255,.96);
  border-radius:14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  padding:26px 28px 22px;
}

/* messages */
.msg{
  background:#ffe8e8;
  border:1px solid #ffb3b3;
  color:#b91c1c;
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:12px;
  font-weight:800;
}

/* Header (logo + org) */
.logo-block{ text-align:center; margin: 2px 0 6px; }
.logo-img{ width: 120px; height:auto; display:inline-block; }
.org-lines{ margin-top:6px; }
.org-lines .org{ color:#c1121f; font-weight:900; font-size:18px; line-height:1.2; }
.org-lines .dept{ color:#c1121f; font-weight:800; font-size:16px; line-height:1.2; }

/* Titles */
.page-title{ text-align:center; margin: 10px 0 6px; font-size: 34px; font-weight: 900; color:#1f2937; }
.emp-name{ text-align:center; font-size: 24px; margin-top: 2px; color:#111827; }
.emp-meta{ text-align:center; color:#374151; margin-top:4px; font-weight:800; }
.emp-meta .meta-label{ margin-left:8px; color:#6b7280; font-weight:900; }
.emp-meta .meta-value{ font-weight:900; color:#111827; }

/* Hint */
.hint-box{
  background:#eaf1ff;
  border-radius:10px;
  padding:12px;
  margin:14px 0;
  display:flex;
  gap:10px;
  align-items:flex-start;
  border:1px solid #dbe7ff;
}
.hint-icon{
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#3b82f6;
  color:#fff;
  font-weight:900;
  flex:0 0 auto;
}
.hint-text{
  color:#b91c1c;
  font-weight:900;
  line-height:1.65;
}

/* form */
.field-label{
  display:block;
  text-align:right;
  margin:14px 0 8px;
  font-weight:900;
  color:#374151;
  font-size:18px;
}
.pin-input{
  width:100%;
  padding:14px 14px;
  border:1px solid #d1d5db;
  border-radius:10px;
  font-size:18px;
  outline:none;
  background:#fff;
}
.pin-input:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(96,165,250,.25);
}

.actions{
  display:flex;
  justify-content:flex-end; /* زر يمين */
  margin-top:16px;
}
.btn-primary{
  padding:12px 30px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.05);
  cursor:pointer;
  font-weight:900;
  color:#fff;
  background: linear-gradient(180deg, #4b86e8 0%, #2e6ad0 100%);
  box-shadow: 0 10px 18px rgba(46,106,208,.25);
}

/* Support */
.support{
  margin-top:18px;
  text-align:center;
  color:#b91c1c;
  font-weight:900;
  line-height:1.7;
}
.support-phone{
  font-size:22px;
  margin-top:6px;
  color:#b91c1c;
}
\n
/* auto save note */
.auto-save-note{
  text-align:center;
  color:#6b7280;
  font-weight:900;
  margin: 6px 0 6px;
}
.save-status{
  text-align:center;
  font-weight:900;
  color:#1d4ed8;
  margin-bottom: 6px;
}


/* ===== UI Overrides (set-pin) ===== */
.logo-block{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  margin: 6px 0 10px;
}
.logo-img{
  width: 135px;
  height:auto;
  display:block;
  margin: 0 auto;
}
.org-lines .org{
  color:#c1121f;
  font-weight: 1000;
  font-size: 22px;   /* تكبير */
  margin-top: 6px;
}
.org-lines .dept{
  color:#c1121f;
  font-weight: 900;
  font-size: 20px;   /* تكبير */
  margin-top: 2px;
}

/* الملاحظة بالأحمر */
.auto-save-note{
  text-align:center;
  color:#b91c1c !important;
  font-weight: 900;
  margin: 8px 0 6px;
}
.save-status{
  text-align:center;
  font-weight: 900;
  color:#b91c1c;
  margin-bottom: 6px;
}

/* بوكس حقول PIN */
.pin-box{
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 18px 16px;
  background: #fff;
  margin-top: 8px;
}
.pin-box .field-label{
  text-align:center;
  margin: 12px 0 8px;
  font-weight: 1000;
}
.pin-box .pin-input{
  max-width: 360px;
  margin: 0 auto;
  display:block;
}

/* عبارة المراجعة بالأحمر وتحت */
.support{
  color:#b91c1c !important;
  font-weight: 1000;
  margin-top: 18px;
  text-align:center;
}
.support-phone{
  color:#b91c1c !important;
  font-weight: 1000;
}


/* ===== FORCE CENTER + BIG TEXT (v2) ===== */
.portal-main .card{
  max-width: 720px !important;
  padding: 28px 34px 26px !important;
}

.portal-main .logo-block{
  text-align:center !important;
  align-items:center !important;
  justify-content:center !important;
}

.portal-main .org-lines .org{
  font-size: 26px !important;
  font-weight: 1000 !important;
}

.portal-main .org-lines .dept{
  font-size: 22px !important;
  font-weight: 1000 !important;
}

.portal-main .hint-text{
  color:#b91c1c !important;
  font-weight: 1000 !important;
  text-align:center !important;
}

.portal-main .hint-box{
  justify-content:center !important;
}

.portal-main .emp-name,
.portal-main .emp-meta{
  text-align:center !important;
}

.portal-main .pin-box{
  max-width: 520px !important;
  margin: 12px auto 0 !important;
  box-shadow: 0 8px 16px rgba(0,0,0,.08) !important;
}

.portal-main .pin-box .pin-input{
  width: 100% !important;
  max-width: 420px !important;
}

.portal-main .support{
  margin-top: 22px !important;
  color:#b91c1c !important;
  font-weight: 1000 !important;
  text-align:center !important;
}


/* ===== PORTAL APP SHELL ===== */

.app-layout{display:flex;gap:16px;align-items:stretch}
.app-side{width:290px;min-width:290px;background:#fff;border-radius:16px;padding:14px;box-shadow:0 6px 20px rgba(0,0,0,.06)}
.app-main{flex:1;background:#fff;border-radius:16px;padding:18px;box-shadow:0 6px 20px rgba(0,0,0,.06);min-height:520px}

.app-brand{display:flex;flex-direction:column;align-items:center;gap:10px;margin-bottom:12px}
.app-brand img{width:90px;height:90px;object-fit:contain}
.app-brand-title{text-align:center}
.app-brand-title .t1{font-size:26px;font-weight:900}
.app-brand-title .t2{font-size:18px;font-weight:800}

.app-nav{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.app-nav-item{display:block;padding:10px 12px;border-radius:12px;background:#f6f7f9;text-decoration:none;color:#111;font-weight:800}
.app-nav-item:hover{background:#eef1f6}
.app-nav-item.active{background:#e8f0ff}
.app-nav-item.danger{background:#ffecec;color:#b00020}

.app-title{margin:0 0 12px 0;font-size:22px;font-weight:900}
.app-card{background:#f7f7f7;border-radius:14px;padding:12px;margin:12px 0}
.app-row{display:flex;justify-content:space-between;gap:10px;padding:6px 0}

.app-alert{color:#b00020;font-weight:800;background:#ffecec;border-radius:12px;padding:10px}

.app-table{border-radius:14px;overflow:hidden;border:1px solid #eee;margin-top:12px}
.app-tr{display:grid;grid-template-columns:1fr 140px;gap:10px;padding:10px 12px;border-bottom:1px solid #eee}
.app-tr.head{background:#f1f3f6;font-weight:900}
.app-tr:last-child{border-bottom:none}

@media (max-width: 900px){
  .app-layout{flex-direction:column}
  .app-side{width:auto;min-width:auto}
}

@media (max-width: 768px) {
  .salary-card-preview {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .scp-center, .scp-bottom, .scp-actions {
    width: 100%;
  }

  .stat-grid {
    display: block !important;
  }

  .stat {
    margin-bottom: 12px;
  }

  .sidebar {
    display: none;
    flex-direction: column;
    background: white;
    position: fixed;
    right: 0;
    top: 60px;
    width: 70%;
    z-index: 100;
    border: 1px solid #ccc;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .sidebar.show {
    display: flex;
  }

  .menu-toggle {
    font-size: 30px;
    cursor: pointer;
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 200;
    background: white;
    border-radius: 50%;
    padding: 5px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

@media (max-width: 768px) {
  .salary-card-preview {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .scp-center, .scp-bottom, .scp-actions {
    width: 100%;
  }

  .stat-grid {
    display: block !important;
  }

  .stat {
    margin-bottom: 12px;
  }

  .sidebar {
    display: none;
    flex-direction: column;
    background: white;
    position: fixed;
    right: 0;
    top: 60px;
    width: 70%;
    z-index: 100;
    border: 1px solid #ccc;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .sidebar.show {
    display: flex;
  }

  .menu-toggle {
    font-size: 30px;
    cursor: pointer;
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 200;
    background: white;
    border-radius: 50%;
    padding: 5px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

@media (max-width: 768px) {
  .salary-card-preview {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .scp-center, .scp-bottom, .scp-actions {
    width: 100%;
  }

  .stat-grid {
    display: block !important;
  }

  .stat {
    margin-bottom: 12px;
  }

  .sidebar {
    display: none;
    flex-direction: column;
    background: white;
    position: fixed;
    right: 0;
    top: 60px;
    width: 70%;
    z-index: 100;
    border: 1px solid #ccc;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .sidebar.show {
    display: flex;
  }

  .menu-toggle {
    font-size: 30px;
    cursor: pointer;
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 200;
    background: white;
    border-radius: 50%;
    padding: 5px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

/* Mobile (+) menu (top-right) */
@media (max-width: 768px){
  .mobile-fab.top{
    position: fixed;
    right: 14px;
    top: 14px;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 0;
    background: #1a73e8;
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    line-height: 48px;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
    cursor: pointer;
  }
  .mobile-nav-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 9997;
    display: none;
  }
  .mobile-nav-overlay.is-open{ display:block; }
  .mobile-nav-drawer{
    position: fixed;
    top: 70px;
    right: 12px;
    bottom: 12px;
    width: min(92vw, 360px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0,0,0,.22);
    z-index: 9998;
    transform: translateX(115%);
    transition: transform .25s ease;
    overflow: auto;
    padding: 10px;
  }
  .mobile-nav-drawer.is-open{ transform: translateX(0); }

  .mobile-nav-source.is-mobile-hidden{ display:none !important; }
}
