/* ═══════════════════════════════════════════════
   OCEAN PRODUCTION — LAYOUT
   Base, loading, login, sidebar, main layout
═══════════════════════════════════════════════ */

/* ── BASE ─────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.cairo { font-family: 'Cairo', sans-serif; }
input, select, textarea, button { font-family: 'Tajawal', sans-serif; }

/* ── LOADING SCREEN ───────────────────── */
#loadingScreen {
  position: fixed; inset: 0; z-index: 999;
  background: var(--nav);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 20px;
}
.load-wave {
  font-size: 56px;
  animation: wave 1.6s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
.load-title { font-family: 'Cairo'; font-size: 24px; font-weight: 900; color: #FFF; }
.load-sub   { font-size: 14px; color: #475569; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid #1E293B;
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
}

/* ── LOGIN SCREEN ─────────────────────── */
#loginScreen {
  position: fixed; inset: 0; z-index: 500;
  background: var(--nav);
  display: none; align-items: center; justify-content: center;
}
.login-box {
  text-align: center;
  padding: 48px 40px;
  max-width: 400px; width: 100%;
}
.login-logo {
  width: 88px; height: 88px; border-radius: 22px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  box-shadow: 0 8px 32px rgba(37,99,235,.35);
}
.login-title {
  font-family: 'Cairo'; font-size: 30px; font-weight: 900;
  color: #FFF; margin-bottom: 4px;
}
.login-sub { color: #475569; font-size: 14px; margin-bottom: 40px; line-height: 1.7; }
.login-note { color: #334155; font-size: 12px; margin-top: 20px; }

/* ── AUTH TABS ─────────────────────── */
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: #111827; border-radius: var(--r-md);
  padding: 4px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; border-radius: 9px;
  background: transparent; color: #475569;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all var(--t);
  font-family: 'Tajawal', sans-serif;
}
.auth-tab.active {
  background: #1E293B; color: #FFF;
}
.auth-tab:hover:not(.active) { color: #94A3B8; }

/* ── AUTH FORM ─────────────────────── */
.auth-field { margin-bottom: 14px; }
.auth-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid #1E293B;
  border-radius: var(--r-md);
  background: #111827; color: #FFF;
  font-size: 15px; font-weight: 500;
  outline: none; transition: border var(--t);
  font-family: 'Tajawal', sans-serif;
}
.auth-input::placeholder { color: #334155; }
.auth-input:focus {
  border-color: var(--cyan);
  background: #0F172A;
}
.auth-btn {
  width: 100%; padding: 14px 20px;
  border: none; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #FFF; font-size: 16px; font-weight: 800;
  cursor: pointer; transition: all .2s;
  font-family: 'Tajawal', sans-serif;
  box-shadow: 0 4px 20px rgba(37,99,235,.3);
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(37,99,235,.4); }
.auth-btn:active { transform: scale(.98); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── APP SHELL ────────────────────────── */
#adminApp { display: none; }
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ──────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--nav);
  position: fixed; top: 0; bottom: 0; right: 0;
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}

.sb-head { padding: 20px 16px; border-bottom: 1px solid #1A2744; }
.sb-brand { display: flex; align-items: center; gap: 10px; }
.sb-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.sb-name { font-family: 'Cairo'; font-weight: 900; color: #FFF; font-size: 15px; line-height: 1.3; }
.sb-tag  { font-size: 10px; color: #475569; letter-spacing: .5px; }

.sb-menu { flex: 1; padding: 10px 8px; overflow-y: auto; }
.sb-menu::-webkit-scrollbar { display: none; }

.sb-section {
  font-size: 10px; font-weight: 700; color: #334155;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 10px 12px 4px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--r-sm);
  margin-bottom: 2px; color: #64748B;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--t);
}
.sb-item .ic { width: 20px; text-align: center; font-size: 16px; }
.sb-item:hover  { background: #111827; color: #CBD5E1; }
.sb-item.active { background: var(--blue); color: #FFF; }

.sb-foot { padding: 14px; border-top: 1px solid #1A2744; }
.sb-user-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.sb-avatar {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: #1E293B; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #FFF;
  overflow: hidden; flex-shrink: 0;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); }
.sb-uname { font-size: 13px; color: #CBD5E1; font-weight: 700; line-height: 1.3; }
.sb-urole { font-size: 10px; color: #475569; }

.sb-out {
  width: 100%; padding: 9px; border-radius: 9px;
  border: 1px solid #1E293B; background: transparent;
  color: #475569; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sb-out:hover { border-color: var(--red); color: var(--red); }

/* Sidebar mobile overlay */
.sb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 45; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.sb-overlay.open { opacity: 1; pointer-events: auto; }

/* Hamburger toggle (mobile only) */
.menu-toggle {
  display: none;
  position: fixed; top: 14px; right: 14px; z-index: 55;
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--nav); border: none; color: #FFF; font-size: 20px;
  cursor: pointer; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* ── MAIN CONTENT AREA ────────────────── */
.main {
  flex: 1;
  margin-right: var(--sidebar-w);
  padding: 24px 28px;
  min-height: 100vh;
}

/* ── TOPBAR ───────────────────────────── */
.topbar {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-family: 'Cairo'; font-size: 26px; font-weight: 900; }
.page-sub   { font-size: 13px; color: var(--soft); margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── EMPLOYEE APP ─────────────────────── */
#employeeApp { display: none; min-height: 100vh; background: var(--bg); }

.emp-header {
  background: var(--nav); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.emp-logo { display: flex; align-items: center; gap: 10px; }
.emp-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.emp-logo-name { font-family: 'Cairo'; font-weight: 900; color: #FFF; font-size: 15px; }
.emp-user { display: flex; align-items: center; gap: 10px; }
.emp-name { font-size: 13px; color: #94A3B8; font-weight: 600; }

.emp-main { padding: 20px; max-width: 640px; margin: 0 auto; }
.emp-greeting { margin-bottom: 20px; }
.emp-hello { font-family: 'Cairo'; font-size: 22px; font-weight: 900; }
.emp-date  { font-size: 13px; color: var(--soft); margin-top: 2px; }
